#help-development

1 messages · Page 284 of 1

rotund ravine
#

It's quite a big grid tho

pale hazel
#

Okay, that makes more sense. I am bit new to using an API so all of this is overwhelming

dry yacht
#

My lord, how can there be such controversy to such a simple API, hahaha :,D. I love it tho, keep on going, xDD.

rough drift
#

I gtg soon though

#

Tomorrow I'll have the API sort of usable

#

Going now though

rotund ravine
#

huh

#

why are yo ueven setting it btw?

#

The default stuff is already that.

sterile token
rotund ravine
#

If you transpile it yourself lol

#

just turn it off in settings

sterile token
dry yacht
rotund ravine
#

He is gonna make a pull request to spigot itself

#

not a plugin

sterile token
dry yacht
sterile token
#

Na haha dont get mad Jan, im just fucking tho because i used to be 1.8 developer. Now only +1.16 comissions

vocal cloud
#

Still gotta work on my @Since stuff lol

gleaming grove
#

They does, great flawless Bedrock version is made with C++

sterile token
#

What properties will you put for a Group object? So far i have name, weight, prefix and nodes

dry yacht
#

Group object? Parents are missing, if I understand you correctly. And what do you signal with weight?

sterile token
dry yacht
#

Yeah then, parents, most definitely. And a list of negative permissions which are subtracted from them and stop propagating down the inheritance chain.

dry yacht
sterile token
#

Okay, can you explain the propagtion part?

sterile token
dry yacht
#

Well, if a group has a parent, it inherits all of those permissions in it's #hasPermission check, but it does not own those permissions itself. If you have Group C inheriting from group B which inherits from group A and group A gets my.example, B gets -my.example, C will not have my.example, as B blocked it. B will also not have it.

sterile token
#

Do you think this way of saving/loading is correctly? or will be any better

vocal cloud
#

Mongo sad

quaint mantle
#

How I know plugin's RAM usage?

sterile token
dry yacht
dry yacht
sterile token
#

I mean not only have to sync between a network i have to sync around different proxies 💀

#

Its not so simple tho

#

HAHAHAH

quaint mantle
#

Lol

vocal cloud
#

Use one global sqlite file /s

halcyon lintel
#

Can someone help me im tryna make a server with a strength 2 area basicly when ever u go inside the area u get strength 2 but if u leave it goes away if that makes sense can someone help me with the script pls

sterile token
dry yacht
sterile token
#

They told me i must use something like RabbitMQ

vocal cloud
sterile token
vocal cloud
#

But it's still loading the whole document

sterile token
#

I mean im not wondering to fuck with this, just understand why most people use Sql

vocal cloud
#

Assuming you're mapping PoJo

sterile token
#

Im not using Pojo´s so far, because it cause me lot of issues

vocal cloud
#

SQL allows you to get only the data you need from queries

#

Since it's relational it also works better for things that require relationships

sterile token
dry yacht
dry yacht
sterile token
dry yacht
#

Just wondering how you got into such a massive project.

sterile token
#

I mean i dont discard it tho

#

Such a big history hahaha

dry yacht
# sterile token Such a big history hahaha

Because, not trying to be mean, but I think you might bite off a bit more than you can chew with that implementation. LuckPerms (i think) also does this stuff, and it's a huge ass sophisticated project. You might burn yourself out in trying to create something similar.

sterile token
#

I join caused a Russians recommend me in that project but i never realize until the owner contacted me and told me if where interested

dry yacht
#

It does? Damn you, point taken...

#

I mean... well, that doesn't dictate how one has to design their API, by no means.

sterile token
#

And my face was 🤡

dry yacht
#

I think you should support both, as the tab instance knows it's width, so why make caller have to use their brain to calculate stuff...

gleaming grove
#

Like if you want to use RabbitMQ you will have to implement event driver architecture

dry yacht
gleaming grove
#

It's harder then Http or direct push to database because you will not get response if data has been saved to database

sterile token
#

What is scratch?

dry yacht
dry yacht
sterile token
#

oh ok

#

Dont bullet me im not native speaker

trim creek
dry yacht
dry yacht
dry yacht
zealous glen
#

Can we just delete this please

#

if I get hacked idc

#

this is the most annoying shit at least add google authenticator support

proper notch
#

Other people care when users upload malware to spigot

#

oh also, there is google authenticator support....

#

I legit use Authy on my account

#

Hover on your profile -> Two-Step Verification -> Verification Code via App

zealous glen
#

I'm not an idiot who downloads random shit

#

bro why are you typing to me do you have aspergers?

#

I know its catered to children like you 🙂

dry yacht
#

Nope. You also don't have to send raw bytes over HTTP just because TCP does. It's called abstraction. If I, as an API designer, think that rows and cols are a better fit, I can translate internally without letting this detail bleed through.

But please, let's just settle on our agreement of adding both slots and grid methods, xDD

rotund ravine
#

What are you on about

#

google 2fa is supported.

dry yacht
#

lrighty, I'mma head out.

zealous glen
vague swallow
#

Hello,
This is my code which is supposed to move the entity to the players position with a vector which is perfectly working, when both locations have the same y-coordinate. If not then the entity flys way higher than the player is and also far beyond the players location. Does anyone have an idea why and what I can do to prevent this?

Entity e = player.getTargetEntity(distance(p), false);
assert e != null;
Location loc = e.getLocation();
Location target = player.getLocation();

int aX = target.getBlockX();
int aY = target.getBlockY();
int aZ = target.getBlockZ();

int bX = loc.getBlockX();
int bY = loc.getBlockY();
int bZ = loc.getBlockZ();

int x = aX - bX;
int y = aY - bY;
int z = aZ - bZ;

Vector v = new Vector(x, y, z).normalize();
v.multiply(loc.distance(target)/2.7);
e.setVelocity(v);
dry yacht
atomic swift
#

was EntityPickupItemEvent switched to PlayerPickupItemEvent

#

or did it just not exist in 1.8.8

gleaming grove
vague swallow
#

because IntelliJ warned me that it could be null but I checked earlier if it was null or not. It's just a formality

dry yacht
# dry yacht Hmmm, those last three lines seem kind of weird to me tbh. You're normalizing th...

I have forgotten how minecraft applies velocities, but from knowing that velocity is speed in m/s, I guess it applies 1/20 * velocity to the target's position at every tick, to apply the whole vector every second. You'd have to consider drag as well, which is dependent on the distance travelled.

What you want to accomplish is move the entity along the vector between the player and itself (end - start, as you correctly calculated). The simplest way of doing this in a linear motion, you could teleport the entity along the path this vector dictates by multiplying it in the range of [0;1] in a loop, taking step sizes in a way that you have consistent velocity no matter of distance. This teleportation could be performed on every tick, as it's not really any more expensive than sending out move packets (which the server essentially does) every tick.

Velocities in minecraft always weirded me out tbh, maybe I'm just stupid.

vague swallow
gleaming grove
#

Ye

vague swallow
#

