#help-development

1 messages · Page 500 of 1

wet breach
#

Basically it revolves around 0

#

If you think of a number line

wise mesa
#

mhm

#

the minimum value is east basically

#

not the minimum absolute value but

wet breach
wise mesa
#

y'know what I mean

#

oh

wet breach
#

If we are dealing with positives the larger number is east

wise mesa
#

ah got mixed up

#

meant maximum

#

maximum as in highest not farthest from 0

wet breach
#

So really you need to see if you have negatives and positives first. So you know which way in terms of 0 you are testing

wise mesa
#

could just use this

#

and max

#

seems like they don't look at the absolute value

#

anyways this all helps a lot

#

tysm for the help

wet breach
#

Only problem with this is if you have 0

wise mesa
#

oh true

wet breach
#

Negative 0 is smaller then positive 0

wise mesa
#

ah yes

#

love floats

wet breach
#

Even though they are the same

#

That is true with ints too

wise mesa
#

oh i forgot ints also have a negative zero

wet breach
#

So if you encounter 0 the check is actually easier

#

Only need to look at one number

#

If that one number is negative or positive. Of its negative its west positive its east and that is all you have to check if you encounter a side that has 0

#

Personally i would use bitshifting for this

wise mesa
#

well there's this if it helps

#

check all of the implementing classes listed at the top

#

register with Server#addRecipe

#

no problem

#

going to bed soon but others here can help if you have questions

#

if you're using a crafting table you're either looking for ShapedRecipe or ShapelessRecipe

#

other blocks use the other types

#

and you want them to be able to craft it?

#

if you have an itemstack of your custom golden apple with whatever custom meta

#

you can just make a new ShapedRecipe or ShapelessRecipe

echo basalt
#

hasn't changed in a good while

wise mesa
#

pass in your itemstack to the constructor

#

or yea just read that

wise mesa
native nexus
wise mesa
#

do you have spigot as a dependency?

echo basalt
#

spigot-api specifically

#

ItemStack should be easy to import

#

might just be your IDE playing tricks on you

wise mesa
#

okay

#

good luck

regal scaffold
#

?paste

undone axleBOT
regal scaffold
wet breach
#

Incoming sudo code. May take me a minute as i am on phone. Time to explain the loopy thingy

tough crater
#

Hey so I have the plug-in geyser installed and it won’t let me connect to the server so I have to go to geyser connect is there anything I have to change so i can just put the server ip and not geyser connect so i can just go straight to the server

wet breach
#

int locationsperholo = (20^3)*holos;
ConcurrentHashMap<Location, Hologram> hololocations = new ConcurrentHashMap<>(locationsperholo)

Location start = player.getLocation();
List<Hologram> foundHolos = new ArrayList<>();

