#help-development

1 messages ยท Page 569 of 1

sterile token
#

Yeah im doing exactly that but with a Database, i finding chaotic having to call many code for saving a user. When you can simply do myUser.save()

echo basalt
#

then keep a reference of the usermanager on the user class

#

and delegate the method to the user manager

sterile token
#

So far i cant use Di because of what i said

echo basalt
#

dependency injection

sterile token
ancient plank
#

I always forget that completable futures exist

hollow beacon
#

same lol I had to google them

sterile token
#

Do i explain my point? That DI is not appropiated in this cases, because if you need to create a instance of the object. Then you have to pass him all the instances to your object

echo basalt
#

no

#

the user manager should be the one responsible for creating the user instance

#

on the loadUser method

sterile token
#

right, thats true but still not my really point

echo basalt
hollow beacon
#

his point is he doesn't like injecting UserManager to User in order to call user.save()

sterile token
echo basalt
#

Well

#

Honestly at work I skip this entire process by just

sterile token
#

Thats why im asking which is the more suitale pattern here

echo basalt
#

injecting the entire plugin and doing all the save logic automatically

eternal oxide
#

save shoudl not be a method of User, it's not that objects job

sterile token
#

Because i dont wanna harcod it using a static getter of the main class, like all plugin done

eternal oxide
#

UserManager.save(user)

echo basalt
#

exactly

#

verano's just mad that dependency injection has to be done everywhere and singleton uses static

sterile token
#

no no im not mad, i never said that. Im just wondering to learn which pattern is better in a specific case

echo basalt
#

damn since when did we cross 45k lines of code at work

#

still it all uses di

sterile token
#

i will use translator to say what i want

echo basalt
#

Just use DI honestly it's a no brainer

hollow beacon
sterile token
#

The problem is not that I don't want to use Di, the issue is that it is not appropriate for all cases. Since you will not always be able to initialize your object to pass it the instance. That's my point, in those cases you are left adrift (like me), not knowing what pattern to use.

hollow beacon
#

instead of

UserManager <-> User

you just get

UserManager -> User

desert tinsel
#

so Im using a dependency for embeded sqlite database: xml <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.39.3.0</version> <scope>provided</scope> </dependency>
and when I enable the server on a 1.8.9 server, I get this error: No suitable driver found for jdbc:sqlite:plugins/DeathMatch/database.db, but when I enable this plugin on a newer version like 1.18 I dont get the error and all is fine, why? This is the code: java public static void connect() { connection = null; try { File file = new File("plugins/DeathMatch/database.db"); if (!file.exists()) file.createNewFile(); String url = "jdbc:sqlite:" + file.getPath(); connection = DriverManager.getConnection(url); System.out.println("Baza de date creata"); statement = connection.createStatement(); } catch (SQLException |java.io.IOException e) { System.out.println("EROARE"); e.printStackTrace(); } }

sterile token
hollow beacon
echo basalt
#

shade the sqlite

desert tinsel
#

how

hollow beacon
#

google it ๐Ÿ˜„

#

if you don't succeed come back to us ๐Ÿ˜›

echo basalt
#

pretty much

#

Just follow the list

eternal oxide
#

you need to initialize it Class.forName

echo basalt
#

good chance honestly yeah

desert tinsel
#

but then why on a newer mc server version works?

echo basalt
#

I do this

#

(yes I'm aware y'all can yell at me for catching all exceptions)

vocal cloud
#

As long as it's logged

echo basalt
#

p much

vocal cloud
#

my younger self would leave the catch empty. Regret 100

echo basalt
#

futures swallow exceptions

#

go figure

hollow beacon
#

sout("something went wrong")

sterile token
#

In my scenario, when creating a new instance of the User entity, it appears to be necessary to pass the DI reference to access the save, update and delete methods. This may indicate a direct dependency between the User entity and the dependency injection system

Thats what im trying to say

hollow beacon
#

yes we understand you

echo basalt
#

dependency injection system

#

it's literally a constructor

hollow beacon
#

we say: it does not matter aslong as you're happy with an approach

echo basalt
#

You're telling me that your user class depends on a user manager?

#

impossible!

#

then just fuckin put all the responsibility on the user manager and treat your user like a pure raw data class

#

simple and efficient

eternal oxide
#

Don;t di to User, it's a nightmare pattern

sterile token
echo basalt
#

If you want you user.save() so much then it's your only way

eternal oxide
#

yep

hollow beacon
#

just store everything in a hashmap

hashmap<UUID, String> names
hashmap<UUID, String> anythingElse

echo basalt
#

If you can live with the fact that userManager.save(user) is how it works

eternal oxide
#

actually not

echo basalt
sterile token
#

But you understand what i meant Elgarl right?

hollow beacon
echo basalt
#

put all the io logic on your user manager and move on

#

That's the best way to do it

eternal oxide
#

just add a method in User

public void save() { UserManager.save(this); }```
echo basalt
#

static

hollow beacon
echo basalt
#

static

sterile token
eternal oxide
#

Not static

hollow beacon
#

yes static

eternal oxide
#

UserManager shoudl be a Static

echo basalt
#

disagree

hollow beacon
#

disagree too

echo basalt
#

user.save() should not be a thing

#

first of all

#

because if you have a user

eternal oxide
#

true

echo basalt
#

you must've gotten it through the user manager

#

so the user manager is always accessible

#

unless you're passing around events

#

but you can just DI the manager to the listeners

eternal oxide
#

User shoudl only be a data class

echo basalt
#

Exactly

sterile token
#

In conclusion the issue is that my logic is not well designed, because that must be putten in the manager. To skip all this issue i mentioned before with passing the instance

#

I could have done that from the start but i prefer to see if was a way

echo basalt
#

You usually learn this kind of data structures through just pure experience

#

I don't blame you it's aight

#

Just see this as a learning moment and move on

sterile token
#

Yes i mean you are right, i understand that. I just get frustrated because people treat me as dumb, when i try to explain what i mean in many ways

cinder abyss
#

Hello, how can I show the player's life on his top ?

echo basalt
#

The first thing you should think about is uhh

#

"Is it the user's duty to handle its own saving?"

sterile token
echo basalt
#

basically single-responsibility principle

echo basalt
cinder abyss
echo basalt
#

What method

eternal oxide
hollow beacon
#

scoreboard = on top

echo basalt
#

not always

cinder abyss
#

like this

echo basalt
#

boss bars are at the top of the screen

#

ah

#

above name

robust zenith
echo basalt
#

Think you can do that with scoreboard teams

shy rock
#
    public void onZombieDeath(EntityDeathEvent event, int zombieLevel) {
        if (event.getEntityType() == EntityType.ZOMBIE) {
            Zombie zombie = (Zombie) event.getEntity();
            int droppedExp = event.getDroppedExp();

            double additionalExp = (int) calculateAdditionalExp(zombieLevel);

            // Add the additional experience to the dropped experience
            event.setDroppedExp((int) (droppedExp + additionalExp));
        }
    }
    private static double calculateAdditionalExp(int zombieLevel) {
        double additioanlExp = 3 + (zombieExpAddPerLevel * (zombieLevel - 1));

        return additioanlExp;
    }```
