#help-development

1 messages Β· Page 830 of 1

remote swallow
#

a lot of plugins only maintain for the latest version

#

eg they only support 1.19.4 of the 1.19 groups

chrome beacon
#

You'd generally only need one per nms revision

#

hence R2 R3

#

etc

slate tinsel
#

oh

slate tinsel
chrome beacon
#

no

slate tinsel
#

But is 1_20_R3 then?

remote swallow
#

no

#

there isnt really a reason to support those versions, they're already on a 1.20 versin update to latest

slate tinsel
#

I think i understand, where it says NMS Version, that's the version you have to have in your plugin, so I need support

1_20_R1, 1_20_R2, 1_20_R3

To be able to support the entire 1.20 - 1.20.4

remote swallow
#

correct but in most cases there isnt a point to support all of the versions for 1.20

chrome beacon
#

well you'll get 1 star reviews

#

if you don't

slate tinsel
#

Okay! but then I at least understand how this works, now I'll just try to get a value from this code that is not null πŸ˜„

#

If v1_20_R3 is to support both 1.20.3 and 1.20.4 then should it have 1.20.4-R0.1-SNAPSHOT in pom.xml?

chrome beacon
#

both will work

#

it's up to you

upper hazel
#

what list to use so as not to add duplicates but at the same time it is possible to take an object by index as a list

green plaza
#

Is there in maven option to get bungee proxy module instead of api?

echo basalt
#

what you can do is just check if the element is already present before adding it

#

OR

#

Use a set and wrap it as a list

#

which might break the order a bit

#

With the first solution you have to deal with time complexities

#

With the second solution you have to deal with an unordered list

slender elbow
echo basalt
#

well

proud badge
#

Yo if I have a block variable in a BlockBreakEvent, and I use block.getType() some time later will the material return always as air? Seems to be the case for me, wanted to confirm

echo basalt
#

Materials are constants so I don't think you're suffering a mutability issue

slender elbow
echo basalt
#

I wouldn't hold a hard reference to a block

echo basalt
proud badge
#
        this.griefer = player.getName();
        this.block = block;
        this.material = block.getType();
        this.blockLocation = block.getLocation();
        this.standingLocation = player.getLocation();
        this.date = new Date();
        this.itemInHand = player.getItemInHand();
        this.previousOwner = previousOwner;
        this.fixed = false;

    }```
I have an object that saves it and it takes quite a while after the event to get saved (opening up of threads). Seems the this.material always saves as air
slender elbow
echo basalt
#

BTW keep in mind that if you're coding on a version below 1.13 holding a reference to Location can cause memory leaks in the case the world that it points to is unloaded

echo basalt
#

gtg now

#

But yeah I saw it

quaint mantle
river oracle
quaint mantle
#

Yes

quaint mantle
#

But

#

Stop

#

If you remove an element

#

And insert it again

#

It won't be on the "last"

quiet ice
#

It will

quaint mantle
#

It will be on the same position as before you remove it

quaint mantle
quiet ice
#

Yes, Absolutely

quaint mantle
#

Wasn't Set collections based on the object hash?

quaint mantle
#

does anyone know how I can make intellij not throw it's own exceptionsfor @NotNull parameters

quiet ice
#

But LinkedHashSet is a combination of a linked list and a hashtable

ivory sleet
#

just the ones that has Hash in their names

#

as geol said as well

quaint mantle
#

I've been thinking wrong all my life πŸ˜”

quiet ice
#

Why the hell would the collection remember the position of an object even though it is absent?

#

Remember that hash collisions are not only possible but also relatively likely to occur

quaint mantle
slender elbow
#

LHS is amortized O(1) access via hash code, but iteration order is guaranteed by insertion order

#

or, well, that's LHM, and so is LHS by extension

quiet ice
#

Reee it's O(k/n), where as k is the actual size and n being the amounts of elements

slender elbow
#

key word is amortized :p

#

all you need is a good hashCode algorithm

quaint mantle
quiet ice
#

Myes, though that has it's dangers

slender elbow
#

sure you can do that, but that is not a good hashCode algorithm

#

because two instances you might consider equal then will have different hashes

#

and won't actually be "equal"

#

#equals and #hashCode go hand in hand and for DS you're gonna use as keys should be implemented appropriately

lost matrix
quaint mantle
#

during run time

lost matrix
#

The annotations are completely meaningless at runtime.

quaint mantle
#

im doing test rn

#

tests and for some reason

#

im getting illegalargument instead of nullpointer

proud badge
#

Oh wait nvm im dumb, you cant do bukkit methods in an external thread ._.

quaint mantle
lost matrix
proud badge
#

If I have a public static function run on an external thread means all of the function's code will be executed on that thread right?

lost matrix
quaint mantle
#
    public ConcreteLine(@NotNull Location start, @NotNull Location end, double incrementLength) {
        Preconditions.checkNotNull(start, "Parameter start is null.");
        Preconditions.checkNotNull(end, "Parameter end is null.");```

```java
        assertThrows(IllegalStateException.class, () ->
                new ConcreteLine(
                        new Location(null, 50, 50, 50),
                        new Location(null, 50, 50, 100),
                        0)
        );
        assertThrows(NullPointerException.class, () ->
                new ConcreteLine(
                        null,
                        new Location(null, 50, 50, 100),
                        1)
        );
        assertThrows(NullPointerException.class, () ->
                new ConcreteLine(
                        new Location(null, 50, 50, 100),
                        null,
                        1)
        );
quiet ice
#

I guess it has something to do with IJ's annnotationprocessor?

quaint mantle
#

2nd one is test

quiet ice
#

Try to do a mvn clean and then do it via maven (not via IJ)

#

Important: Do a clean beforehand, otherwise maven won't recompile your classes

rapid trout
#

How to stop a BukkitRunnable() ? I read the documentation it says to use cancel(); but my runnable doesn't stop. Do someone has an idea ?

chrome beacon
#

That would stop it

quaint mantle
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.

rapid trout
# lost matrix Use the ``cancel()`` method.
new BukkitRunnable() {
                    double progress = 0;

                    @Override
                    public void run() {
                        progress = progress + 0.025;
                        double rounded = Math.round(progress * 1000.0) / 1000.0;
                        bar.setProgress(rounded);

                        if(!p.isSneaking()){
                            bar.removePlayer(p);
                            this.cancel();
                        } else if(rounded == 1) {
                            bar.removePlayer(p);

                            if(p.getHealth() == 1){
                                p.setHealth(2);
                            } else if(!(p.getHealth() != p.getMaxHealth())) {
                                p.setHealth(p.getHealth() + 2);
                            }
                            this.cancel();
                        }
                    }
                }.runTaskTimer(main, 0, 1);
quiet ice
#

Also uh, are you sure that Preconditions.checkNotNull throws an NPE?

quaint mantle
#

Alternatively, you can obtain the task ID and cancel it

quiet ice
lost matrix
quaint mantle
#

Params:
reference – an object reference errorMessage – the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
Returns:
the non-null reference that was validated
Throws:
NullPointerException – if reference is null

lost matrix
#

I mean checkNotNull is the wrong approach for constructors anyways...

quaint mantle
#

should I check state

lost matrix
#

Check argument

quiet ice
#

Hm? Should you use Objects#requireNonNull or wha?

quaint mantle
#

k

quiet ice
#

Depending on how it is configured that is, but my eclipse install will

quaint mantle
#

is this a controversial argument or no

slate tinsel
#

how do i remove the flash that forms when i create a firerocket? So when it explodes

quiet ice
#

I mean technically you shouldn't be unit testing this, but whatever

lost matrix
#

checkNotNull is used in pipelines to fail fast.
Its only really usefull if you actually have a use case for its return value.

pliant topaz
#

When I use player.getLocation.getBlockX() in a command, it returns the right value. When the player then moves and changes position and runs the command again, it returns the old x-coord? Anyone knows why this could be?

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

pliant topaz
#

oh, sry

icy beacon
#

You are probably saving that value somewhere on accident

quiet ice
#

And uh I cannot find the appropriate IJ setting.

icy beacon
#

And not updating

quaint mantle
#

same

#

im looking at runtime configurations

#

not anything that catches my eye

lost matrix
pliant topaz
icy beacon
#

That is still no code provided

pliant topaz
#

working on it, wait

#

public static ArrayList<Integer> gameCoords = new ArrayList<Integer>();

            gameCoords.add(0, 0);
            gameCoords.add(1, 0);
            gameCoords.add(2, 0);
        }```
