#help-archived

1 messages ยท Page 79 of 1

wheat birch
#

anyone know how to get flyway to be able to find the postgresql driver? I have included it in my gradle dependencies and it's definitely showing up in my output jar, but flyway can't seem to find it.

sturdy oar
#

what's flyway

wheat birch
#

database migration tool, makes updating your schema super easy

#

it basically versions your DB

naive goblet
#

@frigid ember You can code it but other stuff might break

heady geode
#

guys

#

I have a problem

#

simple question

#
    public static Block getFirstSolidUnderPlayer(Player p) {
        return p.getLocation().clone().add(0, (ACMethodsUtils.getGroundDistance(p) * -1), 0).getBlock();
    }

How would I make this run synchronized when calling it from an async event

#

now using a runTask

#

won't work here

#

because it needs to return a value

sturdy oar
#

CompletableFuture?

heady geode
#

and calling it from a runTask also wont help

marsh nova
#

you have to use futures

heady geode
#

futures?

marsh nova
#

if you want to use a value which must be retrieved from the main thread in an async task, make a future of the value and call get() or join() on it

#

depending on whether you're using plain Future or CompletableFuture

sturdy oar
#

well the latter has a lot more stuff

marsh nova
#

I find that Future is useful for beginners to understand the main idea of a Future

#

it's more intuitive that get() throws a checked exception because it helps new programmers understand how the exception is propagated

open rain
#

Any devs here?

marsh nova
#

otherwise they glance over the unchecked exceptions in join()

sturdy oar
#

no sorry

#

@open rain yes

#

I'm a professional Scratch programmer

marsh nova
#

we already heard you say so

open rain
#

General wasnt the right place Ik

marsh nova
#

no it was

sturdy oar
#

this isn't either

surreal rover
#

Ah yes, a true man of culture.
Scratch programmer

open rain
#

Oh sorry

sturdy oar
#

wdym Scratch is real hard

marsh nova
#

sadly spigotmc.org is down otherwise I'd tell you to go to the plugin request section

sturdy oar
#

I'm finishing my PhD in HTML programming tho

raven skiff
#

Is SpigotMC downed?

sturdy oar
#

not for me

#

I've been happily browsing it in the past 2 hours

pastel sierra
#

If I cast a block (which i know is a chest) to Chest then do openInventory then will it give me the whole inventory if it's a double chest if not how will i access it?

marsh nova
#

getInventory vs getBlockInventory

pastel sierra
#

oops

marsh nova
#

I can't remember which one is the double chest and which is the single chest block

pastel sierra
#

i meant that

marsh nova
#

check the javadoc

pastel sierra
#

just that there are two things DoubleChest and Chest in docs

#

and if I cast a doublechest block then also it casts it into a chest for some reason

#

So if i do getinventory

heady geode
#

guys

#

so thats what I did