Can someone help me? Why doesn't this work ^, I want each level to drop more exp
echo basalt
#

Your onEnable() method is your entry point

sterile token
cinder abyss
eternal oxide
# cinder abyss like this
if (scoreboard.getObjective("showHealth") == null)
    scoreboard.registerNewObjective("showHealth", Criteria.HEALTH, "\\u2665", RenderType.HEARTS).setDisplaySlot(DisplaySlot.PLAYER_LIST);```
cinder abyss
echo basalt
#

When onEnable() is called:

  • plugin is null
  • conf is null

Then you

  • Get a file configuration from your plugin (which is null), which should throw an error
  • Assign your plugin variable to this
  • do whatever else
robust zenith
sterile token
#

๐Ÿ’€

eternal oxide
#

You get/create the scoreboard and add the player on join

echo basalt
echo basalt
#

You assign it after attempting to get the config

pseudo hazel
#

you have only declared it at the top, then never assign it until after you try to use it

echo basalt
#

You can either put that line after assigning the plugin variable

cinder abyss
# eternal oxide ```java if (scoreboard.getObjective("showHealth") == null) scoreboard.regist...

I found this on Spigot :```java
ScoreboardManager manager = Bukkit.getScoreboardManager();
final Scoreboard board = manager.getNewScoreboard();
final Objective objective = board.registerNewObjective("Belowname", "dummy");
@EventHandler
public void PlayerJoin(PlayerJoinEvent e) {
final Player p = e.getPlayer();
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {
public void run() {
ScoreboardManager manager = Bukkit.getScoreboardManager();
final Scoreboard board = manager.getNewScoreboard();
final Objective objective = board.registerNewObjective("Belowname", "dummy");
objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
objective.setDisplayName(ChatColor.RED + "YourBelowName");
}
},0, 20 * 10);

    }

}```
echo basalt
#

or replace plugin.getConfig() with just getConfig() as your plugin is just this

orchid trout
#

how do i convert a json string to a json object?

echo basalt
#

you parse it

#

usually with gson or anything else

pseudo hazel
#

JSON.parse(str)

pseudo hazel
#

oh wait

#

wrong language xD

echo basalt
#

Depends on the language

cinder abyss
eternal oxide
#

a repleating task shoudl not be needed. just set the scorebaord

echo basalt
#

gson.fromJson(jsonString, JsonObject.class)

pseudo hazel
#

scores on a scoreboard will be updated automatically

sterile token
pseudo hazel
#

its only when you want to change what the scoreboard says that you need to reapply it, i think

sterile token
cinder abyss
# eternal oxide a repleating task shoudl not be needed. just set the scorebaord

is this good ?```java
ScoreboardManager manager = Bukkit.getScoreboardManager();
final Scoreboard board = manager.getNewScoreboard();
final Objective objective = board.registerNewObjective("Belowname", "dummy");

@EventHandler
public void PlayerJoin(PlayerJoinEvent e) {
    if (board.getObjective("Belowname") == null) board.registerNewObjective("Belowname", Criteria.HEALTH, "\\u2665", RenderType.HEARTS).setDisplaySlot(DisplaySlot.PLAYER_LIST);
}```
sterile token
#

Best way would be on the damage event to the player, updating it only when the player is damaged. That what hydratate principle is designed and the best one

eternal oxide
#

as far as I remember if you set teh criteria you don; tneed to update. I could be wrong as it's been a while

#

you need to use the Main scoreboard, or add the player to your new scoreboard

vital sandal
#

:l I got an order that need to modify minecraft chunk data from its byte

#

does 250$ worth it?

#

:l I mean I have to face with this

hollow beacon
#

what do you need to modify

vital sandal
#

:l the packet size in display is so dam large that even vs code on my mac m1 crash

pseudo hazel
#

I can only assume that those numbers are block id's or something

#

in which case you just gotta switch some around

hollow beacon
#

yeah it's defenitely very easy

#

search replace xD

vital sandal
#

and split ๐Ÿ˜„

zenith gate
weak bear
#

Hello do you know why I have this error ?

hollow beacon
#

your db seems offline?

vital sandal
#

in 5s I got 100mb of packets?

weak bear
#

she's not

weak bear
echo basalt
weak bear
cinder abyss
#

Hello, how can I show mobs health above their heads ?

echo basalt
#

bros re-asking his question

hollow beacon
#

hello guys i'm wondering something today

#

how can I like

#

show health bar?

#

above

cinder abyss
echo basalt
#

it's literally the same

#

just add the mobs to the team

cinder abyss
#

okay thanks

hollow beacon
#

just wondering

#

bro my laptop is using 80% of it's memory

#

its ddr5 too

echo basalt
#

ddr5 isn't some magical compression algorithm

echo basalt
hollow beacon
#

it should be faster-ish

echo basalt
#

don't even have a game open

eternal oxide
#

Add players to a Team by name, mobs you add by UUID.toString()

zenith gate
#

InventoryType.PLAYER does this count for like opening a chest to? because the player inventory is shown, or will this only be true if its just the players inventory when they hit E ?

echo basalt
#

It's for E

hollow beacon
#

i have 4800mhz ram actusally

echo basalt
#

my laptop is uhh

#

5200 I think

hollow beacon
#

bro got a 6k laptop

echo basalt
#

I paid 1k for it

#

lg gram

hollow beacon
#

bruh I paid 4k for mine

echo basalt
#

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

#

mine uses an igpu

#

2k screen

hollow beacon
#

rtx 4090 though

echo basalt
#

backlit keyboard and all

#

just a decent work machine

echo basalt
#

paid itself in like a week

hollow beacon
#

i almost paid it off ๐Ÿ˜›

#

got it last week

high pewter
#

Sorry for asking so many questions ๐Ÿ˜… Is there an event for when a player is given an item (such as from the /give command)

echo basalt
#

Nope

high pewter
#

Doesn't have to be specifically for the /give command, just when an item is added to a player's inventory

hollow beacon
#

then also no

high pewter
#

Welp

hollow beacon
#

you can write your own spigot patch though

#

to like create an event upon player#addItem

high pewter
#

I'd have no idea how to do that lol

echo basalt
#

seems overengineered

#

What you trying to check for in particular?

#

could be xy problem

hollow beacon
#

xyproblem

#

yes

#

xD

weak bear
#

do you know how to accept the connetion to my database beside local ?

hollow beacon
#

what

#

127.0.0.1?

weak bear
#

yes how can I accept the external connection

hollow beacon
weak bear
#

thx

hollow beacon
#

this is usually not what you want though

