#help-development

1 messages · Page 1890 of 1

dusk flicker
#

with the exception of world edit for building

trim creek
#

WTF? Using 1.18.1, and I cannot extend JavaPlugin?!

dusk flicker
#

Libs I use are norm just the commons, redis, mongo, and a few others depending on the project

young knoll
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quaint bough
vocal cloud
#

People mistake "don't reinvent the wheel" for "don't ever make something better" don't reinvent the wheel just means if someone has already created a library to handle universal logging don't create your own because it's just going to make everything more difficult for everyone else

dusk flicker
#

^

#

we should get a command like ?wheel for that

lost matrix
#

Sure but its properly written and documented.
There are truly horrible plugins which are widely used. CoreProtect for example.
Super hacky and half of it is just String based. And instead of abstraction/overloading they simply use Object parameter

trim creek
young knoll
#

Lol

#

Imagine not using a build tool

vocal cloud
young knoll
#

I mean, you just have to change a path

#

I think you’ll live

dusk flicker
#

cause no full dev not does use a build system like maven or gradle

trim creek
#

I guess it was pretty enough that we just needed to import a server jar instead of a bootstrap jar... -.-

vocal cloud
quaint bough
gleaming zenith
#

Hello, how can i set a backend server as default server? (Bungeecord)
I mean that the players are always connecting to this server if they join, not to any other even if they played on another server the last time

quaint bough
#

Just makes no sense that the variable changes

vocal cloud
lost matrix
quaint bough
#

ah

#

didnt know there was an extra one for this specific thing

#

thanks though i was really lost

thick gust
#

super best java function

#

there isn't a better one.

#

extending a class and using its constructor. ah just beautiful

tardy delta
#

cancel the move event

lost matrix
#

Listen to the move event and see if the target location is in another chunk as the current location

#

You should probably do this mathematically as the move event is quite expensive

vocal cloud
#

I mean you could set walkspeed to 0? Not sure if that'd freeze them in place or not

young knoll
#

Yes

#

But that wouldn’t even let them move around the current chunk

vocal cloud
#

I mean you don't want them to leave you don't have much of a choice beyond barriers but if you want other players to be able to then idk beyond some sort of check for location

young knoll
#

Yeah you’ll have to use the move event

#

Or a runnable, but that isn’t really any better

sterile token
#

I recommend use CompletableFuture for Async

tardy delta
#

or just the scheduler

ancient plank
young knoll
#

Even with Jump boost 128 sprint jumping still lets you shuffle along

#

Very annoying

vocal cloud
ancient plank
#

😔 cant stop jumping without hacky workarounds

young knoll
#

Is jump boost that hacky

lost matrix
#

This is probably as cheap as it gets:

  @EventHandler
  public void onChunkCross(PlayerMoveEvent event) {
    Location from = event.getFrom();
    Location to = event.getTo();

    int fromChunkX = from.getBlockX() >> 4;
    int toChunkX = to.getBlockX() >> 4;
    int fromChunkZ = from.getBlockZ() >> 4;
    int toChunkZ = to.getBlockZ() >> 4;

    if (fromChunkX == toChunkX && fromChunkZ == toChunkZ) {
      return;
    }

    event.setCancelled(true);
  }
thick gust
#

I'm sure there are libraries which calculate chunks

#

Otherwise you should be able to get the chunk coordinates by the spigot api

#

Think I've done that a few years ago just forgot how.

#

You could also use the PlayerMoveEvent and check if the player's from Location is greater than one block, and if that Location is in a different chunk.

young knoll
#

That’s what that does

shadow night
#

How does config reloading works?

thick gust
#

uh

#

you gotta use the copyDefaults method

#
getConfig().copyDefaults(true);
saveConfig();
#

that should do it.

shadow night
#

It'll reload the config?

young knoll
#

No

#

Plugin#reloadConfig

thick gust
#

I don't recommend reloading the config using that method.

dense heath
#

Anybody know of any good terminal manipulation libraries for Java?

shadow night
lavish hemlock
#

But JLine, Jansi, etc. are neat.

#

Java does not support a lot of terminal features you'd see in native apps (or even JS ones)

sterile token
#

Any opinion of how is made this?

fervent gate
#

How would I create a custom mob with a player skin that I can equip armor, items?

thick gust
#

Just save the config once again using it's config, reloading the config messed up earlier my entire config file and cleared it.

sterile token
young knoll
#

Probably

sterile token
#

I seen that you load that title based a 3d model title

shadow night
#

I've heard using heads you can add any textures without requiring the client to download anything

brittle loom
#

Hello, I'm trying to restore a map by unloading all of its chunks (with ought saving them) and loading them back again, the problem is when I unload the chunks they get saved, so when I try loading them back again the chunks aren't getting restored. Does anyone know how I can prevent chunks from getting saved? The restoring feature works on version 1.8 but it won't work on any versions above. Here's a pastebin of the world restore method: https://pastebin.com/nkAixcLG if you could help it would be much appreciated.

ebon arrow
shadow night
#

How can I fully regenerate (and change the seed) of the whole world including other dimensions? I'd really need it for my plugin

brittle loom
spiral light
young knoll
#

You can’t unload the main world at runtime

spiral light
shadow night
ebon arrow
spiral light
fervent gate
shadow night
spiral light
fervent gate
loud grove
#

Hello everyone, I have a question about netty for reading packets
Every time someone "inject" a player for that in the PlayerJoinEvent, creating a ChannelDuplexHandler and then do this