```gameCoords.set(0, player.getLocation().getBlockX());
gameCoords.set(1, player.getLocation().getBlockY());
gameCoords.set(2, player.getLocation().getBlockZ());```
`player` is represented by the command executer, as you may guess
quiet ice
lost matrix
worldly ingot
#

nullability annotations also do not work at runtime unless you're generating code at compile time

#

IDEs are not the end-all decision maker. Runtime is

rapid trout
# lost matrix Add debug statements right before you call ``cancel()`` and check if its even ca...

This is weird, the line p.sendMessage("tes2") is never run, but the p.sendMessage("test") yes. And when rounded become equal to 1 I have no more message in my chat but I have many errors because the value still increasing.

new BukkitRunnable() {
                    double progress = 0;

                    @Override
                    public void run() {
                        progress = progress + 0.025;
                        double rounded = Math.round(progress * 1000.0) / 1000.0;
                        bar.setProgress(rounded);
                        p.sendMessage(String.valueOf(rounded));

                        if(!p.isSneaking()){
                            bar.removePlayer(p);
                            this.cancel();
                            p.sendMessage("test");
                        } else if(rounded == 1) {
                            bar.removePlayer(p);

                            if(p.getHealth() == 1){
                                p.setHealth(2);
                            } else if(!(p.getHealth() != p.getMaxHealth())) {
                                p.setHealth(p.getHealth() + 2);
                            }
                            this.cancel();
                            p.sendMessage("test2");
                        }
                    }
                }.runTaskTimer(main, 0, 1);
quiet ice
lost matrix
chrome beacon
#

No need to check for an exact value

rapid trout
worldly ingot
#

Well sure, you're going to have to normalize your progress then :p

quiet ice
#

@quaint mantle

quaint mantle
#

oh thanks

#

ok it doent work

#

ima just not test that

quiet ice
#

Try to clear caches and stuff

lost matrix
quiet ice
#

IJ probably won't recompile your entire project

quaint mantle
#

k

slender elbow
#

yeah I have a hunch that 156.4 is not between 0 and 1

quiet ice
#

To be honest I never compared floats with epsilons. Though even then, I generally only compare it with well-defined values like 1, 0 or -1 or NaN, Negative infinity or Positive Infinity

lost matrix
slender elbow
#

I mean if you round it down to the nearest 1.0

#

then yes

quiet ice
#

Also uh, I've been thinking about how one would best design a system for packaging a bunch of files into a zip while having an API for transforming the entries. Allowing that while both allowing APIs to be usable and not exploding the memory requirements to infinity for larger files is challenging. So, has anyone ever used or designed such systems and could point to them? If not, no biggie - I'll just invent my own one. Or if anyone has some advice, would be great too

lost matrix
quiet ice
#

I mean the problem is that files over 2 GB cannot be stored in a single array regardless of how large everything else is - though uh, at the moment I don't intend on storing them anyways, but I'd like to avoid possible future problems

lost matrix
#

Isnt that automatically solved when using a buffered output stream as a backbone for the zip output stream?

slender elbow
#

doesn't NIO's ZipFileSystem work well with that stuff?

quiet ice
#

Uh doesn't the ZipFileSystem have a huge amounts of flaws? I just know that I ought not to touch it

#

Although given that I am just writing to it it probably isn't much of a problem and that I don't need to be aware of problems such as nonstandard CentralDirectoryHeader positions etc.

slender elbow
#

I have never heard that before

quiet ice
#

I probably confused it with something else then

reef flower
#

Hi ! I need some help !
I'm using Worldedit API (versoin 7.0.1) and WorldGuard API (version 7.0.8) and i want to get all Region or region name between two org.bukkit.Location.
Someone can help me ? Chat GPT and Google don't help me...

quaint mantle
#

I am getting this error when trying to package the plugin.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project FirmlyMCMoon: filtering D:\Programming\Plugins\FirmlyMCMoon\src\main\resources\moon_house.nbt to D:\Programming\Plugins\FirmlyMCMoon\target\classes\moon_house.nbt failed with MalformedInputException: Input length = 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

moon_house.nbt is a structure file and is located in the resources folder

pliant topaz
quaint mantle
eternal oxide
pliant topaz
#

Well, the problem is fixed somehow

#

But i got a new one

#

But it's not Spigot related, just some mistake of myself which I'm gonna have to figure out

torn badge
#

Feel free to still ask it if it’s programming related

pliant topaz
#

okay