for(int y = 0; y < 20; y++){
    for (int z = 0; z < 20; z++){
        for(int x = 0; x < 0; x++){
            foundHolos.add(holoLocations.get(start.add(x,y,z));
            foundHolos.add(holoLocations.get(start.sub(x,y,z));
        }
    }
}
#

@regal scaffold

#

Does this make sense?

#

As you can see we dont iterate the map. We are only looping for the math only

#

And then we add what we find to the array

#

Cool thing about arrays is they cant contain duplicates including null so instead what happens is that if duplicate is found it is updated with new value instead

#

So we dont have to bother checking for null returned or duplicates however this means the array could contain at least 1 null

regal scaffold
#

That's very interesting though

#

Because one wouldn't think it's faster

#

But I guess there's a lot of stuff going on behind a hashmap

wet breach
#

Well the map could contain 1k locations. Where as the math for around the player we only checked cubed 20 around player

#

Also hashmap uses hashes

#

So it finds the hash of a given key instead of interating

#

Hashmaps have buckets and therefore makes it easy to find which bucket contains what hash

#

The use of concurrenthashmap is the hashmap that is threadsafe

#

Meaning you can safely use that hashmap between several threads. Since we didnt make any api calls except in the beginning we simply transformed the location which is thread safe to do

regal scaffold
#

I see now

wet breach
#

And voila you can do this check per player per thread or what is recomended is use a thread pool

regal scaffold
#

Alright that makes more sense

#

While we’re on this topic of performance

#

The new display entities

#

Is there any benefit at all from using packets to display them

#

Im talking again, like 1000 per world

#

Im working on efficiency, so sometimes I need to hide/update just some of them

wet breach
#

Probably not but i havent quite looked at them thoroughly. As far as i know they are not ticked or not ticked as often as armor stands. Part of the reason for using packets

regal scaffold
#

They are indeed not ticket but they can be updated obviously so I’m thinking maybe skipping the api later will help a bit when there’s a lot of them

wet breach
#

Since they are entities you should be able to use the api to hide them per player

regal scaffold
#

That is true also

#

I guess the only difference would be server load on creation or update no?

#

Not while they are placed

wet breach
#

As i said part of the reason for packets on armor stands was because the server ticked them often

wet breach
regal scaffold
#

I don’t think they do save

#

Ay all

#

At all

#

If you restart the server they are gone

wet breach
#

Display entities are indeed saved

wet breach
#

But again i havent looked at them extensively yet

regal scaffold
#

Oh really? I might’ve confused myself then

#

Then packets are still better

#

For dynamic stuff

tough crater
#

So nobody is going to help me ??

wet breach
#

I am at work

livid dove
tough crater
#

Nobody was answering the other one

#

So I just went in here

wet breach
#

And my lunch is over

wet breach
remote swallow
livid dove
#

Well be patient. This isn't a staff discord or anything. We are volunteers and hobbiests

rough ibex
#

and also don't go into other channels just so people see it

regal scaffold
#

Frost I know this is the wrong cord but

#

Do you know how to convert a MiniMessage component to NMS Component

#

To use inside a display entity

rough ibex
#

yeah, not for me either.

#

but then again I prefer IRC mode

wet breach
#

So i dont know if you could cast at all or if minimessage has a nms conversion method

#

Best to ask minidigger he should be up right about now

regal scaffold
#

I think I have the conversion right

#

I just have these weird section characters and it doesn't like that

wet breach
#

Use the utf code

#

But let me look

regal scaffold
#

Uhhh

#

&7Owner: &f

#

It should be

#

idk why it got converted

wet breach
#

It gives you a link btw

#

To correct it

#

Probably should look at that lol

regal scaffold
#

It's just a link to the entire docs

wet breach
#

Look at the adventure docs

regal scaffold
#

I have lol

#

I'm just confused why &

#

Is getting converted into section

#

Like if I was using ChatColor.translateColorCodes

wet breach
#

Because & doesnt require special characters for the user and typically that is the character to substitute the section symbol

regal scaffold
#

Do you know if PAPI automatically aplies coloring?

#

Using ChatColor.transate/

wet breach
#

Have no idea. I dont use a lot of these third party apis

regal scaffold
#

Checking the code just wondering if you know of top of your head

wet breach
#

I typically just use the spigot api and make my own stuff lol

#

I dont rely on other plugins for anything if i dont have to because i typically run into problems that are outside of my control to fix leaving me with dumb hack solutions instead or none at all

#

Anyways back to work for me though

#

Driver awaits me to change a tire lol

regal scaffold
#

After a bunch of looking around PAPI

#

I did not find it

#

So.... I'm thinking on what to do

rotund ravine
#

Hmm?

regal scaffold
rotund ravine
#

Oh

remote swallow
#

translate alt codes after minimessage

regal scaffold
#

Really?

#

Like

#

MiniMessage.miniMessage().deserialize(t, resolver)

#

And translate then?

remote swallow
#

yeah

rotund ravine
#

You can just use minimessage formatting for color codes.

regal scaffold
#

Yeah but this was already written

#

It's just weird how & is now section

#

How do I even translate a TextComponents color codes

#

Screw it I'll just use actual mm formatting

remote swallow
#

TextComponent.fromLegacyText() if you have a string but need the component

rigid otter
#

Hello, which of these 2 methods is better to check if a server is online?

ServerInfo#ping() //then check the throwable
Socket#connect(ServerInfo#getSocketAddress(), TIME_OUT); //then check if able to connect
ivory sleet
#

ping

rigid otter
#

But ping take more time than or not?

eternal oxide
#

of course not

#

both send a single packet and get a response

#

ping/pong or in the case of connect the response is probably an ACK

rigid otter
#

OK thank you

eternal oxide
#

unless the server is offline

#

then ping would take the same time

native ruin
#

Is it possible to create a local database in the server

#

One that comes with a spigot plugin

jagged monolith
#

Technically yes, if you use h2 or sqllite or something that the spigot plugin creates. Otherwise if you want something like MySQL you'd need to host it outside of the mc server

native ruin
#

And I can use sqlite just like normal?

hazy parrot
#

Yes

#

Syntax is slightly different, but should be OK

native ruin
#

OK thanks

buoyant viper
#

?jd-b

#

wat

#

oh wait

#

?jd-bc

granite owl
#

prob stupid question but can i pack a dll directly inside the jar under resources?

#

since a jar is basically a zipped archive idk if a binary is treated the same

#

.dll and .so for OS independency

vital sandal
#

Even I added this to maven pom

#

My plugin is still told me that it is not included

buoyant viper
#

(System.loadLibrary, iirc, but u might need to "extract" the DLL from the jar to either a temp or perm location)

rapid dome
#

shade and relocate

quaint mantle
harsh totem
#

I am trying to make slimes always spawn with a size of 5 and make them smaller when they die so that they split into smaller slimes and not into 2 slimes with a size of 5.
For some reason when they die, they become glitched like in the image and they are unhittable.
This is the code, do you know why it's happening?

    public void StrongSlime(EntitySpawnEvent event){
        if (event.getEntityType() == EntityType.SLIME){
            Slime slime = (Slime) event.getEntity();
            slime.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK).setBaseValue(10);
            slime.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(3);
            slime.setSize(5);
        } else if (event.getEntityType() == EntityType.MAGMA_CUBE){
            MagmaCube magmaCube = (MagmaCube) event.getEntity();
            magmaCube.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK).setBaseValue(10);
            magmaCube.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(3);
            magmaCube.setSize(5);
        }
    }

    @EventHandler
    public void SlimeDeath(EntityDeathEvent event)
    {
        if (event.getEntity() instanceof Slime)
        {
            Slime slime = (Slime) event.getEntity();
            slime.setSize(slime.getSize()-1);
        } else if (event.getEntity() instanceof MagmaCube) {
            MagmaCube magmaCube = (MagmaCube) event.getEntity();
            magmaCube.setSize(magmaCube.getSize()-1);
        }
    }```
iron night
harsh totem
iron night
#

it will die only when it is minimum size(0)

harsh totem
#

there is not method for canceling this event

iron night
#

ill send something

#

later

#

i think this should work

    @EventHandler
    public void onEntitySpawn(EntitySpawnEvent event){
        if(event.getEntity() instanceof Slime slime) {
            slime.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK).setBaseValue(10);
            slime.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(3);
            slime.setSize(5);
        }
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event)
    {
        Entity entity = event.getEntity();
        if(entity instanceof Slime deadSlime) {
            int size = deadSlime.getSize();
            if(size > 0) {
                Slime newSlime = (Slime) deadSlime.getWorld().spawnEntity(entity.getLocation(), entity.getType());
                newSlime.setSize(size - 1);
            }
        }
    }
#

@harsh totem

#

btw you dont need to check is it instance of MagmaCube or not cuz MagmaCube is subinterface of Slime

buoyant viper
#

what the Fuck is a logoutivator

rough drift
#

use World#spawn(Location, Class<T extends Entity>, Consumer<T>) to edit properties before the entity is spawned (to avoid flashes)

harsh totem
#

slime split into 1 slime smaller than the one that was killed and 3 slimes with the exact same size as the one who died

iron night
rough drift
iron night
#

okay

rough drift
#

Yeah something like

#
Slime spawned = deadSlime.getWorld().spawn(entity.getLocation(), entity.getType() == EntityType.MAGMA_CUBE ? MagmaCube.class : Slime.class, slime -> {
  slime.setMetadata("changeSize", new FixedMetadataValue(plugin, null));
  slime.setSize(size - 1);
});
#

And use hasMetadata in the entity spawn

iron night
#

bruh, I thought minimum size is 0 but it is 1

lament swallow
#

Does anybody know how to change this message using the SpigotAPI? ServerListPingEvent might be it but i don't know to go from there

harsh totem
#

Thank you

iron night
#

as a result, we have this:

    @EventHandler
    public void onEntitySpawn(EntitySpawnEvent event) {
        if(event.getEntity() instanceof Slime slime) {
            slime.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK).setBaseValue(10);
            slime.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(3);
            if(!slime.hasMetadata("resized")) slime.setSize(5);
        }
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {
        if(event.getEntity() instanceof Slime slime) {
            int size = slime.getSize();
            if(size > 1) {
                slime.setSize(1);
                slime.getWorld().spawn(slime.getLocation(), slime.getClass(), newOne -> {
                    newOne.setMetadata("resized", new FixedMetadataValue(this, null));
                    newOne.setSize(size - 1);
                });
            }
        }
    }
slim wigeon
#

How do I get the block face using block break event? I had this function but before I added the hashset, it was not mining in a 7x7 due to water between the blocks Set<Material> ignoreMaterials = new HashSet<Material>(); ignoreMaterials.add(Material.WATER); ignoreMaterials.add(Material.LAVA); List<Block> blocks = player.getLastTwoTargetBlocks(ignoreMaterials, 10); BlockFace face = blocks.get(1).getFace(blocks.get(0));

fluid river
#

i got a new task to do

#

Im passing 13 tests, but getting TL on test 14

#

basically you have an array of N elements [1, 2, 3, 4]
there is a dist() method, which basically does this:

public static int dist(int base, Set<Integer> set) {
    int result = 0;
    for (int elem : set) {
        result += Math.abs(base - elem);
    }
    return result;
}```
so the dist() returns an integer, which we can call distance.
#