#
    public static Block getFirstSolidUnderPlayer(Player p) {
        CompletableFuture<Block> complete = CompletableFuture.supplyAsync(() -> {
            return p.getLocation().clone().add(0, (ACMethodsUtils.getGroundDistance(p) * -1), 0).getBlock();
        });

        try {
            return (Block) complete.get();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
        return null;
    }

#

but there is only a supplyAsync option

marsh nova
#

woohoo

heady geode
#

and I need to run it sync

sturdy oar
#

ehmmm

marsh nova
#

supplyAsync and specify the Executor

sturdy oar
#

You can also use Bukkit async scheduler

#

which is better

marsh nova
#

CompletableFuture.supplyAsync(() -> value, executor)

heady geode
#

but I need to return a value

marsh nova
#

use the scheduler in this case

sturdy oar
#

It takes some time to understand how Future work

heady geode
#

with a scheduler I can't return a value

sturdy oar
#

you can...

heady geode
#

wut

#

how

marsh nova
#
        Future<Type> futureValue = Bukkit.getScheduler().callSyncMethod(plugin, () -> {
            return value;
        });
sturdy oar
#

you complete the future

marsh nova
#

then you can call #get on that future

heady geode
#

ohhhhh

sturdy oar
#

A248

marsh nova
#

CompletableFuture#completeAsync is only available in jdk 9+

heady geode
#

this code just made me cum

#

let me try it for a sec

sturdy oar
#

if you do get it can block the thread

marsh nova
#

obviously

#

you're blocking inside an async thread

#

all that does is make the async thread wait on the main thread

#

no big deal

#

the user asked how to get a sync value in an async thread, and this works fine for most purposes

sturdy oar
#

He could return a CompletableFuture of block, then use thenAccept

heady geode
#

I dont want to block it

#

but I have no choice

marsh nova
#

nothing wrong with blocking

heady geode
#

since Bukkit API is not thread safe

marsh nova
#

which is why you use a future

#

so that the main thread gives you the value you need

heady geode
#

I mean as long as you won't block the main thread its ok

sturdy oar
#

I don't really know exactly what is doing so I can't really help that much

heady geode
#

making my AntiCheat multithreaded

sturdy oar
#

,-,

marsh nova
#

from what I can tell, Nort is inside an async task and waits a sync value

heady geode
#

its very hard

sturdy oar
#

its very hard even to do a proper anticheat

marsh nova
#

you can do this in 2 ways:

heady geode
#

its very hard even to do a proper anticheat
@sturdy oar also true

marsh nova
#

use a CompletableFuture and specify an Executor, the Executor actually being an executor which runs tasks on the main thread

heady geode
#

Im good at making Anticheats though

#

Im bad at threading

marsh nova
#

use a Future from BukkitScheduler#callSyncMethod

#

is your anticheat public?

sturdy oar
#

oh I see now, he's in a complete different situation than what I was thinking

#

I've recently used CompletableFuture for database connections, but since I'm not interacting with Bukkit API i can just do all async

#

but I guess he can't there

marsh nova
#

he is async and wants to get something sync

#

while inside the async task

heady geode
#

whats the difference between future and completefuture

marsh nova
#

CompletableFuture implements Future

#

it has more methods

hoary parcel
#

a completeable future can complete

#

duh

sturdy oar
#

it's like comparing Bukkit with Paper API

marsh nova
#

specifically related to acting when the future is complete

sturdy oar
#

๐Ÿ˜‚

marsh nova
#

you can't add a completion listener with plain Future

#

you can with CompletableFuture

#

you can also chain logic with CompletableFuture

sturdy oar
#

can you even handle exceptions like this with Future

marsh nova
#

static ๐Ÿ˜ฎ

#

your database manager is not a utility class

heady geode
marsh nova
#

yes

heady geode
#

should now not destory my life when called async

marsh nova
#

yep

#

InterruptedException happens if the async thread is interrupted while blocking, so this shouldn't happen unless you interrupt your own thread

#

ExecutionException if the computation inside the lambda threw an exception

heady geode
#

how would I interrupt it?

#

use like variables and suck?

marsh nova
#

just don't

#

you can do Thread.interrupt() if you're working with raw threads

#

but you should be using the BukkitScheduler or your own thread pool

#

so interruption really shouldn't be happening

sturdy oar
#

oh btw ty , I managed to serialize\deserialize my yaml config objects

#

if someone is interested in how I did it I can provide code

#

A248, you were saying about my static SQL method. Is there something wrong with it?

#

I'm still new to Java so I don't always have the best project structure, if you can tell me why I should change that I might

heady geode
#

oh the I should be fine\

#

btw another thing

marsh nova
#

use an object oriented approach

#

don't make your sql manager static

heady geode
#

I though about that

sturdy oar
#

I could make a singleton i think

heady geode
#

but like utils should be static

marsh nova
#

to be precise, don't use static methods for it

#

sql db access is not utils

sturdy oar
#

Ok I think I got a better way

heady geode
#

Also if go to the object orianted approach

#

then how would I like choose a method

#

lets say I have a 100 methods

marsh nova
#

what

heady geode
#

and I want to summon one of them

marsh nova
#

you should not have 100 methods in any class

heady geode
#

my PlayerUtils class has like 30 methods

marsh nova
#

are they all related to your database?

heady geode
#

there is no database xD

marsh nova
#

oops, I must be getting you 2 confused

#

sorry

sturdy oar
#

yeah he was talking to me about databases

heady geode
#

lol

pastel sierra
#

If I want to check the change in items between chest open and chest close event then what's the best way to do it? ArrayLists?

marsh nova
#

why would you use an arraylist

#

i don't understand

sturdy oar
#

what do you mean 'the change'

pastel sierra
#

Like I have 2 stacks of stone when openchest is called then there's only 1 stack when closechest is called

marsh nova
#

the difference in inventory contents

pastel sierra
#

so i want to get the data that player took 1 stack

heady geode
#
    public static Block getFirstSolidUnderPlayer(Player p) {
        Future<Block> futureValue = Bukkit.getScheduler().callSyncMethod(GodsEye.getInstance(), () -> {
            return p.getLocation().clone().add(0, (ACMethodsUtils.getGroundDistance(p) * -1), 0).getBlock();
        });

        try {
            return futureValue.get();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
        return null;
    }

Server seems to freeze when I run this

marsh nova
#

oof

heady geode
#

currently its called in a position packet listener

marsh nova
#

you are calling that entire method sync

#

that's why

#

if you're sure to call it in an async thread, you'll only make the async thread wait

#

you can debug with Bukkit.isPrimaryThread

pastel sierra
#

(any ideas)

heady geode
#
[18:18:24 ERROR]: ------------------------------
[18:18:24 ERROR]: Server thread dump (Look for plugins here before reporting to Spigot!):
[18:18:24 ERROR]: ------------------------------
[18:18:24 ERROR]: Current Thread: Server thread
[18:18:24 ERROR]:       PID: 19 | Suspended: false | Native: false | State: WAITING
[18:18:24 ERROR]:       Stack:
[18:18:24 ERROR]:               java.lang.Object.wait(Native Method)
[18:18:24 ERROR]:               org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftFuture.get(CraftFuture.java:54)
[18:18:24 ERROR]:               org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftFuture.get(CraftFuture.java:42)
[18:18:24 ERROR]:               me.nort721.godseye.utils.PlayerUtils.getFirstSolidUnderPlayer(PlayerUtils.java:330)
[18:18:24 ERROR]:               me.nort721.godseye.listeners.PlayerDataListener.onSlime(PlayerDataListener.java:145)
[18:18:24 ERROR]:               sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:18:24 ERROR]:               sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[18:18:24 ERROR]:               java.lang.Thread.run(Unknown Source)
[18:18:24 ERROR]: ------------------------------
[18:18:24 ERROR]: Current Thread: Snooper Timer
[18:18:24 ERROR]:       PID: 15 | Suspended: false | Native: false | State: TIMED_WAITING
[18:18:24 ERROR]:       Stack:
[18:18:24 ERROR]:               java.lang.Object.wait(Native Method)
[18:18:24 ERROR]:               java.util.TimerThread.mainLoop(Unknown Source)
[18:18:24 ERROR]:               java.util.TimerThread.run(Unknown Source)
[18:18:24 ERROR]: ------------------------------
[18:18:24 ERROR]: Current Thread: RMI TCP Accept-0
#

thats the error

vale slate
#

reeeeeeeeeeeeeeeeeeeeeeeeeee

marsh nova
#
if (logger.isDebugEnabled()) logger.debug("Primary thread = {}", Bukkit.isPrimaryThread());
#

one-line debug statement

vale slate
#

why the debug if?

marsh nova
#

so you don't call Bukkit.isPrimaryThread() if debug is disabled

#

it's a small distinction which would only matter in extremely performant code

vale slate
#

oh my dumbness, ok

heady geode
#

so if I call it from the async normally I'll get erros because it uses none thread safe methods, but if I call the methods inside it sync then the server freezes

#

what a time to be alive

marsh nova
#

usually the idea with logging is to not create new objects or call computational methods (getters for example are fine) needlessly

#

Nort,

#

you either need to run your code sync, in which case, there's no need to use a Future

#

or you need to run it async, and use a Future for every sync value you need, as well as ensure thread safety

heady geode
#

so you say that if my method can only be run sync

#

then it should only be called from a sync source

#

like the whole check need to be sync

marsh nova
#

if it's not thread safe, you shouldn't call it async

#

you told me it wasn't thread safe

#

and if you're calling it sync, you shouldn't use a Future

stuck goblet
#

Can anyone help me

marsh nova
#

yes

vale slate
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

stuck goblet
#

How can o dowload the Minecraft server spigot?

marsh nova
#

You can't download a JAR except from third-party sites

#

You have to build it yourself using BuildTools

stuck goblet
#

Link?

marsh nova
#

Can you please form a more coherent question?

stuck goblet
#

No i will a minecragz setver

vale slate
stuck goblet
#

thankyou

vale slate
#

just follow the instructions, if you have any problems, feel free to ask

stuck goblet
#

Can you speak german

#

or write

vale slate
#

yep

stuck goblet
#

Ok

#

Wie kann ich einen minecraft server Mit spigot aufsetzen auf meinen pc?

vale slate
#

we should move to DM because other languages than English are not appreciated in here

sturdy oar
#

man I love Functional Interfaces

#

I wish I knew them earlier

timber barn
#

:D

#

Thats why you learn java huh

ripe token
frigid ember
#

the spigot page for download no works

#

how i cam do for download spigot

#

can*

hallow surge
#

I was wondering in version 1.8.8 if the donkey is under the EntityType.HORSE because EntityType.DONKEY doesnt exist

old elk
#

I've spent a while on this and I cant seem to figure it out. I'm using luckperms and yesterday the ranks were working fine and everything was normal but I found out that every rank had every perm so i removed '*' from every rank besides owner but now for some reason only the owner rank shows a prefix even when a person only has moderator or another rank and doesn't have the default rank it will still show the default [member] prefix

sturdy oar
#

@marsh nova sorry for ping, anyway I just refactored my project and I think it's now much more clean

#

I avoided about 200 lines of duplicated code

#

Ty

#

for making me notice

marsh nova
#

No problem

sturdy oar
#

I still have some static methods

marsh nova
#

Keep this in mind: Never write the same code twice

sturdy oar
#

but they're to avoid duplicate code

#

some times static is good

marsh nova
#

yes, that's fine

#

for utility methods

sturdy oar
#

it's super generic

marsh nova
#

methods which don't and never will rely on the context in which they are called

#

precisely, you have given all of the state as parameters to that static method

ripe spear
#

Do u gus know a way to get a minimap in the top withoyt using a mod

sturdy oar
#

minimap?

ripe spear
#

Yes

sturdy oar
#

I don't think you can replicate that with vanilla features

marsh nova
#

In the top? What do you mean in the top?

ripe spear
#

Left corner or if u press m

sturdy oar
#

that

silk bane
#

no not possible, you need a mod

sturdy oar
#

^

ripe spear
#

Aghh

sturdy oar
#

many wanted that feature

#

You could try and suggest it to Mojang

hallow surge
#

if you really want it tell players to get a mod xD

sturdy oar
#

but I highly doubt they'll add it

ripe spear
#

Its lot of trouble

#

If udont have forge

#

U nedd to insatll it

hallow surge
#

mods are easy

#

takes like 10 seconds

ripe spear
#

The priblem is i cant insatll anything other than normall mc

sturdy oar
#

Sponge API is real good

#

why can't you

ripe spear
#

It says crashed every time

sturdy oar
#

Forge has been working without any issue for me on 1.15.2

hallow surge
#

yea same here

#

you must be doing it wrong

ripe spear
#

I dont get that on forge 1.12.2 or normal

#

Its just latest forge

hallow surge
#

delete your current 1.15.2 forge profile

#

and try a reinstall

ripe spear
#

Tried

#

5 times

#

Still the same prob

hallow surge
#

dont use the latest use reccomended always works flawlessly

timber barn
#

I've spent a while on this and I cant seem to figure it out. I'm using luckperms and yesterday the ranks were working fine and everything was normal but I found out that every rank had every perm so i removed '*' from every rank besides owner but now for some reason only the owner rank shows a prefix even when a person only has moderator or another rank and doesn't have the default rank it will still show the default [member] prefix
@old elk
still need help?

old elk
#

yeah

ripe spear
#

Ok il try

#

I think ill use magma as my server software

timber barn
#

you can work there at ur phone too

hallow surge
#

I was wondering in version 1.8.8 if the donkey is under the EntityType.HORSE because EntityType.DONKEY doesnt exist
anyone know the answer to this

timber barn
#

Really helpful and sometimes refreshes ur knowledge

sturdy oar
#

the hell no

#

I've finished that 1 year ago

#

it's for beginners ๐Ÿ˜‚ , I already bought more advanced courses from Udemy

timber barn
#

:'D

#

It also tells good stuff about static ;D

sturdy oar
stark salmon
#

is there a constant under EntityType that equals all entity types?

silk bane
#

no

stark salmon
#

shit

#

this is gonna be tedious

hallow surge
#

EntityType.values

#

i believe

silk bane
#

they're configuring

hallow surge
#

ah

stark salmon
#

wait that could work, because it could just cast the string to the enum

silk bane
#

no.

hallow surge
#

try it out

stark salmon
#

is that only a c# thing

silk bane
#

it won't work

stark salmon
#

oh

#

welp

#

oh wait values isn't a constant right

silk bane
#

it's a method

stark salmon
#

yeah

frigid ember
#

guys help please how to make the WILD go to overworld and not the world they currently in

#

wild is making them do wild in spawn and go outside border

#

same for warp pvp and nether end

drowsy canopy
#

Hey. Anyone can help me with maven?

river apex
#

hey can someone help me setup a default joining world

pastel sierra
#

How do you get the plugin directory folder?

#

Found it nvm

chrome edge
#

Does crafblock has default particle name or id in its class?

hallow surge
#

@frigid ember just get world world i think its that easy prolly wrong but whatever prey sure thats it

#

you basically send them to world world and not the worrld they are currently in

frigid ember
#

yes bt the spawn is in world spawn

#

when they do wild

#

they wild in world spawn and die outside border

hallow surge
#

just get the other world

#

and send players to that

frigid ember
#

so i do setwarp wild in overworld in a 5x5 box

#

and they dowild

#

here ?

#

well idk what to do im stuck here for 2 or 3 days

pastel sierra
#
public void onEnable()
    {
        File log = new File(this.getDataFolder() + "log.txt");
        
        if (!log.exists())
        {    
            try {
                log.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        
        new ChestOpenListener(this);
        new ChestCloseListener(this);
    }

I'm making a log text on enable doesn't seem to work

hallow surge
#

@frigid ember this is your own /wild plugin? correct

pastel sierra
#

Will this code work if I haven't created data folder with config.yml

frigid ember
#

no its not my own

#

i own a server

#

but im asking about the plugin im using

hallow surge
#

what plugin u using

#

are u using multiverse?

frigid ember
#

i tried wild TP and wilderness TP and random teleport

#

all did same

pastel sierra
#
public void onEnable()
    {
        File log = new File(this.getDataFolder() + "log.txt");
        
        if (!log.exists())
        {    
            try {
                log.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        
        new ChestOpenListener(this);
        new ChestCloseListener(this);
    }

I'm making a log text on enable doesn't seem to work

Anyone got any idea?

hallow surge
#

are you getting any errors?

pastel sierra
#

Well, no

#

I haven't created the data folder by config.yml though

#

could that be the issue or will it create the data folder for me?

#

By createNewFile()

hallow surge
#

well where would it print the information if there is no where to print it

pastel sierra
#

oops

#

i see

#

lemme

stark salmon
#

how do you format it like code because i need help w

#

i got the source

hallow surge
#

formatting code isnt hard

stark salmon
#

isnt it like
`test

#

no

#

its not

#

test

#

thats it

hallow surge
#

three 1

#

three of `

frigid ember
#

ik this is a very dumb question : is doing a simple plugin time consuming and hard ?

hallow surge
#

and type java

#

@frigid ember you have any java background

frigid ember
#

just the basics

stark salmon
#
 for (final String e : dropSection.getKeys(false)) {
            if (e.equals("default")) {
                continue;
            } 
            EntityType eType;
            try {
                eType = EntityType.valueOf(e);
            }
            catch (IllegalArgumentException ex) {
                this.log.warning("No entity named " + e);
                continue;
            }
            final ConfigurationSection entitySection = dropSection.getConfigurationSection(e);
            final EntityReward reward = parseReward(defaultAmount, defaultChance, worldsNonexistent, defaultWorlds, entitySection);
            this.entityRewards.put(eType, reward);
        }

How would I go about making every type just use "default"

#

how can I set "e" (even though it's a temp variable)

#

i'm so not fit for this lol

hallow surge
#

gotta start somewhere

#

@stark salmon make a post on the forums

stark salmon
#

ok

#

can I just set eType to EntityType.value()?

#

so every entity is equal to default

hallow surge
#

I dont know any code xD

#

im very basic no idea xD

stark salmon
#

oh lol

#
for(EntityType etp : EntityType.values()) {
    this.entityRewards.put(etp, reward);
}

I got it

faint hinge
#

i know the redis server is up and working fine

idle zodiac
#

how

#

my brain

frigid ember
#

because you're stripping "SHOP MENU" which doesnt have color

#

you should strip the clicked inventory's title of color

idle zodiac
#

o ok

#

if (ChatColor.stripColor(clickedInventory.getTitle()).equalsIgnoreCase("Shop Menu")) {?

frigid ember
#

yes

#

i think

idle zodiac
#

didnt work

frigid ember
#

although you could of just entered the exact inventory title you set it as

idle zodiac
#

i can still change items

#

can i compare inventories?

#

so like

#

if clicked inventory is the main menu?

bronze marten
#

Is there an event which is called when a stackable item breaks (when the block under it is removed?)

#

E.g. a flower on top of a dirt block, player breaks dirt block, do I need to manually get the block above it or is there a nice event for it?

frigid ember
#

or something and secondly is it registered

idle zodiac
#

o ye

paper compass
#

Is there a way to keep chunks permenantly loaded?
If so do I do:

@EventHandler
public void onUnload(ChunkUnloadEvent e) {
    e.setCancelled(true);
}```
bronze marten
#

Chunk#setForceLoaded

harsh anvil
#

seems like a good way to kill your server lol

paper compass
#

We have a minions plugin and it breaks whenever a player leaves the radius of the chunk

bronze marten
#

please dont cancel chunk unload lol

idle zodiac
#

if (clickedInventory.getTitle().equalsIgnoreCase(ChatColor.BOLD + "" + ChatColor.GOLD + "Shop Menu")) didnt work

#

wat is this

bronze marten
#

but rather check where minions are located / pause if chunk unload happen

paper compass
#

what does setForceLoaded do

harsh anvil
#

you shouldnt be using inventory titles to check for inventories

idle zodiac
#

what should i use?

paper compass
#

How do I "pause if chunk unload"

marsh nova
#

instances

idle zodiac
#

?

worldly heathBOT
#

Edit this to change the output of the command!

marsh nova
#

yes

idle zodiac
#

wat

marsh nova
#

instances

idle zodiac
#

so like

#

if i initialise a menu in my shop command

marsh nova
#

clickedInventory.equals(theInventoryYouOpened)

idle zodiac
#

AHHH

#

OK

paper compass
#

Is there a way to keep chunks permenantly loaded? [1.8.8]

marsh nova
#

yes

#

#setForceLoaded

paper compass
#

So I just use setForceLoaded

#

and it keeps it loaded

marsh nova
#

yep

paper compass
#

e.getChunk().setForceLoaded?

marsh nova
#

no need to use an event

#

set it once and be done with it

paper compass
#

setForceLoaded doesn't exist

#

I did say 1.8.8

marsh nova
#

yea I code against 1.8.8 also

#

let me see

harsh anvil
#

i'd bully you but same

idle zodiac
#

if (clickedInventory.equals(new ShopCommand().level0MainMenu))

#

that doesnt work

paper compass
#

I love how people are like "We hate 1.8.8 but we still code with it"

idle zodiac
#

the e.setcancelled doesnt run

paper compass
#

Yeah setForceLoaded is only 1.15

marsh nova
#

yeah, it does not exist

harsh anvil
marsh nova
#

I do not hate 1.8.8

harsh anvil
#

i do

#

i hate developing for it lmao

marsh nova
#

I actually use 1.8.8 myself

paper compass
#

So do I just use e.setCancelled() whenever it unloads?

marsh nova
#

which is one reason I build against it

idle zodiac
#

i'm using 1.8.8

#

my brain

marsh nova
#

that's what you will have to do

paper compass
#

Okay

idle zodiac
#

ah

harsh anvil
#

make sure to do the required checks tho

idle zodiac
#

i see why it doesnt work now

harsh anvil
#

or you'll run out of memory in a heartbeat

idle zodiac
#

the event isnt registered

#

MY BRAIN XDDD

paper compass
#

What would happen if I never unloaded chunks that a player generates, this is for a prison server btw

#

oh ok

harsh anvil
#

then you run out of memory and ur server dies

idle zodiac
#

my brain hurts

marsh nova
#

you're going to have to comprehend a lot more complicated concepts if you want to be a good developer

paper compass
#
        Chunk c = e.getChunk();
        Set<Entity> en = new HashSet<Entity>(Arrays.asList(c.getEntities()));
        for (Player p : Bukkit.getOnlinePlayers()) {
            for (Zombie z : Minions.zombies.get(p.getUniqueId())) {
                if(en.contains(z)) {
                    e.setCancelled(true);
                }
            }
        }
    }```
marsh nova
#

oh man

#

that's some performant code right there

paper compass
#

huh

bronze marten
#

oof

paper compass
#

I can't tell if you're being sarcastic

harsh anvil
#

i hope people cant have as many minions as they want, otherwise they can just use them as chunkloaders lol

tiny dagger
#

well

#

you're doing 3*n

paper compass
#

Yes, yes they can

#

But they do cost money

harsh anvil
#

and that they despawn when the player logs out

paper compass
#

so....

#

Yes they despawn ofc

#

We only made them work when you're online

idle zodiac
#

YES

#

ok i made it work

harsh anvil
#

i'd heavily advise against canceling chunk unloads, but if thats the only way ig u'll have to

paper compass
#

Is that code actually good or?

tiny dagger
#

no

paper compass
#

because I couldn't tell if he was being sarcastic

#

ok

tiny dagger
#

it's expensive

idle zodiac
#

none of my code is good

#

it works kind

tiny dagger
#

3*n

idle zodiac
#

but it;s clunky and horrible

#

but i mean it works

#

so i wont change itf ro the time being XD

timber barn
#

I start code for functionallity too :D

tiny dagger
#

if you want to use hashset speed

timber barn
#

after its working i start making it good

tiny dagger
#

why don't you just add all entities manually if getEntities isn't compatible

harsh anvil
#

could just make it good from the first time

timber barn
#

With some kind of preperation yes

paper compass
#

HashSet<Zombie>

#

that?

harsh anvil
#

you should also return after you cancel the event

paper compass
#

break;

#

return or break

harsh anvil
#

yeah break sorry

paper compass
#

mhm

#

lmfao

tiny dagger
#

return would be faster tho

harsh anvil
#

lmao

tiny dagger
#

cuz it can cancell nested loops

harsh anvil
#

yes, but then it would only work for one player

marsh nova
#

what

#

"return after you cancel the event"

#

oh

tiny dagger
#

tht's an event

marsh nova
#

I see, break the loop

tiny dagger
#

if you cancell once

marsh nova
#

yes of course, in that specific code

tiny dagger
#

that chunk unload for the others

paper compass
#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        Set<Entity> en = new HashSet<Entity>(Arrays.asList(c.getEntities()));
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            for (Zombie z2 : z) {
                if (en.contains(z2)) {
                    e.setCancelled(true);
                    break;
                }
            }
        }
    }```
marsh nova
#

I thought you were saying that adding a return statement at the end of a method made it faster lol

paper compass
#

hmmm

marsh nova
#

you'll have to do more than just break once

#

since you have multiple loops

#

return is fine

#

you can also name the outer loop

#

and then do break <name of loop>;

#

that's a rarely-used feature of java but i don't think you need it

paper compass
#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        Set<Entity> en = new HashSet<Entity>(Arrays.asList(c.getEntities()));
        boolean doBreak = false;
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            if(doBreak == true) {
                break;
            }
            
            for (Zombie z2 : z) {
                if (en.contains(z2)) {
                    e.setCancelled(true);
                    doBreak = true;
                    
                    break;
                }
            }
        }
    }```
#

oh

#

I accedentally

#

I can just do if(doBreak)

tiny dagger
#

that like what a return would do

marsh nova
#

lol

paper compass
#

Return breaks all loops?

harsh anvil
#

yes

tiny dagger
#

yes

marsh nova
#

yes

paper compass
#

oh ty

tiny dagger
#

it ends the method right there

harsh anvil
#

so you did want a return

paper compass
#

jesus fuck the spam

#

lmfao

#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        Set<Entity> en = new HashSet<Entity>(Arrays.asList(c.getEntities()));
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            
            for (Zombie z2 : z) {
                if (en.contains(z2)) {
                    e.setCancelled(true);
                    return;
                }
            }
        }
    }```
#

Is that good code?

#

hmmmm

tiny dagger
#

why Arrays aslist?

#

what type is getEntities i forgot

paper compass
#

getEntities is an array

#

Entity[]

tiny dagger
#

then add them in a loop yourself

marsh nova
#

you can just iterate over the array but ok

tiny dagger
#

directly in hashset

marsh nova
#

there are many ways to write the same piece of code

tiny dagger
#

wait

#

the more i look

#

why is it even hashset

#

if you don't take advantage of it?

harsh anvil
#

entities are already unique i think

tiny dagger
#

oh nvm

paper compass
#

I use HashSet

#

mhm

#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        Set<Entity> en = new HashSet<Entity>(Arrays.asList(c.getEntities()));
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            for (Zombie z2 : z) {
                if (en.contains(z2)) {
                    e.setCancelled(true);
                    return;
                }
            }
        }
    }```
#

So would that be efficient

#

at all

harsh anvil
#

probably the best you can make it tbh, you could also just track the minions directly and then you'd only need to check the entity without getting all players etc

#

like if player joins, check if he has minions, if so add them to a list or whatever

paper compass
#

Well I didn't get all players in that one : P

#

Thats what I do

#

And when the player leaves, remove the minion from all lists

harsh anvil
#

cant you just get the chunk from the entity?

#

instead of getting all entities in the chunk instead

paper compass
#

Lemme change the code

harsh anvil
#

not sure if thats the best way tho

paper compass
#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            for (Zombie z2 : z) {
                if(e.getChunk().equals(z2.getLocation().getChunk())) {
                    e.setCancelled(true);
                    return;
                }
            }
        }
    }```
#

wait

#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        for (HashSet<Zombie> z : Minions.zombies.values()) {
            for (Zombie z2 : z) {
                if(c.equals(z2.getLocation().getChunk())) {
                    e.setCancelled(true);
                    return;
                }
            }
        }
    }```