#
    public static ArrayList<Integer> gameCoords = new ArrayList<Integer>();
    public static ArrayList<String> gamePlayerUUIDs = new ArrayList<String>();
    public static ArrayList<ArrayList> gameData = new ArrayList<ArrayList>();
    public static ArrayList<ArrayList> games = new ArrayList<ArrayList>();

    public static void newBoard(Player player) {

        if (gameData.isEmpty()) {
            gameData.add(gameCoords);
            gameData.add(gamePlayerUUIDs);
        }
        if (gameCoords.isEmpty()) {
            gameCoords.add(0, 0);
            gameCoords.add(1, 0);
            gameCoords.add(2, 0);
        }
        if (gamePlayerUUIDs.isEmpty()) {
            gamePlayerUUIDs.add("");
        }

        gameCount++;
        player.sendMessage("Game X: " + player.getLocation().getBlockX());
        gameCoords.set(0, player.getLocation().getBlockX());
        gameCoords.set(1, player.getLocation().getBlockY());
        gameCoords.set(2, player.getLocation().getBlockZ());

        gamePlayerUUIDs.set(0, String.valueOf(player.getUniqueId()));

        gameData.set(0, gameCoords);
        gameData.set(1, gamePlayerUUIDs);

        games.add(gameData);```

This is the code which makes problems. Basically, `games` is getting overwritten, which in this case means instead of being 2 different values of the lists, it just has the last one both but the list which already was in `games` just gets replaced by the new one
#

And I don't know why

naive loom
#

Could anyone tell me why I can't pull the item out the result slot in the inventory?

orchid trout
#

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

chrome beacon
#

You only have one of each list

pliant topaz
#

Wait, do you wanna tell me the list updates inside the other list?

chrome beacon
#

Depends on what you mean

orchid trout
#

i think you are trying to do something complicated without much experience

pliant topaz
chrome beacon
#

it's stored by reference so yes

pliant topaz
chrome beacon
#

For example when you're setting gameCoords you'll be modifying the gameCoords already in the map

#

since they're the same gameCoords

#

You're basically only storing the same thing over and over again

pliant topaz
#

Oh, I'd have to get the value, not the list itself, right?

chrome beacon
#

You seem to be quite lost at the concept of OOP programming

pliant topaz
#

I come from Python, so yes

orchid trout
#

wanna like create a game object that contains the coords, players and other game data

#

and then store allat in a set

echo saddle
#

is there something strange going on with gson or is it just me

chrome beacon
# pliant topaz I come from Python, so yes

Learn the basics of object-oriented programming all in one video.

✏️ Course created by Steven from NullPointer Exception. Check out their channel: https://www.youtube.com/channel/UCmWDlvMYYEbW42B8JyxFBcA

πŸŽ₯ Introduction to Programming: https://www.youtube.com/watch?v=zOjov-2OZ0E

⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (07:37) Encapsul...

β–Ά Play video
pliant topaz
#

I'll check it out, thank y'all. Looks like I got some learning to do πŸ₯²

chrome beacon
#

?learnjava

undone axleBOT
chrome beacon
#

You can also take a look at some of these ^^

pseudo hazel
#

python also has objects though?

pliant topaz
#

yea

reef flower
#

Hi ! I need some help !
I'm using Worldedit API (versoin 7.0.1) and WorldGuard API (version 7.0.8) and i want to get all Region or region name between two org.bukkit.Location.
Someone can help me ? Chat GPT and Google don't help me...

pliant topaz
#

but noone uses python objects really

pliant topaz
proud badge
#

if I have an ItemFrame, which method could I use to summon that ItemFrame variable in the world at a location. spawnEntity seems to not allow me to grab from a variable

proud badge
#

unless im doing it wrong

chrome beacon
#

Do you already have an item frame?

proud badge
#

I have it stored in a variable

chrome beacon
#

Are you just trying to clone an existing one

proud badge
#

I have the item frame stored in a variable

chrome beacon
#

why

young knoll
#

Where did you get it from

slender elbow
#

walmart

proud badge
#

CoreProtect is bugged right now and I cant use their built in performRollback system so I have to use my own

#

for my plugin

young knoll
#

That does not answer the question

pseudo hazel
#

that variable is just a single itemframe somewhere in the world probably

proud badge
#

Custom object

chrome beacon
#

That does not answer the question

pseudo hazel
#

how did you get it

reef flower
proud badge
#

On item frame destroy -> stores the frame in an object when when I do a command I can get the itemFrame from the object

young knoll
#

Yeah that won't work

proud badge
#

and I was wonder how I'd summon the item frame at a location

#

Rip

chrome beacon
young knoll
#

The instance you have is already removed

pseudo hazel
#

when you destroy it its gone

proud badge
#

I thought a variable just clones all the information about that item frame in that given moment

young knoll
#

If you are on a modern version, get a snapshot of the itemframe before it gets destroyed

proud badge
#

Oh yeah

#

ItemFrameSnapshot or something

young knoll
#

EntitySnapshot but sure

pseudo hazel
#

no its just a reference to that exact item frame

chrome beacon
young knoll
#

mhm

#

Virtual entity api

chrome beacon
#

When did that get added

young knoll
#

1.20.2 sometime

orchid trout
#

is therre an epic scale

proud badge
#

hmmmmm

chrome beacon
#

Does still seem a bit limited

proud badge
#

oh I use 1.20.1 πŸ’€

young knoll
#

2023-11-19

pseudo hazel
#

rip

proud badge
#

Ok how could I get the item frames facing direction thingy

#

ill try to summon a new one

#

and put the item inside

young knoll
#

Pretty sure it's just a method on ItemFrame

#

getFacing probably

proud badge
#

ye it is epic

pseudo hazel
#

do you just want to replace the item frame with the same item frame when it gets destroyed?

proud badge
#

I assume I cant get the facing after its destroyed

#

So I have to register it beforehand

pseudo hazel
#

you can probably get it in the destroy event

proud badge
#

this will account for item frames on grounds right

pseudo hazel
#

but after that its gone

proud badge
pseudo hazel
#

well dont

proud badge
#

I cant just to this.frameFacing = itemFrame.getFacing() inside of the object

pseudo hazel
#

just copy the information you need

proud badge
#

ill have to get it beforehand

young knoll
#

yes

proud badge
#

ok epic

remote swallow
#

hi thats me

proud badge
#

then Im already storing the ItemStack so I can just make a new ItemFrame with that facing and that item and summon it

young knoll
#

F to any other data it has

proud badge
#

like what ?

#

give few examples

young knoll
#

Rotation of the item

#

PDC

proud badge
#

rotation nobody cares, PDC - there isnt any item frame pased PDC on my server

#

so im mostly good

#

Tf I just typed new ItemFrame and it automatically pasted this entire text

#

uhh where do I go from now

#

ok chatgpt told me I could just do this

slender elbow
#

that is how you spawn an entity in the world, yes

proud badge
#

ok epic

#

ok wait this is wonky behavior

#

any way for me to check if there is already an item frame in that location

#

without having to loop through all the entities in the world

#

Unless im wrong and looping through all of the entities isnt that laggy

young knoll
#

World#getNearbyEntities

proud badge
#

epic

#

I assume setting radius to 0 will only check for that exact block

#

or should I set it to 1 instead

#

Any way to make an ItemStackSnapshot or something

young knoll
#

clone it

proud badge
#

ok epic thx

#

technically whats stopping me from cloning the entire item frame, or can I not

eternal oxide
#

ItemFrame is an Entity(when placed) so you can't clone it

proud badge
#

Rip

vast warren
#

Do you guys have a plugin that restricts redstone usage?

proud badge
#

OK I think I did something wrong, when the event runs the cloned item is normal, but when I run it later from storage its air [20:48:24 INFO]: ItemStack{AIR x 0}

ChatGPT told me I could use this to clone it, dont know if it did something wrong,

        // Create a new ItemStack with the same properties as the original
        ItemStack clone = new ItemStack(original);

        // If you want to modify properties of the clone, you can do so here
        // For example, changing the amount:
        // clone.setAmount(original.getAmount() - 1);

        return clone;
    }```

```ItemStack itemInFrame = itemFrame.getItem();
ItemStack itemClone = cloneItemStack(itemInFrame);```
eternal oxide
#

if you want to clone it just ItemStack#clone()

proud badge
#

ok lemme try

eternal oxide
#

show some code

#

an empty item frame has air in it

proud badge
#

Ok let me bring you on an adventure through the lifecycle of the item since its quite long, 1 sec lemme type it out

#

When it gets broken its gets registered here

ItemStack itemClone = itemInFrame.clone();```
Then I run this method to find which category to put it in (ItemFrame in this case)
```AlertMap.newAlert(griefer, null, 1, itemFrame, previousOwner, null, null, face, itemClone);```
Then here I register the new Object to store the item frame information
```public static void newAlert(Player player, Block block, Integer type, ItemFrame frame, String previousOwner, String[] lines, Material material, BlockFace face, ItemStack itemInFrame) {
...
}else if(type == 1) {
            FrameAlert alert = new FrameAlert(player, frame, previousOwner, face, itemInFrame);
            alertIndex = alertIndex+1;
            frameAlert.put(alertIndex, alert);```
Here is what the object looks like 
```public FrameAlert(Player player, ItemFrame frame, String previousOwner, BlockFace itemFrameFace, ItemStack itemInFrame) {
        this.griefer = player.getName();
        this.itemInHand = player.getItemInHand();
        this.blockLocation = frame.getLocation();
        this.standingLocation = player.getLocation();
        this.date = new Date();
        this.fixed = false;
        this.itemFrameFace = itemFrameFace;
        this.itemInFrame = itemInFrame;
        this.itemFrame = frame;
        this.previousOwner = previousOwner;
    }```
eternal oxide
#

why are you passing the ItemFrame? into Frame Alert?

#

actually I'll start from teh beginning. What is your end goal?

proud badge
#

Ability to add it to an index and then obtain information about it and rollback it. For the other alert types (block breaking etc) I just use coreProtect's built in performRollback system but it is currently bugged where it doesnt rollback itemframes so I have to do itmyself

proud badge
#

ah nvm I need it to obtain the location

eternal oxide
#

This is an explosion regen plugin I wrote. It will store and regen frames, banners etc and their contents. Take a look at its code

proud badge
#

ok thx

#

any specific class I should look at that handles item frames

proud badge
#

ok thx

eternal oxide
#

the plugin saves all teh data to yaml and regens it later.

vagrant stratus
glad prawn
#

Why is it not configurable? Like DogLover - Summons ? tamed dogs within a ? block radius of the player

vagrant stratus
#

It's meant to allow complete customization instead of just configuring pre-existing effects, starting with porting the effects that currently exist

vagrant stratus
proud badge
#

BRUHH

#

Ive been trying to figure this out for the past half hour I just realised I've been passing the player's held item instead of the item frame one

#

Figured it out when I accidentally held grass block

vagrant stratus
#

I'll probably just port the easy stuff, push an update, then figure out the rest after

proud badge
#

Is this the same as despawning an entity?

gleaming grove
#

yes

proud badge
#

epic

tender shard
#

do I really have to extend CraftEnchantment now? that seems pretty stupid

carmine mica
#

that method converts the bukkit instance to the minecraft one, so it needs the nms.Enchantment handle

#

simply extending CraftEnchantment won't be enough I don't think

tender shard
#

the weird thing is, I can add custom enchantments just fine, but removing them again throws the cast exception as my enchantment just extends bukkit's Enchantment :/

river oracle
#

or just use some arbitrary enchantment for glow instead of a custom one

#

you can pretty easily unfreeze the vanilla registries with some reflection

tender shard
#

but why the hell does bukkit cast enchantments to CraftEnchantment anyway

#

CraftItemStack#getEnchantmentLevel casts any Enchantment to CraftEnchantment

river oracle
#

yeah its because you need the handle there

tender shard
#

that method only seems to need the ResourceLocation though

#

it shouldn't need any instance of CraftEnchantment

river oracle
#

mindif

tribal cypress
#

Hey, anyone know what's wrong with my javadoc thingy?

/*
     * Checks for a fake nickname stored in the database
     * If there is none present, the method returns null
     *
     * @param sender         The sender of the command - used for informing about errors
     * @param playerName     The name to check against in the database
     * @return               The fake nickname if present, otherwise null (interpret as empty)
     */
    public String checkFakeNickname(CommandSender sender, String playerName){

IntelliJ doesn't seem to show the comments when I display the "Quick Documentation". I even tried to generate the JavaDoc and they don't show up there either.

tender shard
#

if there'd at least be a glow enchantment, I'd be fine. but currently it just sucks - 1.20.4 just breaking custom enchantments but only when trying to remove them lmao wtf

#

NMS removeEnchantment could just take in the ResourceLocation directly and it'd work fine

zealous osprey
vagrant stratus
#

player.getLocation().add(0.0, 12.0, 0.0).getBlock().setType(Material.ANVIL);
being what I'm trying to port this time

short pilot
#
        return new ComponentBuilder(this.name + " (level" + this.level  + ") ").color(net.md_5.bungee.api.ChatColor.BLUE)
                .append("Home to " + this.members.size() + " people")
                .append("Description: " + this.description)
                .append("Money: $0")
                .append("Destroyed Kingdoms: 0")
                .append("Land Power: " + this.claimedChunks)
                .append("Led by Lord " + Bukkit.getOfflinePlayer(this.leader).getName()).create();
#

how can i separate the lines, is it literally just with ]n

#

***\n

tender shard
#

yes

short pilot
#

ok

icy beacon
#

Optic, give me a number from 1 to 100, this is of utmost importance

vagrant stratus
#

Guess I could do a general

name
enabled
actions:
 type
 behavior
  type behavior
 type
 behavior
  type behavior

but that complicates even basic effects πŸ€”

icy beacon
#

Regrettably you are not Optic

icy beacon
#

Thanks

tender shard
icy beacon
#

I will now nuke 34 orphanages

#

Allegedly

tender shard
#

you should nuke the one where voldemort came from

icy beacon
#

Noted

tribal cypress
tribal cypress
zealous osprey
# tribal cypress Sorry but, I have no idea what that means

I assume you query a database, like postgresql or smth, for the info.
That query, depending on the size of the db, could take a while. But your code is written in such a way, that everything in that thread stops until it finished the query.
So imagine you query some data and it takes 5ms to complete. You do that query for everyone on the server, maybe 20+ people. That's a 100ms you spend asking the DB for data. A tick only lasts 50ms, but now you are already at 100ms. So the tps goes down, ie. your server lags.

Futures, or rather CompletableFutures, are Javas way of creating callback functions. Functions which get called once the code providing the data is complete. I'd advise using those.

tribal cypress
lost matrix
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
zealous osprey
vagrant stratus
tender shard
#

yeah

#

nerd

vagrant stratus
#

ugh. Location stuff is also a pain 😐

viral temple
#
    private final static CommandDispatcher<CommandSender> DISPATCHER = new CommandDispatcher<>();
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
        try {
            DISPATCHER.execute(
                    DISPATCHER.parse(command.getName() + (args.length > 0 ? " " : "") + String.join(" ", args), sender)
            );
        } catch (CommandSyntaxException ignore) {}
        return false;
    }

    @Nullable
    @Override
    public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
        try {
            return DISPATCHER.getCompletionSuggestions(
                    DISPATCHER.parse(command.getName() + (args.length > 0 ? " " : "") + String.join(" ", args), sender)
            ).get().getList().stream().map(Suggestion::getText).collect(Collectors.toList());
        } catch (InterruptedException | ExecutionException ignore) {
            return null;
        }
    }```
#

how to use spigot with brigadier.

ivory sleet
#

That looks cursed

viral temple
#

are there any other ways?

ivory sleet
#

You also lose highlighting color for suggestions, no?

viral temple
#

also, I guess no..

#

i'm using onTabComplete

worldly ingot
#

You don't use brigadier with Bukkit's API. It's not possible

#

There are libraries that help you do this like Commodore or Cloud if you're interested in looking into those

viral temple
#

but I guess I would take a look to see how commodore works

vagrant stratus
#

Choco's a nerd

ivory sleet
#

Listen to choco

#

Commodore is nice enough, if u just want the highlighting colors etc

viral temple
#

: >

ivory sleet
#

Or what you can do is to just register commands directly to the dispatcher

#

Then just on the command source stack u get the bukkit entity

#

And it’s basically spigot api with brigadier at that point :)

viral temple
#

spigot should have started to create it's own API on top of brigadier at this point..

#

maybe it's overkill, idk

ivory sleet
#

I mean you’re free to pr it

#

:)