ChannelPipeline channelPipeline = ((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.pipeline();
channelPipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);

But I see that when I do this outside a PlayerJoinEvent -> for example after a command custom, it does not work
does anyone know why it's only working in the PlayerJoinEvent ?
Thanks

ebon arrow
spiral light
# shadow night hacky?

reflection to access world-stuff to close the datastreams and access the world-list to modify the list of worlds ...
then you can create a new world and need to replace some stuff to get this work

i would prefer md5 to give a damm shit about Multiverse and other plugins and instead implement my PR so this would get quite easy ...

spiral light
sterile token
#

What its better for singleton or which one is correct/incorrect:

1-

public ClassName { 

  protected static ClassName instance;

  public Classname() {
    if (instance == null) {
      instance = new ClassName();
    }
  }

  public ClassName getInstance() {
    return instance;
  }
}

2-

public class Main extends JavaPlugin {
  
  protected ClassName instance;
  
  public void onEnable() {
    this.instance = new ClassName();
  }
  
  public ClassName getClassName() {
    return instance;
  }
}
ebon arrow
lavish hemlock
sterile token
lavish hemlock
#

private static final ClassName INSTANCE = new ClassName();
public static ClassName getInstance()

#

That's an actual singleton.

#

Also you'd need a private constructor.

sterile token
lavish hemlock
#

No it will not lmao

#

you just return INSTANCE

#

A field is not evaluated every time it is accessed.

brittle loom
sterile token
lavish hemlock
#

one sec

#
public final class MySingleton {
    private static final MySingleton INSTANCE = new MySingleton();

    private MySingleton() {
        // you could also inject some logic in here to get the caller
        // but that's unnecessary unless you're really strict about reflection
    }

    public static MySingleton getInstance() {
        return INSTANCE;
    }
}
#

That is a pure singleton ^

spiral light
# shadow night Ehm wow

yeahh... i am sadly to lazy to find the issue for not saving scorebaord+gamerules for this world then 😄

ebon arrow
sterile token
#

Does it have a diff name?

lavish hemlock
#

That...

#

Would probably just be called a "service" or smthn.

sterile token
#

Oh ok

brittle loom
lavish hemlock
#

I don't know the actual name for that design pattern.

#

The point of a singleton is that there can only ever be one of it.

brittle loom
#

But I'm restoring it 100 000 blocks at a time

hasty prawn
#

Therefore the 2nd one is the best if your class extends JavaPlugin

lavish hemlock
#

Then don't make your plugin a singleton, use DI.

hasty prawn
#

Singleton is fine for the JavaPlugin instance lol

sterile token
ebon arrow
lavish hemlock
quaint mantle
#

why PlayerPickupItemEvent is deprecated

young knoll
lavish hemlock
#

There's a large number of people (like myself) who fucking hate singletons.

hasty prawn
#

And your reasoning?

lavish hemlock
#

Coupling.

sterile token
#

Wait using singleton can i have many ClassName#getInstance() without getting a new map, set, etc on every method call?

hasty prawn
#

I suppose, but DI is just obnoxious as fuck

brittle loom
lavish hemlock
#

And the fact that most people use them incorrectly (e.g. like in the context object pattern, where large services will never be cleaned up)

quaint mantle
#

is there any event called when someone copies an item in creative with middle click ?

hasty prawn
#

I am only suggesting Singleton for the JavaPlugin instance.

lavish hemlock
#

I'm not entirely against static, it has a place in certain areas (utils and static factory methods)

hasty prawn
#

DI for everything else.

ebon arrow
lavish hemlock
#

I mean one benefit I can see of using a singleton plugin is that it makes it enforces the plugin instance in the rest of your code.

sterile token
#

So after listening to you Maown and Dessie this is wrong?

kind hatch
lavish hemlock
#

Why do you never use final or private?

lavish hemlock
#

A class could extend FileManager and set instance to something else, making it invalid.

quaint mantle
#

InventoryClickEvent ?

hasty prawn
#

Yeah you should use DI for that Verano

ebon arrow
#

@brittle loom

sterile token
kind hatch
hasty prawn
#

"hidden"

lavish hemlock
#

protected makes it accessible to classes in the same package as well.

#

As well as classes that extend that class.

#

It's a little more hidden than public but not by much, especially since your class is inheritable.

hasty prawn
#

I thought protected was extended only

#

And nothing was package

lavish hemlock
#

Apparently it's also package-private

#

I stared at my IDE confused for like

#

5 minutes

#

When I saw an inspection for my protected field

hasty prawn
#

confusedcat really

lavish hemlock
#

Yeah it's fuckin' weird

sterile token
#

So there is no way that only getting the getMethodName() and cant getting varNames (no matter if you extend it or not)

lavish hemlock
#

I don't understand what you mean

ancient plank
#

reminded me that I need to check for creative mode in my nuke plugin

hasty prawn
#

Just let everyone nuke

lavish hemlock
sterile token
ancient plank
lavish hemlock
#

Okay then make your field private and your method public.

#

You can also use final on that field to stop it from being set to something else.

sterile token
lavish hemlock
#

Yeah

sterile token
#

I dont want that be possible

lavish hemlock
#

Which is why you private-ize the field as well so it's only accessible through the method.

#

private makes something only accessible to the class it's in.

#

protected makes something accessible to the class it's in and subclasses.

#

public makes something accessible to everything.

#

protected and no modifier are also package-private, meaning they're accessible to the classes within the same package

sterile token
#

I cannot use private final when class has constructor

#

So im in the same

lavish hemlock
#

Yes you can

#

All classes have constructors

sterile token
lavish hemlock
#

Yeah that means you have to set the config field in the constructor.

sterile token
#

I dont wanna that btww

lavish hemlock
#

But why?

#

Why offload it to a register method?

sterile token
#

Because otherwise my main class would be filled with crap

#

I need a keyboard for: Dont let you getting fields, only gettings methods, no way of extending for (getting fields/methods) and only be able to use it in the same project

lavish hemlock
sterile token
#

Like i need to load more than 10 files. I have 10 lines extra

#

That i can take them out from main class

lavish hemlock
#

You'd just move them to the constructor though.

sterile token
#

But why?

lavish hemlock
#

Because why else would you do it like the above?

#

It's messier.

sterile token
#

So you are telling me

#

Using fileManager.getInstance(FileHandler config, FileHandler lang).register()

#

So?

tardy delta
#

just do new FileManager()

sterile token
#

Btw

tardy delta
#

oh ya

lavish hemlock
#

Don't use a singleton for that lmao

#

It's a service

#

It doesn't need a singleton

tardy delta
#

i agree

lavish hemlock
#

You can instead do plugin.getFileManager()

sterile token
#

🤔

lavish hemlock
#

There's nothing wrong with that

#

If you want less lines of code

#

Use Guice :)

sterile token
#

Guice?

lavish hemlock
#

It's a dependency injection framework

#

When you inevitably learn it

sterile token
#

To much things for doing something easy

lavish hemlock
#

You'll hate it :)

#

Most IDEs allow you to auto-generate getters anyway.