and teleport the entity every tick along the vector?

dry yacht
dry yacht
dry yacht
vague swallow
dry yacht
vague swallow
#

but that would instanly teleport the entity to the player

torn badge
#

loc = playerLoc + (target - playerLoc) * Range(0;1)

dry yacht
vague swallow
torn badge
#

Location playerLoc = player.getLocation().clone(); for (double t = 0 ; t <= 1 ; t += 1/20D) { Location loc = playerLoc.add(targetLoc.clone().subtract(playerLoc).multiply(t)); player.teleport(loc); }
Written on my phone

#

But in a scheduler

#

Because that would just teleport to the end within the same tick

echo basalt
#

oh god please use actual variable names

zealous scroll
#

Is there a way to check if an inventory was opened to the player by a plugin? I'm trying to replace crafting UIs from crafting tables but not from commands owned by other plugins

echo basalt
#

but yeah you basically want to lerp between 2 points

dry yacht
vague swallow
torn badge
#

t is a common variable name for lerping

#

In C#

dry yacht
echo basalt
#

one-letter variable names should be reserved to x, y and z

torn badge
#

What about i, j, k?

echo basalt
#

nope

zealous scroll
echo basalt
#

i -> index/iteration

#

j and k make no sense

dry yacht
# vague swallow thanks!!!

Just gonna take a few minutes as I actually want to give you something that's efficient and understandable.

vague swallow
dry yacht
vague swallow
#

XD

echo basalt
#

Variable names should be short yet meaningful.

torn badge
#

Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters.

echo basalt
#

Each company follows different code styles

#

For example, Google Style

torn badge
#

Yeah okay but it’s still a Oracle convention

#

And I have seen this in all kinds of programming languages

torn badge
dry yacht
torn badge
#

t += 1/duration

wet breach
#

?conventions

dry yacht
# torn badge t += 1/duration

Ah yeah, sorry, I misunderstood that part. Of course the duration is choosable, depending on the delay between iterations.

torn badge
wet breach
#

yeah but the bot is better

torn badge
#

True

vague swallow
#

Why is player.getTargetedEntity() only returning LivingEntities and no other entities? Is there a way to return all targeted entities not only the LivingEntities?

chrome beacon
#

That method is not part of the Spigot API

hazy parrot
#

Guy from whereami gif making mistake again

vague swallow
#

Oh that's why I didn't find it lmao

dry yacht
vague swallow
dry yacht
dry yacht
vague swallow
#

Thanks so much

humble tulip
#

Has anyone benchmarked using reflection with cached methods and classes?

dry yacht
# vague swallow bro this helped me A LOT

I actually hope that it works, because it has been a long ass time since I had to think about all of that, xD. Love to help, as I actually know exactly how it feels to be overwhelmed by things like these.

dry yacht
young nimbus
#

Hi, i bought a server a few weeks ago, everything worked fine. Since today when i run a command of a plugin that i wrote, after 1 minute my server crashes and gives the error Startup script './start.sh' does not exist! Stopping server. Can someone help me? I didn't made any changes on the server, just uploaded my plugin

civic apex
undone axleBOT
humble tulip
#

Send your code as well

#

Methinks infinite loop

#

Any guesses?

chrome beacon
#

Yeah probably

dry yacht
civic apex
#

so i dont have to get them each time

#

it should be faster

humble tulip
#

Yes that

young nimbus
dry yacht
# civic apex so i dont have to get them each time

I only use cached reflection then, as my library searches all dependencies (class, method, field, constructor handles) in the constructor of the class trying to work with them so the plugin won't even load if we're not compatible.

hazy parrot
civic apex
hazy parrot
#

Or its only kotlin

civic apex
young nimbus
#

My command runs titles, after the 6th Title (1minute delayed) it crashes

civic apex
#

i dont think getdeclaredclass has cache implemented

dry yacht
# humble tulip Yes that

I doubt that it's much worse than direct access, as a Field should basically provoke a field access instruction with the overhead of a method call, right?

humble tulip
civic apex
#

and for fields i have static fields set to accessible

#

(when needed)

#

i know for a fact mine has to be faster than non cached

rotund ravine
#

Unless u tell it to

dry yacht
rotund ravine
#

It has the lazy access

civic apex
#

because to get some classes i have to perform operations with streams (or for loops alternatively), and doing that each time is slower

dry yacht
rotund ravine
civic apex
dry yacht
civic apex
#

i call .getdeclaredmethods then filter

young nimbus
civic apex
#

discord?

humble tulip
civic apex
#

how have i not read my own message

young nimbus
#

damn

rotund ravine
humble tulip
young nimbus
#

i am such a idiot haha, bought 5gb extra ram haha

humble tulip
#

Do something x ticks later?

dry yacht
rotund ravine
young nimbus
humble tulip
#

?scheduling @young nimbus

undone axleBOT
young nimbus
#

thanks

civic apex
#

anyways, im having a problem setting a player's gamemode

dry yacht
dry yacht
civic apex
#

its not working

dry yacht
#

...

civic apex
#

i run this on PlayerJoinEvent

#

(debug stuff)

hazy parrot
#

Why don't just... Player#setGamemode or smth

civic apex
#

this is the output, and the gamemode is survival

civic apex
#

the api just calls the nms method and ignores its return type iirc

spice shoal
#

Guys , can it work??

`import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.Event;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.plugin.EventExecutor;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import static org.bukkit.Bukkit.getServer;

public class Eventi implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
FileConfiguration config = getConfig();

    if (config.getBoolean("block-break")) {
        getServer().getPluginManager().registerEvent((Class<? extends Event>) BlockBreakEvent.class, (Listener) this, EventPriority.NORMAL, (EventExecutor) new BlockBreakListener(), (Plugin) this);
    }

    return false;
}

private FileConfiguration getConfig() {
    return null;
}

}`

dry yacht
#

<insert your favourite indent hell meme here>

civic apex
spice shoal
civic apex
#

as oggm (original gamemode) is survival and the gamemode im trying to set is spectator the only way "gm" could be false is if PlayerGameModeChangeEvent is cancelled

hardy garnet
#

Hey guys! i'm having an issue with world creator. When making the new world, players end up being disconnected due to it taking too long. Is there a way I can prevent this

civic apex
#

the thing is i only have my plugin, which never cancels that

#

plus after that p.getGameMode is somehow spectator, which shouldnt be the case if setGameModeForPlayer returns false that way

dry yacht
#

How is something that simple not working

civic apex
rotund ravine
humble tulip
#

Wait you mean the world takes so long to load?

hardy garnet
# humble tulip ??

In actuality its loading an already created world, but while its creating the spawn it takes too long and players get disconnected

dry yacht
# rotund ravine Looks great

Just joking btw, that's normal code, xD. Not one of those "never-nesters", although I love unnested code where ever possible.

civic apex
rotund ravine
#

I should probably have used something other than triple, but was too lazy.

#

The names of the classes are also a bit weird

civic apex
#

if you remove the braces