the integer set has fixed size K(from the input) and can contain any K elements of the array(except the one which is a base element for the dist method)

#

so basically for every element of the array [1, 2, 3, 4]

#

i need to find the most optimal Set of two ints, which gives the lowest dist() result

#

my current approach was to sort the array ascending

#

then take the element and go for binary search

ArrayDeque<Integer> set = new ArrayDeque<Integer>();
int leftPointer = i - 1;
int rightPointer = i + 1;
while (set.size() < k) {
    if (leftPointer < 0) {
        set.add(a[rightPointer]);
        rightPointer++;
    } else if (rightPointer == n) {
        set.add(a[leftPointer]);
        leftPointer--;
    } else {
        int left = a[leftPointer];
        int right = a[rightPointer];
        if (Math.abs(base - left) < Math.abs(base - right)) {
            set.add(left);
            leftPointer--;
        } else {
            set.add(right);
            rightPointer++;
        }
    }
}```
#

the cases for K == 1 or K == n - 1 are in the beginning of my code and i don't care about them

iron night
#

Where from did you get this task

fluid river
#

so the only problem is when i need to add elements to the set by searching the closest possible element

fluid river
#

application

fluid river
#

but fail by time on test 14

#

i'm 100% that's sorting slowing me down

iron night
fluid river
#

new Set<Integer>(anyInt, anyAnotherInt); or Set.of(anyInt, anyAnotherInt);

#

basically it can be any collection which i can get and remove elements from

#

i don't want to use array cuz i can't use remove(Object o)

#

so i stopped on ArrayDeque

iron night
fluid river
#

for example i typed above it's 2

iron night
#

Okay

fluid river
#

[1, 2, 3, 4](N = 4), K = 2

#

[3, 2, 1, 101, 102, 103](N = 6), K = 2

#

[3, 2, 5, 1, 2](N = 5), K = 3

#

i basically found out

#

that to get the lowest dist() result

#

you need to make a set of the closest K elements

#

to the given number

#

so in example with 6 numbers, the inputs to the dist() would look like this:
3, {1, 2}
2, {3, 1}
1, {2, 3}
101, {102, 103}
102, {101, 103}
103, {102, 101}

#

and the dist would return 6 answers:
3
2
3
3
2
3

ocean hollow
#

Is there a way to find out if the player pressed F?

iron night
#

And how much is memory and time limit?

fluid river
#

2 sec limit

#

512 mb memory

#

max n = 300k

#

k is from 1 to n-1

#

i made two separate algorithms for cases when k = 1 and k = n -1

ornate mantle
#

is there a way to get a player at a location?

fluid river
#

so i'm only working with values between

fluid river
ornate mantle
#

splendid

iron night
ocean hollow
fluid river
#

well basically from 1 to 10^9

#

so 1 billion

iron night
#

Well, sorting a 300k array is definitely too long

fluid river
#
if (k == n - 1) {
    if (k == 1) {
        int dist = Math.abs(a[0] - a[1]);
        System.out.println(dist + " " + dist);
        return;
    }
    for (int i = 0; i < n; i++) {
        ArrayDeque<Integer> copy = new ArrayDeque<Integer>(n - 1);
        for (int j = 0; j < n; j++) {
            if (j == i) continue;
               copy.add(a[j]);
        }
        System.out.println((i == 0 ? "" : " ") + dist(a[i], copy));
    }
return;
}```
fluid river
#

and also has bad consequences

#

cuz when array is sorted, the elements are in a different position

#

and when i print the answer

#

my values are misplaces

#

so instead of output 3 2 2 3

#

i get 3 3 2 2

#

or smth similar

echo basalt
#

w hy are you creating n copies

fluid river
#

they are not actually full copies

echo basalt
#

yes you're skipping 1 element in each ocpy

fluid river
echo basalt
#

You could just create a single copy and skip that one element

fluid river
#

cuz i need to pass some kind of set to the dist() method

fluid river
#

i spent 1 day on this trying different solutions

#

went to sleep todays morning

#

gonna change the thing

echo basalt
#

or instead of using an arraydeque

#

use a linkedlist and re-attach the node

fluid river
#

wdym by that

#

reattach

#
if (k == n - 1) {
    if (k == 1) {
        int dist = Math.abs(a[0] - a[1]);
        System.out.print(dist + " " + dist);
        return;
    }
    ArrayList<Integer> copy = new ArrayList<Integer>(n);
    for (int j = 0; j < n; j++) {
        copy.add(a[j]);
    }
    for (int i = 0; i < n; i++) {
        System.out.print((i == 0 ? "" : " ") + dist(i, copy));
    }
    return;
}```
fluid river
#

cuz i need to loop through each element elem of array and use dist() on elem and copy skipping the elem inside copy

#

this thing above uses arraylist so i can just loop from 0 to size and compare i to position of the element, and if they match just skip value

#
private static int dist(int pos, ArrayList<Integer> elems) {
    int result = 0;
    int base = elems.get(pos);
    for (int i = 0; i < elems.size(); i++) {
        if (i == pos) continue;
        result += Math.abs(base - elems.get(i));
    }
    return result;
}```
#

but what do i do with the second part of the task

#

where (K <= n - 2)

#

i can't just make a copy and skip one element again

#

i need a searching algorithm which works on unsorted array

#

so i avoid instantiating my int wrapper for every small int with an originalPosition field

#

and also don't waste my 2000ms on sorting 300k-long int array

#

also if i would use collection, i would need 300k Integers(wrappers)

#

there should be an array solution

#

what's the difference between

#

System.out.print(stringBuilder);
and
System.out.print(stringBuilder.toString());