sterile token
#

😂

lavish hemlock
#

I mean if you design it well enough

#

I'd argue the main class wouldn't be too bloated

#

I use the main class for only services and registration

#

e.g. creating instances of other classes and then registering commands/listeners

sterile token
#

services refence to what?

lavish hemlock
#

Which doesn't take up that many lines btw

sterile token
#

Wait i wanna as k you smth

lavish hemlock
#

Yeah?

sterile token
#

If i use singleton and i had some data saved in map/set/list/etc and i do Class#getInstance() that data will be there or it will be empty because its create a new memory space?

lavish hemlock
#

If it's a singleton that memory is never cleared.

#

static things do not get garbage-collected, and as the instance of the singleton is static, it can't be garbage-collected nor the things contained within the instance.

sterile token
#

So what the singleton does is create an instance and reuse it

ivory sleet
#

Btw verano guice allows singleton (:

lavish hemlock
#

Haha yeah ^

lavish hemlock
#

The singleton pattern is one where you have a single instance of something and cannot create any more instances

#

Why is why it's called a "singleton"

quaint mantle
sterile token
# lavish hemlock Yes

So if I save objects the object will be there, no matter if calling multiple times getInstance() data will be always there

lavish hemlock
#

Yes

sterile token
#

Allright thanks

#

Really thanks

lavish hemlock
#

Same thing applies to creating things in the main class though

sterile token
#

You always help me

lavish hemlock
#

Since the main class isn't cleaned up till the server stops

#

Or sorry, until the plugin is unloaded

sterile token
#

But wait when plugin get unload the classes get unload from Jvm

#

I supouse

lavish hemlock
#

Yeah

sterile token
#

So if had something saved on map/set/etc will get deleted i suppouse

lavish hemlock
#

By the way if you wanna know another way of implementing a singleton

lavish hemlock
#

It goes like this

public enum MySingleton {
    INSTANCE;

    public String getWhatever() {
        // just a basic example method
        ...
    }
}
#

:)

#

"Effective Java" says this is a good way to do singletons but I somewhat disagree since it's unclear what's going on here.

honest sentinel
#

am I dumb or should this work just fine? 1.12.2 btw. There are no errors at all

private static final String[] sounds = new String[Sound.values().length];

@Override
    public void playSound(Location location, Player player, int sound, float volume, float pitch) {
        System.out.println(Arrays.toString(sounds));
        player.playSound(location, sounds[sound], volume, pitch);
    }```
lavish hemlock
lavish hemlock
#

Yeah exactly

#

That's why I never advocate for it.

#

So

#

An "enum constant" is essentially just an instance of an enum class.

#

e.g. INSTANCE is actually a new MySingleton()

#

You can't create any more instances of an enum from outside of one.

#

So, enums can be singletons, since you can declare methods in them.

#

I still don't really recommend this.

#

But it's a cool fun fact at least.

#

(Another off-topic fun fact: Did you know enums can implement interfaces? They can't extend classes though)

lavish hemlock
#

It's good for a system where you want extensibility but you also want to support enums.

quaint mantle
#

GUYS
when i cancel InventoryClickEvent,
the item duplicates, how to fix it, please answer if you know

lavish hemlock
#

So you can have an enum called DefaultStuff that implements Stuff, as well as an ExtraStuff class that does the same.

quaint mantle
#

im getting ignored, feeling good

lavish hemlock
#

Java actually does this in a few places, namely NIO.

lavish hemlock
#

I'm not forced to respond to you :p

quaint mantle
#

i know

#

no one is here

#

😔

lavish hemlock
#

Also

#

You told people to answer if they knew

#

I did not know, so I did not answer.

ancient plank
#

it be like that

shadow night
#

can the types of the standard config be changed if the server owner would if he change the int or bool to a string or something?

brittle loom
tender shard
#

lmao I have trouble with my own library

#

?paste

undone axleBOT
vocal cloud
#

good boy

#

use paste

tender shard
#

I really don't get why it throws this error

vocal cloud
quaint mantle
#

Checking a pdc and setCancelled

grim ice
#

the array is literally empty, u just set its size?

System.out.println(Arrays.toString(sounds));

just use super.playSound(and pass in the stuff)

    player.playSound(location, sounds[sound], volume, pitch);
tender shard
#

I found the problem lol

vocal cloud
#

Stop telling start showing

quaint mantle
#

Im on phone rn

tender shard
grim ice
#

if its a ghost item it will disappear

quaint mantle
#

The method is just not there

grim ice
#

what

quaint mantle
#

Oh

grim ice
quaint mantle
#

Wait

grim ice
#

u high?

#

lol

quaint mantle
#

No i just messed something with cast

grim ice
#

o

vocal cloud
quaint mantle
#

I will try tomorrow thanks

grim ice
#

ok

vocal cloud
#

Next time send the code or we are going to ignore you again

lavish hemlock
shadow night
#

if I have an int in my config, will the user be able to make it something else or will it always be an int?

vocal cloud
#

The user can do whatever they want with it

tender shard
#

lol weird question

hexed hatch
#

they could replace that pretty int with "ooga booga" if they wanted to

tender shard
#

they could even replace it with "uwu 69 asd"

vocal cloud
#

You either have to throw a custom error or let it crash. I recommend

hexed hatch
shadow night
hexed hatch
#

by making sure it's a boolean

#

when reading it

#

boom

shadow night
#

how can I get a standart of a config path?

vocal cloud
#

The user can set it to whatever they want. You can however, throw an error or warn them and set it to something default. I wouldn't do that imo it's best to let it crash so you can tell the user personally how dumb they are when the error says "unable to parse bool from 'treu'"

vocal cloud
#

standart?

shadow night
#

yes

#

default

#

I mean

hexed hatch
#

what does that mean

vocal cloud
shadow night
shadow night
vocal cloud
shadow night
#

path is the name, value is the default value

vocal cloud
#

Alright so you set a default now what

shadow night
#

I need to get it from another function

vocal cloud
#

use .get?

young knoll
#

Tbh I have no idea how defaults work

shadow night
#

oof

young knoll
#

I think there is a getDefault? Idk

vocal cloud
#

Well there is a public Configuration getDefaults();

elfin atlas
#

Question when I spawn a FallingBlock how can I make it that he wont disappear?

shadow night
#

hmm, maybe this`?