#

its not pretty

#

but ¯_(ツ)_/¯

dry yacht
#

Btw, what the hell is a ServerPlayer

humble tulip
#

What's the actual solution to triple for loops

#

To orevent nesting

humble tulip
#

Duh

civic apex
torn badge
civic apex
#

which i dont remember the name of

dry yacht
rotund ravine
#

Probably old EntityPlayer

civic apex
dry yacht
#

Oh, okay. I'm just still stuck in 1.8 times, sorry, xD.

torn badge
spice shoal
rotund ravine
dry yacht
#

This doesn't return a boolean, what version are you on?

torn badge
civic apex
#

i knew something felt wrong

dry yacht
# spice shoal why?

That was a joke, sorry for the sarcasm involved. I have no idea actually, as I'm about to pass out after multiple nights of next to no sleep and a full day of coding. Sorry, but I cannot help you right now, you ask way too much with way too little context and explanation.

civic apex
dry yacht
civic apex
#

im calling .a()

civic apex
#

just the mojang mapped version

civic apex
dry yacht
#

Oh come on, .a is a void too

#

What version are you on, 1.19?

civic apex
civic apex
#

im a certified 1.19 hater

torn badge
#

@civic apex Delay it by 1 tick

civic apex
#

sometimes it did

#

didnt test too much

dry yacht
# civic apex huh

Yeah, at 1.13 it's not a boolean yet, they changed that. I was on 1.13

torn badge
#

Then there must be something wrong on your side

#

Show your whole code

civic apex
#

._.

civic apex
torn badge
#

And please don’t use nms for setting a game mode 😂

#

Your entire listener

civic apex
civic apex
#
@EventHandler
    public void onJoin(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        recentQuitPlayers.remove(p.getName());
        if ((!Uhc.gameManager.isStarted()) || Uhc.gameManager.getAlivePlayers().contains(p.getName().toLowerCase())) return;
        PlayerDeath.setupDeadPlayer(p);
    }```
dry yacht
#

Hmm, depends on which path gave you the false

civic apex
#

uhc plugin yes

dry yacht
#

Are you sure there are no other plugins listening for events?

civic apex
dry yacht
#

You did what?

#

...

torn badge
#

setupDeadPlayer sets the game mode?

civic apex
torn badge
#

Okay now try delaying that by 1 tick

civic apex
#

i already have previously

torn badge
#

Just the entire method call

civic apex
#

k

torn badge
#

And then show your entire setupDeadPlayer method too

civic apex
#
public static void setupDeadPlayer (Player p) {
        p.setHealth(20);
        p.spigot().respawn();
        Player teammate = UHCTeam.findTeammate(p);
        p.teleport(teammate);
        ServerPlayer sp = ((CraftPlayer) p).getHandle();
        Bukkit.broadcastMessage("oggm " + sp.gameMode.getGameModeForPlayer() +"\ngm " + sp.setGameMode(GameType.SPECTATOR));
        Bukkit.broadcastMessage(p.getGameMode().toString());
        new BukkitRunnable(){
            @Override
            public void run() {
                p.spigot().respawn();
                teammate.addPassenger(p);
            }
        }.runTaskLater(Uhc.getInstance(), 1L);
    }```
#

ik im calling respawn twice also for debug

torn badge
#

You call respawn after setting the game mode

civic apex
#

does that set it to survival?

torn badge
#

Possibly

dry yacht
young nimbus
civic apex
#

wow respawn's big

humble tulip
#

index += 2;

vague swallow
civic apex
civic apex
#

its different

#

preference ig

young nimbus
humble tulip
#

ah

#

that's not eclipse

dry yacht
#

You cannot change a variable's value inside a lambda expression. It only captures it's value, but that's immutable then.

humble tulip
#

I'll send an example of how to do it

young nimbus
#

thank you, appreciate it

dry yacht
#

You'd need an AtomicInteger, which is a pointer to an integer, which you can then call incrementAndGet on

rare rover
#

Is there any good alternatives for teleporting an armor stand every 1 tick, im moving it up and down while rotating it

#

Make it look as smooth as possible

#

I could do 3-5 ticks ig

dry yacht
#

Btw, you're not stopping the task either. Return doesn't stop the task.

humble tulip
#
        Bukkit.getScheduler().runTaskTimer(Main.getInstance(), new Runnable() {
            
            int index = 0;
            
            @Override
            public void run() {
                
                if (index >= titles.length) {
                    // We've displayed all the messages, stop the task
                    return;
                }

                String title = titles[index];
                String subtitle = titles[index + 1];

                // Display the title and subtitle
                player.sendTitle(title, subtitle, 1, MESSAGE_DELAY_TICKS, 1);
                player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f);

                index += 2;
            
            }
        }, 0, MESSAGE_DELAY_TICKS);
young nimbus
#

thank you very much!

humble tulip
#

replace return with cancel()

#

also why are you doing index+=2?

dry yacht
humble tulip
#

dont tell me you have titles and subtitles in the same array

dry yacht
humble tulip
#

have a title array anda subtitle array

dry yacht
humble tulip
#

ArrayIndexOutOfBoundsException

rare rover
#

Aka performance

dry yacht
humble tulip
#
String title = titles[index];
String subtitle = titles[index + 1];
humble tulip
dry yacht
dry yacht
rare rover
#

Oh, bet okay thank you

chrome beacon
#

Also ..
?main

humble tulip
#

for low level languages anything goes because you want efficiency

humble tulip
chrome beacon
#

?main

humble tulip
chrome beacon
#

Missed that index variable

#

Mb it's 3am

young nimbus
dry yacht
young nimbus
#

i need to go to sleep, ugh

humble tulip
#

that's where it is

#

but what type of exception?

young nimbus
#

org.bukkit.command.CommandException: Unhandled exception executing command 'regeln' in plugin PravenRegelSystem v1

chrome beacon
#

Just send the entire thing..

humble tulip
#

you have int index = 0 twice btw

chrome beacon
#

?paste

undone axleBOT
young nimbus
dry yacht
#

Send Main.java

humble tulip
#

plugin is null

#

Main.getInstance is returning null

young nimbus
dry yacht
#

You probably got a messed up singleton pattern somehow

humble tulip
#

did you do intance = this in onEnable?

#

ofc not

dry yacht
young nimbus
#

ohhhh

humble tulip
#

put instnace = this

#

at the top of onEnable

young nimbus
#

in onenable right

#

aight

humble tulip
#

yh

chrome beacon
#

Or use di

#

?di

undone axleBOT
humble tulip
#

eh he's new

chrome beacon
#

Good time to learn good practices

humble tulip
#

let them have fun first and then learn better practices

dry yacht
chrome beacon
#

Di isn't exactly hard?

humble tulip
#

it isnt

#

but singletons work

dry yacht
# chrome beacon Di isn't exactly hard?

Maybe not for somebody who knows programming well, no. But programming is not exactly natural logic, you're not born with it. So some people need to take it slowly.

dry yacht
young nimbus
#