pastel basin
#

converting an array to arraylist and then to hashset is inefficient, just using the arraylist would be better

paper compass
#

I didn;t

#

@harsh anvil Is that code btter then

harsh anvil
#

i think so yeah

paper compass
#

Okay I'll try it

silk bane
#

how about this:```
for (Entity entity : e.getChunk().getEntities()) {
for (Set<Zombie> zombies : Minions.zombies.values()) {
if (zombies.contains(entity)) {
event.setCancelled(true);
break;
}
}
}

paper compass
#

Ooooo

#

Thats fun

tiny dagger
#

return konsolas

harsh anvil
#

i think you want to swap those for loops

#

or am i being dum lol

paper compass
#

you being dum

harsh anvil
#

oof

tiny dagger
#

i guess there would be less minions

#

tho all this

paper compass
#

Minions cost irl

tiny dagger
#

seems like extra

paper compass
#

So people wont have as many

#

So would that code above be more efficient would everyone say (that konsolas send)

tiny dagger
#

i dunno tbh

#

this is the best

#

for your current code

paper compass
#

Is everyone seriously having code competitions, the most efficient code wins

tiny dagger
#

wait

#

i think i have a better one

paper compass
#

No way

#

lmfao

tiny dagger
#

for (Set<Zombie> zombie : Minions.zombies.values()) {
if (zombie.getchunk == chunk) {
event.setCancelled(true);
return;
}
}

naive goblet
#

jeez stream it instead

silk bane
#

i meant return

harsh anvil
#

yeah thats a lot more efficient if you ask me

paper compass
#

I cant use that

#

lmao

harsh anvil
#

why not?

paper compass
#

Set<Zombie> doesn't have location

#

Lmao

harsh anvil
#

is zombie not an entity?

#

whut

tiny dagger
#

wait wut

paper compass
#

Look at his code

silk bane
#

you still need the second loop

#

rip

paper compass
#

^^^^^^^^^

naive goblet
#

Set<? extends Entity>

#

?

worldly heathBOT
#

Edit this to change the output of the command!

tiny dagger
#

i think you need to change the code to reflect my idea

#

expose it better

paper compass
#
    public void onUnLoad(ChunkUnloadEvent e) {
        Chunk c = e.getChunk();
        for (Set<Zombie> zombie : Minions.zombies.values()) {
            for (Zombie z : zombie) {
                if (z.getLocation().getChunk() == c) {
                    e.setCancelled(true);
                    return;
                }
            }
        }
    }```