viral temple
ivory sleet
#

Have you contacted md5 about that?

#

Probably the fastest way to resolve account access

viral temple
#

I think the reason I don't have acces is md5

#

I can't remember what I did, but I'm sure I did something stupid xD

wet breach
#

Well it wasnt because you did something smart

smoky oak
#

qq cuz i cant check myself rn, can i pass a 'int' value to a method taking 'Integer' ? i dont remember how primitives interact with that

young knoll
#

yes

smoky oak
#

related question (i promise) is there an explanation on how to make prs?

chrome beacon
#

?contribute

smoky oak
#

thanks

#

time to turn a packet into a block method

#

there a packet in the api i can check to see how to do it in a non-stupid way?

river oracle
#

sendBlockChange InventoryView#setTitle

#

There'd a bunch of send methods

#

Usually that indicates a packet

viral temple
#

((CraftServer) Bukkit.getServer()).getServer().vanillaCommandDispatcher.getDispatcher().register

#

the easiest thing of my life ever.

#

and it works 100% πŸ˜„

viral temple
#

CommandSourceStack >>>>>>>>>>>>>>>>>> CommandSender

quaint mantle
#

Imagine using nms for commands

minor junco
#

Lmao

viral temple
#

I see now... why people uses NMS

worldly ingot
#