thanks @humble tulip

humble tulip
#

np 🙂

#

gn guys

#

gonna sleep

young nimbus
#

gn

civic apex
dry yacht
#

Basically because of coupling. You're locking yourself in.

civic apex
#

in bukkit development at least

#

theres one and only one javaplugin, and only one will ever exist

dry yacht
#

Passing a Plugin (interface) as a parameter doesn't couple you to a main class called "Main", it only couples you to bukkit's API. If you copy the file in another project called "Playground", you'll have to rename all "Main" symbols.

civic apex
#

di isnt more performant afaik

dry yacht
civic apex
dry yacht
civic apex
civic apex
humble tulip
#
                ByteBuf newDS = (ByteBuf) pds.newInstance(Unpooled.buffer());

                writeVarInt(newDS, windownID);
                writeVarInt(newDS, windowType);
                BaseComponent[] component = new ComponentBuilder().bold(true).appendLegacy(ChatColor.RED + "Coool enderChest :)").create();
                byte[] newMsgByteArray = ComponentSerializer.toString(component).getBytes(StandardCharsets.UTF_8);
                writeVarInt(newDS, newMsgByteArray.length);
                newDS.writeBytes(newMsgByteArray);

                readPacket(newDS);

                Object newPacket = con.newInstance(newDS);
dry yacht
# civic apex

Sure thing, have a smaller constructor but end up in couple hell.

civic apex
#

also i dont know if im going to need a plugin instance

chrome beacon
#

How often do you even have a massive constructor

dry yacht
civic apex
#

so if i dont i make the constructor w/out

civic apex
dry yacht
civic apex
#

i do create utils but per plugin

dry yacht
#

If a single class has a huge ass constructor, you're not segmenting it's responsibilities well enough.

#

And having many files in OOP projects is a shitty argument in my opinion.

civic apex
dry yacht
dry yacht
#

If you hate wiring constructors so much, use an auto-injector.

echo basalt
#

it's not even that hard

echo basalt
#

type in your variables and alt+insert a couple times

#

or lombok

dry yacht
chrome beacon
#

^^

#

;/

civic apex
#

not saying its hard to make

#

i just dont like having to specify a plugin instance per constructor

dry yacht
# civic apex whats that

A central registry where you register all your available dependencies and it invokes the constructors and matches instances for you.

echo basalt
#

then specify JavaPlugin

civic apex
#

ofc if i was writing a library i would do that

dry yacht
echo basalt
#

tfw your main has more "this" than actual words

chrome beacon
dry yacht
limpid bloom
#

Need a bit of advice, I am in a big project and I am making something to help do something faster and semi automatic, right now it’s a plug-in but I need it to be faster , problem being I am new to making plugins and kind of new to Java so while everything works, it needs to be faster , rn the plug-in can do an area of around 8mil blocks in about 3-4 seconds but when I need it to check an area of around 500m +, maybe up 1 billion blocks, well the plug-in needs to be better, rn when trying to do large areas the plug-in lags the server so much it crashes , rn it’s not asynchronous so it lags the server quite a bit, for every block in the area it has to check some blocks around it, about 12-24 blocks total and then it decides if it is changing the main block so a lot of checks , rn I am the crossroads, do I continue trying to make plug-in better and not crash the server when doing the volumes we need it too, segmenting the total area to do one after another (in game), or piggy back off of fawe and try to Learn and use craftscript , any help for either option or a different option that may be better .

civic apex
#

why are you in a big project if you are new to java and plugins?

chrome beacon
#

What's the command for load balancing again? I forgot

chrome beacon
#

Just split the scanning of blocks over multiple ticks so the server doesn't crash

limpid bloom
dry yacht
echo basalt
#

the plugin class is usually just like a central hub

#

contains trackers, managers and all

civic apex
#

whats a tracker

echo basalt
#

90% of cases it's just this

remote swallow
civic apex
#

is it a good idea to make listeners/command handlers register themselves

#

?

echo basalt
#

as it's not explicit

civic apex
#

why?

limpid bloom
# civic apex oh

For more context , the world for the project is around 4gb…….. Compressed. Around 20gb on disk , not going through all of it though

civic apex
echo basalt
#

it somewhat breaks single-responsibility principle too

civic apex
#

how?

echo basalt
#

Classes usually stick to a few types

dry yacht
# echo basalt the plugin class is usually just like a central hub

Tbh, I don't think that this is deal. I think the best solution lies somewhere in the middle, where you register all dependencies and all classes which need to be singleton instantiated, and the tool then figures out in which order to create them, if they require each other. That way, you still got references to their symbols and dead code elimination will be applicable, but you can just add another arg to the constructor and don't have to change up the wiring or in the worst case: even the order of instantiation.

No idea why you're against a bit of automation there.

civic apex
#

listeners do that, listen, so why not register them (something required for listening) on their own class

echo basalt
#

You have data classes, handlers, managers

#

Making a data class register itself to the manager starts to... do the manager's job

#

It's like getting hired at a company, going to HR and filing in your details yourself into the database

civic apex
#

a listener is a data class?

echo basalt
#

Not strictly

#

It's odd

civic apex
echo basalt
#

not really

#

you're still creating objects

civic apex
#

¯_(ツ)_/¯

civic apex
dry yacht
# echo basalt no

Depends. The command handler should know what it's invoked by, so why delegate registration to the constructor caller? I usually have an interface which has a method called registerSelf(Plugin).

civic apex
#

but you dont need to see that big chunk of text saying .register a million times

echo basalt
civic apex
#

which isnt important

#

so its distracting

echo basalt
#

you can make separate methods for those

civic apex
#

i have

echo basalt
#

It's difficult to explain grr

civic apex
#

but still

echo basalt
#

hard to explain my code style that I've developed over the past 11 years

dry yacht
civic apex
#

this just doesnt look the best

dry yacht
civic apex
#

not about efficiency either

echo basalt
#

mans coding in the minecraft font

echo basalt
chrome beacon
echo basalt
#

I write my code strictly focused on performance and readability

dry yacht
#

It's about how stupid it get's quickly when you actually are at a project with a decent level of complexity. Modules gonna need other modules, so you'll going to have a lot of fun when wiring everything together.

echo basalt
#

putting everything inside a black box and calling it a day isn't suitable

civic apex
dry yacht
sonic goblet
#

No shot, are you actually coding in the Minecraft font? What an absolute mad lad

remote swallow
echo basalt
civic apex
#

its the monocraft font

echo basalt
echo basalt
dry yacht
echo basalt
civic apex
#

it would call them if it was in the main class too

dry yacht
echo basalt
#

DI is lovely

#

you just need to be organized

civic apex
#

i am not

echo basalt
#

split everything into data classes, handlers or managers

dry yacht
#

You know, I get what you're saying @echo basalt. But I'm not willing to have a wiring site like this if I can solve everything automatically with a few lines of extra code. It's extremely easy, doesn't hide what's going on and saves me from having to do stupid brainless work.