#

Correct?

harsh anvil
#

idk, i'm not a compiler

paper compass
#

or:

            for (Set<Zombie> zombies : Minions.zombies.values()) {
                if (zombies.contains(entity)) {
                    event.setCancelled(true);
                    break;
                }
            }
        }```
#

Which one would be more efficient

#

"A" i think

silk bane
#

depends on the size of the zombies set

#

the second one avoids iterating it

paper compass
#

wait

tiny dagger
#

he iterates over all the chunk entities tho

silk bane
#

yeah

#

which one is larger

harsh anvil
#

well its one or the other

#

normally a chunk wouldn't contain more than a few entities

paper compass
#

Defo B then

harsh anvil
#

you'll have to test and see tbh

silk bane
#

just pick one because this doesn't matter

harsh anvil
#

in most cases not no

tiny dagger
#

yeah he is gonna rewrite this project a few times lol

paper compass
#

?

worldly heathBOT
#

Edit this to change the output of the command!

paper compass
#

They still stop working

keen compass
#

why don't you just extend chunk and have a custom chunk that only holds your entities only

#

this way, when you have the chunkunload event, all you need to do is just compare the chunk in the event with yours

#

if the chunk in the event matches your, get all the entities you have in your chunk

#

no need to iterate lists in that manner to see if your entities are in said chunk
@paper compass

pastel basin
#

did you try debugging to see if the event is being called and the zombies are being found correctly?

frigid ember
hoary parcel
#

backspace

#

del will work too

idle zodiac
#

@frigid ember nice ide you got there XDDDDDDDDDDDDDDDDDDDDDDDDDDD

frigid ember
#

that isnt, its something in eclipse i somehow turned on

idle zodiac
#

ECLIPSE

#

YOU USE ECLIPSE?

frigid ember
#

of course

idle zodiac
#

We hereby sentence you to bucket kick.

hoary parcel
#

@frigid ember control + .

idle zodiac
#

Win + X

#

Alt + F4

frigid ember
#

whitespace characters

idle zodiac
#

XD

hoary parcel
idle zodiac
#

ah

#

that might help

hoary parcel
#

took me 5 seconds to google btw

idle zodiac
#

gg

frigid ember
#

what am i meant to write: how do iget rid of these weird characters that appeared out of nowhere

#

:/

idle zodiac
#

that

#

you write that

#

but mirgnit oij jio found a fix

#

so i mean

#

*mini digger

#

fuck

#

*minidigger

#

my typing tho

#

mirgnit oij jio

frigid ember
#

and then one last thing

    if (!pd.swings.isEmpty()) {
                pd.swings.forEach(l ->{
                    if (TimeUtils.passed(l + 1000, System.currentTimeMillis())) {
                        pd.swings.remove(l);
                    }
                });
            }```