young knoll
#

No that’s just the normal get

shadow night
#

hmm

#

right

waxen plinth
#

Is Class.forName slow even if the class is already loaded?

visual tide
wide coyote
#

how can i send data via proxiedplayer to spigot server

#

ServerInfo#sendData sends the data via first player, not the specified player
ProxiedPlayer#sendData sends the data to player's client, not to the server

shadow night
#

how can I check the type of a variable?

wide coyote
#

instance of might be useful

shadow night
vocal cloud
wide coyote
#

ye i am going to do that

#

i was looking for another efficient way

#

but seems like there is not

near kite
#

@steep gale stop attacking me

#

hes harassing my friends and me @smoky yoke

shadow night
willow widget
#

ok this is pretty basic but I'm getting tired of trying to figure this out xd
How can I get the message from a custom Exception? (which I think is the message given to the exception when thrown)
I tried e.getMessage() but it returns null so idk 😦

#

I know this is not reallly spigot too but... yeah xd

vocal cloud
#

show code

willow widget
#
        try {
            Utils.isCommandEnabled(command);
        } catch (DisabledCommandException e) {
            sender.sendMessage(Utils.color(e.getMessage()));
            return true;
        }

And this is what's supposed to send the message given by the exception but e.getMessage() is returning null.

vocal cloud
#

Like type

young knoll
#

String

willow widget
#

yup

#

but it is returning null for some reason

young knoll
#

Show us where you throw the exception

quaint bough
#

I am making a villager that when clicked shows an interface to interact with. This villager has to stay when logging out and logging back in.

Best way to achieve this by extending entity villager and spawning a custom mob? Or are there much easier ways of doing this?

willow widget
# young knoll Show us where you throw the exception
    public static void isCommandEnabled(Command command) throws DisabledCommandException {
        System.out.println("Evaluated command: " + command.getName());
        System.out.println("Received value: " +
                Main.config.getSpecificValue("Commands." + command.getName().toString()));
        if (!((Boolean) Main.config.getSpecificValue("Commands." + command.getName()))) {
            throw new DisabledCommandException("&c" + command.getName() + " command disabled.");
        }
    }
vocal cloud
#

Now what variable is it in the Exception class

#

And where is it set

willow widget
young knoll
#

Why not just make your method return a Boolean

#

Rather than throw an exception

willow widget
vocal cloud
elfin atlas
#

Question why is this giving me this error:

  BukkitTask s = new BukkitRunnable() {
            int count = 0;
            @Override
            public void run() {
                if(count == 150) {
                    this.cancel();
                    run();
                    run2();
                    return;
                }
                for(ArmorStand armorStand : armorStands) {
                    entityUtil.up(armorStand, armorStand.getLocation());
                }
                count++;
            }
        }.runTaskTimer(main.getInstance(), 0L, 1L);
java.lang.StackOverflowError: null
        at com.google.common.collect.MapMakerInternalMap$Segment.get(MapMakerInternalMap.java:1430) ~[patched_1.17.1.jar:git-Paper-233]
        at com.google.common.collect.MapMakerInternalMap.get(MapMakerInternalMap.java:2345) ~[patched_1.17.1.jar:git-Paper-233]
        at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:329) ~[?:?]
        at co.aikar.timings.MinecraftTimings.getPluginTaskTimings(MinecraftTimings.java:81) ~[patched_1.17.1.jar:git-Paper-233]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.<init>(CraftTask.java:79) ~[patched_1.17.1.jar:git-Paper-233]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.<init>(CraftTask.java:44) ~[patched_1.17.1.jar:git-Paper-233]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler$3.<init>(CraftScheduler.java:308) ~[patched_1.17.1.jar:git-Paper-233]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.cancelTask(CraftScheduler.java:285) ~[patched_1.17.1.jar:git-Paper-233]
        at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:30) ~[patched_1.17.1.jar:git-Paper-233]
        at me.katze.av.rides.flatrides.chairswing.chairswing$1.run(chairswing.java:61) ~[av-0.1.jar:?]
willow widget
vocal cloud
willow widget
vocal cloud
#

Reading the documentation you'll find this
Read in detail the entire comment

vocal cloud
#

And I'm sure your question will be answered

elfin atlas
vocal cloud
elfin atlas
willow widget
golden turret
young knoll
#

That’ll still overflow

#

You keep calling the method from itself

willow widget
vocal cloud
#

Seems like it.

willow widget
#

what should I do then? make a setMessage myself? or what? xd

acoustic pendant
#

Hey! i think i run buildtools but i keep getting this error:

elfin atlas
vocal cloud
young knoll
#

That’s worked for me in the past without issue

willow widget
golden turret
#

first check

#

you can know by

#

going to the maven repo dir

#

and seeing if the spigot dir is there

acoustic pendant
#

where i can see that?

tardy delta
#

goodnight yall

willow widget
#

b r u h it is working now wth hahaha

golden turret
#

{homedir}/.m2/repository

vocal cloud
acoustic pendant
#

i mean, i got this.

willow widget
#

I swear it was giving me a NPE before, idk what did I change but it is working now, sorry for bothering, thanks! 🙂

golden turret
#

your local

tardy delta
#

windows 11 👀

buoyant viper
#

are those sync icons

#

did u run that in onedrive or dropbox or mega dir

golden turret
buoyant viper
golden turret
tardy delta
#

yea

golden turret
#

a

tardy delta
#

i want it too but my school blocks it

vocal cloud
#

Man they added so much s p a c e

golden turret
#

and see if it ran without problems

buoyant viper
#

i almost said make sure u have mavenLocal but then i realized..... hes using maven

dry meadow
acoustic pendant
unreal quartz
buoyant viper
#

what space

dry meadow
#

between the icons

#

It is enabled by default

#

I am using Win11 and it is so buggy with multi screen...

buoyant viper
#

idk it doesnt look toooo bad

acoustic pendant
#

I restarted intelijj and now the 3 sends errors xd

spiral light
acoustic pendant
vocal cloud
vocal cloud
#

I mean you either load a chunk or you don't the most efficient way is to only load those you need

round finch
#

there is also preloading

#

load an area of chunks before anyone comes near the chunk

#

?Math

tender shard
#