#

i mean it will anyways print the string

#

but do i really need to type .toString() to save time

#

or for a string it will additionally call String#toString()

rough drift
#

it's dead anyways

iron night
#

If size isn't 1 it spawns 3 new slimes

fluid river
#

spigot api

ocean hollow
#

How to know if no one is looking at an Entity?

opal juniper
#

rayTraceEntities

iron night
ocean hollow
weak meteor
#

someone uses dev.notcacha.core?

#

i cant find the package anywhere

iron night
#

or for specified by index number from array?

fluid river
#

by index

#

cuz values might be same

#

on different indexes

#

as i said parts of code where (k == 1) and (k == n -1) and (k == n -1 && k == 1) are done

#

now i need different stuff

#

where k <= n -2

iron night
fluid river
#

4 2
1 2 3 4
returns
3 2 2 3

fluid river
#

my sb is not null

#

what is faster then

#

using toString or just the builder

ivory sleet
#

toString()

fluid river
#

thanks

ivory sleet
#

I think at least

#

The other one calls String::valueOf, and then toString()

#

Idk if PrintStream#print(String) does that

ornate mantle
#

how would i run World#getNearbyEntities asynchronously?

chrome beacon
#

You don't

#

Jump to the main thread and do what you need

urban kernel
#

how would i do like &d in a chatcolor
and tghen it converts itself

wise mesa
#

I want to create custom physics objects

#

Is there any good way to access the games physics engine through spigot

#

Or is it possible to get the collision mesh for a chunk/world and pass that into an external physics engine

feral bear
#

Hello I have this error :

java.lang.IllegalArgumentException: Channel must contain : separator (attempted to use BungueeCord)
    @Override
    public void onEnable() {
        Bukkit.getConsoleSender().sendMessage(prefix+"Plugin Opérationnel !");

        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungueeCord");
        INSTANCE = this;

        getCommand("play").setExecutor(new CommandPlay(this));

        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ServersListener(this), this);
    }

fluid river
#

channel should be "Text:Text"

feral bear
kind hatch
lofty plank
#

With packets, you can use worldborder.transitionSizeBetween. Is there a way to do this without packets using the player#setWorldBorder one?

fluid river
fluid river
#

To like ServerName:ChannelName

#

or smth

#

i don't remember

kind hatch
fluid river
#

i used to code plugin messaging plugin like in 2021

#

and the error was already present

#

here you go

#

So that's gonna be

#

"MyPluginsEcoSystem:CringeChannel"

#

1.13 update

iron night
# fluid river i got a new task to do

seems like this one works:

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = randomArray(n);
        //int[] a = new int[n];
        //for(int i = 0; i < n; i++) a[i] = in.nextInt();
        int[] b = a.clone();
        Arrays.sort(b);

        Map<Integer, Long> map = new HashMap<>();
        int p = 0;
        long d = 0;
        for(int j = 1; j <= k; j++) {
            d += Math.abs(b[j + p] - b[0]);
        }
        for(int i = 0; i < b.length; i++) {
            while(p < i && p + k < b.length - 1) {
                int t = Math.abs(b[p] - b[i]) - Math.abs(b[p + k + 1] - b[i]);
                if(t <= 0 && p + k != i) break;
                d -= t;
                p++;
            }
            map.put(b[i], d);
            if(i != b.length - 1) {
                d += (long) (i + i - p - p - k + 1) * (b[i + 1] - b[i]);
            }
        }

        for(int i : a) {
            System.out.println(map.get(i));
        }

    }
    
    private static int[] randomArray(int length) {
        Random random = new Random();
        int[] arr = new int[length];
        for(int i = 0; i < length; i++) {
            arr[i] = Math.abs(random.nextInt());
        }
        return arr;
    }
#

i think it can give wrong answers if there is more duplications of 1 number than K

kind hatch
iron night
fluid river
#

random array is for input right?

iron night
#

ye

#

im not going to manually enter 300000 integers

iron night
kind hatch
fluid river
#

6 2
3 2 1 101 102 103

#

output should be 3 2 3 3 2 3

#

and yours is 99 2 3 3 2 3

#

first answer is dead for some reason

primal rose
#

my plugin is not showing up

#

(its my first problem ever so if i dont give enough info which will be the case lmk)

onyx fjord
#

How do I get an offline player by name?

#

method seems deprecated

kind hatch
#

Bukkit#getOfflinePlayer(String name)

onyx fjord
#

deprecated

kind hatch
#

It's only deprecated because of the transition to UUIDs.

onyx fjord
#

hmm

kind hatch
#

It's not going away

hybrid spoke
kind hatch
#

It has valid usecases

hybrid spoke
#

its deprecated by a stupid reason

kind hatch
#

It was only marked as deprecated because of people abusing player names for storage and then complaining about how their stuff wasn't working.

vital sandal
#

why the 3.3.0 glow red :l

kind hatch
onyx fjord
#

yeah i kinda have a valid usecase (players use name as argument in command)

fluid river
#

use it then lol

onyx fjord
#

alr

fluid river
#

but check if hasPlayedBefore

#

if you need smth related to it

hybrid spoke
#

so it cant find this specific version in your files

#

just reload your maven or clean install fresh

vital sandal
#

Unsupported class file major version 61

#

now I got this error

hybrid spoke
#

your java version is too low

vital sandal
hybrid spoke
#

?paste your entire pom

undone axleBOT
iron night
# fluid river output should be 3 2 3 3 2 3

fixed:

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        //int[] a = randomArray(n);
        int[] a = new int[n];
        for(int i = 0; i < n; i++) a[i] = in.nextInt();
        long start = System.currentTimeMillis();
        int[] b = a.clone();
        Arrays.sort(b);

        Map<Integer, Long> map = new HashMap<>();
        int p = 0;
        long d = 0;
        for(int j = 1; j <= k; j++) {
            d += Math.abs(b[j + p] - b[0]);
        }
        for(int i = 0; i < b.length; i++) {
            while(p < i && p + k < b.length - 1) {
                int t = Math.abs(b[p] - b[i]) - Math.abs(b[p + k + 1] - b[i]);
                if(t <= 0) break;
                d -= t;
                p++;
            }
            map.put(b[i], d);
            if(i != b.length - 1) {
                if(p + k == i) {
                    d -= Math.abs(b[p] - b[i]) - Math.abs(b[p + k + 1] - b[i]);
                    p++;
                }
                d += (long) (i + i - p - p - k + 1) * (b[i + 1] - b[i]);
            }
        }

        for(int i : a) {
            System.out.println(map.get(i));
        }

    }

    private static int[] randomArray(int length) {
        Random random = new Random();
        int[] arr = new int[length];
        for(int i = 0; i < length; i++) {
            arr[i] = Math.abs(random.nextInt());
        }
        return arr;
    }