when I do it in a loop it throws concurrent modification on the forEach line
hoary parcel
#

you cant remove while iterating

idle zodiac
#

and then one last thing
nice java you got there

#

XDDD

#

ok i sotp now

hoary parcel
#

use removeIf

marsh nova
#

this is one of the most common beginner mistakes: modifying a collection while iterating over it

#

you can use removeIf or an iterator to avoid the issue

naive goblet
#

Show us an example so the beginners understand ;o

#

Well I am the most latest beginner so yeah ๐Ÿ˜‰

marsh nova
#

latest beginner*

#
collection.removeIf((element) -> element.isSomethingYouDontWant());
#

that's removeIf

naive goblet
#

yes it was meant to be an error but yeah

sick citrus
#

And definitely no need to check if its empty since for each will just do nothing if the collection is empty.

naive goblet
#

You'd have to stream it first?

marsh nova
#

no

#

no need to stream

#

removeIf is present in collection

#

Collection#removeIf

sick citrus
#

Its on collection not on stream

marsh nova
#

you're thinking of Stream#filter, which is similar but for streams

naive goblet
#

spigot you dsrve this

#

Well I acc thought it existed in streams

#

but me very wrong

sick citrus
#

Well if you removeif on stream, it would remove from the steam, not from the collection...

#