is there any way to properly make entities ridable (e.g. sheep)?

#

I know I could spawn an invisible boat but

#

that would require to basically get all the existing mob speeds etc, manually control them using code etc

#

probably way too complicated

fervent gate
#

I've got a question with buildtools, can I ask that in here?

eternal night
#

yes

fervent gate
#

So, I am getting the following errors when running the build tools with and without a .bat file.

Starting clone of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git to CraftBukkit
Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file CraftBukkit\._LGPL.txt698738479853962368.tmp to CraftBukkit\LGPL.txt
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:215)
        at org.spigotmc.builder.Builder.clone(Builder.java:1051)
        at org.spigotmc.builder.Builder.main(Builder.java:333)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: java.io.IOException: Could not rename file CraftBukkit\._LGPL.txt698738479853962368.tmp to CraftBukkit\LGPL.txt
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1516)
        at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:563)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:467)
        at org.eclipse.jgit.api.CloneCommand.checkout(CloneCommand.java:385)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:212)
        ... 3 more
Caused by: java.io.IOException: Could not rename file C:\Users\lahou\Desktop\Desktop\SpigotBuildTools\BuildTools\CraftBukkit\._LGPL.txt698738479853962368.tmp to C:\Users\lahou\Desktop\Desktop\SpigotBuildTools\BuildTools\CraftBukkit\LGPL.txt
        at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:323)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1514)
        ... 7 more
#

The error starts at the second line

eternal night
#

sounds like something on windows is grabbing a hold of the file

#

are you running this in some synced folder or is your antivirus scanning stuff

fervent gate
#

I'll try this without the Av running, that caused problems in the past

tender shard
eternal night
#

the ultimate IT solution

#

lol

tender shard
#

for windows, yes 😄

fervent gate
#

I'll try that next.

#

Runs faster already

#

Yea, that seemed to have worked

eternal night
#

🙏

tender shard
#

:3

fervent gate
#

Thanks!

tender shard
#

np 😄

fervent gate
eternal night
#

XD

#

mfnalex stealing credit smh

fervent gate
#

lmao

tender shard
#

huh

#

was it the antivirus?

#

I thought it was the rebooting

#

sorry

fervent gate
#

Yea

tender shard
#

whoops I missed that

fervent gate
#

Nah dw

tender shard
#

I still steal the credits

eternal night
#

:>

vocal cloud
#

Have you tried using templeOS to run all your builds?

halcyon mica
#

Is there a lightweight schematic parser library that doesn't require the entirety of worldedit to be loaded?

quaint bough
#

Does anyone know an NMS util for custom entities that does it like this? I don't know how to add attributes are there any guides on that ?

vocal cloud
#

Do you need to use NMS to work with custom entities?

quaint bough
#

Yeah

#

also just learning it

#

but these attributes stuff is all obfuscated

vocal cloud
#

You probably don't have to use NMS to modify attributes

quaint bough
#

so i can just cast my custom entity to spigot and use that instead?

vocal cloud
#

NMS should really always be a last resort

quaint bough
#

Yeah I know but seemed a little easier this way but prob wrong

#

anyway I am trying to make a villager that just sits there and is interactable

#

you could probably just do that with spigot right ?

quaint bough
vocal cloud
vocal cloud
halcyon mica
quaint bough
vocal cloud
vocal cloud
fervent gate
# eternal night :>

Now it is not working in the IDE itself. This is the POM.XML dependencies part:

<dependency>
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot</artifactId>
    <version>1.18.1-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

It gives an error for the version: Dependency 'org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT' not found
I do have the folder in: C:\Users\user\.m2\repository\org\spigotmc

spiral light
vocal cloud
#

Can't use PDC if you're in 1.12

quaint bough
#

ah

#

well I am using 1.12.2 what would be the way to do it ?

halcyon mica
quaint bough
#

I was something about metadata

spiral light
halcyon mica
#

Schematics are not only part of WE, they came up with the base concept

#

But by now, it is more of a standardized format

lavish hemlock
#

@halcyon mica Schematics use the NBT format.

halcyon mica
#

That has been revised plenty of times already

spiral light
halcyon mica
#

I know, gzipped nbt

lavish hemlock
#

Sponge has documented their extension of it via GitHub.

#

But that's all you're gonna find, really.

halcyon mica
#

I was hoping to not have to create my own parser

lavish hemlock
#

I believe schematics actually originate from MCEdit.

spiral light
#

dont know how schematics are build (what keys ....)
but chances are not that bad that you can use the Structures API anyway ^^

halcyon mica
#

I have been explicitly told to not work with structures

spiral light
#

hmmm why

halcyon mica
#

Don't ask me

vocal cloud
#

We are asking you because why

lavish hemlock
#

If they didn't give you a reason, do it anyways :)

halcyon mica
#

I just get a list of requirements and things I am to avoid

#

I do it, and get paid

#

I don't care enough to ask questions

vocal cloud
#

Then either write your own or start searching I suppose

spiral light
#

copy&paste is way harder then writing own system trust me

trim creek
#

+1 by the expeirence.

#

I trust you

fervent gate
#