echo basalt
#

It ain't brainless ¯_(ツ)_/¯

#

also I never have problems when it comes to wiring stuff

dry yacht
#

I can literally hire kids to write constructor calls, lol

echo basalt
#

just register a couple listeners, couple command handlers

dry yacht
echo basalt
#

sure registering listeners is probably the most boring part, but it takes like 30 seconds at most

dry yacht
#

You're quickly at levels like these when your project is rather complex. I wouldn't want to wire 50 of those bad boys up manually, checking what I need to create first.

Look at NMS, or the client itself. They also sometimes have huge constructors. Not all software just uses a reference to a single main class, it can get quite complicated if you're trying to separate out reusable functionality.

dry yacht
echo basalt
#

something tells me you're putting a lot of responsibility in a single class 🤔

dry yacht
#

It's the real world. You cannot have 200 line classes everywhere.

echo basalt
#

tell me about the real world

dry yacht
#

I literally factored out so much it's not even funny anymore. The class is doing all the basics, but somewhere you gotta join abstractions together.

spice shoal
dry yacht
echo basalt
#

all of those commands in a single package

#

mfs leaking essentials sourcecode

dry yacht
#

You have to stop pulling everything apart at some level, or nothing get's done. As the symbol names of my screenshot show you, I already separated concerns pretty well. But as I've said, you have to write it up somewhere.

dry yacht
#

But most of it aren't commands.

echo basalt
#

¯_(ツ)_/¯

#

average plugin developer dick measuring contest

chrome beacon
#

It's like the nms for mob brain behaviour

echo basalt
#

oh god the sensor system in nms is so overengineered

chrome beacon
#

Not sorted in to packages everything is a mess

echo basalt
#

they make sure to use immutablemaps everywhere

#

just to fuck with developers

chrome beacon
#

I'm aware guess who decided to mess with Villager AI for this Winterjam

#

;/

civic apex
#

i have one old plugin which only had three files, and the main class (Main.java) had 1200 lines

dry yacht
# echo basalt ¯\_(ツ)_/¯

I'd love to see you write a hologram plugin from scratch on top of packets with persistence, commands, variable support and so on with your style of programming and then check if it's actually cleaner than mine. Not meant in a bad way at all, just curious. Because most people which tell me that my style is not clean or not conform enough mostly work on far too simple things where these patterns are easy to stick to. But it's really hard to keep it clean when you're literally trying to stick a million features together.

echo basalt
#

packets are easy, I've done harder things

#

like fake blocks and fake entities that can collide with them

#

commands are also easy

#

Variable support is also easy, just a very abstract collection

#

Serialize that collection for persistence

#

And link stuff together

spice shoal
#

**Guys , can it work???
**

`package me.sussolino.juicehub;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class msg implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
String[] args) {

        if(cmd.getName().equalsIgnoreCase("msg")) {
            if (!(sender instanceof Player player)) {
                return true;
            }
            if(args.length == 0) {
                player.sendMessage(ChatColor.RED + "Usa: /msg <Player> <Messaggio>");
            }else if(args.length == 1 ) {
                player.sendMessage(ChatColor.RED + "Usa: /msg <Player> <Messaggio>");
            }else {
                StringBuilder str = new StringBuilder();
                for (int i = 1; i < args.length; i++) {
                    str.append(args[i]);
                }
                Player targetPlayer = Bukkit.getPlayerExact(args[0]);
                if (targetPlayer != null){
                    targetPlayer.playSound(player.getLocation(),
                    targetPlayer.sendMessage(ChatColor.AQUA + sender.getName() + ChatColor.GOLD + "" + ChatColor.BOLD + " > " + ChatColor.GREEN + targetPlayer.getName() + ChatColor.WHITE + "" + ChatColor.translateAlternateColorCodes('&', " " + str.toString().trim()));
                    player.sendMessage(ChatColor.AQUA + sender.getName() + ChatColor.GOLD + "" + ChatColor.BOLD + " > " + ChatColor.GREEN + targetPlayer.getName() + ChatColor.WHITE + "" + ChatColor.translateAlternateColorCodes('&', " " + str.toString().trim()));

                } else {
                    player.sendMessage(ChatColor.RED + "Player non trovato");
                }

            }
        }
        return true;
    }

}
`

undone axleBOT
spice shoal
#

no

dry yacht
# echo basalt And link stuff together

You now know why my class has multiple references to other modules. It's methods are dead simple, but they link features together to define higher level behavior.

dry yacht
dry yacht
echo basalt
#

I wouldn't say there should be a master origin point

#

just lots of modularity

dry yacht
spice shoal
#

Guys , i have a problem.

At line 31 there is this error ";"
IDK how i can fix it , can someone help me?

`package me.sussolino.juicehub;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class msg implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
String[] args) {

        if(cmd.getName().equalsIgnoreCase("msg")) {
            if (!(sender instanceof Player player)) {
                return true;
            }
            if(args.length == 0) {
                player.sendMessage(ChatColor.RED + "Usa: /msg <Player> <Messaggio>");
            }else if(args.length == 1 ) {
                player.sendMessage(ChatColor.RED + "Usa: /msg <Player> <Messaggio>");
            }else {
                StringBuilder str = new StringBuilder();
                for (int i = 1; i < args.length; i++) {
                    str.append(args[i]);
                }
                Player targetPlayer = Bukkit.getPlayerExact(args[0]);
                if (targetPlayer != null){
                    targetPlayer.playSound(player.getLocation(),
                    targetPlayer.sendMessage(ChatColor.AQUA + sender.getName() + ChatColor.GOLD + "" + ChatColor.BOLD + " > " + ChatColor.GREEN + targetPlayer.getName() + ChatColor.WHITE + "" + ChatColor.translateAlternateColorCodes('&', " " + str.toString().trim()));
                    player.sendMessage(ChatColor.AQUA + sender.getName() + ChatColor.GOLD + "" + ChatColor.BOLD + " > " + ChatColor.GREEN + targetPlayer.getName() + ChatColor.WHITE + "" + ChatColor.translateAlternateColorCodes('&', " " + str.toString().trim()));

                } else {
                    player.sendMessage(ChatColor.RED + "Player non trovato");
                }

            }
        }
        return true;
    }

}

`

dry yacht
spice shoal
undone axleBOT
spice shoal
#

ah

#

sorry

echo basalt
#

getHologram, remove, add

#

then the hologram would be responsible for its own lines

spice shoal
#

So , should I add a ")" before the ";" ?

#

i think it's fine

dry yacht
spice shoal
#

I’m sorry but I was joking, but if I take 1 or add 1 , 2 or 3 , the same error.

#

now it work , thanks elder god of the world !

summer lark
#

Hello !

Is it possible to make enderpearls cross through plain structures like a big wall using chunks?

undone axleBOT
inland barn
#

which is more preferred?

  • plugin development using vscode and wsl or linux
    or
  • intellij/eclipse and windows
#