I've tried writing API over Brigadier twice now, and Paper has also tried writing API over Brigadier. We've failed each time because Mojang wrote it in a way that's near impossible to wrap

viral temple
worldly ingot
#

I know. There's also Cloud and Commodore which are fantastic-er. But they're not Bukkit API

river oracle
quaint mantle
#

I dont want implement lots of interfaces to just get fancy tab completer

viral temple
worldly ingot
#

API is the easy part. The implementation is the difficult (and near impossible) part. The way Mojang designed their arguments system heavily ties it to the class instances, which makes argument type wrappers problematic

minor junco
worldly ingot
#

Don't you okay me :(

#

YOU TRY

#

I'VE TRIED TWICE :((

slender elbow
#

I'll let Owen try

slender elbow
#

and break every plugin in the process

worldly ingot
#

That does sound up Owen's alley

worldly ingot
#

Extremely flimsy and no strong API contracting there

river oracle
worldly ingot
#

They're mostly string-based command construction and that's not good :p

minor junco
viral temple
minor junco
#

With an executor and some argument type shit and you're good to go

mortal hare
#

am i wizard or what i've made a sorting algo that sorts million of random numbers in under 20ms in running ryzen 3700x and im not sure if this is normal or my sorting algo is broken, i've checked the sort result with online sorters and it seems to be accurate

quaint mantle
#

Bros want fancy one

mortal hare
#

i've sorted array using Shell Sort with HIbbard sequence

#

can anyone confirm that sorting million amount of numbers under 20 milliseconds is not too fast lol

#

because insertion sort takes like ages

#

while shell sort takes under 20 ms

quaint mantle
#

i sort with randomization and sometimes I get times such as 1ms

mortal hare
#

millions?

quaint mantle
#

yeah sometimes

river oracle
#

Especially if your heated up

#

I wouldn't doubt it's possible

mortal hare
#

yea i've benchmarked it insertion sort and it like needs at least 5 mins to compute while shell sort under 20ms which sounds too good to be true tbh for me

river oracle
#

Feel free to implement it into craftbukkit and bukkit if you think it'll be easy I hear it isn't quite that

#

?contribute

river oracle
#

Personally would love to leverage brig

undone spindle
#

Does anyone know how to deploy a package with github 00

paper viper
minor junco
river oracle
minor junco
#

Then we can actually sleep well

#

Knowing we could do player.respawn() over player.spigot().respawn()

paper viper
#

i mean u just need a single reflection class

#

to get the command map

#

but then you're done

#

you don't need NMS or a lib

river oracle
#

how would that work with the command map??

#

lol

#

that only takes in Bukkit Command's

#

which inherently don't support Brig functionality

paper viper
#

also i swear i had this conversation with you already

#

lmfao

undone spindle
#

0_0

#

PlsπŸ₯Ί

viral temple
river oracle
#

how does that work with the coloring?

#

I wasn't aware Bukkit's SimpleCommandMap supported that

viral temple
paper viper
#

again, i swear i had this conversation with you

river oracle
paper viper
#

commodore automatically handles it

#

lol

wet breach
undone spindle
paper viper
river oracle
paper viper
#

@river oracle

river oracle
#

oh yeah we did xD

#

I forgot

quaint mantle
#

Hey, now that we are talking about automatizing things. Is it possible to automatically create a release (not github packages, just a release under a randomly generated tag)?

mortal hare
quaint mantle
#

obv that it's not true lmao

#

do you rly think a random shuffle will get millions of items into the correct positions

subtle folio
#

Is there a way to make it so that a certain entity doesn't get pushed back by an explosion

mortal hare
#

insertion sort sorts 128k array in 17 secs, while shell sort with hibbards sequence sorts in 38ms

ivory sleet
mortal hare
#

s = are iterations

#

one iteration group twice the size

#

last column is the average time in ms

viral temple
mortal hare
#

last 5 rows depict arrays of 128k

#

in both tables

#

left table insertion sort right table shell sort

#

like please someone help me in turning this mystery

paper viper
mortal hare
#

i really need to benchmark it

#

as its my assignment

paper viper
#

Github actions should be able to do this

viral temple
smoky oak
ivory sleet
#

there are more issues than that

viral temple
ivory sleet
#

like for instance tab completetion is done async (usually) which iirc is somewhat tied to the way mojang interacts with brig, then we would need to allocate more resources for that, additionally stuff like cmd blocks and anything that ties to mc's code internally, what happens to that if we just ignore brig and do it packet wise?

viral temple
#

What?

viral temple
ivory sleet
#

u didnt read what I said

#

you have to first of all consider spigots goals as an api

viral temple
#

No, I don't see your problems

ivory sleet
#

not just add a feature because someone wants it

viral temple
#

Yes

#

Correctly

#

And?

#

It's something people requested for a long time..

#

It's the only part of the api that stayed untouched for 10 years, for god's sake..

ivory sleet
#

yes I agree that the command api should get an overhaul

#

but its not a great idea to design something on top of mere packets

#

i mean sure there are some api methods that do just that

#

but thats single methods

viral temple
#

I don't say we should remove it, or make it any other way. But we need something new..

ivory sleet
#

yes but you suggested just building our own framework that abstracts directly above packet level

#

thats what im disagreeing with, and well, there is little chance such a pr would be accepted anyway

viral temple
ivory sleet
#

i did

viral temple
#

No, you didn't.

ivory sleet
viral temple
#

I meant to make our own command tree framework api whatever you call it.

#

And control that with packets.

#

Didn't say to make the system out of packets.

#

That doesn't make any sense.

ivory sleet
#

well its not brigadier thats the issue still

#

its how mc couples it

viral temple
#

Build it above brigadier.

ivory sleet
#

im pretty sure ppl tried it

#

as choco mentioned

viral temple
#

Let Minecraft/Mojang do its own thing.

ivory sleet
#

its really not as easy as u think

viral temple
#

Not to make another api

#

Or system

#

Or framework

#

Or whatever you call it.

#

What I'm saying is not to use wrappers.

#

πŸ€·β€β™‚οΈ

ivory sleet
#

if its not "wrapping"

viral temple
#

I didn't say "on top" intentionally

smoky oak
# mortal hare am i wizard or what i've made a sorting algo that sorts million of random number...

ah here, heres the explanation
different sorting algorithms take different amounts of time depending on how they sort.
I'll give you two examples: insertion sort sorts the list one by one, comparing the element addedd to the sorted list at the correct spot by iterating over it and inserting at the correct spot
As a result of that it compares each element with (on average) half of all other elements. you have n * n / 2 comparisons, which grows exponentionell with the speed your list of numbers grows

the fastest algorithm im aware of - merge sort, which is pretty similar to shell sort - splits the list in half, and those in half, until it ends up with lists 2 long, sorts those in one comparison, then merges those together.
this merge step takes as many elements as are merged - so for the last step it takes n, for the second to last n as well, because you have two merges of n/2 size

due to the halving you only have that merge as many times as you split, which (iirc) is log(2)n, or at least something that grows slower than n.