Just going to post this without a reply. I am getting the error in the second block. I ran buildtools earlier
POM.XML

    <groupId>org.spigotmc</groupId>
    <artifactId>spigot</artifactId>
    <version>1.18.1-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>```

It gives an error for the version: 
```Dependency 'org.spigotmc:1.18.1-R0.1-SNAPSHOT' not found ```

I do have the folder in: 
```C:\Users\user\.m2\repository\org\spigotmc```
eternal night
#

did you properly reload your ide

fervent gate
#

Yes

spiral light
#

do you have the foldet and also the jar ?

eternal night
#

org.spigotmc:1.18.1-R0.1-SNAPSHOT is not a valid dependency

#

so like, make sure you clicked the maven reload button

fervent gate
#

did that twice

eternal night
#

rip

fervent gate
#

Guess I'll have to reboot the pc at last

quaint bough
#

how do you make an entity freeze? but not with no ai

shadow night
fervent gate
quaint bough
#

actually no ai does that also make it not pushable?

shadow night
#

I think you can push it (using code) or tp it even with no ai

#

As its still an entity and it still has its coordinates and velocity

quaint bough
#

yeah but I also want to make it not pushable

olive crescent
#

Hi, how do I make a "timer", for example, if the player does not give a command within 30 seconds he is expelled, or something along those lines, how do I make this timer?

quaint bough
#

I saw some old post overriding the g(double d0, double d1, double d2) method but I cant do that so idk

shadow night
quaint bough
#

it is pushable atm

#

oh i did it

#

overwriten this method

#

and than it stops pushing

#

velocity still works fine

shadow night
#

Or google

olive crescent
#

thanks

undone axleBOT
tender shard
#

works fine for me

#

what happens if you run mvn package ?

fervent gate
#

For me too, but not for the ide

vocal cloud
#

I'm late to this party but build tools has been run I assume

fervent gate
# tender shard what happens if you run `mvn package` ?
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< me.cosmicdev:ACMobs >-------------------------
[INFO] Building ACMobs 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.spigotmc:spigot:jar:1.18.1-R0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.248 s
[INFO] Finished at: 2022-01-15T23:45:38+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ACMobs: Could not resolve dependencies for project me.cosmicdev:ACMobs:jar:1.0-SNAPSHOT: org.spigotmc:spigot:jar:1.18.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [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/DependencyResolutionException

Process finished with exit code 1
tender shard
#

erm I mean buildtools

vocal cloud
#

Do it again

tender shard
#
java -jar BuildTools.jar --rev 1.18.1
vocal cloud
#

mvn clean

#

Make everything as fresh as possible

fervent gate
fervent gate
tender shard
#
  1. Run BuildTools again (with --rev 1.18.1)
  2. Run mvn clean package -U
tender shard
#

send your bat file

#

or better paste it

#

?paste

undone axleBOT
fervent gate
#

That is the thing they have on their website

rich inlet
#

Is it possible to get a player's name with all the corresponding colors and prefixes that this player has? :)

fervent gate
#

It runs with latest

rich inlet
tulip owl
#

Vault handles prefixes

#

So you need to query their API

#

as well as the spigot one for other stuff OFC

shadow night
tender shard
#

it's something thats provided by other plugins

#

e.g. vault

shadow night
rich inlet
fervent gate
# tender shard ?paste

Any idea on what may be causing the issue, because if I run the clean and pkg thing, still getting errors

tulip owl
rich inlet
#

Okay, thanks :)

left swift
#

out of curiosity, I saw a minecraft dev plugin for intellij idea that generates an initial project (mavan depends etc). Should it be used or is it better to do everything manually?

lavish hemlock
#

You should use it if you have enough experience.

#

Doing things manually is a good learning exercise.

#

But yeah I know MinecraftDev, it's a very nice plugin.

tender shard
tender shard
#

(only works when you check at least one dependency though)

#

I really dislike the intellij minecraft plugin

rich inlet
tender shard
left swift
#

what is allatori?

tender shard
tender shard
#

it's paid though (290$)

fervent gate
#

Guess it works now$

quaint mantle
#

im trying to check if a item has a certain enchant, this is what i have

.getEnchants().containsKey(Enchantment.DURABILITY))

what should i put inside containsKey instead since rn it throws an error

quaint mantle
tender shard
#

for getEnchants: it returns a Set

#

for getEnchants you'd have to use getEnchants().getKeys() to check the enchantments

craggy plover
#
@EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            if (event.getItem().getItemMeta().equals(BetaRelease.betarelease.getItemMeta())) {
                Player player = event.getPlayer();
                DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(255,0,0), 1.0F);
                player.spawnParticle(Particle.HEART, player.getLocation(), 100, dustOptions);
            }
        }
    }
quaint mantle
#

its `

#

lol

hexed hatch
#

why is that even static

craggy plover
#

im such an idiot XD

craggy plover
tender shard
#

the message was edited

craggy plover
#

yeah i changed it

elfin atlas
#

Question when I spawn a FallingBlock how can I make it that he wont disappear?

tender shard
#

you can't

#

they will ALWAYS disappear at some point

#

I spent hours getting it to work - listening to events, manually setting the "alive ticks" to 0 every few seconds, ...

#

they always get removed after about 5 minutes at most by vanilla

elfin atlas
tender shard
#

oh that's no problem

#

one sec

elfin atlas
#

Okay thank you

tender shard
#

I think you can cancel this

#

oh wait sorry

elfin atlas
#

Okay

tender shard
#

^this

elfin atlas
#

Thanks

tender shard
#

np

woeful moon
#

what would be the best way to store data on achievements (which players have already completed which achievements)? a row for each player and a column for each achievement?

fervent gate
#

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

This is the error.

package me.cosmic.mobs;

import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.monster.EntityZombie;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;

public class TribeDruid extends EntityZombie {

    public TribeDruid(Location loc) {
        super(EntityTypes.be, ((CraftWorld) loc.getWorld()).getHandle());
        this.x((float) loc.getX());
        this.y((float) loc.getX());
        this.z((float) loc.getX());
        this.cn(new ChatComponentText(ChatColor.RED + "" + ChatColor.BOLD + "Tribe Druid" + ));
    }
}

This is the code. I am pretty confused on what it causing the error and why I can't use things like setPosition

#

It cannot resolve the setPosition method

chrome beacon
#

See the 1.18 release post for more info

fervent gate
#

Where can I find that?

chrome beacon
#

Main page of spigotmc

elfin atlas
#

I mean in a smooth way

#

I'm trying to do it like this but this is now a good idea I guess

  public static void teleport1() {
        for(FallingBlock fb : door1) {
            Location loc = fb.getLocation();
            CraftEntity ent = (CraftEntity) fb;
            ent.getHandle().setPositionRotation(loc.getX(), loc.getY(), loc.getZ()+0.1, loc.getYaw(), loc.getPitch());
        }
    }
tender shard
#

of course you can use .teleport

chrome beacon
tender shard
#

since they fall, they SHOULD be able to accept velocity too

chrome beacon
#

^

elfin atlas
#

So just normal teleport?

tender shard
#

the API can do it, no need for NMS

elfin atlas
tender shard
#

this should definitely be a thing in spigot API

wintry badger
#

Hi, I want to write a plugin that prevents Elytras from being repaired. So its about enchanting with mending, combining with phantom membranes or another elytra. Which events should I look into?

tender shard
#

why doesn't it exist D:

tender shard
wintry badger
#