high pewter
#

That's fair. Pretty much, I'm making a 'randomness plugin' which can be turned on and off. One of the random parts of the plugin is that block and entity drops are randomised, and if a player has 'learned' these drops already I want to show them in the item lore. I'm needing to listen to a lot of events to add/remove the lore (remove because I don't want it to be permanent) but one edge-case I haven't covered yet is if a player is given an item by another plugin or by the /give command

weak bear
orchid trout
#

and i was wondering why it didnt work

#

adsljhfbsadfdsapoidshg

hollow beacon
#

or write your own

high pewter
#

I still want /give to work lol. I suppose I could override it, but that still doesn't cover items given by other plugins

weak bear
high pewter
#

If I could detect items being added to (or removed from for that matter) any inventory, that would be great too, I'd just have to check if a player is viewing the inventory

hollow beacon
#

yeah you could check the inventory every tick

#

not ideal

#

but eh

#

is it a public plugin or for a specific server

high pewter
#

I plan on making it public

hollow beacon
#

you can make it not your problem

#

make some kind of

/plugin reconsider (player)
command that checks the player inventory and changes their allowed stuff accordingly

#

that might be best performance wise?

#

or check it upon inventory open

silk mirage
#

Wait I got question, can I like link my own MariaDB driver to Spigot instead of shading it to 100 different plugins?

hollow beacon
#

you can make a little plugin that has the driver, iirc other plugins should find it

#

if not, you can write a patch that does it

chrome beacon
#

You can just use the library loader if it's hosten on maven central

wet breach
scenic onyx
#

hi, i have problem whit import nms.

hollow beacon
chrome beacon
#

No

wet breach
#

just make sure to remove the mysql driver as mysql and maria drivers conflict with each other

high pewter
#

Right now, what I've got covered is:
PlayerJoinEvent - add lore to entire inventory if ongoing game, otherwise remove it
PlayerLeaveEvent - remove lore from entire inventory
InventoryOpenEvent - add lore to entire inventory if ongoing game, otherwise remove it
InventoryCloreEvent - remove lore from entire inventory
PrepareItemCraftEvent - add lore to item being crafted
ItemSpawnEvent - remove lore from spawned item

But there's quite a lot this doesn't cover (some of which I think I know a fix though): getting an item from the creative menu, getting an item from another plugin, getting an item from /give, blocks with inventories you don't open (campfires, jukeboxes), picking up an item off the ground which was dropped by a non-player or by a player before a game was started

silk mirage
high pewter
silk mirage
#

you get me

#

like how dlls and .sos work

remote swallow
#

is the driver on maven central

scenic onyx
#

hi, i have problem whit import nms. my plugin import "import org.bukkit.craftbukkit.v1_19_R3.entity.CraftPlayer;
" but not import: "import net.minecraft.server.v1_19_R3.BlockPosition;
import net.minecraft.server.v1_19_R3.PacketPlayOutBlockBreakAnimation;". You can resolve it?

wet breach
silk mirage
wet breach
#

sure

#

just remove it from the jar

silk mirage
#

bruh i have to open recaf for that

remote swallow
#

just note that may break some plugins that use it

wet breach
#

you just open the jar like a zip file

remote swallow
silk mirage
wet breach
#

you don't need that for removing mysql driver

cinder abyss
#

Hello, how can I unshow a mob's customName if a player can't see the mob directly ?

scenic onyx
cinder abyss
hollow beacon
#

you can hook into their AI and see if they can see the player

#

correct me if i'm wrong

chrome beacon
#

Eh it's probably better to rayTrace from the player to nearby entities

scenic onyx
pseudo hazel
#

what is the conversation api stuff used for

#

its kinda unclear to me just from reading the docs

#

it sounds like a text adventure

hollow beacon
#

like someone executes /region create

#

and you get asked a question like

"whats the region name called"

pseudo hazel
#

oh

remote swallow
#

asnyc pre chat event

hollow beacon
#

and you can catch that message without having to keep track of who should send what using lists/maps etc

pseudo hazel
#

I see

remote swallow
#

my brain skipped the rest of that convo ๐Ÿ’€

pseudo hazel
#

I thought maybe I could use it for inventory stuff

#

but I dont think so

#

or atleast thats not what its intended for

hollow beacon
#

inventory stuff like

pseudo hazel
#

well

#

if you think about it, selecting some settings from an inventory can also be kinda like a conversation

#

like you click on the settings item, it would take you another inventory screen

hollow beacon
#

eh you can do player.chat upon click

pseudo hazel
#

etc

hollow beacon
#

lol

wet breach
pseudo hazel
#

yeah

#

I see

#

it is purely like a text chat thing

#

got it

wet breach
#

one of the nice things of it is you can put the player in their own channel with the server

#

this allows server chat to not clutter the screen

#

as well as when they go back to main channel they can still scroll through history

#

of what was being talked about

pseudo hazel
#

oh

#

thats useful

#

like in general

#

for having different chat channels and stuff

wet breach
#

but, when they are in the channel with the server, you can listen for their input in the chat

#

and do things with it ๐Ÿ™‚

hollow beacon
#

does it put other chats above the prompt?

#

๐Ÿ˜ฎ

wet breach
#

link I gave above demonstrates how my plugin does that

silent steeple
#

whats the enum name for CLOCK

#

its not Material.CLOCK

hollow beacon
#

watch?

#

depending on your version

trim creek
#

prob Material.WATCH

chrome beacon
wet breach
chrome beacon
#

Yeah it's watch in old versions

glossy venture
silent steeple
#

1.8

#

watch right

hollow beacon
#

yes

silk mirage
#

how do i force my plugin to use a jdbc driver

#

it seems to use the spigot one

chrome beacon
#

Relocate it

silk mirage
#

What about Class.forName?

chrome beacon
#

You change that the location where the shaded version is

silk mirage
#

Like

#

what if I don't relocate it

#

and just do Class.forName

zenith gate
#

is there any way to add onto existing AttributeModifiers ?

#

without having to remove attribute and add it again

eternal oxide
#

you can;t relocate sqlite

frail gazelle
#

is there any way i am able to make a listener return a value like a boolean?

basically i am trying to make an accept or deny ui where if you hit green, it returns accept and if you hit red, it returns deny

any way to go about this or any alternatives?

hollow beacon
#

create your own event?

#

give us a little more context

trim creek
#

Maybe voids...?

#

void accept()
void disaccept()

noble lantern
#

yeah i dont get why you couldnt just call the method you wanted right after you dont even need any of that

#

if clicked slot == accept slot

run code you want to run when accepted

hollow beacon
#

^

hollow beacon
#

how is this code

public class AchievementTier {

    @Getter
    private final int requirement;

    @Getter
    private final List<String> commands;

    @Getter
    private final Sound sound;

    @Getter
    private final float volume;

    @Getter
    private final String completionMessage;

