#help-development

1 messages ยท Page 119 of 1

worldly ingot
#

It installs the JDK

quaint mantle
#

so just add this to jitpack.yml?

#
  - sdk install java 17.0.4.1-tem
  - sdk use java 17.0.4.1-tem```
worldly ingot
#

Yeah

quaint mantle
#

alr

#

let me try

worldly ingot
#

That should work, assuming Jitpack's documentation is accurate

#

They claim you can use SDKMAN commands

snow lava
#

it's possible to make the armor stand head bigger?

quaint mantle
#

taking longer to log

#

so that may be a good sign

#

finally!

#

thanks so mcuh

#

that took 2 days

#

bruh

worldly ingot
#

o/ Glad it worked

worldly ingot
snow lava
#

i'm trying to make a custom block with a custom texture. i have been working with nms and i could create a spawner with a block in his head

echo basalt
#

Hand is big enough

#

rotate it a lil

quaint mantle
#

okay so another problem

#

i have the dependency added but nothing appears?

#

i've reloaded intellij

#

and reloaded maven again

snow lava
# echo basalt Hand is big enough

Today I'll show you how to essentially add any new block you want to Minecraft without having to replace any pre-existing, vanilla blocks or textures!

โ–บSubscribe - http://bit.ly/Subscribe_Sarc
โ–บFollow Me On Twitter - http://bit.ly/SarcTweet

โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Other info:
โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Commands:

/blockdata ~ ~ ~ {RequiredPlayerRange:0s}

/blockdata ~ ~ ~ {Sp...

โ–ถ Play video
#

in this video he creates a new block from datapacks

#

but i can't find the tags to increase the scale of the head

quaint mantle
#

sorry for ping

#

but im curious

desert frigate
#

anyone?

#

i tried ```java
public static boolean isLocationInArea(Location location, Location location1, Location location2) {
BoundingBox box = new BoundingBox(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ());
return box.contains(location.getX(),location.getY(),location.getZ());
}

isLocationInArea(location, location,location);``` still false :(

quaint mantle
#

have you tried a location that isn't within the box

desert frigate
#

yup

#

nah this is broken java BoundingBox box = new BoundingBox(1,1,1,1,1,1); return box.contains(1,1,1); it returns false

fluid river
#

Use xyz lol

desert frigate
fluid river
#

Using like entire class with constructor to check if x y z is between two points is too much effort

desert frigate
#

what.

worldly ingot
#

I agree. Either use a BoundingBox to start with or forego the BoundingBox entirely

kind hatch
fluid river
fossil lily
desert frigate
#

i tried js public static boolean isLocationInArea(Location location, Location location1, Location location2) { if((location.getBlockX() > location1.getBlockX()) && (location.getBlockX() < location2.getBlockX())){ if((location.getBlockY() > location1.getBlockY()) && (location.getBlockY() < location2.getBlockY())){ if((location.getBlockZ() > location1.getBlockZ()) && (location.getBlockZ() < location2.getBlockZ())){ return true; } } } return false; } and it didnt work either

quaint mantle
fluid river
#

Umm

desert frigate
#

like idk whats wrong anymore

fluid river
#

ofc its not working

#

= <=

desert frigate
#

i tried that too dawg

fluid river
#

Should be everywhere

desert frigate
#

i did everything

#

till someone told me to use boundingbox instead

fluid river
#

Idk about it's .contains method, so can't really tell what's the problem

desert frigate
fluid river
#

But if your xyz doesnt work then your locations are wrong

fluid river
#

Not signature

desert frigate
fluid river
#

Then

desert frigate
#

no borders

fluid river
#

Boxes border

#

Not a world border

drowsy helm
#

just use BoundingBox.of

#

BoundBox.of(location1, location2)

echo basalt
#

account for min and max

#

and all

fluid river
#

Don't think it's gonna change anything for him but let's hope

ebon ether
#

someone give me a plugin to make

#

i need ideas

#

I j wanna make a plugin

#

i need shit for my github

desert frigate
#
BoundingBox box = BoundingBox.of(location1,location2);
        return box.contains(location.getX(), location.getY(),location.getZ());```
#

dying inside

#

im gonna try java BoundingBox box = BoundingBox.of(location1,location2); return box.contains(location1.getX(), location1.getY(),location1.getZ());

#

if this doesnt work idk anymore

vocal cloud
#

Probably won't work because it needs to be inside the box not on it.

#

Expand your location1 and 2 by 1 and it'll probably work

fluid river
#

I said that already)

ebon ether
#

is that general

#

ight ill go to general

desert frigate
fluid river
# ebon ether .

ProtocolLib rotate player to his back. So when he flies up, he looks like he is going to heaven

fluid river
ebon ether
#

ohh

#

i see

fluid river
ebon ether
#

ahh

#

thats pretty cool

#

ight

fluid river
#

You can make him lie forever

cedar laurel
#

Is there any way to check if the player is in Minecraft Pocket Edition?

fluid river
#

And even when he walks forward his character is still lying 90 degrees back

drowsy helm
desert frigate
fluid river
#

But his legs are moving

drowsy helm
#

geyser would have a method for it

fluid river
drowsy helm
fluid river
#

And add to second

drowsy helm
#

you are just shifting it 1 to the side

fluid river
#

To make box bigger

vocal cloud
fluid river
drowsy helm
#

making a box bigger isnt as simple as just adding 1 or subtracting 1

#

you have to check whether the value is larger or smaller, then do it accordingly

fluid river
#

Well basically if you know that x y z of first loc are lower than x y z of second

#

You can do that

#

He is just testing

#

So he will get 000 and 222

#

After this

vocal cloud
#

Write unit tests don't do it ingame

fluid river
#

Or you just forgot to compile and put to folder and restart

#

He probably died from cringe

ebon ether
#

nuker

#

i give up

#

give me somethign easier boss

fluid river
#

Haha ez

#

Well

ebon ether
#

bro I thought it would be easy like you could just go into the toggle flight event and rotate the player or some shit

#

but no

fluid river
#

You know about new chat event?

ebon ether
#

its gotta be harder then that

fluid river
#

So player looks lying to everybody, even for himself