i used to work with c++ projects via ubuntu or wsl and using visual studio code for development and was just curious about other thoughts

spice shoal
#

intellij idea for me

#

so , 2 * option

river oracle
#

but intellij on linux works as well

inland barn
sterile token
#

I use Ubuntu 20.04+ Intellij - They works perfect no issues

spice shoal
#

in
new ItemEvents();
new ItemManager();

remote swallow
#

You dont need the linr that just has new itemevents you already register thr listener and does item manager have listeners in

spice shoal
#

So in the game they will work the same in theory, right?

remote swallow
#

If the item events class register's listeners for item manager if it has listeners in it, yes

spice shoal
#

oh ok , thanks for information :))

carmine urchin
#

I'm trying to use NMS with mojang mappings for spigot 1.19.3 and for some reason when I write the code MinecraftServer server = craftPlayer.getHandle().getServer() in the form of a command, an internal server error occurs and the output is "Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer.getHandle()" Are my mappings corrupted?

sullen marlin
#

you didnt remap your plugin

carmine urchin
#

I implemented the plugins specialsource-maven-plugin and maven-shade-plugin in my pom.xml, installed the remapped 1.19.3 jars, and someone gave me their pom.xml as a reference, but still the error continues. Aren't these the correct steps to remap my plugin?

lost ferry
#

hey, how to show server on craftbukkit that is in bungee list?

remote swallow
#

i would guess just like any other server type

lost ferry
remote swallow
#

oh that

magic dome
#

what would be the best way to go about setting specific heights of terrain in a world... all while keeping the vanilla cave generation underneath the height specified. IE lets say my code says that the ground should go up to y=100 in a specific xz coordinate, I know how i can set it using a custom chunk generator... but how do i ensure that vanilla generation is still occuring underneath

remote swallow
remote swallow
lost ferry
magic dome
#

I don't see it there

#

oh wait its just called "generateCaves"

#

it says "Shapes the Chunk caves for the given coordinates" but would that generate caves throughout multiple chunks or would each chunk be random?

remote swallow
# lost ferry any solution?

no idea, i doubt many people use craftbukkit as there server jar now-a-days so it shouldnt cause too many issues

magic dome
#

ngl ive looked at chunk generators for hours and they still make little sense to me

remote swallow
#

yeah, ive got no clue how they work

#

i just remembered md saying something about that method

lost ferry
remote swallow
#

what do you want {server} to be

lost ferry
remote swallow
#

if input is HUB-1 then you can just use what you already have, that would return hub-1 from the config

#

change .SERVER for .NAME if you want Lobby-1

#
Bukkit.getScheduler().runTaskTimer(JavaPluginInstance, () -> {
  for (Player player : Bukkit.getOnlinePlayers()) {
      player.doSomething();
  }
}, 0, 5);
#

yeah

#

change player.doSomething to OtherClassName.scoreboard(player)

#

might need new

quaint mantle
#

hey all. How do i create a boundingbox with 2 coordinates for the corners of the bounding box? I just want to figure out if im in this bounding box as well but have no clue where to start on creating the actual bounding box

#

created said bounding box, how do i check if enter the bounding box? Im using the player move event and im planning on having a few 100 of these regions all with checks for which bounding box i have entered, shouldnt cause lag should it?

echo basalt
#

uhh

#

not really

drowsy helm
echo basalt
#

A bounding box is basically a cuboid

drowsy helm
#

so theres the constructor and BoundBox.of(location1, location2)

echo basalt
#

The thing is

drowsy helm
#

then to check if you're inside you can do .containts(position)

echo basalt
#

only thing I hate about that class

#

is that there's no partial contains

#

like

#

it only checks if all 4 corners are contained within one another

#

if you have 2 perpendicular aabb's they don't collide

quaint mantle
drowsy helm
#

oh interesting

#

print your values and see