    public AchievementTier(ConfigurationSection baseSection) {
        this.requirement = baseSection.getInt("requirement");
        this.commands = baseSection.getStringList("commands");

        this.sound = Sound.valueOf(baseSection.getString("sound"));
        this.volume = (float) baseSection.getDouble("volume");

        this.completionMessage = baseSection.getString("completionMessage");
    }
}
#

like the object should not be responsible for loading it's own data

#

but eh it looks clean?

pseudo hazel
#

who else would be responsible

hollow beacon
#

the manager

#

you could pass the data from the constructor

pseudo hazel
#

that would be a monster manager then

#

like if it had to deserialize all data of the things it manages

hollow beacon
#

extremely valid point

pseudo hazel
#

unless you have a manager for every serializable class, which doesnt make sense

weak bear
hollow beacon
#

because you have an error in your SQL syntax

#

show your complete query

hollow beacon
weak bear
#

that's my request

hollow beacon
#

"INSERT INTO housepurchase VALUES (?, ?, ?, ?, ?, ?, ?)"

#

i think

weak bear
#

Okay thx

#

I will try

hollow beacon
#

you might also need to specify the column names

#

row*

#
weak bear
#

Okay thx

echo basalt
#

YOu're not doing IO, you're just parsing cached data

#

Pro tip

#

You can @Getter the whole class

#

instead of each field individually

hollow beacon
#

๐Ÿ˜ฎ

#

lemme change that

echo basalt
#

And I'd also @EqualsAndHashCode

hollow beacon
#

i'm quite new to lombok so that helps

#

thanks : D