ebon ether
#
package com.lusionmc.rotateplayer;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleFlightEvent;

public class myListener implements Listener {

    @EventHandler
    public void onFly(PlayerToggleFlightEvent event) {
        Player player = event.getPlayer();
        ProtocolLibRotate.rotatePlayer(player, 90);
    }
      
}
fluid river
#

Nice but sucks

ebon ether
#

๐Ÿ™

fluid river
#

I coded it like 2 years ago

#

Was kinda funny

#

I broke 2 blocks above myself

ebon ether
#

LOL

fluid river
#

And just started slowly flying up

#

Like from grave

#

With lying anim

#

Alr my second old idea

#

Homing Arrows

ebon ether
#

bro

#

if I cant rotate a player

#

u act like I can make

#

homing arrows ๐Ÿ˜ญ

fluid river
#

This is easy

vocal cloud
#

Don't ask for ideas if you can't do anything

fluid river
#

Like 30 minutes

ebon ether
#

i dont expect

#

hard ideas

#

i want

#

easy ideas

#

so I can learn more

fluid river
#

Of cose and testes

#

Literally 2 classes

#

One for event and one for handling arrow velocity over time

#

And one main of course

#

Now as you can add PDC to arrow

#

You can store like entity id there

ebon ether
#

brain is hurting

vocal cloud
#

Don't need to add PDC do you? A HashMap with the move event would probably suffice

fluid river
#

And each tick change arrow direction

fluid river
#

To entities location

vocal cloud
#

Less actions/s

#

theoretically at least

fluid river
ebon ether
#

listen boss u gotta hook me up w the free java lessons

fluid river
#

With literally default Bukkit runnable

vocal cloud
#

Well if your opponent doesn't move you don't need to run a check

fluid river
#

Its 5 am for me

ebon ether
#

true

#

gts

fluid river
#

They dont trigger any move event

#

As far as i know

vocal cloud
#

Paper has an entity move event

fluid river
#

Well i would like just spigot

#

The thing is

#

You not only change arrow direction every time

#

But also set it's velocity

#

To any number you want

#

So if you are nice at coding

#

You can make them go reeeeally slow

vocal cloud
#

It's just with enough arrows it could create some lag

fluid river
#

And have like 10 arrows

#

From different directions

#

Going to one white sheep

#

Slooooowly

#

So you can take a screenshot)

ebon ether
#

whys it gotta b white

#

why cant it b black

fluid river
#

Most common

#

Actually its gonna look like Dio's Za Warudo from JoJo

fluid river
ebon ether
#

im j watching you guys argue abt how to make a plugin

#

that you told me to make

#

and im sitting here

#

knowing that im damn well not going to make it

fluid river
#

Just make it

ebon ether
#

because i have no clue

#

where the hell to start

fluid river
#

Not gonna take long

vocal cloud
#

Start by changing an arrows direction when fired

fluid river
#

Start with bowshootevent

ebon ether
#

OK

vocal cloud
#

?jd-s to find the events you'll need

undone axleBOT
fluid river
#

Check if player triggered it

#

Get arrow

#

Get entity player is aiming at

#

If no entity then dont do anything

#

If there is add it to hashmap

ebon ether
#

do I need any depend

#

no

fluid river
#

Spigot API

ebon ether
#

right

#

SpigotAPI

#

got it

fluid river
#

Or bukkit at least

ebon ether
#

I just type SpigotAPI into "depend?

fluid river
#

Bro

ebon ether
#

ive never done depend

vocal cloud
ebon ether
#

LOL

fluid river
#

Just a default plugin

vocal cloud
#

ight I'm out

fluid river
#

Same

ebon ether
#

nah bro stay

#

stay

#

get some popcorn

fluid river
#

Good luck

ebon ether
#

its gunna b fun

#

NAH

fluid river
#

Cop p__n

ebon ether
#

noooo

fluid river
#

Bro i wanna sleep

river oracle
#

use maven

fluid river
#

I have philosophy class at my university today

#

And programming class

#

I wanna slip

#

Out

river oracle
# ebon ether noooo

use maven I'm not going to elaborate more it'll be built into your ide look up an IDE specific tutorial on maven and how to use it on youtube/google there will be some pretty in depth docs/videos

ebon ether
#

pom.xml

fluid river
#

Dylann make a hello world

#

Without ide

#

With just notepad

#

And windows console

ebon ether
#

no

#

im making ur damn homing arrows

fluid river
#

javac
AND
java

river oracle
#

that provides 0 value

#

lol

fluid river
#

Bro who cares

ebon ether
#

SKIPPED THE FUCK OUTTA IT

river oracle
#

same here lol

ebon ether
#

๐Ÿ˜ญ

fluid river
#

I never had any java course

vocal cloud
#

Nuker is going through a

First time?
moment.
The amount of people here who don't know basic java is high

river oracle
#

been a year still can't compile a pure java project without looking it up lol

fluid river
#

Learnt everything myself through years

river oracle
#

maven>>

fluid river
#

Never used gradle btw

river oracle
#

cuz its mid

#

no need to

vocal cloud
#

yup all the time

river oracle
#

legit most people tryna makea spigot plugin don't know what tf a java is half the time

vocal cloud
#

sometimes people come in with ANT KEKLEO

fluid river
#

Reminds me of my childhood

river oracle
#

my first java project was a spigot plugin I have a couple cringy posts on the forums but I think I tried my best to not be a complete idiot

ebon ether
#

bro what it just game me an error when installing spigotapi adding it as dependency

fluid river
#

When i tried 1.5.2 plugin

#

I actually never made any question post

#

Except for NMS ones

#

I tried to change book text in 1.8 plugin

ebon ether
#

AHA I ADDED THE SPIGOT API

fluid river
#

oooooo mah gaaaaaad

#

Free java lessons btw

#

Hey guys

#

Who is still alive

#

Why do guys use "w" instead of "with" on the internet

#

What's the connection between this two variants

#

Where it comes from

vocal cloud
#

me w the boys? never seen that before?

fluid river
#

i know me and the boys

#

Kinda cartoon meme

vocal cloud
#