The total steps an algorithm needs dependent on the entry set is what we call the 'complexity' (ignoring constants, addition or multiplication) of that algorithm. Note how insertion sort is nΒ², and merge sort n log n.

(google says shell sort CAN take nΒ² but takes on average n log n)

What this means in relation to your question is that with such a massive data set, it is much close to the 'optimal' case than the 'worst' case. assume 1 million numbers: Insertion sort takes 10^6 * 10^6 10^12 comparisons. Average shell sort time? 10^6 * (log 2 1000000) = 10^6 * 19 = 1.9 * 10^7

In other words, on average (large, unordered data sets), shell sort is five hundred thosuand times faster than insertion sort

ivory sleet
smoky oak
#
  • if you ignore the time the other operations take. You tend to have much less of those than comparisons / the same amount as comparisons
mortal hare
viral temple
# ivory sleet then what exactly ru suggesting?

We should make our own command tree framework from 0, make it so commands get registered, unregistered, etc
Then listen to command related packets to control the framework, and send command related packets appropriately to what the framework is saying.

smoky oak
viral temple
mortal hare
#

is it possible that my ryzen 3700x can sort randomized array of a million integers on java in under 30-40 ms with shell sort and hibbards sequence

smoky oak
#

i mean, probably?

chrome beacon
#

Try it and see

viral temple
smoky oak
#

depends how you mean 'possible' here

ivory sleet
smoky oak
#

dunno how fast itll be, but it's on the best known average time complexety for sorting

mortal hare
# chrome beacon Try it and see

well it does but i cant really test it properly, i've sorted it and my timing shown that it sorts under 30 ms on single thread

#

it sounds too good too be true

smoky oak
#

well again

#

how are your times?

smoky oak
#

how long were you on both insertion and shell sort for how many elements?

ivory sleet
# viral temple Huh?

how are you gonna make it not abstracting directly against packet level if you're not allowed to wrap around brig?

mortal hare
#

128k elements, insertion sort 17 secs, 128k elements shell sort hibbards sequence 20ms

ivory sleet
#

ur idea doesnt make sense

mortal hare
#

i just need rough estimate

chrome beacon
#

You can use jmh for a quick test

viral temple
#

Packets are just bytes..

chrome beacon
#

Generate some random numbers or export a sample of your data

smoky oak
#

so given the math above - yes it can be proven, no i cba - you have roughly 10^10 comparisons for insertion, and 2*10^6 on shell sort average.
500 times difference
17s / 500 = 34 ms

#

so yea it adds up

ivory sleet
viral temple
viral temple
ivory sleet
#

yes but you're skipping the entire step of integrating commands with the rest of the server logic

#

like...

#

as said earlier

mortal hare
#

can speed up the process so much

smoky oak
ivory sleet
#

we dont wanna abstract directly on top of just sending packets backwards and forwards

smoky oak
#

the diff grows faster the larger ur numbers

quaint mantle
#

i dont even wanna abstract anything

#

i just wanna work with the packets

viral temple
#

I'm gonna try tomorrow.. see what I can do..

#

You guys said you would like cloud?

viral temple
smoky oak
#

(side note: bogosort has optimal speed 1, average speed n! (multiply each number from 1 to n in a row).
It sorts by: Randomly shuffling your data, checking if it's in the correct order, and repeating until it is)

#

thats your 'worst case'

#

for sorting, the bottleneck is more or less guaranteed how many comparisons you make

viral temple
smoky oak
#

so minimize those

paper viper
#

i got worse sort than bogo

ivory sleet
smoky oak
#

and what scientists figured is that splitting then merging is the simplest way to get very low times because of that n log n thing

viral temple
#

Some people should start thinking outside the box a bit..

ivory sleet
#

yeah I see

#

well nicuch im still interested in what u might create

#

so keep me updated :)

viral temple
#

Alright

smoky oak
#