quaint mantle
#
@EventHandler
    public void enterVanguardRegion(PlayerMoveEvent e) {
        Player player = e.getPlayer();
        Location loc = player.getLocation();
        BoundingBox vanguardBox = new BoundingBox(133.0, 71.0, 300.0, 139.0, 71.0, 307.0);
        if(vanguardBox.contains(loc.getX(), loc.getY(), loc.getZ())) {
            player.sendMessage("Entered Box.");
        } else {
            player.sendMessage("Not in Box???");
        }

    }```
#

yeah good idea

drowsy helm
#

also no bounding boxes don't cause heaps of lag

#

depends how often you are checking

echo basalt
#

oh yeah btw buoo

drowsy helm
#

its just a greater than lesser than check

#

yur

echo basalt
#

the guy from the rpg server keeps begging me to help him out

drowsy helm
#

lol

#

ill tell him to stop

echo basalt
#

like

#

paid work is one thing

#

but he's probably more broke than me

quaint mantle
#

136.30718410893195 71.0 302.34903518358374 My coords

#

why am i not in the bounding box

#

im lost

quaint mantle
#

if anyone has any idea on why this bounding box isnt working, please lmk

quaint mantle
#

Less lag

echo basalt
#

wut??

#

making things async just because isn't... ideal

#

also papi has nothing to do with boundingboxes

quaint mantle
#

both things you said make no sense to me!

echo basalt
#

making stuff async just because is something I do... more than I should

quaint mantle
#

but ill deal with that when i figure out why this bounding box isnt working

echo basalt
#

because I like to play it safe :)

quaint mantle
#

so i should make it async?

echo basalt
#

no

quaint mantle
#

okay gotcha

#

do you see anything wrong with what im doing?

#

bc it reallyyyyyyyy doesnt want to work

echo basalt
#

I mean..

#

the Y level is always the same

#

that can cause issues

#

try like

#

going in the area, in-game

#

but 1 block below

quaint mantle
#

okay

#

nope no changes

echo basalt
#

or above idk how you're doin this

#

actually I see hm

quaint mantle
#

above & below show no changes

#

oo

echo basalt
#

make the Y like 3 blocks tall

#

having it as the same value is.. .not ideal

#

at least set it to like 1 block above

#

you're making a bounding box that's like a sheet of paper

#

instead of a box

quaint mantle
#

that is a good point

#

ill change it to bedrock to height level

#

ah yep

#

look at that

#

it fixed!

#

whats the best way for me to make a getPlugin method?

#

i dont want to run into issues getting an instance of my main class later down the road

jagged monolith
#

Use the current getPlugin method?

jagged monolith
rare rover
#

how do i write to a packet? Using mojang mappings?

sonic goblet
#

I'm very bad at math and I'm having a bit of brain lag.
I'm trying to create a chest populator that uses a scale of 1-10 to determine how full the chest(s) should be. 1 being empty or nearly empty and 10 being full or nearly full. But I'm having some problems translating that into code. My two variables are the container size, and the "purity" of the chest (being on the 1-10 scale)

Any math chads have any suggestions of how I should go about that?

jagged monolith
#

?paste

undone axleBOT
drowsy helm
#

LoginEvent doesnt have a .getPlayer method iirc

drowsy helm
#

PostLoginEvent

drowsy helm
#

for the event

jagged monolith
#

Yeah, Use the PostLoginEvent instead of the LoginEvent

remote swallow
#

^^

jagged monolith
#

PostLoginEvent has a getPlayer()

drowsy helm
#

did you copy paste all that code from somewhere?

#

the LoginEvent

#

has to be PostLoginEvent

jagged monolith
#
  1. Remove LoginEvent
  2. Use PostLoginEvent
  3. Get the proxied player from the event
#

@unreal shoal ^

quaint mantle
#

Hey, anyone here know how to make text pop up on your screen? Sort of how theres text right in the middle of your screen

jagged monolith
quaint mantle
#

okay so send title it is

quaint mantle
drowsy helm
#

idk why helpchat was the first that popped up

remote swallow
#

Use string string int int int

#

Other one is deprecated

quaint mantle
#

okay and what if i just dont want a subtitle

#

do i just do ""

remote swallow
#

Pretty much

quaint mantle
#

perf

#

and are the ints as ticks?

remote swallow
#

Think so

drowsy helm
#

yeah

#

you can do null

#

instead of ""

#

looks a bit nicer

jagged monolith
#
Parameters:
title - Title text
subtitle - Subtitle text
fadeIn - time in ticks for titles to fade in. Defaults to 10.
stay - time in ticks for titles to stay. Defaults to 70.
fadeOut - time in ticks for titles to fade out. Defaults to 20.
quaint mantle
#

oh i was looking at the helpchat one

#

thanks

drowsy helm
#

yeah my fault

quaint mantle
#

allg

#

what in the world is helpchat anyways lol

remote swallow
#

Creator of papi

jagged monolith
quaint mantle
#

oh thats neat

chrome coyote
#

Hellow, what is the best plugin for tab?

remote swallow
remote swallow
drowsy helm
#

lol what

quaint mantle
#

oh shit

#

so uh

chrome coyote
#

with more options

remote swallow
#

The link omega weapon dev sent

#

Its very customisable

jagged monolith
#

It's free. You only need to pay if you want support from the dev which isn't really needed.

quaint mantle
#

since its whenever im moving, that title keeps coming up, 1s lemme send my code:


// PDC :
        Player player = e.getPlayer();
        PersistentDataContainer playerPdc = player.getPersistentDataContainer();
        String playerLocation = playerPdc.get(new NamespacedKey(Nebula.getPlugin(), "playerregion"), PersistentDataType.STRING);


        Location loc = player.getLocation();
        BoundingBox vanguardBox = new BoundingBox(133.0, 0, 300.0, 139.0, 256, 307.0);
        if(vanguardBox.contains(loc.getX(), loc.getY(), loc.getZ())) {
            if(!playerLocation.equals("vanguard"))
                player.sendMessage("Entered City: Vanguard.");
                playerPdc.set(new NamespacedKey(Nebula.getPlugin(), "playerregion"), PersistentDataType.STRING, "vanguard");
                player.sendTitle("Entered Vanguard", "", 10, 70, 20);
        } else {
            player.sendMessage("Not in Box???");
            playerPdc.set(new NamespacedKey(Nebula.getPlugin(), "playerregion"), PersistentDataType.STRING, "unknown");
            System.out.println(loc.getX() + " " + loc.getY() + " " + loc.getZ());
        }```
quaint mantle
#

the chat msg only sends once, the title keeps coming up repeatedly

drowsy helm
#

its super useful

quaint mantle
#

im assuming its bc it never finished its sequence

#

no idea how to deal with that tho

drowsy helm
#

you have to keep track of whether a player has entered before

#

orelse it will spam

quaint mantle
#

yep i did

#

the chat msg sends once

#

title sends a million times

rare rover
#

okay

#

1 more question

drowsy helm
#

oh

#

skill issue tbh

quaint mantle
#

i have an idea to fix it

#

fax yo

rare rover
#

how would i send a packet to the server, never sent one to the server

#

only to a player

drowsy helm
#

like a spoof packet?

rare rover
#

sure

drowsy helm
#

uuuh fuck

#

i dont actually know if thats possible

#

you would have to have a fake client

rare rover
#

im just trying to teleport the entity using a packet

#

so i can use async

quaint mantle
#

why use a packet?

#

oh

drowsy helm
#

thats not a good idea

#

its gonna cause heaps of desync

#

and technically the player wont be teleported

#

just teleport them on the main thread

#

use a runnable or smth

quaint mantle
#

fuck my idea failed

rare rover
#

alrighty

#

so just use stand.teleport(location);?

drowsy helm
#

yeah

rare rover
#

okay

quaint mantle
#

yeah uh buo

drowsy helm
#

unless you are using the packet to fake something being in a location

quaint mantle
#

how do i just send that title once

#

i have 0 idea

drowsy helm
#

when you say it pops upmultiple times

#

does it not go away

#

or just fades in and out

quaint mantle
#

oh no, everytime i move, it resets its sequence

#

it constantly fades in

drowsy helm
#

but the chat message only once right

quaint mantle
#

yep

drowsy helm
#

oh

#

you didnt do brackets

quaint mantle
#

brackets where?