#

i put if(p + k == i) after putting dist in map here

hybrid spoke
#

your source is j17, but you compile with j9

rough drift
vital sandal
iron night
rough drift
chrome forge
#

Hi everyone! What is formula for calculating speed in percent? I know that default speed attribute value is 0.2 (100% speed), but attribute value 0.4 much faster than 200% speed

iron night
#

i hope itll pass at least test 5

fluid river
#

same

#

time limit on test 14

#

same as my solution

vital sandal
#
Unsupported class file major version 61```
still this issue
fluid river
#

java version

iron night
vital sandal
fluid river
#

i don't know

#

all of my solutions fucked up on test 14

#

and yours also

iron night
#

oh, you are russian too

fluid river
#

any other ideas

chrome forge
#

wtf man why are you asking for help in spigot development chat?

rough drift
#

and it's fine tbh

fluid river
#

cuz why not

#

i'm basically developing

#

and need help

iron night
fluid river
#

i know there are some creative guys

#

what the heck do they put in their task lol

iron night
fluid river
#

nah

#

15 is the highest

#

i can switch to java 8 🙂

iron night
#

maybe java 15 has slower sorting or slower hashmap?

fluid river
#

i don't think they were touched since added

iron night
#

which processor is on the testing system

fluid river
#

Intel(R) Xeon(R) CPU E5-2660 @ 2.20GHz, 20480KB cache, virtualizаtion on 1 core, 4GB RAM, used OS Linux

fluid river
vital sandal
fluid river
#

mismatch

#

of server and plugin or maven version and actual version

#

where do you get this error?

iron night
#

oh, maybe N limit isn't 300k, but 3m?

vital sandal
#

maven-shade-plugin ?

fluid river
#

show

chrome beacon
#

?paste

undone axleBOT
vital sandal
chrome beacon
#

make sure the shade plugin is up to date

vital sandal
#

3.3.0

fluid river
chrome beacon
fluid river
#

oh lol k is starting from 2

#

i need to remove some obsolete code from my old solution

vital sandal
iron night
# fluid river

sorting takes 50% of time when N is 300k, but i see no different solution

chrome beacon
kind hatch
vital sandal
chrome beacon
#

Since you're using modules make sure the issue isn't in one of the other modules

iron night
small timber
#
    @EventHandler
    public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent e){

        Player p = e.getPlayer();
        String message = e.getMessage();
        PermissionAttachment attachment = p.addAttachment(plugin);
        YamlConfiguration data = getPlayerData(p);



        if(message.contains("kick")) {
            attachment.setPermission("minecraft.command.kick", false);
            data.set("hasKickPermission", false);
            saveData(p, data);
        }

now, even though the player has permissions before running the command, when they press enter, the message that shows up is as if they didn't have permissions in the first place

kind hatch
#

It looks to me that you are setting the permission to false. Therefore, they don't have it.

small timber
#

how can I do that?

vital sandal
#

I tried to relcated and shadded the jar

#

but still got this error

#

java.lang.NoClassDefFoundError: com/ziwoxyt/summitcosmetics/mclibs/inventory/SimpleInventory

chrome beacon
#

Show all of your poms

kind hatch
iron night
# fluid river 1 second?

try putting if(map.containsKey(b[i])) continue; in the beginning of the for(int i = 0; i < b.length; i++) loop

small timber
#

thanks

vital sandal
iron night
#

maybe there is something important that im missing

arctic ingot
#

Hey, does anyone know a way to make an arena reset for a 1v1 system? So that the arena is at the end of the fight so before the fight reseted.

chrome beacon
#

There are many ways

#

You can for example store all the block changes and revert them

#

or just disable world saving and reloading the world

arctic ingot
#

The problem is, when I save all mined and placed blocks in a list, unplaced water or lava, for example, are reset.

vital sandal
#

save it all in a HashMap (location,before state) -> only put it in if there is no location at it exist

chrome beacon
#

Yes

viscid fractal
#

anyone know how to set the block orientation when adding a block to the world?

tall furnace
#

Someone here a couple days ago was saying "Spigot does not have any direct downloads of the server or javadoc files. They have to be built with BuildTools."

hazy parrot
#

That is api

#

Just interfaces with no implementation

#

You can't download spigot jar, he was, in fact, correct

ocean hollow
#

how can i get information whether no one is looking at the item?

#

As I understand it, I need to use RayTraceResult, but how exactly?

eternal oxide
#

You need to provide more information

#

you want to tell when No one is looking at a specific item?

#

What item?

final monolith
ocean hollow
# eternal oxide You need to provide more information

I have an item that drops from a block. I'm adding it to the list of items. I need to make a pickup system, when a player looks at an item, it is highlighted, and a title appears, and there is an opportunity to pick up an item on F.

#

Giving a glow to the object the player is looking at is not a problem. But to remove the glow is another

eternal oxide
#

so add to it's PDC the player who is looking that triggered the glow (could be more than one)

#

then tick the item until no one is looking anymore

#

rather add the players UUID

#

I deleted the code

#

You seemed to lose interest

#

however

#

there is a simpler way to do the duping

small timber
#

how do I listen for all the advancements in the game being completed?

eternal oxide
#

if you only want to dupe like that when it goes through an end porta

#

then detect it in the teleport event

#

it will have the velocity

#

however you don;t really need it

#

you are only doing it on sand and you always want 4 thrown in each direction

#

I thought you were duping?

#

if a block comes in from the east and gets thrown west when it exits, thats not a dupe

#

I thought the point was when a block enters the portal it produces 4 the other side

#

one thrown in each direction

#

so there is no actual duping

#

to dupe mean you make a duplicate, so you end up with more than you started

#

controling the direction it is thrown is not a dupe

#

seems so

zealous osprey
#

Isn't there just a config in the paper.yml file?

#

Try if the EntityPortalEnterEvent works with falling blocks. If so, you might be able to check if the entity is of type falling sand and then manually load the end platform, spawn a falling sand and give it the velocity the one in the overworld has.

wild apex
#

anyone know a way to catch an event when a bedrock user hold-clicks, i believe that may be right clicking on java? like when hold to talk to aa villager?

rotund ravine
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
tribal quarry
#

you should do the same thing, but there's two problems: skin-set ratelimit, count of alts

final monolith
#

thank you anyway!

tribal quarry
#

just use mineskin client api

primal rose
#

    @EventHandler
    public void onInventoryClick(InventoryClickEvent e){
        Player player = (Player) e.getWhoClicked();
        UUID uuid = player.getUniqueId();

        if(e.getView().getTitle().equals(ChatColor.DARK_AQUA + "Trails")){
            e.setCancelled(true);``` ```public class TrailMenu {

    public TrailMenu(Player player){

        Inventory inv = Bukkit.createInventory(player, 27, ChatColor.DARK_AQUA + "Trails");``` my inventory click doesnt get cancelled