Stream*

#

Thats if it existed on stream.

naive goblet
#

well you could use collect

marsh nova
#

yes, that's a good distinction, modifying a stream created from a collection would not change the underlying collection

sick citrus
#

And make a new object?

marsh nova
#

so you would have to re-assign the collection if that was your approach

sick citrus
#

Then might as well just use an iterator...

naive goblet
#

I mean it depends what you're trying to achieve

marsh nova
#

no you can use removeIf just fine

#

using streams is worse for readability and performance

naive goblet
#

readability ywah

#

and some methods can be bad for performance ig

sick citrus
#

I don't think the performance hit of using a stream is really the same as cloning a massive collection

naive goblet
#

but I mean if you use new lines for it I'd say readability is just fine

sick citrus
#

but sure

keen compass
#

I am not a fan of lambdas

sick citrus
#

lambdas are the future of java

naive goblet
#

true

keen compass
#

doubt it

sick citrus
#

No point in arguing, we'll see soon enough ๐Ÿ˜›

naive goblet
#

yeah who are we to blame

keen compass
#

to have lambdas you need the normal methods

sick citrus
#

lisp.

keen compass
#

so, can't have one without the other

sick citrus
#

False-ish

#

no need for methods with lambdas.

#

Static class functions work just as well

naive goblet
#

I mean pretty sure kotlin will takeover java once they get all the functions java has

sick citrus
#

kotlin sucks

naive goblet
#

cuz rn iirc no inner classes etc

sick citrus
#

all those java-derived sublanguages are a fad and will go extinct soon enough.

#

They don't bring anything new

naive goblet
#

not so sure

sick citrus
#

that is massive enough to warrant their existence.

keen compass
#

I dislike kotlin, but to have lambdas you need the underlying structure. And I doubt java is going to remove everything about it to just be nothing but lambdas.

naive goblet
#

^

#

Thing is since kotlin can run in jvm I personally think it won't die but idk

keen compass
#

Kotlin has to run on a kotlin jvm, not java jvm

sick citrus
#

^

keen compass
#

but java can run on kotlin jvm

sick citrus
#

...since kotlin is an extension of java it makes total sense.

naive goblet
#

oh yh but I mean it runs as java in the end

tiny dagger
#

kotlin jvm is not a thing

sick citrus
#

Tell me honestly about one thing that kotlin provides that java doesn't.

keen compass
#

has to be to have kotlin because Java JVM doesn't know kotlin

sick citrus
#

Or scala, or any of those sublanguages

tiny dagger
#

kotlin translates to java byte code

naive goblet
#

^

tiny dagger
#

it's just another way to write java code

sick citrus
#

java bytecode

#

But it's not java.

naive goblet
#

That's what I thought. I saw a plugin sc having 1 kt rest java

tiny dagger
#

it is

naive goblet
#

Depends what you define as java now

sick citrus
#

Look, you can compile javascript into C bytecode

#

does'nt mean javascript is C.

tiny dagger
#

in this case is

#

i can open your compiled project

#

with a java decompiler

#

it looks computer made

keen compass
#

man kotlin's website is just garbage

sick citrus
#

And I can open a javascript code compiled into C bytecode

keen compass
#

could they make it any worse o.O

tiny dagger
#

but it's java nonetheless

sick citrus
#

and it will render proper C code

marsh nova
#

