#help-development

1 messages · Page 1805 of 1

smoky oak
#

I'm just storing an instance in a static variable in the main plugin class. That viable too?

noble lantern
#

What specifically about it

warm cloak
grim ice
#

reject Indentation as well

noble lantern
#

tf is indentation

vale ember
#

but why? plugin instance is only one, what's the problem of using singleton?

smoky oak
#

do indentation with singular spaces

noble lantern
#

Yall saying you dont always write your code like this?

grim ice
#

what the fucking

#

lmao

eternal oxide
# grim ice reject Indentation as well

reject whitespace java publicstaticUUIDgetUUID(Stringname)throwsIllegalStateException{try{URLurl=newURL("https://api.mojang.com/users/profiles/minecraft/"+name);HttpURLConnectionconn=(HttpURLConnection)url.openConnection();conn.setReadTimeout(5000);conn.setInstanceFollowRedirects(true);conn.addRequestProperty("User-Agent","Mozilla/4.0");conn.setDoOutput(false);try(JsonReaderreader=newJsonReader(newInputStreamReader(conn.getInputStream()))){reader.setLenient(true);//readJSONdataJsonObjectjson=newGson().fromJson(reader,JsonObject.class);//closereaderreader.close();returnUUID.fromString(json.get("id").getAsString().replaceFirst("(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)","$1-$2-$3-$4-$5"));}catch(IOExceptione){thrownewIllegalStateException("ERROR_CHECKING");}}catch(Exceptione){/**Failquietly.*Noneedtospamastacktrace.*/returnnull;}}

noble lantern
noble lantern
vale ember
grim ice
#

my eyes

#

awegouahgr

noble lantern
#

reject programming

Embrace paper and pencil

tardy delta
visual tide
grim ice
#

lol

#

i had an idea of some logic and i dint want to forget it

tardy delta
#

i'm writing on paper

sand gull
vale ember
# eternal oxide reject whitespace ```java publicstaticUUIDgetUUID(Stringname)throwsIllegalStateE...

01110000 01110101 01100010 01101100 01101001 01100011 01110011 01110100 01100001 01110100 01101001 01100011 01010101 01010101 01001001 01000100 01100111 01100101 01110100 01010101 01010101 01001001 01000100 00101000 01010011 01110100 01110010 01101001 01101110 01100111 01101110 01100001 01101101 01100101 00101001 01110100 01101000 01110010 01101111 01110111 01110011 01001001 01101100 01101100 01100101 01100111 01100001 01101100 01010011 01110100 01100001 01110100 01100101 01000101 01111000 01100011 01100101 01110000 01110100 01101001 01101111 01101110 01111011 01110100 01110010 01111001 01111011 01010101 01010010 01001100 01110101 01110010 01101100 00111101 01101110 01100101 01110111 01010101 01010010 01001100 00101000 00100010 01101000 01110100 01110100 01110000 01110011 00111010 00101111 00101111 01100001 01110000 01101001 00101110 01101101 01101111

sand gull
#

should be illegal ngl

noble lantern
sand gull
#

Ever since I started using Mongo I haven't touched SQL anymore haha

noble lantern
#

"Oh god is this syntax right"

"Oh god did i escape that user entered input"

sand gull
#

Mongo + Redis = 🥰

noble lantern
#

Yeah i love mongo

sand gull
tardy delta
#

i had most of the exercices in MySql workbench

sand gull
#

Out of curiosity, what would you guys think is a fair price for a plugin of which there is nothing alike on Spigot yet? It's fairly complex, involves a lot of packets, and is related to server/network optimization.

eternal oxide
#

One million dollars!!!!

sand gull
#

👀

tardy delta
#

10 dollar

sand gull
#

Yeah I was thinking of around $12

noble lantern
#

Does it have a Vault-ItemStack library

sand gull
#

It doesn't even use ItemStacks haha

noble lantern
#

Damn, make it free then

#

jkjk

#

but yeah, 10$

sand gull
#

Lmao trust me, you'd change your mind when you see the plugin

tardy delta
#

server/network optimisation uses itemstacks hmm yeah

noble lantern
#

I optimized my ItemStacks

#

By changing the CustomModelData

#

😎

#

Looks > Performance

sand gull
#

CustomModelData my beloved

tardy delta
#

i also did

#

was using damage stuff before

sand gull
tardy delta
#

but that hides the durability

sand gull
grim ice
#

if its really that hard

#

well maybe 15$ or smth

sand gull
#

Yeah I'll go anywhere around 12-18

summer scroll
#

even with some heavy tasks?

noble lantern
#

Can it basically handle runscape in mc ^

sand gull
# summer scroll even with some heavy tasks?

This is considering every player is just moving around, mining etc. Heavy tasks will always take a toll on performance, but it would still keep up consistent TPS even with heavier task yeah.

summer scroll
#

interesting

#

would love to see that

sand gull
dusty kindle
#

one question how can i make this chat foramt work with hex codes?
java event.setFormat(ChatColor.translateAlternateColorCodes('&', VaultUtils.getChat().getPlayerPrefix(p )).split("&")[0]+" "+ p.getName()+ChatColor.WHITE+ ": " + ChatColor.GRAY+event.getMessage());

gritty urchin
#

1000 players

#

bruh

sand gull
tardy delta
#

👀

tardy delta
summer scroll
#

it would be really useful for server owners, assuming there is no something that breaks

tardy delta
#

otherwise you'll need to look it up

gritty urchin
#

or something

sand gull
dusty kindle
sand gull
#

Not spoiling anything else haha. You'll see when it's released.

noble lantern
#

ngl why make it a plugin and why not patch a server jar?

#

I feel like if you can squeeze 1000 players into a server with only a plugin optimization, why not go full out for the jar

summer scroll
sand gull
#

Because of what it offers is probably not what you have in mind, it'll be clear once you see it ;P

noble lantern
#

ill teade you source code

gritty urchin
noble lantern
#

to a plugin i havent worked on i n3 years

noble lantern
sand gull
noble lantern
#

Someone in here is prolly lurking, see what he says and bam its released by tmrw

sand gull
#

^

tardy delta
#

i saw this

noble lantern
#

©️

#

:paste:

gritty urchin
#

yeh ppl will copy it anyway

noble lantern
#

ugh no custom moejis

gritty urchin
#

once its released

noble lantern
sand gull
noble lantern
#

because they 1st have to make it, and then they have to make it better in order for people to download the older one over the newer one

sand gull
#

^

noble lantern
#

Or as we saw in here a few days ago, just have a prettier front page and your set

tardy delta
#

smh ChatColor.of should work with the right import

noble lantern
#

i have yet to release my traders plugin because i cant make a decent front page

#

A1 Plugin pages

gritty urchin
#

Just freelance someone

noble lantern
#

uhh discord lag?

#

WOAH that lag

#

A1 spigot page ^ hmu 5$ an hour

#

jk

tardy delta
#

is json data storage faster than yaml?

gritty urchin
#

yes

noble lantern
#

dont have to worry about tabs and spacing

sand gull
#

"The JSON grammar is very concise. The YAML parsers are comparatively complex, leading to increased overheads."

#

Google is your friend

noble lantern
#

JSON feels nicer to configuer as well

vale ember
#

why even spigot uses yaml if minecraft uses json?

summer scroll
#

it's more readable maybe?

noble lantern
#

so much nicer looking

sand gull
#

YAML is more user friendly for config

noble lantern
vale ember
#

that "readablity" leads to much more errors + worries about tabs

summer scroll
#

so many [] {} in json xd

noble lantern
#

[] = array {} = object eg actual config

sand gull
#

People who are not familiar with programming in general could have troubles messing up brackets

noble lantern
#

Json has nothing to do with programming

sand gull
#

It literally has

noble lantern
#

You can learn Json in 10 minutes if youve done Yaml before

sand gull
#

JavaScript Object Notation

vale ember
#

json is created for transfering js objects in php and vice versa AFAIK

sand gull
smoky oak
#

Two questions: what map is the fastest for a Key/Value mapping for up to 5000 values, and how can I iterate over all Materials that are also able to become ItemStacks?

tardy delta
#

i should take a look at gson

sand gull
noble lantern
noble lantern
sand gull
smoky oak
noble lantern
#

Moshi is good but

smoky oak
#

so no

noble lantern
#

It doesnt do automatic serialization of classes...

sand gull
lunar schooner
#

Hey folks, I recently switched from Eclipse to using IntelliJ, however I'm running into an issue with Javadoc. It is not giving me the javadoc for anything from the java standard library. Spigot e.d javadoc works fine, whats going on here?

smoky oak
#

look up my earlier message

#

had the same issue

lunar schooner
#

How far up?

smoky oak
#

this

#

wait no

tardy delta
#

doesnt it generates javadocs by default?

smoky oak
#

thats the exact opposite ofmy problem lol

#

well it says it does but they generate there

lunar schooner
#

It semes your is flipped though, or am I reading it wrong? The Bukkit API has javadoc for me

smoky oak
#

ye

#

i just realized

lunar schooner
#

I need the standard library's docs 😅

smoky oak
#

also it might genereate the javadoc when you use --generate-sources, but NOT in the target folder but instead in that weird .m2 folder

noble lantern
#

dont make fun of mah boy .m2

#

He gets deleted twice a year, dont diss mah boy

lunar schooner
#

For reference, this is what my javadoc looks like now

noble lantern
lunar schooner
#

Im missign the entire description part

smoky oak
#

supposed to look like this

#

you ARE using a JDK, right?

lunar schooner
#

This is what my doc on a bukkit api looks like, showign the description

#

Yeah, I'm using OpenJDK 17

noble lantern
#

your using 16

lunar schooner
#

No, my docs come from 16.

lunar schooner
#

Hover, my active JDK is 17

noble lantern
#

wtf

lunar schooner
#

But, I've also tried changing the doc url to 17, makes no difference

mortal hare
#

I LOVE how minecraft client checks the team not by player's UUID but by its name.. WHY? this is cancer. Now whenever apply glow to NPC which has the same name glow persists due to how client thinks

noble lantern
#

you can find it in file

lunar schooner
mortal hare
#

And to fix this i need to generate invisible characters just to separate NPC teams

lunar schooner
#

why not the method then 🤔

lunar schooner
#

Oh, I indeed am using 16

#

nice

#

I do have both installed, so it shouldnt matter a bit

mortal hare
lunar schooner
#

seems only my terminal adheres to what I set then 😂

#

(Using SDKMan for managing my Java versions)

noble lantern
#

im a simple man i just change my PATH

#

However

smoky oak
#

String.substring does not exist for me lol

noble lantern
#

Maybe SDKMan has something to do with the docs?

lunar schooner
#

Shouldnt, since the JDK used by IntellIJ was downloaded via apt

noble lantern
lunar schooner
noble lantern
#

You see i simply dont support versions less than 1.13

#

ez

smoky oak
#

wait can you show me a code example of that

#

my brains melting rn

lunar schooner
#

Eh, I have to, because work

noble lantern
lunar schooner
#

At work we have some projects on 8, 9, 11, 16 and 17

gritty urchin
smoky oak
#

now it exists

noble lantern
#

oh dang your work lets you use java

smoky oak
#

wth

noble lantern
#

lucky

lunar schooner
noble lantern
#

hiremepls

lunar schooner
#

Id much rather use Rust

#

and thats what all new projects use too

#

slowly porting all Java code to Rust

noble lantern
#

jkjkjk

lunar schooner
#

Mmm rustlang :bigbrain:

noble lantern
#

i love both versions of rust tho xD

charred wind
#

How can I cancel block explosions for blocks with a specific metadata?

lunar schooner
#

Ive never played the game lol

noble lantern
#

people always join the Rust discord asking about RustLang its kidna funny

noble lantern
lunar schooner
#

Yeah its a bit tricky

#

See the same thing on r/rust a lot

noble lantern
#

anways the docs issue uhhh

eternal oxide
noble lantern
#

You get docs on Eclipse?

lunar schooner
#

Yep I do

mortal hare
noble lantern
#

Maybe scour Intellij's forums or ask a question on theyre forums yourself

#

it feels like some intellij settings

charred wind
#

Can't find a blocklist..?

noble lantern
#

blocks store data now tf

#

since when

eternal oxide
#

not unless they have a TileEntity

noble lantern
#

If you want protected blocks you need to either store a list of Blocks (bad)

Or a Cuboid Region of some sorts and check if block is in that region (good)

#

oh wait they wanted something else

#

mb

charred wind
noble lantern
#

Normal Blocks dont hold data though

eternal oxide
eternal oxide
#

even then, you are checking the wrong event

gritty urchin
#

and spawn an invisible armorstand with the desired name

eternal oxide
#

Block explods is for things like Beds blowing up, actual blocks exploding, not blocks being blown up

mortal hare
#

In order to make glow work properly you need to create non identical player names

#

ofc i can add armorstand

#

but i think there should be a better way

eternal oxide
#

and glow will nto work at all with Optifine or any shaders

noble lantern
#

Just add armor stand as passanger bam

gritty urchin
#

Unless your moving it

charred wind
gritty urchin
#

then yeah

hushed hedge
#

help

eternal oxide
#

both will have a blocklist

gritty urchin
noble lantern
#

I wouldnt see any reason to move it though unless you want more lines to the hologram which is a good reason to move it

gritty urchin
#

ColouredConsoleSender cannot be cast to Player

charred wind
#

And from the blocklist, i can remove those blocks, that should not be exploded, right?

eternal oxide
hushed hedge
#

So Player player = (Player) sender is not being defined well? or is it with the instaceof?

gritty urchin
#

Paste your command method

noble lantern
#

If you end up storing thousands of blocks into a List your gonna run into memory issues

Your best to make a type of CuboidRegion like a WorldEdit region and then check if the Block is in between the 2 highest points of the Cuboid Region

gritty urchin
#

Are you sure sender

#

is CommandSender

hushed hedge
tardy delta
#

and extra brackets

noble lantern
#

whoever deleted theyre message'

#

you were right

#

it needs to be up one line higher

#

because hes casting before he checks

smoky oak
#

wait

#

yea

#

i only read the first line lol

vale ember
#

is there a way to make command's help message be colored multiline and something like this via plugin.yml or i shud always return true in 'onCommand' and handle it from code?

noble lantern
#

\n for new lines

vale ember
#

and what about colors?

noble lantern
#

ChatColor.translateAlternateColorCodes('&', yourString);

#

^

noble lantern
#

no you use that in your code

#

plugin.yml is basically useless

vale ember
#

oh, i know that, i was asking about plugin.yml

noble lantern
#

i barely ever fill anything out on it

rough basin
#

How do I summon a Baby Husk?

#

Thonk

noble lantern
#

i forgot im using a custom command handler, ignore my last remark

noble lantern
#

set it after its spawned

quaint mantle
vale ember
#

though i prefer creating utility class for parsing colors like:

ChatText.of("%RED%This is red");
noble lantern
#

i dont even import the class i just import the static method

rough basin
#

maybe i forgot import something

noble lantern
#

also

quaint mantle
#
# plugin.yml
command:
  usage: |-
    &e/<command> [<args>]
    &d/...
visual tide
#

why multiline usage 🤔

noble lantern
#

Entity should be a HUSK so cast it to HUSK

quaint mantle
tardy delta
eternal oxide
#

no

noble lantern
#

Once you change it to Husk instead of Entity setBaby(true) should appear

tardy delta
#

it goes brr but yea

noble lantern
#

although base Entity should have that method iirc

rough basin
noble lantern
#

Whichever yes

quaint mantle
#

org.bukkit.entity.Husk

noble lantern
#

^

quaint mantle
#

Husk husk = (Husk) ...

rough basin
#

Thanks :0

spiral light
#

does someone know what the
[I;303365728,590365872,-1635679079,-1707570548]
is from a UUID ?

noble lantern
#

tf

#

you got that from an UUID?

spiral light
#

i want a uuid to be that list

noble lantern
#

oh

#

I assume your using the Yaml system huh

eternal oxide
#

That is the 4 longs which make up the UUID

#

you can rebuild it

spiral light
summer scroll
#

OfflinePlayer is null

#

f

ivory sleet
#

I mean NPE tells you what’s null

summer scroll
#

it's annotated NotNull?

misty current
#

getuniqueid is

ivory sleet
#

getUniqueId is

noble lantern
#

@NotNull annotation doesnt actually do anything code wise

#

Its just for your eyes, eg readability

ivory sleet
#

Yeah and can sometimes even lie

noble lantern
#

^

misty current
#

what should I do to provide vault economy? implement Economy?

misty current
#

or extend AbstractEconomy

noble lantern
#

wait

#

making your own economy right

misty current
#

yes

noble lantern
#

if so AbstractEconomy

#

it should have all the add, remove, and set methods when you extend it for your to override

misty current
#

well it doesnt make much difference since abstracteconomy implements economy

noble lantern
#

Was just about to say that

#

xD

#

But yeah IIRC whenever i made custom economies i did AbstractEconomy

misty current
#

yea it has some utils method overrides

#

like taking an offlineplayer as a param and converting to a name

#

i'll use the abstract class

noble lantern
#

Yeah itll have lots of stuff for your to override some if it can be left empty/null if you dont ever plan on using it and know plugins you use wont use it

#

Like converting to name im sure no one uses

misty current
#
    @Override
    public EconomyResponse isBankMember(String name, OfflinePlayer player) {
        return isBankMember(name, player.getName());
    }

i meant stuff like that

noble lantern
#

oh yeah

#

Its just to make it easier to call, in case you only have the String, or only have OfflinePlayer

misty current
#

that takes the player and passes the name

#

yep

#

i'll use abstract economy

#

also i guess i can manage player data as i want?

noble lantern
#

Yep!

misty current
#

vault does nothing for me right

noble lantern
#

Nah vault tells you to piss off for data storage stuff

misty current
#

lol

noble lantern
#

May i suggest

misty current
#

well i need to go with mongo

noble lantern
#

MongoDB

misty current
#

so

#

yes

noble lantern
#

ther we go

#

perfect

misty current
#

i already have some experiences and i've watched around 2 hrs of videos about anti patterns :p

#

only thing that annoys the shit out of me is the huge log and i can't figure how to stop it

noble lantern
#

huge log?

misty current
#

yeah when it starts

#

it logs a bunch of stuff

tardy delta
#

mongoDB always lets me think at monke

misty current
#

useless stuff

noble lantern
#

json database go brrrt

noble lantern
#

you can edit the Object to set those logs to not happen

#

Similar to Discord4J logs work or Spark's

misty current
#

i've tried literally every method i could find

#

java logger, log4j

noble lantern
#

isnt there a MongoBuilder?

noble lantern
#

I havent used mongo in a long time, but iirc there was a Builder that had some logging methods

misty current
#

lemme see

noble lantern
misty current
#

there's MongoClientSettings

noble lantern
#

Could be it

#

I havent used mongo in a very long time

misty current
#

welp

noble lantern
#

This exists

#

But you need another lib....

lean gull
#

(it doesn't set my gamemode to creative)

tardy delta
#

is there a gson tutorial or something on the forum?

vivid temple
#

why is this always true?

if (killer.getInventory().getItemInMainHand().getItemMeta().getDisplayName() != null)
misty current
misty current
#

((LoggerContext) LoggerFactory.getILoggerFactory()).getLogger("org.mongodb.driver").setLevel(Level.ERROR);

noble lantern
#

In your Listener class for your onJoin method

lean gull
#

oh right, thanks

noble lantern
#

Maybe log .getClass

#

and see what its an instanceof

misty current
#

and yes i got the right imports

#

hm i'll have to retry

#

gimme a sec to set it up

vivid temple
#

oh

tardy delta
#

either it will throw an exception or will be empty

vivid temple
tardy delta
#

iirc if itemmeta.hasLocalizedName()

late sonnet
tardy delta
#

ah hasdisplayname

vivid temple
#

oh

noble lantern
#

wish we had that method a long time ago

tardy delta
#

in which case it wont have a displayname?

late sonnet
tardy delta
#

hmm

quaint mantle
#

For the love of god why cant getDisplayName be nullable

noble lantern
#

Doesnt this method return the default item name iirc? It can also just chack against this for this displyname

vale ember
#

does Player interface have any implementation in spigot???

young knoll
#

It does in craftbukkit

vale ember
vale ember
#

thanks

noble lantern
#

^

noble lantern
misty current
#

ok i'm finna launch the server

#

and imma see

#

wait wtf did it really not give a classcast now

tardy delta
#

getI18NDisplayName()... what a name

ivory sleet
#

It stands for internationalization iirc

tardy delta
#

mwa

noble lantern
#

yeah they could of came up with a better name

#

like

#

getInternalName().....

#

getDefaultName() ffs

misty current
#

now i wonder why tf it was giving me a classcast before

#

oh well

tardy delta
#

getName() :kek:

noble lantern
#

im honestly malding there is no method to get the vanilla item name

misty current
#

kinda anti climatic that i need to use 2 imports just to stop a fucking log

#

but ok

echo hound
#

How can i do monthly stats

misty current
#

yeah it works fine thanks burchard

noble lantern
#

IIRC Spring does the same bs

misty current
#

i'll give it a try but for now i just care it's gone :p

quaint mantle
#

how to check if a block is a "block" not something like grass, fence gate, fence or ...

misty current
#

Material#isSolid() iirc

#

or something similar

quaint mantle
#

is ladder solid ?

misty current
#

don't think so

quaint mantle
#

im making something like a block animation

misty current
#

solid blocks should be ones that can pass redstone signal

quaint mantle
#

and i dont want it to spawn like on fence

tardy delta
#

check the implementation

misty current
#

no implementation

#

just check the enum

spiral light
#

how can i convert a uuid into a four 32-bit number ?

noble lantern
#

imagine if every minecraft block had a class like Entitys do

quaint mantle
#

i will just decompile CraftBlock and see

misty current
#

there's all the enum constructors

tardy delta
#

ladder is soli

#

d

noble lantern
#
final GrassBlock grassBlock = world.getBlockAt(grassBlockLocation);

grassBlock.delete();
grassBlock.update(true);
quaint mantle
tardy delta
#

for what?

quaint mantle
#

to check

#

if a block IS a block

#

not something like ladder

eternal oxide
#

a Block is just a representation of a location

quaint mantle
#

a Material

#

whatever

tardy delta
vale ember
#

how can i make custom config file instead of plugin.yml, like plugin.json? or even annotations in code?

tardy delta
#

solid checks if there can be built upon

quaint mantle
#

or fence

#

or ...

noble lantern
quaint mantle
#

i should not check for every tag

noble lantern
#

^ why

vale ember
spiral light
# quaint mantle Why

the new 1.18 system wants a intarray of the uuid instead of the uuid for a SkullOwner in a item

misty current
#

nbt tags in mc use that iirc so maybe something related

noble lantern
#

you dont?

#

What are you trying to achieve

#

that you need to ditch plugin.yml

#

plugin.yml is something spigot needs to load your plugin

#

You cannot change it, you cant trade it

quaint mantle
#

Ah you dont have proper skull api on spigot

misty current
#

you'd have to modify the spigot jar

noble lantern
#

^

misty current
#

something you don't want to do

spiral light
vale ember
#

like plugin.json or annotation in plugin's main class

noble lantern
misty current
noble lantern
#

Idk why the plugin.yml is such an issue

#

i NEVER touch it

misty current
#

¯_(ツ)_/¯

quaint mantle
#

what about my issue

noble lantern
quaint mantle
#

what should ido

noble lantern
#

Only time i ever touch plugin.yml is for depend and soft-depend

misty current
#

if you use a command api you don't even need to modify it for commands

noble lantern
#

If you want to remove commands form plugin.yml inject BukkitCommand's into Bukkit's CommandMap

misty current
#

i made my own so ez

noble lantern
#

wait

#

this is the perfect time to advertise my library

misty current
#

lol

#

redlib moment #2

vale ember
noble lantern
#

Without changing Spigots source code you cannot remove plugin.yml

vale ember
misty current
#

plugin.yml is there for a reason

noble lantern
#

no way no how, you can however make a seperate plugin that works like BentoBox

misty current
#

you'd probably write 100 of them in the time it'd take you to modify spigot's jar

noble lantern
#

If you make a Plugin, thats loads your own custom made plugins you can have your own plugin.yml in a sense

vale ember
noble lantern
#

Whats so hard about it?

noble lantern
#

BentoBox doesnt need plugin.yml for its Addons

stone sinew
vale ember
#

can i at least auto-generate it at build time from other file?

noble lantern
#

They have a .yml yes

misty current
noble lantern
#

But its a custom one

noble lantern
#

Its one you can make whatver ou want

quaint mantle
#

Oh wair

noble lantern
sand gull
#

I've started using the Cloud Command Framework recently, from the developers at NoxCrew and I love it

noble lantern
#

hence "addon.yml"

#

addon.yml is the one that actually handles the loading for BentoBox

stone sinew
noble lantern
stone sinew
#

Its still required to be used by spigot as a plugin

noble lantern
misty current
noble lantern
misty current
#

else it doesn't even call onEnable

noble lantern
#

BentoBox doesnt load addons as a plugin.. its loads them through ClassLoader...

stone sinew
vale ember
#

is plugin.yml used in PluginLoader? i mean if i implement it can i somehow it use instead of JavaPluginLoader?

sand gull
#

@noble lantern Damn that Pterodactyl NodeJS API was just what I was looking for, nice work

noble lantern
quaint mantle
#

@spiral light to get 2 ints from long use
long l = 0;
int fst = (int) l;
int snd? (int) l >> 32

noble lantern
#

as well as spigot

#

This is how you can have a custom "plugin.yml"

#

hence why bento has "addon.yml"

Bento's addons are loaded as "addons" to the main plugin that loads these

stone sinew
noble lantern
#

When i have time sure, its 6:30am rn tho

#

Either way

#

point is i was TRYING to make

#

is that you can have something SIMILAR to bento box that allows you to not have to use Spigots plugin.yml but if your only using that project like bento for that reason your using it wrong

noble lantern
#

If you dont want to have to fiddle with commands in plugin.yml use a custom command handler and never touch the plugin.yml again

noble lantern
#

There is no way to work around plugin.yml without:

Editing Spigots source code

Doing something similar like BentoBox does or the plugin i made i sent above

misty current
#

wait in theory could you make multiple economies with vault

noble lantern
#

Yes

misty current
#

like a token one, money one

noble lantern
#

Yep

#

Just have diff classes

misty current
#

o interesting

#

don't need it but i'll keep in mind

noble lantern
#

So like one class is named MoneyEconomy

Next is CoinsEconomy

#

yeah its super usefull

#

a lot of MobCoins plugins use vault

misty current
#

at least i know what i need to code because of the interface

quaint mantle
#

imagine not using vault for economy

noble lantern
#

im using items

misty current
#

and i don't discover a year later that i forgot to put an eco method i need

noble lantern
#

CMD ftw (CustomModelData)

misty current
#

sexy

lone reef
#

Anyone know why EntityTypes wouldn't be available on 1.18? I'm using a remapped-mojang depend

misty current
#

i used to run a friend server with some plugins of mine that had item eco and it was fun

slim cairn
#

How would I give the player blue dye if they pass throug ha ring?

misty current
#

especially with inflation, they didn't know where to put money

noble lantern
misty current
#

nah i like giving pain to people

noble lantern
#

it will go down 4 or 5 more times

misty current
#

i don't like servers using npcs

#

i find it lame and outdated

#

especially compress npcs

noble lantern
misty current
#

because literally everyone copy pastes

#

the same stuff

noble lantern
#

I reccomend using WorldGuard api and world edit api to save yourself some time

lone reef
noble lantern
#

Custom plugin

misty current
#

yes i know

quaint mantle
#

Honestly "vault virtual card" is the most convenient

slim cairn
misty current
#

but i still don't like it, i much prefer guis or commands

#

but if you made your own system it's nice

noble lantern
misty current
#

at least it's not that trash plugin everyone uses

noble lantern
#

Also EntityTypes was never a thing wasnt it?

#

Thought it was EntityType

lone reef
#

oh I'm using a spigot jar

#

just with a remapped-mojang classifier

#

for nms mappings

noble lantern
#

Ah thats why its likely not showing up

misty current
#

btw how do i get my economy later?

#

can I construct the class

lone reef
#

entitytypes is a nms thing

misty current
#

or is there a proper way to do it

noble lantern
noble lantern
misty current
#

and it just returns an instance of that class?

#

like i construct it on enable

quaint mantle
#

Just pass Economy instance in constructors where you need it

noble lantern
misty current
#

ah kk

noble lantern
#

Just make sure its registered

misty current
#

wdym

noble lantern
#

As in your onEnable just make sure you register the AbstractEconomy class

misty current
#

do i need to call a method from vault

#

or something?

noble lantern
noble lantern
slim cairn
#

Do you think there's like a tutorial or a doc somewhere?

misty current
noble lantern
# misty current do i need to call a method from vault
if(Bukkit.getServer().getPluginManager().getPlugin("Vault") != null) {
    Bukkit.getServer().getServicesManager().register(Economy.class, new ClassForEconomy(), this, ServicePriority.Highest)
}

https://www.spigotmc.org/threads/vault-custom-economy.282548/

misty current
#

oke thanks

noble lantern
slim cairn
ivory sleet
#

Oh then you basically know Java

noble lantern
#

If you know C# Java should be fairly easy, its relatively the same just a few minor syntax differences

But google is your best friend look into how to make your own CuboidRegion and then listen for when a player location is inside that CuboidRegion

slim cairn
#

ty

noble lantern
#

However WorldEdit/WorldGuard's API may be more simple to use

#

as you can just create a region with them and not need to create a whole class like that one

slim cairn
#

If I want to give 1 blue dye for green rings, 2 for yellow, 3 for orange etc etc would it be different? Since the rings spawn randomly

misty current
#

make multiple regions i guess

slim cairn
#

So the region thing wouldn't work like thatt

noble lantern
#

You would have to handle it yourself

So EG:

CuboidRegion at x location is blue, give blue dye

CuboidRegion at x location is red, give red dye

#

basically like a config in a sense, but a more runtime config

#

when you randomly generate the ring, randomly generate a color associated with it and assign it to the ring

#

HashMaps/Maps (Dictionarys for you) would be useful in this

#

at least i think theyre called Dictionary in C#

slim cairn
#

They're circles

noble lantern
misty current
#

is using async for vault safe? i'll need to make mongo requests so i need async

noble lantern
#

Lots of math involved

slim cairn
#

ah nvm then

#

I'll just make the rings cubes

noble lantern
noble lantern
#

Only issue is

#

It wuld be best to have a cache system

#

HashMap<UUID, Long>

#

always pull values from the map never from mongo

#

only pull form mongo on player join/server loads

misty current
#

oh yea that's stuff on my end, i plan on caching online player data and also any data that is requested

noble lantern
#

But if you read from mongo during runtime it can be an issue

#

eg player spend money he doesnt have

misty current
#

let's say someone wants to get a player's balance, i'd make a request to mongo if someone wants an offlineplayer's balance

#

and cache it

noble lantern
#

Why not cache the whole playerbase?

misty current
#

also i'd cache online player's data

noble lantern
#

When server starts just pull the entire database

misty current
#

wouldn't a 10k element hashmap be bad

noble lantern
#

Its only Longs isnt it

misty current
#

also requesting all data would take a bit

#

wouldn't it

noble lantern
#

Since its basically JSON the actual Size of MongoDB being sent is actually really small

misty current
#

i'd need to store more stuff in player profiles

#

maybe i should separate them

noble lantern
#

and its only 54kb

#

so if you stored 10k UUID, Long in a HashMap ide say it would be fine

#

and pulling all that data from mongo shouldnt take long at all

misty current
#

i mean wouldn't it slow down if i try to get something from an huge map

#

or call methods from it

#

also, i'd need to autosave it and syncronize it

#

so then i'd have to save all data back

#

let's say every 5 minutes

noble lantern
#

considering a HashMap can have millions of entries

#

10k shouldnt be an issue

#

But 10k of a large object could bring memory issues eg if you store 10k blocks or Locations in a HashMap

#

But 10k Longs shouldnt be an issue for any modern machine

noble lantern
#

If you edit cache before sending to MongoDB you never need to update

#

Server starts
-> Loads player data
-> player pays player 1$
-> player's balances are changed in cache
-> PUT request sent to mongoDB

#

you should only be sending requests this way

#

You shouldnt ever have to call a get unless you only want to load online players and player that get accessed while theyre offline

#

Loading online and accessed players

Or load entire database, up to you really

#

You can even create a purge system where inactive accounts with not much money get deleted

#

so that way you save on index + storage space

slim cairn
#

Could you send me a thing about CuboidRegions? I created a region for the ring with worldguard however I have no idea how to make CuboidRegions and google only talks about making them without WG

misty current
eternal oxide
#

eg BoundingBox#of(Block corner1, Block corner2)

noble lantern
#

There will never be a need to pull data since you already have it

slim cairn
noble lantern
#

And since you changed the data locally, and pushed that local data you already know whats in the database so no need to reverie unless the request fails

eternal oxide
misty current
#

i don't need to in this case but let's say i do

eternal oxide
#

if they do, its simple

misty current
#

i could only cache online player data couldn't i

noble lantern
#

Complex*

#

You would basically need to be always pulling the data

slim cairn
#

(Btw ive never made a plugin before, I have the Skript plugin on my server but thats kind of it so I have no idea what to even do)

noble lantern
#

So in that scenario you would need a queen system

noble lantern
#

And make sure each economic exchange is carried out in order and not before your Mongols request is returned back with the players balance

slim cairn
eternal oxide
noble lantern
#

Thats the third person to say that xD

#

Hahaha

eternal oxide
#

prefered ide for Java between eclipse or intelij?

misty current
#

intellij

noble lantern
#

Notepad++

vale ember
#

IntelliJ onelove

quaint mantle
#

nano md_5

noble lantern
#

Pen and paper

eternal oxide
#

Eclipse for me, but my question was to Host

noble lantern
#

Anyone who doesn't use intelligence in here needs to be banished

#

Jk

#

Okay integlligence yes

slim cairn
noble lantern
#

I meant to type intellij, but what I said still stand as well

eternal oxide
slim cairn
#

Alrightt

stone sinew
#

Eclipse for java, Intellij to convert other's source to eclipse 😉

slim cairn
#

so what would I use instead

misty current
eternal oxide
#

My choice is Eclipse as its simpler. Many go for Intelij because they like the bells and whistles and it does code suggestion so they can be lazy

quaint mantle
#

Intellij Idea definetly

noble lantern
#

Intellij has spoiled me with tab compeltions

#

Intellij + tab9ine is OP

eternal oxide
misty current
#

jetbrains basically have an ide for everything

noble lantern
#

Intellij auto correct on top of the AI auto completion oh my GOD

misty current
#

pycharm, intellij, and so on

eternal oxide
#

thats probably the most complrehensive tutorial for a beginner to plugins

slim cairn
#

Damn if Intelij does all of that wouldnt it be better

noble lantern
#

Some people prefer simple

misty current
#

i like intellij completions

#

also the plugins

noble lantern
#

Intellij has so many features sometimes its hard for people to use

vale ember
#

intellij + mc development plugin

eternal oxide
#

I prefer Eclipse. It does what I tell it and no more.

quaint mantle
#

intellij is simple as dick

noble lantern
slim cairn
noble lantern
#

Ive never written my own pom.xml

vale ember
noble lantern
#

Ayo what

misty current
#

lmao

#

same

noble lantern
#

What did he say

vale ember
noble lantern
#

What did that guy say ayo what

slim cairn
#

So eclipse or IntelliJ

misty current
#

intellij for me

noble lantern
misty current
#

try both and decide

eternal oxide
#

your choice, its personal preference

vale ember
#

IntelliJ + plugin i sent

slim cairn
quaint mantle
misty current
#

maven better

noble lantern
#

Tab9ine is overpowered

slim cairn
#

I'll just go with IntelliJ

quaint mantle
#

maven suck

misty current
#

i don't like tabnine

vale ember
misty current
#

i prefer codota

noble lantern
misty current
#

also iirc it does ^

noble lantern
#

Ffs auto correct

#

"Grable"

quaint mantle
misty current
vale ember
misty current
#

not request until i'm sure the data is updated?

quaint mantle
#

Groovy sucks even more than maven

misty current
#

how would i make sure it is

noble lantern
misty current
#

messaging channels could be an option i guess?

#

if i usebungee

noble lantern
misty current
#

i'd need the servers to talk somehow

noble lantern
#

On economy update:
Update to all servers

#

That could be an option instead indeed

#

And the condition just runs on the proxy

misty current
#

like i can say hey this player data is changing so wait please to all servers

noble lantern
#

Economy***

misty current
#

and then say ok it's done u can get it

noble lantern
#

So no need for waiting since its all cache

misty current
#

o yea so hold all data in a bungee plugin

noble lantern
#

Yessir

#

And the spigot plugin side just talks back and forth between the bungeecord

misty current
#

sometimes i wonder how much it took for big production servers to sync data up

slim cairn
#

Okay so I downloaded IntelliJ

#

The Zip

misty current
#

i think it's one of the most complex things about spigot coding

slim cairn
#

It gave me idealC

noble lantern
#

Its a lot of work for data syncing accrods servers ngl

misty current
#

also error handling and all this stuff

noble lantern
#

Its so hard to prevent duplications

misty current
#

like hypixel

#

they probably have more than a bungee too

noble lantern
#

If its not perfect someone will figure out a dupe in your sync and rip

charred plover
#

Hey guys I need a plugin that will transfer to the site when the item is Right clicked, is there such a plugin?

noble lantern
#

Hypixel uses uhh

slim cairn
#

idealC > bin > idea64.exe?

noble lantern
#

Shoot whats it called...

misty current
#

hypixel has had countless dupes like that

#

and also another server (cosmicsky) had a similar dupe

slim cairn
misty current
#

inventory and balance were updated one after the other in the same async thread

misty current
#

so people made notes and instantly got kicked from an island to join another server

noble lantern
#

OH YEAH!!

#

Redis!!

misty current
#

and keeping the money note but getting money back

slim cairn
noble lantern
#

Redis is fuckin perfect for this

#

Host redis on the local machine and bam

misty current
#

something else i have to learn nice

noble lantern
#

All redis is is just a HashMap pretty much

#

Key Value nosql storage system

vale ember
misty current
#

do i need to host it somewhere to make it send messages between proxies

hushed hedge
misty current
#

wait does it classify as a database?

slim cairn
noble lantern
#

It connects similarly to like Mongols connects

#

It classifies as a temporary database

#

Redis data is cleared on restart

misty current
noble lantern
#

You can make it persistent, but don't

misty current
#

i'd need it just for messaging anyways

tardy delta
#

dont create that many itemstacks

noble lantern
misty current
#

it is for messagign

#

right

noble lantern
#

If you use redis

tardy delta
#

create one, add it, set it to a new itemstack add it

misty current
#

what'd i need it for?

noble lantern
#

PluginMessaging would be used if you not using redis

In that case bungeecord basically acts as a redis server

#

As the bungeecord plugin would be handling a map of data for balances

#

If you use redis, you dont even need to cache anything on your end

#

Load data from mongo

-> send to redis

#

And you can create a program thats always running to sync mongo + the redis server together so that way all players are loaded 24/7 to redis

But TBH this isn't meant for something like a public plugin like I think your making

misty current
#

nah defo not public :p

#

core plugin for a server

noble lantern
#

Oh then defo use redis

#

Yeah I reccomend redis if its your own private thing

#

Basically treat redis like a Java program that only runs a HashMap

misty current
#

so i can make requests to redis

noble lantern
#

Yes

#

And since redis is in ram, if your redis is hosted locally theres no delay

smoky oak
#

ItemStack.getDurability() is deprecated, what should i use instead?

misty current
#

what would the difference be? wouldn't it act like mongo and need async or take a bit to take data

#

for network speeds

#

wait i host it on the bungee server

#

in theory

noble lantern
#

So you have no latency

slim cairn
noble lantern
#

Its also better for security too

slim cairn
#

Waddo I do

noble lantern
#

That way its not on an open network

misty current
#

hmm slapping redis on a minehut proxy isn't very doable lol

noble lantern
#

you know those containers have ssh right

misty current
#

wait can i connect to them using something like putty

#

or winscp

noble lantern
#

Yeah its a lil complicated search in the dev chat and look for my latest messages on the minhut chat

#

You need to use a ngrok tunnel but that whole system is rather simple

#

Ngrok tunnel plugin -> ssh access

hushed hedge
#

jugador.getInventory().addItem(ItemStack[diamond_helmet]);

#

??

noble lantern
misty current
#

that's a lot of work just for editing longs lmfao

slim cairn
misty current
#

well that's what distinguishes a good server from a trash one

noble lantern
#

You can entirely remove the queue and redis...

hushed hedge
vale ember
misty current
#

i mean for me that i don't have much experience with this kind of stuff

slim cairn
#

Did that

#

it gave me a zip

noble lantern
#

But there is a chance that a player may spend money he doesnt have because you were waiting for a request to finish

misty current
#

i'd be interested in learning to use redis and also to code bungee plugins

vale ember
#

try installing from marketplace from ide

misty current
#

so it's a good occasion isn't it

noble lantern
#

Its legit just a HashMap

#

Its a collection of different HashMaps pretty much

slim cairn
noble lantern
#

Database.HashMap is its structure

slim cairn
#

Do I make a spigot or bukkit plugin

gritty urchin
#

@eternal oxide How do you suggest I do this with a tree search?

misty current
#

aight imma try it

#

thanks a lot

#

gtg now

#

bye

noble lantern
#

Dm me if you have questions im off to bed myself

eternal oxide
gritty urchin
#

but there are many portals

slim cairn
eternal oxide
#

ok, so its going to be vertical or horizontal blocks

noble lantern
#

For (x)
For (y) {}

gritty urchin
#

So block face?

eternal oxide
noble lantern
vale ember
lunar schooner
#

Hey folks, I'm toying around in NMS again. I'd like to disable an entity's collision completely, is this possible? Previously I had a field collides in net.minecraft.world.entity.EntityLiving, though this one seems to have gone

slim cairn
vale ember
#

then choose spigot and click Next

noble lantern
#

Increment X until you hit air, go back one X. Then go up and down on Y until you hit Air, go down one on X again and continue

slim cairn
vale ember
#

it's package in which you project is stored like com.host.pluginname, just like namespaces in c#

#

artifactId is your plugin name and groupId is for example com.host

slim cairn
vale ember
#

you are not neccessary to use 'com.host'

slim cairn
#

and what Version?

noble lantern
#

Gnight devs

vale ember
slim cairn
#

Ahh

#

Then just next

vale ember
#

just specify you as author, and if your plugin have dependencies, put them here

#

also you may add description

#

but it's not necessary

slim cairn
#

btw its 1.17.1 not 1.18. Ignore that I changed it

vale ember
#

it's ok, but remove 'no' from website, just leave it blank

#

also change minecraft version if you want, current is 1.18

vale ember
#

remove 'no' from website (leave it blank) and proceed

dusty kindle
#

Hello anyone know how to fix that


import com.metaxcrew.magicalcore.MagicalCore;
import com.metaxcrew.magicalcore.Utils.VaultUtils;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import java.util.regex.Matcher;
import java.util.regex.Pattern;



public class ChatDesign implements Listener {
    public ChatDesign(MagicalCore plugin) {
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    public String translateHexColorCode(String message) {
        Pattern hexPattern = Pattern.compile("&(#[A-Fa-f0-9]{6})");
        char colorChar = ChatColor.COLOR_CHAR;

        Matcher matcher = hexPattern.matcher(message);
        StringBuilder buffer = new StringBuilder(message.length() + 4 * 8);
        while (matcher.find()) {
            String group = matcher.group(1);
            matcher.appendReplacement(buffer, colorChar + "x"
                    + colorChar + group.charAt(0) + colorChar + group.charAt(1)
                    + colorChar + group.charAt(2) + colorChar + group.charAt(3)
                    + colorChar + group.charAt(4) + colorChar + group.charAt(5)
            );
        }
        return matcher.appendTail(buffer).toString();
    }

    @EventHandler

    public void onChat(AsyncPlayerChatEvent event) {


        Player p = event.getPlayer();
        event.setFormat(ChatColor.translateAlternateColorCodes('&', translateHexColorCode(translateHexColorCode)), VaultUtils.getChat().getPlayerPrefix(p )).split("&")[0]+ p.getName()+ChatColor.WHITE+ ": " + ChatColor.GRAY+event.getMessage();
    }

}
slim cairn
#

I did

vale ember
#

yep

#

you created project

slim cairn
#

nice

#

So what now-

vale ember
#

everything in onEnable will run every time server boots up, code in onDisable, when server is turned off

#

just start writing code

#

use spigot docs to find what you need

slim cairn
#

I honestly have no idea what I'm searching for