shy rock
#
    public void onZombieDeath(EntityDeathEvent event) {
        int zombieLevel = getRandomNumber(minZombieLevel, maxZombieLevel);
        if (event.getEntityType() == EntityType.ZOMBIE) {
            Zombie zombie = (Zombie) event.getEntity();

            int additionalExp = (int) calculateAdditionalExp(zombieLevel);

            // Add the additional experience to the dropped experience
            event.setDroppedExp(additionalExp);
        }
    }

    private static double calculateAdditionalExp(int zombieLevel) {
        int additionalExp = 3 + (zombieExpAddPerLevel * (zombieLevel - 1));
        return additionalExp;
    }```
Im still having problems with this ^, I dont know why custom levels dont get custom exp drops
hollow beacon
#

you have to add the extra exp to the normally dropped exp

#

also debug to make sure it's actually what you want

shy rock
hollow beacon
#

// Add the additional experience to the dropped experience
event.setDroppedExp(additionalExp);

#

you'd do

event.setDroppedExp(event.getDroppedExp() + additionalExp);

#

not sure if getDroppedExp exists but eh something simlair must be there

shy rock
#

huh let me try

near valve
#

Hello, I need help, I am creating a plugin for version 1.19.4 and I don't know how to fix it what imports to use.


package rpg.drop.api;

import net.md_5.bungee.api.ChatColor;
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.protocol.game.PacketPlayOutChat;
import net.minecraft.network.protocol.game.PacketPlayOutTitle;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;

public class TitleAPI {

    public static void sendTitle(Player p, String text) {
        ChatComponentText chatTitle = ChatComponentText.Serializer.fromJson("{\"text\": \"" + text + "\",\"color\":\"" + ChatColor.GREEN.name().toLowerCase() + "\"}");
        PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, chatTitle);
        PacketPlayOutTitle length = new PacketPlayOutTitle(5, 20, 5);
        ((CraftPlayer) p).getHandle().b.sendPacket(title);
        ((CraftPlayer) p).getHandle().b.sendPacket(length);
    }

    public static void sendActionbar(Player p, String text) {
        ChatComponentText icbc = ChatComponentText.Serializer.fromJson("{\"text\": \"" + text + "\"}");
        PacketPlayOutChat actionBar = new PacketPlayOutChat(icbc, (byte) 2);
        ((CraftPlayer) p).getHandle().b.sendPacket(actionBar);
    }

    public static void sendBroadcast(String text) {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.sendMessage(text);
        }
    }
}
eternal oxide
#

Spigot has a sendTitle

#

no need to use packets

noble lantern
near valve
#


import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import net.md_5.bungee.api.ChatColor;
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.protocol.game.PacketPlayOutChat;
import net.minecraft.network.protocol.game.PacketPlayOutTitle;


These imports are not working for me even though I have the api and server engine in the libraries

hollow beacon
#

you don't need those man

eternal oxide
#

use the API not nms

reef flower
#

Hi ! I'm trying to use Reflections in my java plugin but when the plugin try to start, i get this error :

java.lang.ClassNotFoundException: org.reflections.Reflections
noble lantern
#

oh

#

set to compile for scope

#

needs to be shaded into your jar

near valve
robust zenith
reef flower
noble lantern
#

clean package works on maven

and the default shadowJar on gradle should suffice sometimes even build / jar works depending on the scenario

near valve
reef flower
#
plugins {
    id 'com.github.johnrengelman.shadow' version '7.0.0'
    id 'java'
}

group 'fr.chomagerie.plugin'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation 'org.reflections:reflections:0.10.2'
    compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'

}




sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../../../Minecraft Server/1.20.1/plugins')
eternal oxide
hollow beacon
#

no need to use NMS/imports

noble lantern
reef flower
remote swallow
#

shadow jar is gradles shade

noble lantern
green prism
#

Hey there! I have a quick question. Does player.getPing() work, or do I need to utilize CraftBukkit and Reflections?

remote swallow
#

same way you would run build

noble lantern
#

if you want exact use packets

green prism
#

Thank you

reef flower
remote swallow
#

what do you need shadowjar for

reef flower
remote swallow
#

check the jar is correct

#

you should change the jar location inside of the shadowjar task

#
shadowJar {
    destinationDirectory = file("./target/")
}
#

that replaces setLibsDirName('../../../Minecraft Server/1.20.1/plugins')

robust zenith
reef flower
# remote swallow that replaces `setLibsDirName('../../../Minecraft Server/1.20.1/plugins')`

I've just done it but it doesn't change anything, do I need to change anything else?

plugins {
    id 'com.github.johnrengelman.shadow' version '7.0.0'
    id 'java'
}

group 'fr.chomagerie.plugin'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation 'org.reflections:reflections:0.10.2'
    compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'

}
shadowJar {
    destinationDirectory = file("../../../Minecraft Server/1.20.1/plugins")
}




sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
}
remote swallow
#

theresd 2 shadowjar sections in that

reef flower
#

Oh yes !

reef flower
remote swallow
#

run the clean task

#

then shadowJar again

reef flower
hollow beacon
#

you shouldnโ€™t get the jar

remote swallow
#

try and set the destination to something like ./target/ and then check in the jar and see if its shaded

reef flower
remote swallow
#

no clue

reef flower
reef flower
tawdry monolith
#

hey, is there a way to make it so cactus can spawn on any block? I can't find anything online :/

#

place on any block*

zenith gate
#
@EventHandler
    public void onRespawn(PlayerRespawnEvent event){
        Player player = event.getPlayer();

        PersistentDataContainer playerData = player.getPersistentDataContainer();

        if(Boolean.TRUE.equals(playerData.get(new NamespacedKey(Overhaul_Systems.getPlugin(), "DoubleJump"), PersistentDataType.BOOLEAN))){
            player.setAllowFlight(true);
        }

        if(Boolean.TRUE.equals(playerData.get(new NamespacedKey(Overhaul_Systems.getPlugin(), "Healthy"), PersistentDataType.BOOLEAN))){
            player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, -1, 1, false, false, false));
        }

    }

When the player does die and respawns, they are not given the potion effect. But the setAllowFlight is, they can double jump after they respawned, the Regeneration isn't working tho, and I don't quite get why.

noble lantern
echo basalt
#

maybe because you're giving regeneration for a single tick?

noble lantern
#

oh

echo basalt
#

also I'd use a pdc wrapper

tardy delta
#

also could just do if pdc.getOrDefault(..., false)

noble lantern
zenith gate
noble lantern
#

then try a tick later or your if statements are falling through somehwere, try debug logs

zenith gate
#

they arent. its just the potion effect. the if statement does work. i put print statememnts in there.

#

yeah I tried putting the potion effect for 10 minutes and it didn't apply

noble lantern
#

and what about giving the effect one tick later after that event

zenith gate
#

huh. that seemed to fix it, I thought you meant like changing the duration of the effect ๐Ÿ˜…

#

Why has that happened tho? what's the reasoning for it?

noble lantern
#

nah :p

RespawnEvent can be finicky when editing the player object because theyre not actually in the world yet iirc

young knoll
#

Yeah you need to delay most things with respawn

zenith gate
#

huh, okay, that's good to know.

weak bear
#

Hey do you know why I have this error

echo basalt
#

Just change it a bit

#
private final Map<String, CompletableFuture<EnkaUserInformation>> currentRequests = new ConcurrentHashMap<>();
private final Cache<String, EnkaUserInformation> cachedData = CacheBuilder.newBuilder().expireAfterAccess(15, TimeUnit.MINUTES).build();

public CompletableFuture<EnkaUserInformation> fetchData(String id) {
  CompletableFuture<EnkaUserInformation> cachedRequest = currentRequests.get(id);

  if(cachedRequest != null) {
    return cachedRequest;
  }

  EnkaUserInformation cachedInfo = cachedData.getIfPresent(id);

  if(cachedInfo != null) {
    return cachedInfo;
  }

  cachedRequest = CompletableFuture.supplyAsync(() -> {
    ...
  });

  currentRequests.put(id, cachedRequest);
  return cachedRequest;
}
#

Better to manage futures manually

#

So that when your plugin / service shuts down you can join or cancel them all at once and all

#

You can then make the cache a map and use ttl to invalidate data

remote swallow
echo basalt
#

if it doesn't get read

#

there's expireAfterWrite

#

if you want to just get nuked after 15 minutes

#

but given your TTL is variable

#

I'd just use a map

#

guava

#

it's shaded on spigot

#

?whereami

echo basalt
#

shade it then

#

this is literally the official spigot discord server

#

but anyways

#

just shade it if it's your own

#

you do your usual fetch

#

and insert the result in your cache

#

you're probably playing with generic types

#

then you need to make sure that your future does complete with K

#

so supplyAsync(() -> {
...
return clazz.cast(value);
});

#

prolly

#

no

#

can't you just

#

thenCompose

#

OR

#

skip the supplyAsync part?

#

but prolly thenCompose

#

.

#

Not really

#

HashMaps are only serializable if all the keys and values are too

#

it wants another future

#

it kinda merges them

#

yeah that works

#

depends

#

is your original future async?

#

If so, that doesn't matter

#

show code

#

it's async if you just use the supply / runAsync methods

#

ah you create a new future

#

Should work regardless

#

yeah whatever

#

I'd convert your cache to a map and implement ttl manually

#

maybe with some kind of executor going over it every second

#

I guess that works

#

but I'd rather put the ttl on the user information class itself

#

so yeah no point in the bivalue

river oracle
#

Bi value, what can the value not decide what it wants to be

#

Just choose 1 value it needs to stop being so greedy

echo basalt
#

he a little confused but he got the spirit

#

loop through the values

#

make a static executor

#

great question

#

bros cooking

#

meanwhile my dinner just arrived

subtle folio
#

not sure how to get started on coding this, is there a way to scaleably code something like, 1 = 'aaaa', 2 = 'aaab', 3 = 'aaac', and so to z and then it adds to the counter?

echo basalt
subtle folio
echo basalt
#

but you add 26 ^ 4 as the min value

subtle folio
#

Maybe more of a number to letter combo

#

where its acendingly higher

#

aaa > aab correct?

echo basalt
#

opposite

subtle folio
#

if a is the highest then it has to

#

oh

#

omfg

#

im reversed

echo basalt
#

it always points to the smallest

#

or I just see it as pacman eating the best food

subtle folio
#

oh shit

#

fk

noble lantern
#

maybe I'm being stupid but how can I make file have outputDirectory as its parent so I can save it?

echo basalt
#

I feel like your video downloaded event is stupid

noble lantern
#

its async

echo basalt
#

should pass a byte[] which you then save to a file

noble lantern
#

ahh

#

that part

#

lemme see if theres something else

#

maybe theres a stream or smthn instead

primal goblet
#

Hey, i'm trying to make npcs (EntityPlayer w/ Packets)
and i gave him a skin and everything works fine
but the issue is when i try to use packets like headrotate packet or entity move packet
the skin will be not appeared anymore, why?

noble lantern
#

nvm there was this

echo basalt
#
public static final String ABC = "abcdefghijklmnopqrstuvwxyz"; // Feel free to add numbers
public static final int CHARACTER_COUNT = 4;
public static final int ABC_LENGTH = ABC.length();

public static String convert(int input) {
  StringBuilder builder = new StringBuilder();

  for(int index = CHARACTER_COUNT; index > 0; index--) {
    int remainder = input % ABC_LENGTH;
    input /= ABC_LENGTH;

    builder.append(ABC.charAt(remainder));
  }

  return builder.toString()
}
#

hm

subtle folio
#

is there a way to configure the stop message all players see?

#

how ๐Ÿคฃ

noble lantern
#

reflection

subtle folio
#

bruh

#

i wanna use nms

trim creek
#

bukkit.yml

subtle folio
#

and reflection

#

cmon now

trim creek
#

It will handle you your stop message

#

upon using /stop

hard acorn
#

How do I check if a player dies to the ender dragon using magic? (dragon's breath)

#

Also, DamageCause.DRAGONS_BREATH doesn't work

undone axleBOT
#

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

trim creek
#

There are "laws". "Not working" is an useless statement.

noble lantern
#

bruh you cant suppress ignored since when

hard acorn
#

Ok. On player death, I find the player's cause of death. If due to dragon breath, I execute some code. I then tested to see if it would work, which it didn't.

 @EventHandler
  public static void playerInfected(PlayerDeathEvent event) {
    EntityDamageEvent.DamageCause cause;
    try{
      cause = event.getPlayer().getLastDamageCause().getCause();
    }
    catch (NullPointerException ne) {
      cause = null;
    }
    if (cause == EntityDamageEvent.DamageCause.DRAGON_BREATH) {
      Location deathLoc = event.getPlayer().getLocation();
      event.deathMessage(Component.text(event.getPlayer().getName() + " succumbed to the Dragon's Infection."));
      util.zombieReinforce(deathLoc, 1, 0, null, CreatureSpawnEvent.SpawnReason.LIGHTNING, null);
    }
  }
tribal quarry
#

try ethanal, you will be in heaven just in seconds

hard acorn
#

When the player dies to dragon's breath, the death message is "[PLAYER] died to the Ender Dragon using Magic"

trim creek
#

The fact that Cโ‚‚Hโ‚†O is Hungarian, makes you want to feel yourself in heaven already.

noble lantern
#

you can save Locations directly into configs thankfully :)) no need for any parsing

#

save the UUID as a String and load it with UUID.fromString()

trim creek
#

Mostly because I am Szรฉkely as well.

hard acorn
#

in the case of getCause() causing a NullPointerException which my IDE is warning me about

noble lantern
#

uhmmm there is away to save an actual map into yml but im not knowledged enough on that

So, my dumbass would likely go with the 2 lists unless someone else smarter knows how to save maps to yml

#

fr

trim creek
#

Hands up for those who hates NPE

hard acorn
#

...

noble lantern
#

intellij ignoring my suppression warning is even worse

trim creek
noble lantern
#

90% of npes are caused by developers

#

change my mind

hard acorn
#

Okay but what about my original problem?

noble lantern
#

sad seems that one dont work either

#

guess ill have to change it for my whole ide

#

im considering 10% being people doing configs ๐Ÿ˜›

remote swallow
#

if you count interfaces like them sure

echo basalt
#

abstract classes

#

idfk what this guy means by templates

noble lantern
#

yeah as long as you dont shuffle them they are fine

remote swallow
#

probably something in js, or a C varient

noble lantern
#

illusion

remote swallow
#

what

noble lantern
#

how do you save maps in yml

remote swallow
#

do you mean generics

noble lantern
#

for this guy

echo basalt
#

why would I want to save stuff to yml?

noble lantern
#

not for me

hard acorn
#

Thanks for the help!

echo basalt
#

you fuckin

noble lantern
#

someone else, wasnt sure if you knew or not

remote swallow
#

what is a template

trim creek
#

I usually save stats into .yml

remote swallow
noble lantern
#

mongodb ๐Ÿ˜ฉ

remote swallow
#

that is generics

trim creek
#

that doesnt sounds to be Java my friend

echo basalt
#
for(Map.Entry<String, Whatever> entry : map.entrySet()) {
  String key = entry.getKey();
  Whatever whatever = entry.getValue();

  config.set(key, whatever);
}
trim creek
#

or is it

remote swallow
#

its not java, hes wonder if its in java

#

in java its generics

noble lantern
remote swallow
#

thats what im saying

echo basalt
#

generic types

remote swallow
#

no one here will know what your on about then

echo basalt
remote swallow
#

have fun

noble lantern
trim creek
#

do you even use Java, Mr. C2H6O?

noble lantern
#

oop didnt mean to ping

echo basalt
#

is ok

trim creek
#

o.O

echo basalt
#

wtf are you doing here

remote swallow
#

?learnjava!

undone axleBOT
trim creek
echo basalt
#

in help development?

trim creek
#

When I typed a word in #general he immediatly realized I am prob Hungarian. xd

remote swallow
#

they were in general asking about being paid to make plugins

noble lantern
#

a troll i think

young knoll
#

Pretty sure itโ€™s just a troll

remote swallow
#

good luck trying to make money of spigot plugin development

noble lantern
#

sniped

young knoll
#

Not very interesting tho

#

3/10

noble lantern
#

the one that was here yesterday was mildly entertaining

trim creek
noble lantern
#

mainly cause it said controversal dev shit CH_Kek

remote swallow
trim creek
#

Look out for stuff bud

echo basalt
trim creek
echo basalt
#

sorry I don't speak to trolls

trim creek
#

that scared the fuck out of me

echo basalt
noble lantern
#

joe hub

remote swallow
echo basalt
#

bold of you to assume I think java's good

noble lantern
#

alright downloader done

now mp3 -> ogg converter

Then a resource pack creator -> shove into a file hosting

Some buuuulshit

trim creek
#

Dude

#

this is a Java MC software server

echo basalt
#

It's just that c++ is as fast as my mental sanity declining

trim creek
#

why are you even in the server in the first place?

echo basalt
#

let trolls be trolls

#

I don't give a shit

#

no point in getting mad

trim creek
# echo basalt let trolls be trolls

No they can be insane. ๐Ÿ’€
Just visist Quora... ๐Ÿ’€
"My 15-years old son accidentally made my 188,577,283 years old mother pregnant. What do I do?" ๐Ÿ’€๐Ÿ’€๐Ÿ’€

echo basalt
#

I just finished a 5 hour coding session and I'm oughta start another one

echo basalt
# trim creek No they can be insane. ๐Ÿ’€ Just visist Quora... ๐Ÿ’€ "My 15-years old son *accident...

My Mother (19M) Wont Stop Calling Me (15M) Daddy

It all started about 2 weeks ago when my step-sister (24M) got stuck in my spaghetti jar (Marinara), my mother (24F) spirals the jar at my head (246mph). It missed my head and hit my dog (March 5 2002 - October 3 2023). He perished in an instant (Critically Dead). My mother (Tony Pizza) grabs me by the toe and yanks me to the basement (12m x 15m x 11m (Ikea)) and ties me up tight (Very Tight). She put my dogs remains in the chili (Spicy) that she force-fed me with a spoon (Star Wars). She reaches and dangles me step-sister (4mM) but slips on the way back. I (12M) was tied in my basement (12m x 15m x 11m (Ikea)) with no alive family members. I surely starved. But miraculously my mother (Big Jill), with her last slither of life said, "Upvote for part 2..."

subtle folio
#

why does discord still show blcoked message - show message

noble lantern
#

i thought you said you had a map?

echo basalt
#

for loading it's the reverse

noble lantern
#

yeah you just get that hashmap and call values() and keys() on it to get the iterable values of the map

trim creek
#

You can't stop the reality bud.

echo basalt
#
for(String key : config.getKeys(false)) {
  Whatever value = config.get(key, Whatever.class);
  map.put(key, value);
}
remote swallow
#

why dont we have an easy way to type bytes

#

like 1b

echo basalt
#

you have

#

0b00110011

noble lantern
#

oh

#

like longs and floats you mean

#

i see

echo basalt
#

because 0b is used to indicate a binary number

trim creek
#

Hmm... Proof?

noble lantern
#

problem solved

echo basalt
#

โœจ Configuration sections โœจ

trim creek
#

btw Bedrock Edition is yer friend. โค๏ธ

echo basalt
#

they're basically sub configs

#

are you dumb

trim creek
#

True, but MC Java is still, and will always be written in Java.

remote swallow
#

so your reason for loving cpp is its not oop?

#

what a shit reason

#

3 billion devices run java

trim creek
#

I guess?

echo basalt
#

fun fact

#

all the blu ray players run java

#

and most tv remotes

trim creek
remote swallow
#

you do realise java is a compiled language too

#

java is compiled to bytecode

trim creek
#

Don't get me wrong but wasn't Java released in like 1995 or something? ๐Ÿ˜†

remote swallow
#

lmfao

#

you say java is bad but you cant even get ur facts straight

trim creek
#

Uh yeah sure, but you don't get anything forward with "/j", because I understand nothing out of it huh

remote swallow
#

/j is a tone inidcator for a joke

trim creek
#

ahha

#

understood

remote swallow
#

oh no how sad?

young knoll
#

Java is JIT compiled

#

Itโ€™s kind of a weird mix between compiled and interpreted

trim creek
#

Isn't Java compiled like, it needs to go trought another process before it reaches to the CPU's code base or something?

remote swallow
#

go learn skript, im sure you'll love it

trim creek
#

I am sure this will do.

#

And I am fucking sure I fucking hate Skript.

remote swallow
#

what

trim creek
#

Fuck you, @noble frost.

remote swallow
#

i refuse to touch skript, even with a 35ft pole

trim creek
#

Skript is a plugin for Java MC servers, if you didn't know.

#

It has a stupidly odd language to use.

remote swallow
#

you 1st ask about making money from spigot dev then say cpp is the best language ever to exist, so you probably will love skript

echo basalt
#

childish bunch of fucks

trim creek
#

And is a laggy shit

#

lol

echo basalt
#

quit arguing

#

it's a waste if time

young knoll
#

To be fair epic is literally a child

echo basalt
#

not talking about epic

remote swallow
#

correct

trim creek
echo basalt
#

true

#

but

#

you can act like an adult

trim creek
#

Turning 17 some days later.

echo basalt
#

I turned 18 this year

trim creek
#

oh wait I misread

remote swallow
#

skript has a purpose, but that isnt how its used

trim creek
#

Yes I can probably NOT act like an adult

#

Because I hate most adults

#

lol

echo basalt
#

well

#

that's a bit generalized

#

I hate people my age

trim creek
#

But ppl prob can't.

#

Skript isn't meant to do big stuff

#

yet

noble lantern
#

i will argue with every skript user till the end of time

remote swallow
#

well done, it should be used for basic custom commands, or add a drop to when a player dies, not entire servers

trim creek
#

others such as @noble frost tried to make an ENTIRE NETWORK using Skript

echo basalt
#

there's no reason to spend your time learning skript when you can learn java just as fast

trim creek
#

which itself is just pathetic

noble lantern
#

learning java is so satisfying

trim creek
echo basalt
#

I made my own skript thing

#

with a gui

noble lantern
#

especially when you can bang out 300-600 lines at a time and step back and take a look at it

trim creek
#

Felnล‘tti.

hazy parrot
#

maybe 3 if you are fast learner

noble lantern
#

2 if you already know english

trim creek
#

It took me 5 months btw

noble lantern
#

what

echo basalt
#

so is java if you have a brain and an iq above the amount of money in your wallet

trim creek
#

I was like

echo basalt
#

Java took me like a day to learn and many years to master

trim creek
#
on chat:
  cancel event
  broadcast: "asdasdnyalogasd"
#

and I have been struggling

#

FOR MONHTS

#

to realize

#

: is unneeded

#

XDD

young knoll
#

Skript is such a weird format

echo basalt
#

but there were definitely "click" moments like when I learned about hashmaps, lists

young knoll
#

Itโ€™s like SQL but even more cursed

echo basalt
#

or when someone said we were registering a listener twice and OOP just instantly clicked

noble lantern
#

uhm

echo basalt
#

it's in the name

noble lantern
#

a loader

trim creek
#

Isn't it the loader?

noble lantern
#

for classes :>

trim creek
#

alias the main?

subtle folio
#

is there such a thing as Cron jobs in spigot?

echo basalt
#

just like EA is in the game

trim creek
#

(I usually call the main class Loader)

noble lantern
#

class loader is used if you wanna do some fuck shit like read files inside your jar file

#

bunch of other shit too but, i used it for that once

echo basalt
#

more like inject your custom class replacement

noble lantern
#

i remember it being like around the code involved in it

#

yeah i did do that as it was a copy of bento box's module loader lmao

echo basalt
#

jar file scanning is quite simple

noble lantern
#

as long as you have Reflections :>

echo basalt
#

nope

noble lantern
#

fuck it without that

echo basalt
#

you just new JarFile(file)

#

and fuck with it

noble lantern
#

read inside your own jar file though

young knoll
#

Yeah you can do that

noble lantern
#

i remember something about it being complex and it had to be a huge reflection fuck up

trim creek
#

stuff you set

#

otherwise null

remote swallow
#

primitive or boxed

trim creek
#

afaik

young knoll
#

I sometimes extract all the files in my resource folder using JarFile

echo basalt
#

primitive is just the primitive's default value

#

otherwise it kinda has none

#

and complains that it's unset

#

that's only for method variables tho

#

anything else is null

#

โค๏ธ

noble lantern
#

and you can read packages of a JarFile?

echo basalt
noble lantern
#

during runtime?

echo basalt
#

I use it to copy across all the .yml files

young knoll
#

^

#

You can also read code files too tho

#

I used it for some janky auto registration

echo basalt
remote swallow
#

lombok @UtilityClass

echo basalt
#

fuck off

noble lantern
#

wonder why this never showed up when i googled "how to read classes from a package during runtime in java" online before

echo basalt
#

you and your extremely roundy font

echo basalt
remote swallow
#

my font looks normal

noble lantern
#

it was all really complex reflection or using Reflections lib

young knoll
#

Lombok bad

echo basalt
noble lantern
remote swallow
echo basalt
#

mf got a 25k monitor

remote swallow
#

its like 1080p 144hz

echo basalt
#

top is yours

echo basalt
#

even my main 2k 144hz can't be that roundy

young knoll
#

Future fonts

remote swallow
#

get shit on

subtle folio
#

no need for pointers in modern languages

remote swallow
#

love arial

young knoll
#

Isnโ€™t arial just Times New Roman but Microsoft

remote swallow
#

idfk

#

arial is just the best

echo basalt
#

I just use times new roman

#

that explains it

remote swallow
#

get shit on

echo basalt
#

nah

#

I can't bother being corny with my browser

#

just use default settings

#

update once the thing turns red

#

maybe if you could shut the fuck up for a moment

#

you'd understand that all the variables passed around are basically pointers

hazy parrot
#

why is it good

echo basalt
#

except for primitives

#

if you want manual memory management

#

Unsafe is the class for you

hazy parrot
#

there is literally no reason for using dynamic allocation in modern times, and basically everyting in java is pointer passing wise as illusion said

echo basalt
#

you can..

#

do that

hazy parrot
#

you can do that without pointer xd

echo basalt
#

arrays are objects

#

you can do a Map<String, byte[]>

#

it's cursed

#

and I use it at work

#

quite a bit

#

sure

hazy parrot
#

literally only reason i use dynamic alloc in cpp is if object have to outlive current scope, literally no other reason, and in java, you can do that easly

echo basalt
#

you're just salty that there's no spigot api made in c++ so you can cry about the memory leaks

hazy parrot
#

and lets say polymorfism, which you also dont need pointers for in modern languages

#

XD

#

pOwEr

echo basalt
#

just block em honestly fuck it

#

this feels as good as the day I blocked magmaguy

hazy parrot
noble lantern
#

I tried googling but honestly couldn't find anything on this:

How can I convert MP3 -> OGG? Is there no libraries/native ways for this?

remote swallow
#

ffmpeg mayb

subtle folio
#

lol

noble lantern
#

no like

#

code wise

young knoll
#

Play it through your speakers and then record it again from the mic

noble lantern
#

bet

subtle folio
#

ffmpeg

#

has a java lib

remote swallow
noble lantern
#

alright then

subtle folio
#

i never lied

#

until i said i was good at java

echo basalt
#

UUID.toString

#

UUID.fromString

noble lantern
#

holy fuck

echo basalt
#

You can

noble lantern
#

9mb

echo basalt
#

It's called

#

Configuration sections

#

yml is honestly a bad database schema

#

this is just basic java serialization

noble lantern
#

mongo + pojo

Or

Json + pojo

#

i vote json

#

spigot comes with gson

echo basalt
#

or yml + pojo but properly done

#

or just be a little bitch like me

noble lantern
#

gl finding a lib for that CH_Kek

echo basalt
noble lantern
#

i wish json was more widely accepted

#

ah sqllite lmao

#

you can

#

x/y/z/yaw/worldUuid

echo basalt
#

you can if you serialize them

#

it's called

#

converting to a string

#

yikes

young knoll
#

Make everything a byte array

#

Computers store everything as bytes anyway!

noble lantern
echo basalt
#

and make your plugin download shit

noble lantern
#

never heard of that whats that, or at least the naming is different to me

#

no the way illusion sent is how it should be done

#

i dont get the issue

#

one sec

#

you cant have multiple same-keys in a map

#

they get overridden

#

sooo?

young knoll
#

The power of multi map

noble lantern
#

why are your keys the same in the first place lmao

#

its a key

#

you only need one uuid and a list of locations

#

HashMap<UUID, List<Location>>

young knoll
#

Or if you want to be fancy

#

Multimap<UUID, Location>

noble lantern
#

oh that sounded like a external lib

young knoll
#

Itโ€™s guava

noble lantern
#

lol il try that one day

young knoll
#

Which is in spigot

noble lantern
#

ah so spigot

#

neat imma give that a whirl

young knoll
#

Itโ€™s just a nice wrapper for Map<key, List<value>>

noble lantern
#

i use it quite a bit in musepluse for the queues + music track loading

#

its a < <>> < <>> <<> <>><> fest lmfao

subtle folio
#

not musey plusey

#

canโ€™t believe you keep listening to me for james

#

names

#

i thought it would stop after homosexualdemon

echo basalt
#

I gotta stop designing protocols honestly

noble lantern
#

musey plusey getting a big updataty waty ๐Ÿคฃ i couldnt find a way to type this out lmfao

noble lantern
subtle folio
#

pls donโ€™t ever stop

echo basalt
#

somehow I managed to make this work

(master -> client1) Yo this template is updated [skywars, abc123}
(client1 -> master) Ye, I need the files with the hashes "12ab34cd" and "aaabbbccc"
(master -> client2) Yo here's a request that belongs to client1, as far as I'm aware you're already synched based on what you said before
(client2 -> client1) Yo here's the shit you requested, bossman ordered
(client1 -> master) Yo thanks for this, I'm up to date now (unlocks client2 to proxy another request)

#

took me 2 hours to write all the logic but it works in theory

subtle folio
#

how are you coding all this? just with spigot plug-ins?

echo basalt
#

no

#

standalone java thing

subtle folio
#

thought so

#

yeah

echo basalt
#

just a few java classes

subtle folio
#

okay

pine lake
#

Hello how can I apply enchantement/custom meta on crafting?

young knoll
#

PrepareItemCraftEvent

pine lake
#

I though it was CraftItemEvent

young knoll
#

Well you probably want them visible before they actually craft it

pine lake
#

Thx it worked!

next zinc
#

?paste

undone axleBOT
next zinc
hard acorn
#

How do I properly set the color of an AreaEffectCloud? This is the code for the AEC that spawns when a dragon fireball hits, but it doesn't go through. Using .getColor() I can see that the color actually does change in code, but I can't see it in game

 @EventHandler
  public static void onDragonballImpact(EnderDragonFireballHitEvent event) {
    Location loc = event.getEntity().getLocation();
    event.getAreaEffectCloud().setColor(Color.GREEN);
    for (LivingEntity z : loc.getNearbyLivingEntities(8)) {
      if (z instanceof Zombie || z instanceof EndZombie) {
        Location transfo = z.getLocation();
        z.remove();
        util.zombieReinforce(transfo, 1, 0, null, CreatureSpawnEvent.SpawnReason.LIGHTNING, util.getRandomSpecial());
        transfo.getWorld().strikeLightningEffect(transfo);
        for (Player p : transfo.getNearbyPlayers(50)) {
          p.playSound(transfo, Sound.ENTITY_LIGHTNING_BOLT_THUNDER, 100, 1);
        }
      }
    }
  }
next zinc
#

not sure if that will work but give it a try

#

and then change the Color to Color.GREEN or BGR whatever you want

hard acorn
next zinc
#

I have a ability I made right in front of me that has the same AreaEffectCloud entity that was colored so I just went for it and sent that message

#

Glad it works tho

woeful crown
#

is there a list of minecraft blocks/items that aren't entities and that break when the block it's attached to breaks, such as torch, pressureplate, button, various plants.