(log n) tends to be very small even for massive numbers (bc its 'how high is n in 2^n to reach this number), so its almost linear

#

(also side note here: in MATH, log is log base 10, in computer science, it is log base 2)

mortal hare
#

log is log base 10, in computer science, it is log base 2, yea ik such annoying to deal with

#

at least for me, since when i log i think of log10 most of the time

#

i mean if such sorts are so great for large datasets then when you think about it its great to sort it and do the binary search

#

since it costs basically nothing

smoky oak
#

binary sort is basically the same

#

depending on how your data is structured you might want to multiply the pivot point by something, for example decrease it by 30% if you have lots of values near 0

#

but basic binary sort is just like 'sorted list: element in center? nope, element between here in the direction i need to go now to the other known edge? repeat'

wet breach
#

binary sort works best on a small set of items in an array. So what you do is you grab a sub array of elements which is approximate to what you are wanting

#

the more a list is heavily sorted the better it gets as well

smoky oak
#

*search oops

wet breach
#

as your list gets smaller its best to switch to binary insertion sort as well πŸ™‚

#

which doubly makes it better

river oracle
#

insertion sort is also really good if your data has a lot of presorted sections

#

as it gets closer and closer to O(n)

ivory sleet
#

Merge sort is nice

#

also radix sort if im allowed to mention that one

smoky oak
river oracle
#

lol

smoky oak
#

actually

#

grab 100 random elements and count for how many the next is sorted compared to it

#

if its above lets say 95 insertion sort

#

otherwise some on average more efficient one

quaint mantle
#

im tryna import things with gradle
but when i build it says "class file has wrong version"

worldly ingot
#

Guess it depends on what version of Java you have installed, what version of Gradle you have installed, whether or not you're using a Gradle wrapper (and what version that wrapper is), and what version of Java your project is using

#

So

java --version
gradle --version
./gradlew --version (if you're using a wrapper)

and how you're defining Java versions in your build.gradle(.kts)

quaint mantle
#

how would i update

worldly ingot
#

We don't know what you need to update, so give us the information we need :p

#

It's like asking us to help you with your homework but you haven't even told us what the questions are

quaint mantle
#
                                                   ^
  bad class file: F:\Users\aabss\.gradle\caches\modules-2\files-2.1\com.github.MistyKnives\Kick4J\1.0\d02f63867c19a5a31c64bd718b82f223382c43d9\Kick4J-1.0.jar(/uk/co/mistyknives/kick4j/events/impl/channel/ChannelFollowEvent.class)
    class file has wrong version 64.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.```
#

that happens when i try to build

remote swallow
#

its compiled with java 20 while your project needs it to be java 17

quaint mantle
#

so i gotta make my project 20

worldly ingot
#

Either that, or something higher, or find another API

young knoll
#

Who the heck be compiling with non LTS versions

remote swallow
#

nerds

#

they also have lombok on maven

#

you could probably just build the lib urself with java 17

worldly ingot
#

Also probably an option, yeah. It's open source

#

Depends on whether or not they're actively using J18+ features I suppose

quaint mantle
remote swallow
#

theres 1 way to find out

quaint mantle
#

Just compile in java 8

#

And magic

#

It will be available on all modern LTS versions

young knoll
#

Yeah but then I can’t use modern features

remote swallow
#

like records

quaint mantle
#

Why do I need records when I have @AllArgsConstructor or @RequiredArgsConstructor and @Getter?

#

I mean yes

#

I like new features

remote swallow
#

you have @Builder for records

#

wait im fuckin dumb

young knoll
#

Why do I need Lombok when I have not Lombok

remote swallow
#

i only just realised what builder is actually for

young knoll
#

I bet it’s for builders

remote swallow
#

yeah

#

for some reason i thought it made record stuff

remote swallow
#

when they dont need anything

quaint mantle
remote swallow
#

java 16

#

anyone pre 1.17 can leave

#

time to update

quaint mantle
#

I compile for java 8 πŸ˜”

young knoll
#

I compile for 17

#

Since yknow

remote swallow
#

i compile for ur mom

young knoll
#

17

quaint mantle
#

I remember when 17 came out and decided to compile one of my plugins with it
Lot of people came to me blaming for setting the version to java 17

young knoll
#

If I compile for 8 I have to go back to the old instanceof stuff

#

Like a caveman

remote swallow
#

thats what i meannnnnnnnnnnnnnn

worldly ingot
#

There's a difference between setting it to Java 17 when only 8 was required and setting it to 17 when 17 is required lol

quaint mantle
remote swallow
#

idk if i have the source for that

quaint mantle
#

But it's just 1 line of code

remote swallow
#

all of that brain power saved

young knoll
#

Caveman code

remote swallow
#

by it being 1 line

quaint mantle
# young knoll Caveman code

Whats caveman is to public class Main { public static void main(String[] args) { System.out.println("Hello world!"); } }

#

That's still one line guys 😎

remote swallow
#

wheres ur package

quaint mantle
#

No package, I'm a novel

remote swallow
#

package pluginname; real

quaint mantle
#

package test

#

All of us had at least one

remote swallow
#

nop

young knoll
#

Use of the default package is discouraged

#

Look at me I’m eclipse

quaint mantle
quaint mantle
#

IntellIj go brrr

remote swallow
#

i wonder if choco has a net.hypixel.choco

young knoll
#

I don’t see why they would have names in it

#

It’s probably just net.hypixel

remote swallow
#

seperate all that code

#

met

young knoll
#

Yeah yeah new phone keyboard

remote swallow
#

is the keyboard too big now

young knoll
#

Yes

quaint mantle
#

Code a new keyboard

#

That's how programmers fix things

remote swallow
#

make ur own ios

quaint mantle
#

I already did

#

It's called CorsOS

#

Because no one can access it

wary mauve
#

How do skyblock servers have world borders for each island in the same world?

echo basalt
#

Packets

young knoll
#

Hey we have an api for that now

#

Smh

naive loom
#

I'm looking to write a system like how in Fortnite you can ping players but in minecraft, and was wondering of ideas on how to make it. Like how should the player see the ping? Should it be a hologram, if so you have to be in the same chunk no?

wet breach
naive loom
wet breach
#

the server already knows the ping of the players to the server there isn't really a way for players in mc to directly ping another player and wouldn't want this anyways

naive loom
#

what

#

did u read my message

#

like in entirety

wet breach
#

I did

naive loom
#

Have you played fortnite where you can ping your locations?

wet breach
#

but you didn't clarify the part of pinging players

#

no, I don't play games just because they are popular

echo basalt
#

same system exists on apex

#

basically you can alert your team of things going on during the game

wet breach
#

never played apex either

echo basalt
#

And it's usually a 3d indicator saying "I hear people there" or "someone has been here before"

wet breach
#

but I understand now in what you mean

#

probably best you still clarified though

naive loom
#

If it'd be available to see in different chunks.

naive loom
wet breach
#

if the goal is to show direction of another player

#

using the particles though gives you a general idea of direction and not exact

#

depends on the overall goal or how accurate it needs to be

echo basalt
#

what if we used glowing entities?

#

And sounds

vagrant stratus
echo basalt
#

isn't exactly an icon but sure

#

there are also voicelines

young knoll
#

Massive ongoing explosion

vagrant stratus
#

Haven't touched Apex in ages, only remembered the icon lololol

quaint mantle
#

What GUI and command framework do you guys think is the best

naive loom
#

Particles wouldn't be visible in that distance.

wet breach
#

then you are subject to the players render distance

#

not sure why it needs to be so far away

#

even from the map, you can't see the entire map from the players perspective either

vagrant stratus
#

needs to re-create the functionality of the game lol

naive loom
young knoll
#

Could spawn a client side beacon I guess

vagrant stratus
#

Really the only thing you can do, server side anyways

near night
#

anyone know why this won't run?

manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.BLOCK_BREAK) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                getLogger().info("RAN THE LISTENER");
            }
        });
#

nothing in console

wet breach
vagrant stratus
#

Yea, probably the best they'll give with server-side limitations lol

#

Also just remembered I need to look at how Skript parses its files... or I just make my own parser. ig

barren peak
#

I have a project in Eclipse that is not using maven but I want to use a maven dependancy for it,
(this one: https://github.com/Rapha149/SignGUI)
does anyone know how I can use it for eclipse anyway? I tried building it but that led to errors. However, I did build the whole project, if you arent supposed to do that lmk, otherwise if anyone knows how I can get this dependancy into eclipse without using maven, that would be great

eternal oxide
#

convert it to a maven project

barren peak
eternal oxide
#

yes, if you want to use a maven dependency

quaint mantle
#

I would just spawn a particle trail to the "alert"

#

And probably a chat message with the callout text

#

Like

Enemy in my position
And then displaying a trail to the position

#

There's unfortunately no way to open a "dialog" like in 3d shooter games, but you could open a GUI (which blocks all the vision)

eternal oxide
#

text display rendered at teh correct location

quaint mantle
#

That's also a solution

#

You could use a block render as the icon aswell

barren peak
barren peak
# quaint mantle Can we see the pom?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FusionWars</groupId>
<artifactId>FusionWars</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.github.rapha149.signgui</groupId>
<artifactId>signgui</artifactId>
<version>2.2.2</version>
</dependency>

</dependencies>
</project>

rotund ravine
#

Shade it

quaint mantle
barren peak
quaint mantle
#

Shading makes your plugin a fat-jar

#

This means it contains all its dependencies on the same .jar file

barren peak
quaint mantle
#

If you are using latest spigot version and your dependency is on maven central, you can take profit of the "libraries" setting (I don't really remember if it was called like this)

quaint mantle
barren peak
quaint mantle
#

That's an example

 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.4</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <createDependencyReducedPom>false</createDependencyReducedPom>

                                <relocations>
                                    <relocation>
                                        <pattern>original.package.name</pattern>
                                        <shadedPattern>destination.package.name</shadedPattern>
                                    </relocation>
                                </relocations>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
#

You put this in the maven plugins section, inside <build>

#
<build>
  <plugins>
    ...plugin here
  </plugins>
</build>
#

If you don't know what relocation is, it basically means it will move elements from the dependency into a place you want it to have. It's highly recommended to do it, in order to avoid dependency conflicts

#

Basically relocation is

  • You have your class file at "io/github/myawesomename/MyJavaClass"
    In order to avoid other person which also shades the same class file or has a class file in the same directory and name as yours, you want to relocate it, so maven will move io/github/myawesomename/* to a directory you want
#

All this internally, and without affecting your plugin functionality

#

At the beginning, maven seems too big and overwhelming, but trust me, its worth it

#

You could also try gradle

#

Which I personally don't like, but its kinda the same

barren peak
barren peak
# quaint mantle If you don't know about this, just shade

I seem to be getting the same error, here is my new file, did I do the shading correctly?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FusionWars</groupId>
<artifactId>FusionWars</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
** <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>**
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.github.rapha149.signgui</groupId>
<artifactId>signgui</artifactId>
<version>2.2.2</version>
</dependency>
</dependencies>
</project>

quaint mantle
#

I don't really know if that affects, as I think that's the default value, but try adding <scope>compile</scope> on your dependency

#
<dependency>
            <groupId>io.github.rapha149.signgui</groupId>
            <artifactId>signgui</artifactId>
            <version>2.2.2</version>
            <scope>compile</scope>
        </dependency>
barren peak
eternal oxide
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
barren peak
#

cool, thanks

barren peak
quaint mantle
#

You should be doing mvn clean deploy

#

Or that's what I use

#

I think compile would be the same

#

is there a way to set the exact amount of time the crop grows with plugin, and to see how much we have left?

#

i'm thinking of making it using the method of storing all the crops in Map and making them grow every certain time with a scheduler, but this seems too inefficient

eternal oxide
#

mvn clean package

barren peak
quaint mantle
#

A google search will probably give you the answer

#

I would also recommend you to switch to IntellIJ

eternal oxide
#

did you create a build profile?

barren peak
eternal oxide
#

goals woudl be clean package

barren peak
eternal oxide
#

right click project, run as -> Run Configurations

worldly ingot
#

"Run as -> Maven build..." will also get you there and pre-fill some fields

barren peak
#

so I built it as a jar file and put it in my external jar's, it didnt work either. Do I have to also put that file in my minecraft plugins folder? what I did with protocolib and citizens for example was I put them in my external jars & in the minecraft plugin folder

#

Update: maybe the error is in how I am building the plugin. Right now I am just exporting as a jar file, does that not work with this?

also, maybe I did the shading incorrectly? (my pom xml is up above if you want to take a look)

eternal oxide
#

do not use export

#

run the maven profile

#

the jar with be put in a target folder

barren peak
eternal oxide
#

clean package

sage tiger
#

where can i read about the latest additions to the bukkit API, like a list of "patch notes"?

worldly ingot
#

Or just the Bukkit/CraftBukkit commit history

sage tiger
fierce whale
#

how can I load world from specific path?
I tried this with WorldCreator object but It only could load world from main server folder.

sullen marlin
#

You can use a relative subfolder

#

Don't think you can escape out

fleet kraken
#

<JavaPlugin>.reloadConfig() dont work, i need something else?

#
fun onReload(sender: CommandSender) {
    MainPlugin.plugin.reloadConfig()
    sender.sendMessage("Config reloaded!")
}
eternal oxide
#

you are caching your config if reloadConfig() does not work

#

you should work from getConfig(). Do not assign it to a Field.

near night
#

anyone know why this won't run?

manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.BLOCK_BREAK) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                getLogger().info("RAN THE LISTENER");
            }
        });```
nothing in console
eternal oxide
#

why are you trying to use ProtocolLib to listen for block break packets?

near night
near night
eternal oxide
#

block break is in the API, why are you wanting to listen to packets for it?

near night
#

oh that was just to test packet listening. i wana listen to BLOCK_BREAK_ANIMATION

near night
#

i wana set the break animation on a block. is that what that is?

eternal oxide
#

this is when a player swings their arm, left or right

near night
# near night i wana set the break animation on a block. is that what that is?

this was my code for that java manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.BLOCK_BREAK_ANIMATION) { @Override public void onPacketReceiving(PacketEvent event) { event.getPacket().getIntegers().write(0, new Random().nextInt(2000)); event.getPacket().getIntegers().write(1, 1); getLogger().info("RAN THE LISTENER"); } });