tribal quarry
terse ore
primal rose
#

yes

#

i also get no errors in console when i open or click in the gui

final monolith
#

If i upload two skins, the first one will still be valid?

tardy delta
#

please dont create a new random on every invocation

#

yes

tribal quarry
final monolith
#

will buy some servers (vps or dedicated) to do these requests without ratelimit

#

hahah thanks xD

weak meteor
#

Has someone used ebcm recently?

tardy delta
#

sounds like icbm

weak meteor
#

Or smth like that

gilded bloom
#

Hello, I have a quick question. I want to send to the player CLOUD particle packet, but when I am setting the** getParticles** value to EnumWrappers.Particle.Cloud I get this strange particles.
WHEN I RUN A COMMAND EVERYTHING LOOKS FINE SO IT IS NOT MY RESOURCE PACK OR SHADERS FAULT!
CODE:

ProtocolManager pm = ProtocolLibrary.getProtocolManager();
                        PacketContainer packet = pm.createPacket(PacketType.Play.Server.WORLD_PARTICLES);
                        packet.getModifier().writeDefaults();
                        packet.getParticles().write(0, EnumWrappers.Particle.CLOUD);
                        packet.getDoubles().write(0, -(border/2)).write(1, p.getLocation().getY()).
                                write(2, z);
                        packet.getFloat().write(0, 0.1f).write(1, 10f).
                                write(2, 10f).write(3, 0.001f);
                        packet.getIntegers().write(0, 10000);
                        pm.sendServerPacket(p, packet);

I also tried EnumWrappers.Particle.getById(5) where 5 is a CLOUD particle id and I tried it with different EnumWrappers.Particle like EnumWrappers.Particle.FLAME or EnumWrappers.Particle.REDSTONE.
Please help.

alpine cairn
#

Would it be difficult to update a plugin myself that was only tested until 1.15.2? It disables itself on server startup. I have no idea how this would be done.

sullen marlin
sullen marlin
alpine cairn
#

I tried decompiling it but I don't really know what makes it out of date

sullen marlin
#

No idea why that plugin wouldn't work on 1.19

#

What's the error

alpine cairn
sullen marlin
#

You mean like the API has always allowed?

gilded bloom
sullen marlin
#

?paste

sullen marlin
alpine cairn
sullen marlin
#

settings:
update-checker: false

gilded bloom
alpine cairn
#

I'll try that

sullen marlin
#

Might fix it, otherwise someone will need to decompile it and see

grim oak
#

Hi, I'm looking at improving my ability. I notice in well built plugins the built-in events aren't used so much, or the structure and use of Listeners and Events are different. Sorry if I'm not being very clear, but if you do understand what I mean can you please send me some suggestions on how to better structure events with custom events etc, or by sending open source plugins I can look at for inspiration

alpine cairn
paper crest
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
There is no longer spigot for 1.19.4? Only spigot-api works...

undone axleBOT
eternal oxide
undone axleBOT
paper crest
#

On 1.19.3 worked that

eternal oxide
#

There has never been a Spigot hosted in a legal repository, run buildtools

paper crest
#

Yes worked after running BuildTools

#

Thanks

iron night
paper crest
#

I have fast PC :p

eternal oxide
#

He didn't, unless he's running a super computer.

sullen marlin
hollow birch
#

ive been thinking about a problem for a while now and im stuck, i have custom enchants each is an enum and each has a max level. Each enchant also has a tier which stores a percentage change for that tier to happen.

i want to have a method that will return a random enchant based on each tiers percentage chance. the problem im having is that enchant cant be higher than the enchants max level. So when i do that check it will just return nothing

#

what i want is to be given a random enchant and if that enchant is already maxed out then it will give me a different one

alpine cairn
sullen marlin
#

Remove maxed out enchants from the list you are randomly selected from

sullen marlin
hollow birch
sullen marlin
#

Just run the random again with different tiers in that case?

wild apex
#

How do i have a right click event

onyx fjord
#

theres right click for air and for block

hollow birch
sullen marlin
#

Simplify your code

#

Have a pickRandom method to start

wild apex
sullen marlin
#

Then do your tier loop, but remove max enchants before passing to pickRandom

hollow birch
#

it will return an enchant successfully but for some reason when i try to add it with this method it cant find any of the method inside of the enchant

#

even tho it is outputting EFFICIENCY with the first sout

weak meteor
#

whats this? net.minecraft.util.com.google.common.base.Joiner;

#

or whats used for

sullen marlin
#

Joining things, though it hasn't existed as that name in forever

#

It's just google guava

weak meteor
#

bro what

#

💀

#

this code's old af

sullen marlin
#

1.7 lol

weak meteor
#

should i replace it with: org.apache.commons.io.IOUtils?

#

ig its the same lol

#

it worked, so

#

dont bother answering

wise mesa
#

can an itemstack have velocity

#

oops not itemstack

#

item display

hollow birch
#

this is the error im getting

#

this is the method

#

the sout(enchant.getname) is null

#

but its an enum??

#

how would it be null

wise mesa
#

im setting the velocity of an itemdisplay but its not moving

#

do i need to make an armorstand and have it constantly teleporting to it or something

hollow birch
#

Does it have gravity?

wise mesa
#

oh no

hollow birch
#

Idk if this is true for itendisplay but u know for armor stands it’ll ignore velocity

#

If no gravity

#

Guessing it’s the same

#

Since inherited from entity

wise mesa
#

okay ill test it

young knoll
#

Display entities don’t tick

sharp bough
#

is there any way to translate the enchant name to the display name? for example "vanishing_curse" to " Curse of Vanishing"

young knoll
#

So velocity doesn’t work

#

Display entities also always have no gravity because they don’t tick

hollow birch
#

I just kept the name efficiency

sharp bough
#

im not answering you

#

im making my own question

#

is there a way to do that

#

in vanilla?

hollow birch
#

Oooh

#

I don’t know if there’s a specific method for it but you could loop through all the enchants

#

And check the name

sharp bough
hollow birch
#

There’s a Enchantment.getbykey method