drowsy helm
#
if(vanguardBox.contains(loc.getX(), loc.getY(), loc.getZ())) {
            if(!playerLocation.equals("vanguard"))
                player.sendMessage("Entered City: Vanguard.");
                playerPdc.set(new NamespacedKey(Nebula.getPlugin(), "playerregion"), PersistentDataType.STRING, "vanguard");
                player.sendTitle("Entered Vanguard", "", 10, 70, 20);
        } else {

vs

if(vanguardBox.contains(loc.getX(), loc.getY(), loc.getZ())) {
            if(!playerLocation.equals("vanguard")){
                player.sendMessage("Entered City: Vanguard.");
                playerPdc.set(new NamespacedKey(Nebula.getPlugin(), "playerregion"), PersistentDataType.STRING, "vanguard");
                player.sendTitle("Entered Vanguard", "", 10, 70, 20);
            }
        } else {
#

for the playerLocation.equals if statement

quaint mantle
#

oh for fucks sake

#

cmon bro

drowsy helm
#

wheres the CreaShield class?

#

if you are trying to load your main class it should be dashspy.main.Main

jagged monolith
#

Show the file structure you have.

stray nacelle
#

guz

#

me ned helb

#

wif worlt gen

jagged monolith
#

?main

stray nacelle
#

lol

quaint mantle
#

is there any way for me to not be forced to restart my server without risking my plugin having a mental breakdown?

#

it is so slow

remote swallow
#

Your package would be dashspy.main not dashspy.main.Main

stray nacelle
#

but i use plugwoman cuz it faster

jagged monolith
#

Quick Question. Do you know Java. Or is this your very first time coding

#

?learnjava!

undone axleBOT
remote swallow
quaint mantle
jagged monolith
#

You should learn the basics of java before coding a plugin

drowsy helm
#

Plugman in some situations

#

Most cases it’s best to just restart

quaint mantle
drowsy helm
#

You can optimise your server to start in less than 10 seconds

quaint mantle
#

ooh please help me there

#

what can i do for that

remote swallow
#

Theres a load that could arise

quaint mantle
#

shit takes a solid 40-1m to load

jagged monolith
drowsy helm
#

Test environment use as little ugins as possible

stray nacelle
remote swallow
#

So there isnt really a good way to tell if it would work or not

stray nacelle
quaint mantle
#

thats fair

#

its gonna be fairly big by the time im done

#

so server load times are an issue

remote swallow
#

Best bet you have is using a plugin manager and hoping it doesnt break anything or hoping /reload doesnt then

stray nacelle
#

guyzzz me need help with "smooth noise generator"

#

like plains but somewhere a hole

#

what if i will say "i like paper" ?

remote swallow
#

?whereami

jagged monolith
stray nacelle
#

oh no :(((

#

i distrait byy skissorz

stray nacelle
remote swallow
#

Huh

quaint mantle
#

i asked this yesterday but didnt get the answer i was looking for, how do i make a gun that functions like one from actual triple A games. The gun shoots as long as I hold the left click button down and when my finger goes off the left click button, it stops shooting

jagged monolith
#

You'd probably need to mess with particles, vectors and locations

#

It would be somewhat possible, but would take a bit and lots of trial and error.

quaint mantle
#

see but then it would only fire the event once so id only shoot once

#

im trying to figure out how to keep the gun shooting while im still holding left click down

remote swallow
#

Wouldnt the event fire consecutively if you were holding

quaint mantle
#

nope it wouldnt, i tried

jagged monolith
#

No, I think it only fires once.

quaint mantle
#

it only fires nce

jagged monolith
#

I've just had a quick look at the docs and I honestly don't think it's possible without delving into packets.

quaint mantle
#

thats fine with me, whatever to get it done

jagged monolith
#

Because there really isn't a way to check if a player is holding the mouse button

quaint mantle
#

ive been meaning to learn nms, this would force me to

#

what packet would the player even be sending to inform me that their holding the mouse down

jagged monolith
#

Unless someone else knows of a way to do it, I think packets might be the best option. (not 100% sure if possible with packets but should be)

quaint mantle
#

now that i think abt it, every server with gun mechanics always use right click to shoot, i havent tested it but does right click always fire if held down?

icy beacon
#

so I updated my plugin and now it's ~4.7MB, but the max size for uploading files is 4MB, so where do I upload the file now? is there a traditional hosting for this maybe?

maiden thicket
#

kidding

jagged monolith
#

^ Didn't know that was a thing. Wouldn't trust it

maiden thicket
#

it is trustworthy

#

xD

#

it was custom made fork of paper to patch creative mode exploits

#

primarily for the free op server they run

jagged monolith
#

Using a shadowJar or anything for compression? Surely there is a way you could bring that size down. Maybe some of the dependencies could be set to compile instead of implemented

remote swallow
#

iirc maven shade has a minimize tag so some size would able to come off

torn shuttle
#

hm if class 1 implements cancellable and class 2 extends class 1 if I want class 2 to still implement cancellable the same as class 1 do I need to tell it to implement cancellable again or would it know to do that through polymorphism?

#

it should be extended right?

cobalt thorn
#

Hi, im trying to make a translator for chat, im using Protocollib i manage to make the packet works, but i don't know how to change the message to the new one and resend it to the user

code:

public class Message extends PacketAdapter {

    public Message(Translator plugin) {
        super(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.CHAT);
    }


    @SuppressWarnings("deprecation")
    @Override
    public void onPacketSending(PacketEvent event) {
        if (event.isCancelled()) {
            return;
        }

        PacketContainer packet = event.getPacket();
        String message = packet.getStrings().read(0);

        String translated = Translate("de", message)
    }
}
hazy parrot
torn shuttle
#

that's what I assumed, thanks

hazy parrot
cobalt thorn
remote swallow
#

you could still do that on event priority highest

#

for chat messages

cobalt thorn
#

oh

#

i need it more for plugins

remote swallow
#

customising messages another plugin sends i would guess needs packets to intercept

cobalt thorn
#

for chat i have already the solution but for plugins im trying to search the way

cobalt thorn
charred pollen
#

how does a baltop gets created, been wondered for awhile, and my plugin needs this command 🥹

remote swallow
hazy parrot
jagged monolith
hazy parrot
remote swallow
jagged monolith
hazy parrot
#

If you are storing balance in some kind of database, it's just one query

charred pollen
rough drift
#

@quaint mantle @dry yacht What about TabPosition.ofSlot(2) and TabPosition.ofPos(0, 1);

#

y/n?

jagged monolith
#

Use a for loop to loop through the balances, and add it to a list then print the list

charred pollen
hazy parrot
#

It's probably better to use correct database for this stuff instead of storing in yaml

jagged monolith
#

You'll need to get an array or list of the balances, then print that list to the player.

hazy parrot
#

Because it looks exactly like yaml config

#

If its sqlite, just select player, balance from table order by balance desc limit 15 for example

torn shuttle
#

my programming playlists keep getting weirder

jagged monolith
# charred pollen its stored in data.db

Same concept. You'd need to get a way to Loop through the balances, and add them to a list, with the players name, position and balance and send it to the player

charred pollen
jagged monolith
#

Maybe get the balances, put them into an array, sort the array based on the values, then just loop over the array

hazy parrot
remote swallow
#

do you not use a java database api for data.db

#

i would recommend using hikari cp and sqlite

#

with a connection pool

jagged monolith
#

HikariCP is really good. I just always get confused trying to implement it, I have always wanted to. Just never actual spent the time to learn it

remote swallow
#

ive got no clue how it works either lol

#

one of my friends plugins used it so i just copied the concept

#

it works as intended so i just use it if i need sqlite

quaint mantle
#

How to get value from async task?

charred pollen
#

thanks, will try 😄

remote swallow
jagged monolith
remote swallow
#

want me to find the classes that i used?

jagged monolith
#

Well I was wanting actual Database no sqllite 😛

remote swallow
#

ah

#

ive got no clue about that part

quaint mantle
remote swallow
#

is it in plugin.yml

quaint mantle
#

I tried to set value from outside of task

remote swallow
#

return the value like normal?

solemn meteor
#

Hey, I get a weird error when I run my server, it seems to be something at TabExecutor. Am I doing something wrong?

#

The error in question

#
getCommand("chud").setExecutor(new CoordinatesHUDTabExecutor());
getCommand("chud").setTabCompleter(new CoordinatesHUDTabExecutor());
remote swallow
#

is it in plugin.yml

jagged monolith
solemn meteor
remote swallow
#

also you dont need to set tab completer, setExecutor does that auto

solemn meteor
#

I keep forgetting that I need to do that

#

I hate my life

#

thanks for the help

remote swallow
#

use TabExecutor instead of CommandExecutor & TabCompleter

lavish hemlock
#

Agreed