you can run kotlin Bukkit plugins without a "kotlin jvm"

sick citrus
#

but it's NOT javascript

marsh nova
#

what even is a "kotlin jvm"

#

PerWorldInventory for example is written in kotlin

naive goblet
#

Weby wordwise kotlin will never be java

sick citrus
#

The only important thing is :

Tell me honestly about one thing that kotlin provides that java doesn't.
@sick citrus

naive goblet
#

Well at the end it's made for developers

#

But you don't need ; f.i

keen compass
#

Well despite your question @sick citrus many languages continue to get created regardless

#

because somewhere someone wanted it done differently

sick citrus
#

Created and forgotten.

#

That's my point. Kotlin will never replace java, and will not hold the test of time.

keen compass
#

Depends on whether or not the developers keep developing it

sick citrus
#

They will if Kotlin offers something no one else provides. Otherwise...

naive goblet
#

Well as kotlin kind of is java it will never replace it.

#

But it might get the majority of the java developer audience later. Idk who knows?

keen compass
#

Never know, but it isn't going to magically go away either

naive goblet
#

Yeah

keen compass
#

only way it goes away is because it is stopped being developed

naive goblet
#

I believe it will stay as there is some big companies using it right?

keen compass
#

yes

#

think Jetbrains uses it

naive goblet
#

Some android stuff is built up by that iirc.

keen compass
#

JetBrains are the ones that make IntelliJ

naive goblet
#

Yeah right

#

It seems to be popular for android developers when doing a quick internet search.

keen compass
#

But as far as lambdas go, it is cool java finally supports them, just call me old school as I don't use them ๐Ÿ˜›

stark salmon
#

My modifications to the plugin worked yayaya

naive goblet
#

1.8

#

its quite sometime since it got added ๐Ÿ˜ฎ

keen compass
#

yes, but you know how long it took to add it to begin with XD

naive goblet
#

yeah thats true

#

When did Generics get added btw?

river apex
#

is there a plugin that forces players to join a certain world when they join the server

frigid ember
#

Why I have a different uuid on RankUP and on Lobby

#

?

worldly heathBOT
#

Edit this to change the output of the command!

naive goblet
#

Idk if you can use the event that fires before the player joins

keen compass
#

@frigid ember do you use bungee? and if you do did you directly connect to the server?

#

I am a fan of new things being added to Java, and I am quite accustomed to Java's conventions as far as working with Java goes. I would hate to be forced to use lambda's though lol

#

mainly because you can't always tell what is going on with lambda's

naive goblet
#

I feel like lambdas sometimes is very useful but yeah it's preferences ig.

keen compass
#

Yes I would agree they are useful especially if you are seeking for shorter code where it doesn't matter

#

to me, I don't mind if my method is 10 lines and can be condensed to 1 line, because overall, it doesn't mean it will run faster because it fits on 1 line vs 10

naive goblet
#

Yeah correct

#

That's a good point

#

I just like short classes though

red zenith
#

Anyone know the proper way to register custom Recipes with the Server, so that a player can โ€œdiscoverโ€ them on Join? (Using the Api). Iโ€™ve only been able to get this to work by requiring a player to connect, disconnect and reconnect after the server starts

naive goblet
#

I prefer having more classes than longer ones.

#

Just add the recipe to the server recipes?

#

Or am I wrong?

red zenith
#

Using the Api?

naive goblet
#

Yeah

#

You should be able to get the recipe iterator with the server instance

red zenith
#

This is for a plugin that allows for the creation of new recipes, through config or commands

keen compass
#

?jd

worldly heathBOT
naive goblet
#

Yeah frost I c

red zenith
#

Thanks, Iโ€™m familiar with the docs and the api

naive goblet
#

Good because not everyone is unfortunaly

keen compass
#

I was using that link for myself

#

lol

red zenith
#

I know the recommended approach for defining Recipes and registering them. The problem seems to be related to the timing

keen compass
#

anyways that should be the relevant api

naive goblet
#

intressting it has to be stored in a knowledgebookmeta

#

thought it was a player property

keen compass
#

the more you know

#

๐Ÿ˜‰

naive goblet
#

I mean rn working with an abstraction hell

#

so kind of paused my research in the api

keen compass
#

at least it isn't Dependency Hell

naive goblet
#

lmao true

#

I used to be one those who managed dependencies manually as well.

keen compass
#

maven is weird sometimes in that regards

naive goblet
#

That was a chaos.

#

I prefer Gradle overall.

keen compass
#

sometimes when I want to shade something, it will out of the blue try to shade spigot in

#

and then I have to tell it not to do that

#

other projects it isn't an issue

naive goblet
#

It's just so much simplier in my opinuion.

#

Hmm yeah shading in gradle is also very smooth

#

maybe that's a version issue

keen compass
#

I think it is an issue with those that use depedencyreduced pom

#

when they shade their projects and push to a repo

#

if you use a dependency reduced pom and deploy to a repo, that pom will replace your default pom in the repo

naive goblet
#

Hmm yeah ig. Acc I've never really used maven.

#

Oh that seems to be a thief

red zenith
#

When the player joins

#

I register the recipe before that

keen compass
#

if it is only an issue on join

#

wait a tick or two

red zenith
#

Its only an issue on first join after server restart

keen compass
#

so try waiting a tick or two after the event has fired to do that then

marsh nova
#

if you want to be sure not to shade spigot, just ensure it is provided scope

frigid ember
#

@keen compass when I connect to Bungeecord, I am redirected to the login, and then when I log in, I am redirected to the lobby.

marsh nova
#

or, better: specify the artifacts you want to shade explicitly

#

this is what I do for all my projects which have shading, and it ensures I never shade anything I don't want to

red zenith
#

If Im using nms at all, I have to shade spigot or paper, I cannot just build against the api

naive goblet
#

BukkitTask :p

keen compass
#

@marsh nova the problem was transitive dependencies. But it is weird because there is no way to know what transitive dependencies have

#

So, like I said its not always a problem

red zenith
#

Well, in this pluginโ€™s case thatโ€™s irrelevant

keen compass
#

but every now and then it is and then I have to tell the shading plugin to not shade in certain things XD

marsh nova
#

you can use the effective pom

red zenith
#

Exclusions are fun

marsh nova
#

or I think

#

it's called dependency hierarchy

#

either way, you can view your transitive dependencies

naive goblet
#

Migrate to Gradle ;]

keen compass
#

Yes you can view them, but that doesn't mean you know what they have shaded either. If they shade a dependency themselves, and then you have a dependency that depends on it, and then you shade that dependency you can end up with spigot or its related things it has shaded, into your shaded jar

#

quite fun when you are trying to track down where some of things getting shaded in are coming from

red zenith
#

You can filter or use an artifactSet exclude

keen compass
#

Yeah I had to use exclusions in one of my projects

red zenith
#

You can check the dependency tree with maven

keen compass
#