river oracle
weak meteor
#

I was trying to compile 1.7 plugins like for 1.19.4 with maven

#

(Terrible idea)

#

Just a why not lol

hollow birch
viscid fractal
#

How can I enchant an item that can't normally be enchanted? I tried using this
item.addUnsafeEnchantment(Enchantment.LUCK, 1);
but with no luck.

wise mesa
#

why is south +z and north -z

#

I hate that

#

now I gotta change all my code lmao

hollow birch
wise mesa
#

so I'm creating a zip file at runtime

#

how can I hash that zip file for client side comparison

#

also running into a strange issue

#

if the player rides an itemdisplay then it can't move

wet breach
wise mesa
#

ah

weak meteor
#

amplifier goes 0 = 1 in game? or 1 = 1 in game?

wet breach
#

0 means no effect

#

Or you dont want to apply amplification

#

It is a multiplier

weak meteor
#

k

hollow birch
#

bro im so confused

#

only thing i can think is cuz its storing tier and im accessing it from tier its a self reference?

#

but wouldnt that give me an error in the ide

#

idk

#

that was not the problem,

weak meteor
wise mesa
#

so for some reason whenever I teleport something that has a rider

#

it just won't move

#

I don't understand

#

when I remove the rider it moves just fine

#

does anyone know what could cause this

hollow birch
#

idk how smooth this would look but

#

try removing the rider

#

teleporting

#

then setting the rider back

wise mesa
#

oh I see I just googled and someone suggested the same thing

#

and then someone else suggested nms

#

which I might do tbh

wet breach
lethal rune
#

When I send my Intelij project to a jar, it doesn't include my plugin.yml or my config.yml in the jar... how do I fix this?

wet breach
#

Since statics are not null the only thing that could be null is their value

#

Well pretty sure that applies to enums too

hollow birch
#

What is a range clamp

wet breach
#

Means you dont allow it to go below or above certain values

hollow birch
#

Ah

wet breach
#

There isnt 100 enums for tiers for example

#

So having a random number of 100 makes no sense

#

But yeah getting a returned value of null wont throw an exception since this is allowed

#

Its only if the object your accessing is null will that happen

drowsy helm
#

use pdc

#

dont compare display names

#

?pdc

drowsy helm
#

no

#

use pdc

near plover
#

can someone help me with this please? :that I can't get it to work, it tells me that it didn't find the dependency

"Dependency 'com.theokanning.openai-gpt3-java:api:0.2.1' not found"

    <dependency>
    <groupId>com.theokanning.openai-gpt3-java</groupId>
    <artifactId>api</artifactId>
    <version>0.2.1</version>
    </dependency>
remote swallow
#

did you reload maven?

jagged monolith
near plover
#

I'm ready but still it doesn't matter :c

import io.openai.api.OpenAI;
import io.openai.api.models.CompletionRequest;
import io.openai.api.models.CompletionResponse;

"Cannot resolve symbol 'openai'"

do you know why this happens? :c

vital sandal
#

how do I include lib with maven module?

near plover
buoyant viper
#

use the maven-shade-plugin

vital sandal
#

I did

#

?paste-bin

eternal oxide
#

You posted your poms and indicate you have an issue with shading but no details we can work with. Like what isn't being shaded

#

I didn;t notice the time difference.

buoyant viper
#

working w fuckin JS rn and for some reason fuckin clearInterval just is not doin anything

#

am i not allowed to call clearInterval inside of setInterval or something

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.

buoyant viper
vocal cloud
#

Get JS'd

buoyant viper
#

true