is it about applying the enchantment book?

brave sparrow
#

Yup

wintry badger
#

thanks!

craggy plover
#
@EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            if (event.getItem().getItemMeta().equals(BetaRelease.betarelease.getItemMeta())) {
                Player player = event.getPlayer();
                DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(255,0,0), 1.0F);
                player.spawnParticle(Particle.HEART, player.getLocation(), 100, dustOptions);
            }
        }
    }
#

It’s not workin

#

How I fix?

brave sparrow
#

Did you register the event?

craggy plover
brave sparrow
#

Use debug statements to figure out which line isn’t working then

fervent gate
#

because I ran the bt with --remapped

fervent gate
#

and added this

chrome beacon
#

There is more

fervent gate
#

That was the only thing I read on a spigot discussion

chrome beacon
#

You need the thing under that

#

Example Maven Config

fervent gate
#

Just add that?

chrome beacon
#

Yeah

worldly ingot
quaint mantle
#

Hello everyone, I'm making a plugin for kik for afk. How can you ignore the push from the water?

chrome beacon
fervent gate
#

mb

chrome beacon
#

Yeah

#

Things are using their correct names

tender shard
undone axleBOT
#

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

fervent gate
#

Yea, it actually works. It's crazy when things work, I'm not used to that lol

tender shard
#

lol

quaint mantle
#

when im getting the lore from an item if the lore has a color / chat color how can i remove that from the string or check if it is in the string

tender shard
quaint mantle
#

how can I remove all of a certain material from a player's inv?

#

i was trying to do String.replace and when checking using != "symbola"

delicate lynx
#

removes all of that material

quaint mantle
#

yea I was looking through the docs when I found out what that does

buoyant viper
#

check if getCustomName() == null before u use it @elfin atlas

tender shard
#

as @buoyant viper said

#

if something is annoted with @ Nullable, ALWAYS do a null check before accessing any methods on it

wintry badger
#

👀 is it that one?

tender shard
#

oh sorry

#

it is

#

PrepareItemCraftEvent @wintry badger

#

oh wait you talked about the anvil event

#

or are you using some outdated MC version?

wintry badger
#

i think all these things are handled in the anvil, right?

#

1.18

shrewd solstice
#

how can i spawn a falling block??? i've tested everything i've found....

#

1.16.5

shrewd solstice
#

can you pls juste give me the code to spawn it bc its like the 15th time i go on this site and found nothing that work

tender shard
#

what did you try?

#

and what doesn't work?

shrewd solstice
#

all

tender shard
#

show the code you used

tender shard
#

it takes one location parameter and one blockdata parameter

#

ok I don't like it but here you go

#
        World world = Bukkit.getWorld("world");
        BlockData blockData = Bukkit.createBlockData(Material.DIRT);
        world.spawnFallingBlock(new Location(world,0,100,0),blockData);
shrewd solstice
#

how can i disable the item drop?

tender shard
#

You should really learn to use javadocs

#

@shrewd solstice

shrewd solstice
#

i put this on what?

wintry badger
#

I think this would be enough to prevent players from repairing elytras? i know they wont be able to rename elytras, but its not a problem

@EventHandler public void onPrepareAnvil(PrepareAnvilEvent event) { if (event.getInventory().contains(Material.ELYTRA)) { event.setResult(null); } }

#

this seems to work but im curious if theres any other way to repair elytras in the game

tender shard
#

on your FallingBlock object

sterile token
#

How to import Spigot jar 1.8.8 complete?

tender shard
sterile token
#

Via repo maven please

tender shard
#

does anyone the difference between these InventoryAction.DROP_ALL_CURSOR and PLACE_ALL?

#

nvm I found out. DROP is for putting it "outside" of the inventory, i.e. dropping it

sterile token
#

Hahaha

#

I will prob create a normal project instead of maven one

buoyant viper
#

u could add it via local file

sterile token
#

Why local file when having maveN?

#

Btww

buoyant viper
#

idk ur the one whos maven cant find it

tender shard
undone axleBOT
buoyant viper
tender shard
#

you used spigot-api

#

instead of spigot

#

spigot-api = only api
spigot = spigot-api + NMS + craftbukkit

sterile token
#

Ahh

buoyant viper
#

time 2 convert gradle project 2 maven

#

aaaa

sterile token
#

So how i do? Cuz if i change spigot-api to spigot

#

It get an error

tender shard
#

did you run BuildTools for 1.8.8?

sterile token
tender shard
#

to get spigot

sterile token
#

Im using it from maven repo

tender shard
#

spigot is in no maven repo

#

you have to run buildtools

sterile token
tender shard
#

no it is not

sterile token
#

Go to sonatype

tender shard
#

SPIGOT IS NOT IN THE MAVEN REPO

sterile token
#

Yes

hasty prawn
#

It's not

tender shard
sterile token
#

So why im using it directyle from maven??

#

MNns

tender shard
#

otherwise you wouldnt get an error

sterile token
#

No cuz,because the first time i declare the repo

tender shard
#

spigot-api is in the repo

sterile token
#

And then its get download to local repo

tender shard
#

spigot is not

sterile token
#

AHHH

#

Btww

#

That why

tender shard
#

spigot = contains NMS = copyright protected

#

you MUST run buildtools to get spigot

lavish hemlock
sterile token
#

Omg such annoying

#

Installing another thing for getting an spigot

#

Really nice

tender shard
#

you literally only have to download one .jar file and run it once

#