near night
eternal oxide
#

if you want to make teh players swing arm, there is also API for that

#

there is also API for breaking stages on a block

near night
#

oh there is?

#

what is it?

near night
#

ayyy TYSM!

upper hazel
#

I need a real number from America to register in gpt chat, can anyone lend me one? πŸ˜…

molten hearth
#

Bro is somehow region locked for a global service

median trench
#

Hi there, I'm getting a strange behaviour when spawning a trident and am unable to trace it at all.
Happens with both

val trident = player.world.spawn(projectile.location, Trident::class.java)
        trident.velocity = projectile.velocity
        trident.shooter = player

and

val trident = player.launchProjectile(Trident::class.java, projectile.velocity)

it doesn't print a thing on console but(and) it freezes the server completely, any clue? Thank you

eternal oxide
#

with so little code it can only be a guess

#

as you mention a projectile there you are running this code in a spawn event so you are creating an infinite loop

median trench
#

oh that must be it I call it in the ProjectileLaunchEvent, will do some fixes thank you

#

yup fixed thank you didn't consider that the event was called when spawning it

shell robin
shell robin
chrome beacon
#

Use the method I sent

#

hint: ItemStack != AnvilInventory

shell robin
chrome beacon
#

It's not

#

!= means not equal

shell robin
#

πŸ€¦πŸ»β€β™‚οΈ I misunderstood what you meant

#
                int repairCost = inventory.getRepairCost();```I don't know if i understand what you meant but if you said something like this, its not working.
chrome beacon
#

What's inventory

shell robin
#

inventory is an anvil inventory

chrome beacon
#

show code

shell robin
#
                if(inventory.getType().equals(InventoryType.ANVIL)){
                    int repairCost = inventory.getRepairCost();
                }``` Is this not enough?
glad prawn
#

((AnvilInventory) inventory).getRepairCost()

shell robin
#

oh okay

#

thank you

#

I did, thanks

short raptor
#

How do I check if a block is fire

#

Like that

chrome beacon
#

block.getType == fire

short raptor
#

oh

#

sorry Im dense

umbral ridge
#

unless if there is isFire() like there is isAir(). Maybe we'll have different kind of fires and air types in tge future

young knoll
#

I mean we do

#

Soul fire and fire

#

Air, cave air, and void air

young knoll
#

I wish Mojang added more tags

chrome beacon
#

You can always add your own

pulsar monolith
#

Hello, how can I make the sound I am playing follow the player? Right now i am using the player.playSound() function. However, the sound remains fixed at the location where the function was executed. Is there a way to make the sound move along with the player as they walk?

eternal oxide
#

mono sounds only not stereo

pulsar monolith
eternal oxide
#

if you are adding sounds they must be mono

pulsar monolith
eternal oxide
#

are you playing built in MC sounds or new sounds in a data pack?

pulsar monolith
#

new sounds

eternal oxide
#

then do as I said

#

don;t change your code, but change teh sounds so they are recorded in mono

pulsar monolith
#

Oh πŸ˜‚

#

I'll try that

#

thanks

umbral ridge
#

hey is there an online util to convert songs to minecraft note sounds?

young knoll
#

Uhh

umbral ridge
#

i'm playing around with sounds and I though how abt if I make it play a song

#

but doing it manually is a pain im looking for a faster way

floral summit
#

so, I'm trying to make a plugin that makes the tab a fixed size by adding things like fake players with blank names in each column under the actual players. how will I go doing that? (I'm kinda new to spigot/protocol lib so please explain, thanks!)

young knoll
#

NoteBlockStudio can convert midi files

chrome beacon
#

^^

umbral ridge
#

ok thanks!! so if i have an mp3 file I have to convert it to midi?

young knoll
#

yes

umbral ridge
#

can i also do that with note block studio

young knoll
#

don't think so

chrome beacon
#

The easiest way would be to find an existing midi file

umbral ridge
#

midi files have .mid extension?

#

thanks, figured it out

#

XDD works

#

nice

sterile flicker
#

is it possible to choose java 19 under 1.20.4?

chrome beacon
#

Possible yes

#

bad idea also yes

#

stay on lts

undone spindle
#

LTS versions are recommended

chrome beacon
#

17 or 21

#

though 17 is recommended since that's what Minecraft uses

rotund ravine
#

31 πŸ’ͺ🏻

undone spindle
#

unless using a minecraft version 17 or lower then 8 is recommended

rotund ravine
#

17 all the way

#

Jkjk

eternal oxide
#

11 or 17

rare rover
#

Finally got her finished

#

Beautiful API I made ong

rotund ravine
rare rover
#

Yep

#

100%

umbral ridge