vocal cloud
buoyant viper
#
(function() {
    'use strict';

    let intId = setInterval(() => {
        let closeBtn = document.querySelector('svg[aria-label="Close"]');
        if (closeBtn == null) return;

        closeBtn.parentElement.click();
        console.log('closed Meta prompt.');

        clearInterval(intId);
        console.log('cleared task');
    }, 1);
})();```
chrome beacon
#

I don't think you can safely reference intId like that

#

It's probably undefined

buoyant viper
#

(added a console log between log and clear)

chrome beacon
#

Actually why not just use setTimeout

#

It runs once

buoyant viper
#

i considered it

#

but i also considered page load times

chrome beacon
#

There shouldn't be a difference?

buoyant viper
#

the context of the prompt is this stupid thing that shows up when ur editing ur profile on instagram btw

buoyant viper
#

that page load could outlast the timeout window

chrome beacon
#

Defer javascript?

#

So it loads last

#

Also wouldn't the same happen with interval

buoyant viper
#

well

#

/waiting/ by running itself every 1ms and checking

chrome beacon
#

Ah right

#

Just defer the js loading and use setTimeout

#

That way it will be loaded after html

buoyant viper
#

its a tampermonkey script so ill have to experiment with run-at times

#

document-end should work

#

but instagrams also kinda like fuckywucky and has a loading screen before actual content

#

so there might be a not technically ready "html loaded" event

#

fixed it by adding a little bit of delay before i clearInterval i guess

grizzled oasis
#

Hi, I had an idea for protecting my plugins (not on Spigot), it's possible to check modification while the plugin is running so that if malware modifies some classes or adds it the server can be stopped and executed some protection?

eternal oxide
#

you could crc your classes

grizzled oasis
eternal oxide
#

but anything you do can easily be removed by malware

#

crc = a checksum of your class.

grizzled oasis
#

with reflection?

eternal oxide
#

you can read yoru jar and crc check each class.

#

there is also the new security manager in java, but I've nto used it

#

they are doing a CRC on a file, you could just do it on each class.

eternal oxide
#

yes, as you are wanting to check for in memory modification using the ClassLoader would be best

grizzled oasis
eternal oxide
#

the CRC is just a number so you check it against whatever you calculated that it should be

grizzled oasis
#

sorry for asking but if a malware runs and changes class in theory the hash should change?

eternal oxide
#

yes

grizzled oasis
#

so i need to check the hash and can be an actual good system

#

if the hash are the same then it can run

eternal oxide
#

however, if someone is going to the effort to change your classes they will just disable your CRC check

grizzled oasis
#

so let me understand one thing CRC is hash?

eternal oxide
#

yes

grizzled oasis
#

or something totaly different

eternal oxide
#

kinda

#

a hash is less accurate

#

a CRC is a calculated value of every byte in yoru class.

grizzled oasis
#

so i should calculate crc before the plugins run in a machine and then compare them?

eternal oxide
#

yes, you calculate the CRC before release. you include those values in your code (encrypted) then compare when it runs.

grizzled oasis
eternal oxide
#

no

#

yes you can read classes

#

the stackoverflow even showed you how to read it from teh ClassLoader

#

the CRC demo I linked shows you an example of how to calculate a CRC from a file

#

it's just a bunch of bytes

quaint mantle
#

i run into weird problem pretty sure my constractur is good

#

wait ill provoide code

#

?paste

undone axleBOT
quaint mantle
#

why its null i think my constractur is fine no?

hazy parrot
#

That String guiname will execute before constructor

#

Put it inside too

quaint mantle
#

inside the constractur?

#

i put it into the method instead

#

bruh i did the same with like more 400 lines of code at other classes

#

ill have to init() guess

#

thanks Goskii88

fierce whale
#

Is there a way to set time personally?
For instance, simultaneously player A is day time but B is night time

jagged monolith
fierce whale
rough drift
#

How do I know the server's max health? (The value inside the spigot.yml)

rough drift
#

Thank you

hexed tendon
#

hey yall, i'm working on a fork of a plugin. I had help from the main dev in setting up everything, however, some errors keep popping up. It is very annoying, as NMS always is. I hope to get help, as that would be very nice. Here are some screenshots

#

here is the java file

thorny gull
#

hello looking for a dev to help me make server

hexed tendon
#

if you want anyone to actually propose to help you, you should firstly describe the task

eternal night
#

?services

undone axleBOT
hexed tendon
#

very funny

#

ok

#

missread

#

mb

#

sry

humble tulip
#

?paste

undone axleBOT
humble tulip
#

Not downloading

hexed tendon
chrome beacon
#

I'd just use Citizens

#

There's no need to reinvent the wheel

cinder abyss
#

Hello, how can I call a method 20 ticks before the world unload ?

icy beacon
#

you want to predict the future?

cinder abyss
#

or maybe I can make cache for what I want

icy beacon
#

omg don't you fucking love it when you paste 2 lines in intellij and suddenly it freezes and loads the cpu to 90%

icy beacon
undone axleBOT
icy beacon
#

this shit has been upgraded recently but it happens nevertheless

#

ok now it's reindexing jdk

#

cool

#

that's normal

terse ore
icy beacon
#

lmao

#

i still love intellij more than anythint else

#

even though this sometimes happens

rough drift
#

Edit spigot to run the world unload 20 ticks later, and when you schedule it run your code

#

ez

rough drift
#

LMFAO

#

Don't do it like that lmfao

#

Use a world unload event, cancel it if the world is not marked, run your code, mark the world, schedule unload 20 ticks later

#

Might not work on shutdown

restive pasture
#

guys wich language should i chose to minecraft development i was learning java and im not sure if i should keep up to it since its become an outdated version

#

what other options do i have besides java

rough drift
#

Java

#

Java

restive pasture
#

kotlin etc?

rough drift
#

or optionally Java

tall furnace
#

Java

#

100%

restive pasture
#

oh ok

rough drift
#

Kotlin is a mess to deal with and bloats your plugin size by the MBs

restive pasture
#

i get it

tall furnace
#

Java will never be outdated

#

It's used in everything

rough drift
#

Hell java 20 got released like a week ago or smt

#

lemme check

restive pasture
#

java is not used for android development for example

restive pasture
rough drift
restive pasture
#

all programming languages recieve updates

rough drift
#

It was used before that

restive pasture
#

doesent mean they are an moder programming languges

rough drift
#

Then they made jetbrains (creators of IntelliJ) make kotlin which is based off of the JVM to not get lawsuits

restive pasture
#

what i mean by outdated is that there are better options rn

restive pasture
#

i get it that for minecraft for sure its the best

rough drift
#

Well java is still a pretty solid one actually

restive pasture
rough drift
#

It's getting many perf/syntax improvements

tall furnace
rough drift
tall furnace
#

I use it for android development

restive pasture
#

yea

#

u can use it

tall furnace
#

It's all I use for Android

restive pasture
#

i meant its not the best one anymore

rough drift
#

Oracle made a lawsuit on Google a while back, it still can run Java because it's just the JVM

restive pasture
#

it used to be one of the main ones

#

but kotlin its better now

river oracle
rough drift
#

They just couldn't actually use Java at Google for android

rough drift
#

or configuring gradle ig

restive pasture
#

im saying

#

that java isnt the perfered anymore man jesus

#

its kotlin

rough drift
restive pasture
#

for android

rough drift
restive pasture
#

and i tought it would be that for the others

river oracle
#

No java is still a industry standard for many things

#

And it will never go away much like C

rough drift
#

^

restive pasture
#

well i hope so

#

so i wont be unnecessarly learning a language i could replace with something better

#

im not planning on doing android development anyways was just double checking if java would still be a nice language for pc

hexed tendon
#

java is still super useful

rough drift
#

Yep

hexed tendon
#

and its the only viable option

#

for mc dev

#

except if you want to become a datapack programmer

#

which is an awful lang

rough drift
#

Clojure

rough drift
#

It's not even a lang

hexed tendon
#

true true

#

but it can count as a language

#

as it is turing complete

#

its just a pain

rough drift
#

fair

hexed tendon
#

and unusable in most scenario

#

who would use minecraft as a runtime env?

#

bad idea

rough drift
#

This dude

#

He would use mc as a runtime

restive pasture
#

Ah and btw what are they exaxlcly trying to do with bedrock i have been away from MC for a while and now both versions are free while bedrock is called bedrock and Java is called minecraft Java edition?

#

Are they trying to replace a version or wsp

river oracle
#

Bedrock is just the micro transactions in your face version

#

That's abt it

restive pasture
#

I wouldnt be suprised if they made it the main one every single thing innit u have to pay for it lol

orchid gazelle
restive pasture
#

I rly hope it never happens man

kindred valley
#

Th going on here

brisk estuary
#

hey, does anybody know what would be the best way to make a creature spawn particles around it? To be exactly I want to some of the cave spiders naturally spawned have a special drop and a player would know that spider is a special one by the particles around it

#

The first thing I thought is to achieve that with listeners, so using a CreatureSpawnEvent I would mark a cave spider as a special one and then do the particles thing

#

but I don't know if it's a good way to achieve that

rough drift
#

That's the correct way to do that

small current
#

hello, what is the event for a block being activated because of redstone, and how can i get the location of the redstone that activated it ??

rough drift
#

There is a block state event iirc

small current
brisk estuary
weak meteor
#

(Never getting that sout)

#

Why?

eternal oxide
#

did you forget a { } ? can;t tell as it's just an SS

#

your else if doesn;t start with a }

icy beacon
weak meteor
#

yes

#

it is