`bt

lavish hemlock
#

if you're a dev you should probably've used BuildTools anyways :p

tender shard
#

?bt

undone axleBOT
tender shard
#

I run buildtools everyday with cron lol

lavish hemlock
#

how else would you run a test server?

sterile token
lavish hemlock
#

. . .

buoyant viper
lavish hemlock
#

FUCKING KNEW IT

sterile token
#

From there

lavish hemlock
#

Y'all didn't see it but I did

tender shard
lavish hemlock
#

@sterile token That is not an official source.

tender shard
#

I love it

buoyant viper
#

i just dont know how a few of the tasks i used to use work

lavish hemlock
#

No sites that provide pre-compiled server jars are official, and are prohibited from mention/discouraged from use.

buoyant viper
#

like i cant figure out an alternative to gradles 'application' plugin

#

i tried 'exec' but it kinda

#

almost worked but didnt

tender shard
#

the application plugin

lavish hemlock
#

Provides a script for running an application.

buoyant viper
#

it lets you run your project

tender shard
#

maven exec should work fine

buoyant viper
#

it almost was

tender shard
#

here's an example for maven exec:

lavish hemlock
#

@buoyant viper You shouldn't use Maven btw.

tender shard
#
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>run-allatori</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                    <arguments>
                        <argument>-Xms1024m</argument>
                        <argument>-Xmx2048m</argument>
                        <argument>-jar</argument>
                        <argument>${user.home}/.m2/repository/com/allatori/allatori/${allatori.version}/allatori-${allatori.version}.jar</argument>
                        <argument>${basedir}/target/allatori.xml</argument>
                    </arguments>
                </configuration>
            </plugin>
lavish hemlock
#

Just my advice.

buoyant viper
#

but a system property i was trying to provide just didnt work, and then when i fixed that, a dependency wasnt getting included or something

quaint mantle
#

bro maven is amazing

buoyant viper
lavish hemlock
buoyant viper
#

maow build system when?

lavish hemlock
#

Don't use Gradle or Maven :)

buoyant viper
#

my time is precious and my money is short

quaint mantle
#

bruh

lavish hemlock
#

Both are shit for different reasons.

buoyant viper
#

the people want and i have nothing to give

tender shard
#

maven is nice. gradle is nice too but... maven does the same thing, just easier

buoyant viper
#

i NEED Maow build system.

lavish hemlock
#

I'd argue Gradle is easier when it takes less lines to do the same shit.

buoyant viper
tender shard
#

maven at least doesn't need a 150MB wrapper downloaded into EVERY project

quaint mantle
#

yee

tender shard
#

imagine you have 10 gradle projects - now you have 1.5 GB of useless wrappers

buoyant viper
#

i think maven is a bit more stable, gradle can break something you used in just one swift update

quaint mantle
#

gradle projects take SOOOOOO long to load for me

lavish hemlock
#

Maven projects take forever to compile for me :p

tender shard
quaint mantle
#

ikr

tender shard
lavish hemlock
#

At least Gradle is fast after first run

tender shard
#

that's true

lavish hemlock
tender shard
#

both maven and gradle have their ups and downs

buoyant viper
#

lets switch to SBT

lavish hemlock
#

It spent like a full minute resolving dependencies and then a few more minutes compiling.

lavish hemlock
#

Not to mention how fucking terrible Apache's projects actually are.

vagrant stratus
#

Here's a question, has anyone here done cyclic multiplicative groups with java 🤔

buoyant viper
#

so log4j had a slight hiccup

lavish hemlock
#

More than just Log4j

buoyant viper
#

ik

tender shard
#

my angelchest plugin takes over a minute to compile but I once converted it to gradle and it was only like 5 seconds faster than maven, so..... whether it takes 60 seconds or 55 is probably not really important

lavish hemlock
#

The very library itself is bloated

#

But past that

#

There's tons of things that make other projects better than what Apache does

#

How often do you import Apache collections over Guava?

buoyant viper
#

neither

#

why need more collections when oracle already give us so much?

lavish hemlock
#

Bidirectional maps, immutable collections (which can be faster), multimaps, etc.

#

And Guava has more functionality on top of that.

#

(Although I wish it were modular)

#

And oh god

#

Have you even delved into projects like Apache Maven Resolver?

#

Like, sometimes you might need to resolve a Maven dependency with transitiveness and other important aspects.

#

Well, why not use the official solution?

#

It's god awful to work with.

#

(This is because Maven Resolver should actually be called Repository Resolver, seeing as it is decoupled from Maven)

#

(This also means it's over-engineered and it follows too many enterprise design decisions, like thousands of services with no good explanation)

#

Face it, Apache libs are outdated.

#

Minecraft no longer imports Apache Commons iirc.

buoyant viper
#

lang3, io, codec, compress in 1.18.1

lavish hemlock
#

Codec and Text are pretty useful actually, but beyond that ehh...

#

(Oh yeah, fun fact, Compress is much slower than java.util.zip)

buoyant viper
#

they still import apaches Http instead of using the Chad java 11+ HttpClient

#

smh mojang

lavish hemlock
#

(Like much slower)

lavish hemlock
#

oh actually wait

#

apparently they moved the package

#

Java 9 and 10 it was in an incubator stage

#

yeah fair enough

buoyant viper
#

it was introduced fully in J11 yeah

lavish hemlock
#

Why not just make your own HTTP server? :)

buoyant viper
#

i have

lavish hemlock
#

Same

buoyant viper
#

it wasnt nearly as correctly implemented as any other http server implementation

#

but hey

#

it served static files

lavish hemlock
#

lmao

tender shard
#

btw this is awesome:

#

if you quickly wanna download sth from your server without any SFTP setup etc

#
python3 -m http.server
#

creates a webserver from your current directory

lavish hemlock
#

interesting

#

anyway so

buoyant viper
#

i usually have php installed so i just php -S 0.0.0.0 or whatver it is

lavish hemlock
#

my main grievances with Maven boil down to usability

#

for one

#

the documentation is hosted on Apache's shitty site

#

I say their site is shitty because I find it hard to navigate

buoyant viper
#

gradles isnt really much simpler

lavish hemlock
#

Agreed

#

I also hate pom.xml

#

XML is one of the worst formats ever conceived

buoyant viper
#

oh u hate it bc of that? i hate it bc its called fuckin POM

lavish hemlock
#

SGML was aight, still not readable but not as bloated as XML

#

actually

#

HTML would make a decent format for a lot of stuff

#

but it's cemented as "the website format"

buoyant viper
#

isnt it also kinda,,,, idk

#

basically XML

#

more tolerable XML at least

lavish hemlock
#

well sure but it's also a little cleaner

#

yes

#

but in reality none of these formats work great

#

I personally don't like formats that require indentation (to either function or be clean)

#

because they're painful to work with in a text editor that doesn't automatically indent

buoyant viper
#

tab key go brrrr

lavish hemlock
#

Some text editors still interpret TAB as "insert tab character"

#

But I personally prefer 4 spaces

buoyant viper
#

what kinda text editors r u usin

lavish hemlock
#

Nano and Windows Notepad