no one uses w that I've ever seen

#

as a replacement for with

vocal cloud
#

No one I know does it might be local to them

fluid river
#

I see it for 9999 time

#

Already

#

Well on the internet only

#

Cuz i'm russian

#

No English texts here

vocal cloud
#

Well I don't see it so shrug1 might be more American cause I'm from Canada

fluid river
#

Only slang like cringe and hype

#

Gtg sleep

#

Wakin up in 6 hours

#

Cya

vocal cloud
#

TimeZone moment

fluid river
#

Yah

#

5 am for me

vocal cloud
#

Just change your timezone thonk

fluid river
#

Ez

ebon ether
#
public class myListener implements Listener {
    public void onShoot(EntityShootBowEvent event) {
        if (event.getEntity() instanceof Player) {
            if (event.getProjectile() instanceof Arrow) {
                Arrow arrow = (Arrow) event.getProjectile();
            }
        }
    }
}```
#

bro

#

i can do this

#

this is light

fluid river
#

My university wouldnt change it to follow my regime

#

Now get entity player is scoping to

ebon ether
#

so like find the entity

#

the player is aiming at

#

closes to

#

crosshair

fluid river
#

In line of sight

ebon ether
#

ok

#

ok

#

i saw that

#

i saw that

#

in whatever its called

#

event.

fluid river
#

And the closest from all entities in it

ebon ether
#

and then it popped up

scarlet creek
#

Is it possible to play the enderpearl cooldown animation on items?

fluid river
#

No

#

I think

vocal cloud
#

With some insane NMS maybe

fluid river
#

ItemStack.setCooldown

#

Is all i know

scarlet creek
#

I see

#

Probably not going to go into NMS for such a small detail

fluid river
#

Or it's player setCooldown

scarlet creek
fluid river
#

No

#

Just slot blinking

scarlet creek
#

Oh

fluid river
#

I mean like it will be filled with white

#

And slowly the white layer will go down

#

Until item is recharged and ready to be used again

ebon ether
#

getSpectatorTartget?

scarlet creek
#

Oh? Iโ€™ll try that then

fluid river
#

Player.setCooldown i guess

#

Material and ticks

#

As params

fluid river
#

You can google how to find entity player is looking at

vocal cloud
#

read the docs on the methods you're looking at

#

?jd-s

undone axleBOT
fluid river
#

Smart bot

vocal cloud
#

Also go to sleep

#

jeez louis

ebon ether
#

@fluid river ur gunna have to deal w the fact

#

that it is all sheep

#

not j white

vocal cloud
#

let them sleep

ebon ether
#

got it

#

ok mike

#

its j u and i now

#
public class myListener implements Listener {
    public void onShoot(EntityShootBowEvent event) {
        Player player = (Player) event.getEntity();
        if (event.getEntity() instanceof Player) {
            if (event.getProjectile() instanceof Arrow) {
                Arrow arrow = (Arrow) event.getProjectile();
                player.getNearbyEntities(10, 10, 10);
                for(Entity e : player.getNearbyEntities(10, 10, 10)){
                    //Example
                    if(e.getType() == EntityType.SHEEP){
                        LivingEntity sheep = (LivingEntity) e;
                        arrow.setVelocity(sheep.getLocation().toVector().subtract(arrow.getLocation().toVector()).normalize());
                    }
                }
            }
        }
    }
} ```
#

i stole

#

the nearby

#

entities

#

but ont the arrow.setVelocit etc

#

Check if player triggered it
Get arrow
Get entity player is aiming at
If no entity then dont do anything
If there is add it to hashmap

#

hold on im fixing it mike

vocal cloud
#

get nearby would not be what you want.

ebon ether
#

but its like aimbot

vocal cloud
#

well if you want aimbot over homing then yes

ebon ether
#

@vocal cloud