its how I got to learn about transitive dependencies more ๐Ÿ˜›

#

I don't just learn how to resolve something, but try to understand why it even happens in the first place

naive goblet
#

That seems like a good method

red zenith
#

Otherwise itโ€™s just whackamole every time youโ€™re trying to figure it out again

naive goblet
#

haha

#

yeah indeed

keen compass
#

So, if a transitive dependency has shaded artifacts you won't know about them in the dependency tree. Especially if they make use of dependency reduced pom

#

dependency reduced pom, removes dependencies in the pom if they get shaded in

naive goblet
#

Well I mean how do you even go about modulation in maven?

keen compass
#

good news is, that the shaded plugin works on package names and not the dependencies themselves only

marsh nova
#

Ideally your dependencies haven't shaded spigot into themselves.

red zenith
#

The fun one for me is a mulitmodule project for different mc versions that wonโ€™t all support the same version of another lib I want to use

marsh nova
#

Otherwise the libraries you are relying on may not be designed the best.

#

You go about modularisation in maven simply, by doing it.

keen compass
#

@marsh nova well this was in the past, I don't have issues with it no more. Just the odd occurrence here and there of certain things being shaded in that I didn't realize were being shaded in and don't have a direct dependency on the things being shaded in either.

marsh nova
#

You use a parent pom and multiple sub-modules.

naive goblet
#

So pretty much the same as in gradle?

marsh nova
#

don't ping please, it makes messages harder for me to read

red zenith
#

I wanted to use Guice 4.2 with all my modules, but an older version of spigot wouldnโ€™t play nice with it.

marsh nova
#

To be honest I do not know enough about gradle

#

I should be less quick to cast my opinion in Maven's favour

#

Although, the reasons why I do so are clear

keen compass
#

I prefer maven over gradle

#

Maven in most cases will perform the same as Gradle

#

in fact, many people don't know that maven can build in parallel ๐Ÿ˜‰

#

you can even give it more resources as well

runic wadi
#

i took the time to get a vague understanding of gradle and it was worth it. it looks like shit from a distance, but it's actually fairly structured

obtuse rose
#

Gradle can do more advanced stuff though

red zenith
#

Itโ€™d take me quite a while to get as comfortable with gradle as I am with maven, and Iโ€™ve only scratched the surface of using Maven

naive goblet
#

Tbh yeah it's so much less work

marsh nova
#

I really don't need or want parallel builds. My machine only has 2 cores so it wouldn't help much anyway.

obtuse rose
#

Gradle config is much cleaner too

keen compass
#

@obtuse rose I don't doubt that Gradle can do some advanced things, I mean technically maven can too. I think a better thing to say would be that Gradle allows more advanced things more easily.

#

I can do complex builds with just using maven only, just comes down to what you know and how to use what you do know

stable escarp
#

Hello was wondering if anyone is able to help me on my server, suddenly yesterday or 2 days ago, non-opped players freeze for like half a second once in a while, and it's really annoying. I tried deleting some plugins that might be causing it, but I can't pinpoint it, if anyone would like to help me please @ or msg me thx :d

runic wadi
#

i mean if you ever want to use forge, fabric, or sponge, you're gonna have to use gradle

marsh nova
#

have to?

#

sponge allows you to use maven

obtuse rose
#

You can make fat jar with only some script in gradle, you need shade on maven.

naive goblet
#

Chick

obtuse rose
#

Not saying it's practical

runic wadi
#

you're subject to whatever mapping plugin the platform offers

keen compass
#

don't actually need shade to make an uber jar.

naive goblet
#

It's hard to know exactly how he did it

keen compass
#

you could always use the Jar plugin

obtuse rose
#

True

naive goblet
#

But it can be by packets or just having hacked items

obtuse rose
#

But my point is you can do some scripting in gradle

#

If you need one

runic wadi
#

oh well the sponge API doesn't require any mapping I suppose but then you can't use "NMS" stuff

#

so maven is available

keen compass
#

but just note one of the things maven can do, that most don't realize is that you can have maven run arbitrary commands and you can even make maven plugins as well if nothing fits for you.

obtuse rose
#

Or you could just switch to Gradle

keen compass
#

I have no real need for switching as I am just fine with using Maven. I agree Gradle does making doing some things easier for some.

timber barn
#

do you use maven @keen compass ?

keen compass
#

Yes I do

obtuse rose
#

Then use maven then!

timber barn
#

nvm answered

#

:D

obtuse rose
#

Maven is not bad

naive goblet
#

Just get with something you can work good with and it should be fine ๐Ÿ™‚

keen compass
#

^

timber barn
#

I don't use any dependencie management... should I?

naive goblet
#

YES

keen compass
#

using maven or gradle makes it easier to manage dependencies

obtuse rose
#

Imo Maven would be much better if they use something else other than XML though

keen compass
#

create a maven plugin that allows that

timber barn
#

whats wrong with that

keen compass
#

I am pretty sure a maven plugin already exists that does that actually

obtuse rose
#

@timber barn there's lots of markup clog up my screen real estate

keen compass
#

lol

#

yeah, I am not a big fan of xml either

timber barn
#

Loool

keen compass
#

but at least they didn't go with a weird xml setup though

obtuse rose
#

True

timber barn
#

my precious xml ๐Ÿ”ฅ

obtuse rose
#

Xd

keen compass
#

I was turned off from xml by some projects that used it in odd ways that made it hard to do things with

timber barn
#

what about json?

marsh nova
#

I like xml actually, its verbosity makes it easy to read

#

it's nice and smooth

keen compass
#

Json is nice for server payloads, not so much when it comes to config files though since it wasn't designed for human readability in mind

timber barn
#

json too is designed for being human readable actually

#

well thats what the authors said

naive goblet
#

lmao

#

yaml then

keen compass
#

well from what I have seen in how it is implemented reading it is quite difficult sometimes

timber barn
#

well ok, its quicker and dirtier than xml

keen compass
#

the only thing I dislike about Json, is the infinite arrays

timber barn
#

its shorter and dont use end tags

keen compass
#

as far as I am aware JSON doesn't put a limit on arrays inside arrays

naive goblet
#

oof

timber barn
#

and it supports arrays

#

!

keen compass
#

and there is no way to know how many arrays an object has either

timber barn
#

nested arrays till infinity

keen compass
#

just have to keep looping until there is no more

naive goblet
#

That's a hell acc

timber barn
#

I don't see the problem here

silk bane
#

xml supports arrays, they just look like shit

timber barn
#

๐Ÿ˜‚

runic wadi
#

ok this might be an unpopular opinion but I actually thing yaml is disgusting. i just had to say it

#

very important that everyone knows

silk bane
#

thanks mr trapped

runic wadi
#

yaml is really atrocious

naive goblet
#

Well it's readability is good

runic wadi
#

no it's awful and hideous

timber barn
#

indeed

marsh nova
#

yaml?

naive goblet
#

except the lines