public void onShoot(EntityShootBowEvent event) {
        Player player = (Player) event.getEntity();
        if (event.getEntity() instanceof Player) {
            if (event.getProjectile() instanceof Arrow) {
                Arrow arrow = (Arrow) event.getProjectile();
                if (event.getProjectile() instanceof Arrow) {
                    BlockIterator i = new BlockIterator(player, 200);
                    Location l = player.getEyeLocation();
                    while(i.hasNext()) {
                        l = i.next().getLocation();
                        for (Entity w : l.getChunk().getEntities()) {
                            if (w.getLocation().equals(l)) {
                                
                            }
                        }
                }
            }
        }```
vocal cloud
#

Wat

ebon ether
#

wym what

#

i need peer review

vocal cloud
#

Does it work?

ebon ether
#

no fucking clue

#

an AI made it

#

not github copilot

#

i lit gave it

#

I gave it this:

import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityShootBowEvent;



public class myListener implements Listener {

    @EventHandler
    public void onShoot(EntityShootBowEvent event) {
        Player player = (Player) event.getEntity();
        if (event.getEntity() instanceof Player) {
            if (event.getProjectile() instanceof Arrow) {
                Arrow arrow = (Arrow) event.getProjectile();
            }
        }
    }
}
#

and I told it "get all entities in player's line of site"

#

and it gave me that

#

and it seems right

vocal cloud
#

No

ebon ether
#

its wrong

#

ok

#

lets try this again

vocal cloud
#

Don't use AI you're smart you can prototype something on paper then execute it I'm sure.

ebon ether
#

ok i will resume in the mornign

#

i appreciate all the help

quaint mantle
#

why is my jitpack not working?

#

it should

#

but cant actually use it

#

dependency loads correctly

vocal cloud
#

what do you mean by cant actually use it?

quaint mantle
#

here

#

i made this api

#

this 100% exists

vocal cloud
#

and you imported it? From JitPack?

quaint mantle
#

yep

vocal cloud
#

This is why I host my own lmfao

quaint mantle
#

lol

#

i mean it should work

#

idk why it isn't

#

no errors in console

vocal cloud
#

show the pom and link the jitpack

quaint mantle
vocal cloud
#

Where is the jitpack link

quaint mantle
#

oh-

vocal cloud
#

You're looking for TimerAPI or TimeAPI?

#

Cause it's in there

quaint mantle
#

timer doesn't work either

vocal cloud
#

Time

quaint mantle
#

like i said it should work

vocal cloud
#

Works for me

quaint mantle
#

tf-

vocal cloud
#

Check your libraries on the project tab

quaint mantle
willow fjord
quaint mantle
vocal cloud
quaint mantle
#

i shouldn't be

vocal cloud
#

The api is fine

#

where you import it isn't

#

Wait are you importing it into itself?

quaint mantle
#

uh, idk

#

:/

vocal cloud
#

Import it into a different project

#

Unless I'm reading that wrong

quaint mantle
#

oh

#

no im not

#

but i'll create a new one

#

one sec

#

oh it works now

#

tf

#

ยฏ_(ใƒ„)_/ยฏ

#

well i must be dumb

#

thanks

vocal cloud
#

There you go

quaint mantle
#

how would i get the plugin if its a dependency?

#

since i need a plugin for a scheduler

vocal cloud
#

Why would you need the other plugin? Why not use the current plugin?

quaint mantle
#

well its a dependancy

#

i need the plugin its hooked into

#

if possible

faint frost
#

Is it possible to set players xp from a config?

#

nvm i did it

lost matrix
# quaint mantle if possible

Then create a constructor with a JavaPlugin parameter.
This way the api user has to provide his JavaPlugin instance in order to use the api.
You can take this instance to register Listeners and schedule tasks,

torn oyster
#

is there an event called when an item is removed from a players inventory

lost matrix
#

Nope

torn oyster
lost matrix
#

There are several events that can be used for such a detection. The only thing you wont be able to detect is other
plugins removing items programmatically.

torn oyster
lost matrix
#

No

torn oyster
#

i'll make a custom event then

drowsy helm
#

How are you gonna listen for it

#

Without checking each tick

torn oyster
#

eh i'll call it whenever i clear

kind hatch
#

You could in theory constantly keep track of player inventory states and make comparisons, but it might not be a perfect solution.

torn oyster
#

in a situation where it matters

#

probably not the best but idrc

lost matrix
#

If you only worry about your own clears then you dont need an event...

torn oyster
#

i have a custom items/gui library i made

#

and i figured out that when the items are removed

#

they keep activating when a different one is added back

#

and whenever i clear i'll call the event which the library listens for

lost matrix
#

smh

torn oyster
#

what?

#

do you have a better solution or smth?

drowsy helm
#

Are you creatibg a new listener for each item

kind hatch
#

Alright, so I'm going to try and revive an old thread of mine. Initially I was going to abandon the idea, but the more I kept working on my project, the more I kept finding the need for a system like this. Also, the more I thought about it, the more beneficial it would be.

The original context is located here: https://discord.com/channels/690411863766466590/991327724918550579
The gist of it is that I'm trying to create a Language Pack System of sorts.

I was originally going to hack this together by hard coding every file name needed, but the more I thought about it, I didn't like the idea of that implementation since it'd be a major pain in the ass to maintain. I'd prefer for something a little more robust. However, with with my ambitions for this system, a half decent implementation is proving to be quite the challenge.

I've only had two major breakthroughs in terms of a better implementation, but they seem more like stepping stones at the moment as there are still several things I wish to improve.

I currently have the ideal directory structure that I want to preserve. I also have a few ideas on how to reduce the initial file size of the plugin jar and a method for using all of the files that will be generated, but my problem lies in how to make this more modular. I understand that it is my plugin and I probably have the right to reserve what filenames are expected from the plugin, but I'd like to be able to add and remove files from these packs easily. The easiest way to do that would to not rely on hard-coded names, but this is where I need help because I don't know how I would do that reliably.

eternal oxide
#

just have the pack include a key file, or index them

kind hatch
#

Hmm, indexing them would probably be the best approach as I don't want end users to accidentally edit important values like this. Because of that, it would have to be an internal index. However, it comes down to how I would store/make it. I know that I could make a list of names that are expected, but that wouldn't account for any future files that would be added.

#

See, part of the problem is that these packs will also rely on values from the config. So certain files will need to have the ability to be excluded.

eternal oxide
#

including values from teh config is easy, just regex replace

kind hatch
#

To be specific, it would more than likely just be boolean values that it checks against. In my example, I have a guis file. If the server owner wants to disable gui functionality in the plugin, there would be no need to load the gui message file, so it would be excluded from the pack results.

lean sandal
#

How do I add a project picture to my plugin?

tall jewel
#

Hi,
How to prevent players from moving items into custom inventories? I already canceled InventoryMoveItemEvent, InventoryDragEvent and InventoryClickEvent. In InventoryClickEvent I use
if(e.getClickedInventory().getHolder() instanceof BlockChangerInventory)
and players still can move item with pressing SHIFT and clicking on the item. Of course, instead of e.getClickedInventory I can use e.getInventory but it blocks players from changing items' position in own inventory.

drowsy helm
#

can you show your code

chrome beacon
#

You could just cancel if they shift click items in their inventory

ornate zinc
#

hello . how can i set my custom zombie health ?

chrome beacon
#

set the max health attribute

ornate zinc
#
            World myWorld = Bukkit.getWorld("world");
            Zombie zombie = (Zombie) myWorld.spawn(spawnLocation, Zombie.class);
            zombie.setMaxHealth(50);
            zombie.setHealth(50);
            zombie.setBaby();
            zombie.setCustomName("&4&lGhost");
            zombie.setCustomNameVisible(true);
#

i use this but it didnt work

chrome beacon
#

I recommend using the spawn method with a consumer

#

then put the code modifying your entity there

ornate zinc
drowsy helm
#

if this is a fully custom mob use nms

eternal oxide
#

Attributes

chrome beacon
shadow zinc
#

How can I exclude a library from being minimized by maven shade plugin?

chrome beacon
#

See if the clicked inventory is the player inventory and not your one

#

Then check if they're shift clicking

meager trout
#

if ZombieSetMaxhealth does not work

zombie.setMaxHealth(zombie.getHealth + double);
zombie.setHealth(zombie.getMaxHealth);```
#

try this

chrome beacon
#

._.

#

Let's not suggest using deprecated methods

shadow zinc
#

why isn't this including all of the lib? java <minimizeJar>true</minimizeJar> <!-- Ensure not set to true --> <filters> <filter> <artifact>net.wesjd.anvilgui</artifact> <includes> <include>**</include> </includes> </filter> </filters>

meager trout
chrome beacon
meager trout
#

hmm

meager trout
tender shard
shadow zinc
tender shard
#

your filter settings are wrong

#

try "*:*" as artifact, then provide the full package name in the includes part

#

followed by /**

shadow zinc
tender shard
#

or try fixing the "artifact" part by including both, groupname and artifact id, e.g. "com.jeff_media:JeffLib"

tender shard
#

it doesn't go by "class name" but by file path

shadow zinc
#

ahh right

tender shard
#

since it's also used for resources and stuff, not just java files

shadow zinc
#

but I can't remove it because all my language files use the adventure syntax

#

I could remake it, but thats a lot of bother

tender shard
shadow zinc
#

you gonna hate me for this

#

1.8-1.19

#

java 8

#

not that using java 8 changes anything to do with the plugin.yml

knotty meteor
#

someone knows good obfuscator?

odd wedge
eternal night
#

you gotta protect your source code from evil thieves kappa

odd wedge
eternal night
#

actual 5head move ๐Ÿ˜‚

tender shard
knotty meteor
#

but it has good deobfuscator..

tender shard
#

they all have deobfuscators

knotty meteor
knotty meteor
tender shard
#

i bet that java-deobfuscator with all transformers from the "general" and "normalizer" package enabled also make it readable

knotty meteor
#

Oof

quiet ice
#

At least decent obf

knotty meteor
#

yes thats why i use newest version of some obfuscators like skid

quiet ice
#

Skidfuscator is freeware, and as such the deobfuscators are much better there

knotty meteor
#

Ow oof

#

Do you maybe know a better obfuscator then?

quiet ice
#

At least I think so

eternal oxide
#

don;t bother

chrome beacon
#

^

quiet ice
#

But buying one is pointless given that spigot does Not allow heavily obfed plugins

shadow zinc
#

am I allowed to download libraries (can't use plugin.yml libraries) in code. Does this violate any rules?

tender shard
#

yeah spigot forbids like the most useful settings lol

eternal oxide
#

The only time you should obfuscate is if you are producing a commercial product which you own the IP for and are required to attempt the minimal level of protection.

tender shard
#

for paid plugins its forbidden

shadow zinc
#

why?

tender shard
#

they must always work without internet except for libraries feature

#

if it works without downloads, ok

#

if it's free plugin, also ok

shadow zinc
#

damn adventure is causing a lot of bother

tender shard
#

but a paid plugin that NEEDS to download something to run at all, that's forbidden unless plugin.ymls libraries loader is used

shadow zinc
#

i see

quiet ice
tender shard
#

I don't remember that rule

shadow zinc
#

whats the point of that tho?

quiet ice
#

Although I could be wrong there

shadow zinc
#

why wouldn't there be internet?

chrome beacon
#

So what I did to use adventure is to have one Spigot jar with adventure shaded and one paper jar without it

quiet ice
tender shard
#

for free plugins, I dont see any reason in this rule, if there is one

quiet ice
chrome beacon
#

You can also use maven

#

common
spigot
paper

shadow zinc
#

wait so did you minimize the spigot java with adventure in it?

tender shard
chrome beacon
#

You can also use ProGuard to strip unused methods as well

#

Depends on how much space you want to save

shadow zinc
#

i just need it to be under 4mb

tender shard
#

I mean adventure is less than 900kb if you have minimizeJar enabled

chrome beacon
#

Yeah

shadow zinc
#

also when I download my library from my nexus server it doesn't minimize the jar

#

which I guess makes sense

#

is there a way I can do that?

#

so what I mean is if I minimize my library it will go from 3mb to 1mb, approximately. But if I download this library from my nexus server it adds an extra 3mb to my plugin.

chrome beacon
#

Publish the minimized jar

#

Actually no don't

#

Just publish the api

#

No need for implementation

shadow zinc
chrome beacon
#

Do you want your library shadeable?

shadow zinc
#

yes

tender shard
#

you could also create a plugin that does nothing than to provide Adventure, then tell people it's a dependency for your plugin lol

#

you could tell them "if you run spigot, you must download XY-Lib, if on paper, you dont have to"

shadow zinc
#

lol no, I hate people telling me to download extra plugins

tender shard
#

me too

#

but isnt the file size limit 8mb or so?

chrome beacon
#

4

shadow zinc
#

yeah 4

chrome beacon
#

Make your lib depend on Adventure
When developers use it let them handle shading adventure

#

This way the end user don't need other jars

shadow zinc
#

i see

#

so use the provided tag and somehow require adventure for other developers

chrome beacon
#

Yeah

heady slate
#

Any forum staff online

shadow zinc
tender shard
#

i can upload .jars higher than 4 MB

chrome beacon
shadow zinc
#

yeah cuz your trusted

tender shard
#

this uploads fine for me

chrome beacon
#

We're aware

#

Now remove that link

tender shard
#

7200kb is too large to upload on spigotmc but 4416kb works for me

chrome beacon
#

hm I thought it was 4MB ๐Ÿค”

#

Guess I was wrong

shadow zinc
#

i think its user specific

tender shard
#

it's definitely SOMEWHERE between 4 and 8

shadow zinc
#

rep or something

#

my rep is really low so I can't go above 4mb

#

just a theory

tender shard
#

seems to be 6mb, probably it was raised at some time

shadow zinc
#

hmm

#

md_5 never comes on at the right times

chrome beacon
#

You could also just have an external download like EssentialsX

shadow zinc
#

yeah I could, but I like uploading directly to spigot, its convenient and I feel like people would trust it more even tho im pretty sure they don't scan the files for viruses

#

I say that because a month ago I saw some idiot spamming a plugin that was clearly a virus, people had rated 1 star and warned of it being a RAT

#

I should have decompiled it

frail spire
chrome beacon
frail spire
#

Whhy not to ci

tender shard
#

it points here for me

chrome beacon
#

^^

ivory sleet
#

Latest isnt always stable

odd wedge
chrome beacon
odd wedge
#

Yes, but anything can be reverse engineered

chrome beacon
#

Yes we got mappings for methods and field names but things like params and local variables are still obfuscated

odd wedge
#

Doesn't matter how much you obfuscate

chrome beacon
rough drift
#

I solved my ping message problem by simply making an overcomplicated piece of code that just works

chrome beacon
#

Making a premium plugin, might as well go open source

#

Pay for support is the best model for everyone

frail spire
odd wedge
#

You can only obfuscate so skids can't reverse engineer it

#

If someone wants to crack it they would

frail spire
odd wedge
#

Why would anyone normal look at your code

chrome beacon
#

^

green prism
#

hello everyone! I was asking around to know if anyone knew how to create animated text in gradient. Iโ€™ve seen a bit around and the only one that seems to do something similar is MiniMessage but I did not understand how to animate it, it would seem to be just static? (?)

chrome beacon
#

You can use :<number> to offset the gradient

#

Take that for example

green prism
chrome beacon
#

Every time you want to update the animation you change the number and resend the message

green prism
# chrome beacon Every time you want to update the animation you change the number and resend the...

I explained really badly then, there is an API for the inventories of Phoenix616 (https://wiki.phoenix616.dev/library/inventorygui/start) where you can put the object Dynamic... I donโ€™t know how I could implement MiniMessage with gradient here

#

Maybe create a class with an int position = 1 and increase and scale for each call I wouldnโ€™t know

chrome beacon
#

oh are you animating an inventory title

green prism
#

np

#

inventory item

chrome beacon
#

ah I see

green prism
#
gui.addElement(new DynamicGuiElement('d', (viewer) -> {
    return new StaticGuiElement('d', new ItemStack (Material.CLOCK), 
        click -> {
            click.getGui().draw(); // Update the GUI
            return true;
        }, 
        "Update time: " + new SimpleDateFormat("HH:mm:ss").format(new Date()));
}));```
chrome beacon
#

Yeah just have an int position and update it every tick or so depending on speed

green prism
chrome beacon
#

The offset

green prism
#

hm, okay I understand... I'm going to try, thank you!!!

chrome beacon
#

oh wait that's a decimal number not an int

green prism
#

wdym

chrome beacon
#

It goes from -1 to 1

green prism
#

so I do the same thing but starting from -1.0?

chrome beacon
#

Start from 0

#

then slowly increment towards 1

#

When it reaches 1 reset to 0

green prism
#

okay, thank you ๐Ÿ™‚

chrome beacon
#

hm no go from -1 to 1

#

my bad

#

Start at -1 and reset to -1 when it reaches 1

green prism
#

dont worry, Iโ€™m still trying to figure out how to make the parse ahahah...

#

thank you ahahah

chrome beacon
#

^ you can use this to prototype messages

green prism
#

whats this ahaha

chrome beacon
#

See the input

#

Put your minimessage there

#

<yellow>Woo: <gradient:green:blue:-1>||||||||||||||||||||||||</gradient>! Take this for example

green prism
#

thats freaking cool ahaha

green prism
# chrome beacon Put your minimessage there

Can I ask you one last question? I just started with "bungee" plugins, but if I program like I always do on Spigot, the same things happen, right? Or there are problems of compatibility with APIs like that of inventories etc...

echo basalt
#

whatever exists on bungee is available to use

#

everything else is your problem

chrome beacon
#

Bungeecord is another API since it's a proxy

#

It does not have inventories in the same way as the spigot server

green prism
#

ouch

#

may God help me

#

brUh JavaPlugin does not exists

chrome beacon
#

You usually don't have a lot of proxy plugins

#

Why are you making a Bungeecord plugin?

#

Like why is it on the Bungee instead of the server

green prism
#

sounds good?

#

from how I described it you can understand that Im finishing the ideas lmao

echo basalt
#

then you just want to do everything on spigot and have a communication layer through bungee

echo basalt
#

yeah just have a basic system to broadcast a message through the proxy

#

and do the rest in spigot

green prism
lost matrix
#

?pluginmessaging

green prism
lost matrix
green prism
#

So youโ€™re telling me I only need four lines of code to do the bungee part?

drowsy helm
#

laughs in redis

tall dragon
echo basalt
#

laughs in abstracted packet communication system

drowsy helm
#

speaking of, what happened to redis bungee

#

are they still even working on it

echo basalt
#

pretty sure original support dropped but there's an updated fork

#

there's not much to add ig

tall dragon
drowsy helm
#

yeah fair enough

tall dragon
#

would love to see how it is compared to my own

drowsy helm
#

yeah i use a packet system for redis

#

super handy

tall dragon
#

yea i do too

echo basalt
tall dragon
#

yea

#

sure

echo basalt
#

it's similar to ProtocolLib

drowsy helm
echo basalt
#

But I also have some variants for it

#

a lil specific

#

I'll use my more general version

#

I got some modifications for my skyblock core with more abstraction for direction n all

tall dragon
#

did yall ever have issues with redis connections timing out?

drowsy helm
#

i just open a new connection each query

#

much easier than an always on one

echo basalt
#

grr this is annoying to exemplify the API as it's a bit abstracted

#

we got packet processors, which are responsible for sending and calling back packets

tall dragon
#

Jedis?

echo basalt
#

so this is where you impl your redis logic, sockets etc

drowsy helm
#

yeah jedis

tall dragon
#

isnt that what the JedisPool does for you?

lost matrix
#

Redisson

echo basalt
#

then I got an abstract packet class

#

so I just pull an NMS and do like

drowsy helm
#

pooling is for clusters

#

diff scenario

echo basalt
#
public class WhateverPacket extends Packet {

  private final UUID playerId;

  public Packet(byte[] bytes) {
    playerId = readUUID();
  }

  public Packet(UUID playerId) {
    this.playerId = playerId;
    writeUUID(playerId);
  }
}
#

and just send it

#

if the packet is registered, I serialize the packet id

#

otherwise I serialize the class

kindred valley
#

?paste

undone axleBOT
tall dragon
#

mine look like this

@RedisPacket(id = "UserQuitServer")
public class UserQuitServerPacket extends Packet
{

    private UUID uuid;

    @Override
    public void send(BaosOutputStream out) throws IOException {
        out.writeUUID(uuid);
    }

    @Override
    public void receive(BaosInputStream in) throws IOException {
        this.uuid = in.readUUID();
    }
}
echo basalt
#
PacketManager manager = ...; 

manager.send(new WhateverPacket(id));

WhateverPacket response = manager.await(WhateverPacket.class, (packet) -> packet.getPlayerId().equals(id)); // times out after 3 seconds, add int param for custom timeout

response.getSomethingElse();
#

I abstract away the streams because some objects can be better stored

#

I can also add listeners for onReceive and onSend

kindred valley
drowsy helm
#
public class GenericQueryPacket extends MECallbackPacket<GenericQueryResponsePacket>{
  private final String exampleData;
}

public class GenericQueryResponsePacket extends MECallbackResponsePacket{
  private final String responseData;
}

public class testPacket{
  public void exampe(){
    MEPacket query = new GenericQueryPacket("data");
    GenericQueryResponsePacket responsePacket = query.await(packetManager, 3(timeout));
    System.out.println(responsePacket.getResponseData());
  }
}
#

this is an example for my callback packets

#

then theres generic broadcast packets which dont require a response

echo basalt
#

on my skyblock core I went a lil fancy

#

made packet directions, server identifiers

#

uhh

#

packet redirection between proxies

#

a dummy packet manager that has empty methods everywhere for those idiots who can't setup redis

#

just jams all communication

#

tons of stuff

#

also made dynamic tabling for sql

tardy delta
#

whoa

tall dragon
#

yall also have packetlisteners that listen at all time? like spigot listeners bassically?

echo basalt
#

pretty much yeah

drowsy helm
#

yep

echo basalt
#

I mean

#

listener logic is simple

drowsy helm
#

then i delegate it to a spigot event

#

or bungee vent

tall dragon
#

i just got this ```java
/**
* Handles incoming {@link SendMessagePacket}'s
* Allows for message sending cross server
*
* @param packet
* @param channel
*/
@PacketHandler
private void handleUserMessages(SendMessagePacket packet, String channel) {
List<Player> recipients = Common.convert(packet.getRecipient(), value ->
{
OfflinePlayer player = Remain.getOfflinePlayerByUUID(value);
if (player.isOnline() && player.getPlayer() != null) return player.getPlayer();
return null;
});

    packet.getMessage().forEach((line) ->
    {
        Common.broadcastTo(recipients, Localization.Format.USER_MESSAGE.replace("{message}", line));
    });
}
drowsy helm
#

yeah i wanna do someting like that

echo basalt
tall dragon
#

works rlly nicely

drowsy helm
#

rn i use a generic event

#

then use instanceof

#

it's not ideal

tall dragon
#

i also register the listeners automatically like spigot does

#

with the annotation

echo basalt
#

I'm not a fan of annotations and reflections in general

drowsy helm
#

mind sharing the code where you call the event?

tall dragon
#
    @Override
    public void receive(String channel, Packet packet) {
        PacketLogger.logReceivePacket(packet, channel);
        if (this.channels.isEmpty() || this.channels.contains(channel)) {
            List<Method> methods = this.methods.get(packet.getClass());
            if (methods == null || methods.isEmpty()) {
                return;
            }

            for (Method method : methods) {
                try {
                    method.invoke(this, packet, channel);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
drowsy helm
#

ah so just a registry

tall dragon
#

?paste

undone axleBOT
echo basalt
#

am I the only one who made an exception logger that logs stuff to files?

#

helps a ton with debugging

tall dragon
drowsy helm
#

log files are for the weak

echo basalt
#

simple 35 line class

#

stores each exception on its own file, on a dedicated folder

#

you just scroll down to the last

#

I also made my own command system

#

might be the only one here tho

tall dragon
#

probably lmao

drowsy helm
#

Epic

tall dragon
#

ya

drowsy helm
#

have you considered for your annotation having channel specific stuff

#

e.g

#
    /**
     * Handles incoming {@link SendMessagePacket}'s
     * Allows for message sending cross server
     *
     * @param packet
     * @param channel
     */
    @PacketHandler(channel = "channel1")
    private void handleUserMessages(SendMessagePacket packet, String channel) {
        List<Player> recipients = Common.convert(packet.getRecipient(), value ->
        {
            OfflinePlayer player = Remain.getOfflinePlayerByUUID(value);
            if (player.isOnline() && player.getPlayer() != null) return player.getPlayer();
            return null;
        });

        packet.getMessage().forEach((line) ->
        {
            Common.broadcastTo(recipients, Localization.Format.USER_MESSAGE.replace("{message}", line));
        });
    }```
#

so only if the packet is sent on x channel, it will invoke

echo basalt
#

condense all the java code into the annotation itself

#

๐Ÿ‘€

tall dragon
#

oh thats actually not a bad idea. then i can lose the channel in the method itself too

#

since thats all it would be used for

drowsy helm
#

yeah thats what i was thinking

#

just one less if check on the method

#

less boilerplate

tall dragon
#

pretty good idea thanks. will have to look into that

echo basalt
#

fancy

drowsy helm
#

the only thing i hate

echo basalt
#

am I the only mf out here that enjoys supporting all types of APIs for common stuff?

#

Like block pasting

drowsy helm
#

idk what to name my packets

#

because Packet is already taken

#

lol

echo basalt
#

I got worldedit, but I can also load chunk files directly

#

or use SWM

#

I got mf amazon S3 support because some guy asked for it

drowsy helm
#

lmao

tall dragon
drowsy helm
#

i try to make it as scalable as possible

tall dragon
#

yeaaa some are not the best xD

echo basalt
#

I'd probably make more packages

drowsy helm
#

yeah for the base class though

#

is it just called Packet?

echo basalt
#

yeh sure why not

drowsy helm
#

I went with RedisPacket

#

but i feel its too long

tall dragon
#

yea mine is just named Packet

drowsy helm
#

conflict of interest with nms Packets though

echo basalt
#

who cares

#

it's a packet regardless

drowsy helm
#

fair

echo basalt
#

there are like 35 Main classes

drowsy helm
#

yo Epic im gonna copy you if you dont mind

#

with that annotation

echo basalt
#

am I the only mf that likes splitting up listeners and commands based on function

drowsy helm
#

nah I do the same

echo basalt
#

sometimes I end up having looong packages

drowsy helm
#

one listener per function

tall dragon
echo basalt
#

I mean

#

one package per function too

#

so

#

listener:

  • player
  • mob
  • block
  • world
  • inventory
#

then within player I'd make subcategories

#

instead of just pulling an essentials move and stuffing 50 commands in the same package

odd wedge
#

Does anyone know how to remove balance from an player using vault's api? I checked the docs and couldn't find anything

tender shard
#

Economy#withdrawPlayer(...)

odd wedge
#

Oh I must've missed that thank you

boreal seal
#

sometimes when i have a huge class with 1 goal

#

which can include up to 10 listeners

#

in it

echo basalt
#

ew

boreal seal
#

and 2000-3000lines for example

#

but many other small classes..

#

i really see no reason splitting everything everything up

lost matrix
#

Because it makes the code not horrible to read.
Having a single class with thousands of lines is very bad practice.
Same goes for methods. They should be only a couple of lines long.
Especially listeners.

boreal seal
#

there no reason making servel classes

#

at all

#

if i would go

#

and make class for each listener

#

it would be really messy

#

would be more 20 classes

#

for really no reason

#

when all those 20 listeners even a single goal

lost matrix
#

There are a ton of reasons for that. One would be modularity. You cant to write
reusable code. The other is separation of concerns. You want to have specific classes
with specific purposes. The next one is cleanliness. Having a lot of small methods with
descriptive names makes your code way better to read. Its essentially self documenting.

quaint mantle
#

are there tutorials on how to add moments and attacks? (like attacking a player)

boreal seal
#

its just opinion like what color should be better

quaint mantle
boreal seal
#

oh there many about path goals

#

about range attacks?

quaint mantle
#

ye

boreal seal
#

you cant make it more then 3 blocks

#

like otherwsie the attack wont be really made by playe

#

r

lost matrix
#

No its not. There is an industry standard for over a decade now.
There is tons of literature just going over this one principle. Its not an opinion. Its a standard.

torn shuttle
#

does anyone with experience with the sonatype nexus repository manager know if there's two different managers for snapshot and non-snapshot builds?

boreal seal
#

u can use vectors to see where players aim

#

and if theres a player just make him it the other

torn shuttle
#

I seem to be committing just fine to snapshot builds but can't seem to get it right for non-snapshot builds

boreal seal
#

but otherwise attack distance is hardcoded into client side

#

so

#

;l

lost matrix
#

iirc

torn shuttle
#

yeah that's what I thought as well but are they both searchable from the nexus repo manager?

#

because I can only find my snapshots on there

#

as far as I can tell it should be able to... guess I'll have to actually access the repo and see what it does

lost matrix
# boreal seal

My listeners for example contain very little logic. Almost none.
They only react and delegate. Thats how an application interface like spigot is meant to be used.

odd wedge
eternal night
#

โœจ static state entrypoints โœจ

echo basalt
odd wedge
#

Everything should be static and only write in the main class

eternal night
#

a true spigot design principle

odd wedge
#

What's the need for multiple methods when you can have one

glad prawn
#

Do I need to reloadConfig after adding something with set to config and saveConfig ?

lost matrix
eternal night
#

thats why you abuse records to auto generate your constructor 5Head (pls don't)

eternal night
#

who doesn't

lost matrix
#

And i ran into the usual problems with statics being initialized and depending on
other static initialisations which leads to a mess. Solved this my writing a Lazy<T> class blobimfine

odd wedge
#

Easiest way to make a data class

lost matrix
eternal night
#

does gson/jackson not support those ?

ivory sleet
eternal night
#

A close one conclure

#

I was about to haunt you in your dreams

odd wedge
#

I wish something like this existed

public void myMethod(final String... s, final Integer... i) {}
lost matrix
ivory sleet
#

If you really want that theres an interesting debate that goes like

#

If you have so many parameters, they are already so (arguably) cohesive that you might just encapsulate them inside some object before sending them to that function myMethod

lost matrix
#

I read through some JEPs yesterday. Does v19 include the first incubation for Valhalla?

ivory sleet
#

And then you can utilize some builder pattern

#

To like, have double var arg thingy

eternal night
#

it should not

#

20 is the first valhalla one

#

iirc

#

if the proposed JEPs make it

lost matrix
#

List<int> when

ivory sleet
#

๐Ÿ™

odd wedge
#

I mean wouldn't you be able to have a record class that holds them and then utilize it as a list

eternal night
#

๐Ÿ™

upper vale
#

you should use List<Object> all the time for the most flexible list possible

eternal night
#

tho I think 19 has some neat loom things

upper vale
#

scalability

eternal night
#

sorry wrong wat

ivory sleet
#

Think they were joking? (I hope)

lost matrix
#

Why stop there? Just use Object all the time. It can hold a List<Object> if you want to.

eternal night
#

the final level of polymorphism xD

heady spruce
#

I've got a question, how do I know if a player made 5 kills without dying? Every help is wanted

upper vale
#

yes

smoky oak
#

bah

odd wedge
#

something like this

public record MyClass(String... s) {}
public record MyClass2(Integer... i) {}
``` @ivory sleet
ivory sleet
#

Oh yeah

smoky oak
#

dunno what i did but i found something the other day that wasnt instanceof object

lost matrix
odd wedge
#

Would work in theory

echo basalt
#

I only learned that an array is an object like 5 years into java

smoky oak
#

sounds bout right

ivory sleet
heady spruce
echo basalt
#

was checking for equality with ==

smoky oak
#

HashMap<UUID, int> killcount

odd wedge
#

I found another way to abuse record classes @eternal night

smoky oak
#

if kill increase

#

if death set to 0

upper vale
#

Integer

torn shuttle
#

anything can be an object if you really believe in yourself