#help-development

1 messages ยท Page 2270 of 1

glossy scroll
#

did you open your player log

#

asked for a that a bti ago

elder blaze
#

no

#

where can I see?

glossy scroll
#

.minecraft/logs/latest.log

elder blaze
#
[02:01:05] [main/INFO]: Connecting to 127.0.0.1, 25565
[02:01:06] [main/INFO]: [CHAT] Bienvenido/a a Topo PR3C14D0
[02:01:08] [main/INFO]: Stopping!
[02:01:08] [main/INFO]: SoundSystem shutting down...
[02:01:08] [main/WARN]: Author: Paul Lamb, www.paulscode.com
#

literally

#

xd

glossy scroll
#

like i said

#

.

elder blaze
#

oh

#

right

#

what's the difference between ChatSerializer.a and .b?

elder blaze
eternal oxide
#

um, are you trying to send a title?

#

It looks like you are

glossy scroll
#

no

#

header and footer

#

in tab list

eternal oxide
#

ah

glossy scroll
#

this is an ancient version

#

im not gonna look at the obfuscated code

elder blaze
#

xd

elder blaze
glossy scroll
#

no

#

not a title

elder blaze
#

header

#

and footer

elder blaze
#

any good motd generator?

zenith gate
#

?paste

undone axleBOT
zenith gate
eternal oxide
#

your while loop will never exit

#

Single thread, you can't wait for things to happen

zenith gate
#

but when there is no one in the ArrayList the while loop doesn't do anything...

#

right?

elder blaze
#

make a condition for breaking

elder blaze
#

thx

eternal oxide
elder blaze
zenith gate
glossy scroll
zenith gate
#

so just make a break condition when no one is in the array?

elder blaze
#

._.

eternal oxide
#

just change while to if

#

then in your runnable you can enable flight again

zenith gate
#

I have an item that players can create that will allow them to fly so wouldn't they just be able to overide it and be able to fly again?

#

that's my problem I had when I first attempted doing this...

eternal oxide
#

your combat terminates after 60 seconds

glossy scroll
zenith gate
#

at least i know of..

glossy scroll
#

sounds like you need to put in some sort of internal access

#

like isInCombat

#

and your item can look at that before making changes

eternal oxide
#

don;t have your item enable flight, just toggle flight

#

IF flight is enabled

zenith gate
eternal oxide
#

Change your while to if.
Put enable flight in the runnable when combat ends.
Don;t have your item enable flight, only set flying IF flight is enabled.

zenith gate
winged storm
#

what do i enter as the first argument for my NamespacedKey

dusk flicker
#

theres this great thing, called JavaDocs

#

?jd-s

undone axleBOT
zenith gate
#

is there a function for getting a players head? i'm not seeing it anywhere in docs

quaint mantle
#

Wait i forgot, can i ask for paid plugin devs here

idle pier
#

so.

#

can i get help?

zenith gate
idle pier
zenith gate
#
getServer().getPluginManager().registerEvents(PUTEVENTHERE);
dusk flicker
#

?services

undone axleBOT
zenith gate
idle pier
#

basically, thats meant to be used in public void onEnable, it doesn't work.. Basically its a GUI menu. I can get it opened but because i have an argument in the constructor for a Player object, i cant use it in the onEnable because it will try to open the GUI on startup for null player and then fail to enable the pluigin. I am trying to register the event when a command is executed but putting this getServer().getPluginManager().registerEvents(PUTEVENTHERE); on command execution doesnt work either. So basically in the end i have a menu that can be opened but players can just drag objects around, close it and get more into there inventory

subtle folio
#

Can WeakHashMap's have duplicate keys?

delicate lynx
#

that inventory setup sounds way too complicated for no reason

zenith gate
#

yeah...

idle pier
delicate lynx
#

why are you registering an event with the menu?

idle pier
#

not sure if i can make that ll in one class

delicate lynx
#

make them separate

zenith gate
#

It's more organized as well

idle pier
#

i am trying to have them separate

quaint mantle
dusk flicker
#

Need to make more posts first

#

Messages, etc

idle pier
#

bruh, who though it was a good idea to not allow file uploads

zenith gate
#

virus?

lost matrix
zenith gate
#

oh

idle pier
#

brain

idle pier
lost matrix
#

Dont name your classes ...Class
FirstScreen, SecondScreen, ThirdScreen are horrible names for classes.
Not very descriptive.

lost matrix
# idle pier

How are you planning on implementing this structure anyways?

quaint mantle
#

If i dont have privileges

dusk flicker
#

get involved in the community

#

theres other forums to post in

#

reply to messages, etc (just dont spam)

idle pier
subtle folio
#

?xy

undone axleBOT
delicate lynx
#

you're not telling us really anything

#

this seems way too much to achieve something simple

echo basalt
#

oooh so mysterious

lost matrix
idle pier
#

i have another idea

glossy scroll
#

what's wrong with registering listeners post runtime?

#

not trying to be snarky

#

just question

idle pier
# echo basalt oooh so mysterious

no need to mock me, im just trying to get this finished soon, and i only want to get an answer on how to register events post start. It's either a yes (here's how), or no (and i say alrighty)

lost matrix
worldly ingot
#

Every time you register an event, the registered listeners have to be rebaked

glossy scroll
worldly ingot
#

lol yeah

dusk flicker
#

ah yes throw those listeners into the oven like a good baker

worldly ingot
#

pretty sure it was in that very method

glossy scroll
#

once again this is one of those things i personally havent really done before but always nice to ask

worldly ingot
# idle pier baked?

Go through all the Listener instances, find their event handlers, sort them by priority, etc.

idle pier
lost matrix
idle pier
glossy scroll
#

to unregister a listener use HandlerList.unregisterAll

idle pier
glossy scroll
#

i mean once again you're not really giving us the full picture

#

so we dont really know

#

if you're just registering one listener with like 2 events in it, it probably will be fine (allbeit still not the best thing)

idle pier
glossy scroll
#

what

idle pier
#

nvm, i dont want to confuse you further..

glossy scroll
#

I would make an interface that your inventories use that have necessary methods that mirror the events you need

#

have a main controller that listens to these events

#

in in that controller call the respective methods in the active inventories

lost matrix
# idle pier nvm, i dont want to confuse you further..

So here is the highest abstraction layer that made sense to me right now:

public interface IMenuHandler {

  Inventory getBukkitInventory();

  void handleTopClick(InventoryClickEvent event);

  void handleBottomClick(InventoryClickEvent event);

  default void handleClose(InventoryCloseEvent event) {

  }

}

First question was: "What does a Menu react on?"

#

Here is the singleton that hosts your open menus:

public class MenuManager {

  private final Map<Inventory, IMenuHandler> handlerMap = new HashMap<>();

  public void register(IMenuHandler handler) {
    handlerMap.put(handler.getBukkitInventory(), handler);
  }

  public void unregister(IMenuHandler handler) {
    handlerMap.remove(handler.getBukkitInventory());
  }

  public Optional<IMenuHandler> getHandlerOf(Inventory inventory) {
    return Optional.ofNullable(handlerMap.get(inventory));
  }

}
quaint mantle
#

optional ๐Ÿคข

#

sorry continue

glossy scroll
quaint mantle
#

K

idle pier
lost matrix
#

And here is the listener for it:

@RequiredArgsConstructor
public class MenuListener implements Listener {

  private final MenuManager menuManager;

  @EventHandler
  public void onClick(InventoryClickEvent event) {
    Inventory primary = event.getInventory();
    menuManager.getHandlerOf(primary).ifPresent(menuHandler -> {
      if (primary == event.getClickedInventory()) {
        menuHandler.handleTopClick(event);
      } else {
        menuHandler.handleBottomClick(event);
      }
    });
  }

  @EventHandler
  public void onClose(InventoryCloseEvent event) {
    menuManager.getHandlerOf(event.getInventory()).ifPresent(menuHandler -> {
      menuHandler.handleClose(event);
      menuManager.unregister(menuHandler);
    });
  }

}

Now you will only have to register your listener once.
After that you simply implement the interface IMenuHandler.
And use it like this:

  public void openSomeInv(Player player) {
    IMenuHandler handler = new YourHandlerImplementation();
    menuManager.register(handler);
    player.openInventory(handler.getBukkitInventory());
  }
worldly ingot
#

5 million IQ, only I would have used InventoryView instances > Inventory

glossy scroll
#

why differentiate between MenuManager and MenuListener

lost matrix
idle pier
quaint mantle
#

He is

#

He's done it before

glossy scroll
#

I'm learning lots today.... ive always passed around instances of listeners ๐Ÿ’€

quaint mantle
#

He's like make 50 plugins just by helping in this channel

river oracle
#

I feel like 7smile7 has been around long enough to know a couple things ahaha

quaint mantle
#

Are you calling him old

glossy scroll
#

i mean

quaint mantle
#

Me personally

glossy scroll
#

any seasoned developer

#

could take what he said

lost matrix
glossy scroll
#

and transcribe it into code

idle pier
glossy scroll
#

he managed to put it into code though haha

lost matrix
#

I guess ive just done this quite often now.

zenith gate
#
public class LevelToHealth implements Listener {
    @EventHandler
    public static void onLevelToHealth(PlayerLevelChangeEvent event){
        Player player = event.getPlayer();
        if(player.getLevel() >= 20){
            Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).setBaseValue(Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getBaseValue() + 1);
            player.sendMessage(ChatColor.GREEN + "Granting a half a Heart every level");
        }
    }
}

I understand that this keeps going on on and on, but Is there a similar way of doing this, but it stops granting health after level 60, and wont grant health if they have already achieved this level aka level 22 ( goes and enchants now level 18 ) they get to level 20 again and they are granted an additional heart..

I don't know if this is viable and not really looking for a solution more looking for a shove in the right direction..

signal ether
#

Is there a straightforward way to set an event priority based on config value? Obviously just when the plugin first enables and I register the event

lost matrix
zenith gate
lost matrix
#

I just mean a Map of which the content is persisted when a session ends.

zenith gate
#

mhm okay

lost matrix
# zenith gate mhm okay

Player joins -> you load the data into memory
Player quits -> you save it back do disk/database

zenith gate
#

alrighty, thank you

lost matrix
iron glade
#
String rawURL = MiniMessage.miniMessage().serialize(e.message());
int messageLength = rawURL.length();
String shortenedURL = messageLength >= 32 ? rawURL.substring(0, 30) + "..." : rawURL;

Would this be a good way to shorten an URL a user pasted into the chat?

signal ether
#

if you're not interesting in actually preserving the data i guess. this would work with any string honestly not just urls

lost matrix
signal ether
#

he's not even shortening the url, he's just truncating to the first 31 chars

iron glade
#

The actual URL is saved as it is pasted, I just want to send the player a message back that the url [URL] was accepted and there I don't want to paste the whole URL as it makes the message ugly

signal ether
#

ah.

lost matrix
#

I think he should at least create hover component that shows the whole url

iron glade
lost matrix
#

So you cant even click on it...

#

Sounds quite useless. "Hey here is a nice url. But only half of it and you cant open it."

iron glade
#

Nooo let me explain in more detail :D

#

I ask the user to input a valid URL containing an image

#

and after he did it and the URL was valid (contained an image) i notify him that the URL he provided was accepted

#

and in that message i put the shortened url if it is too long

lost matrix
#

Makes sense. No need to show the user his own full url then.

winged storm
#

what arguments am i supposed to provide for a namespacedkey

iron glade
#

yes! that was the plan. Since action bars can go out of the visible screen I want to keep them quite short even if the URL is very long

waxen plinth
#

?jd-s

undone axleBOT
waxen plinth
winged storm
#

ik

#

but i dont understand

#

what im supposed to put

waxen plinth
#

What do you not understand

glossy scroll
lost matrix
signal ether
#

ideally you can also download a sources jar

winged storm
glossy scroll
#

you need a plugin and a key

#

plugin - the plugin to use for the namespace

idle pier
glossy scroll
#

key - the key to create

lost matrix
glossy scroll
#

Vehicle would be the abstract class or interface

glossy scroll
#

HondaAccord would implement/extend Vehicle

signal ether
lost matrix
idle pier
glossy scroll
#

yep

signal ether
#

Also kinda unrelated but I don't actually know what namespaced keys are even used for in a plugin? That's just because I'm big dumb though

glossy scroll
#

your implementation would be HondaAccord

idle pier
#

i dont read books, last time i did was 9 years ago

glossy scroll
#

rather, HondaAccord would be an implementation of Vehicle

#

so if someone tells you to "implement something" they may mean extend/implement another class

#

or "create an implementation"

lost matrix
glossy scroll
#

(of course, implementation has many meanings... requires some context)

glossy scroll
winged storm
glossy scroll
#

we mainly use them for persistent data containers

#

it allows spigot/minecraft to uniquely identify where a piece of data is coming from

signal ether
#

so like commands and what else?

glossy scroll
#

and it allows you to reserve a piece of data

#

no... not realyl commands

#

like in NBT

signal ether
#

oh i just thought commands because you can type stuff like /minecraft:tell to specify plugin

glossy scroll
#

no that's different

#

similar idea, but completely different

#

we use plugin.yml for that

zenith gate
#

is it possible to make a crafting recipe call for multiple items? like 2 diamond blocks in each corner and 5 gold blocks for the rests to make 1 item?

signal ether
glossy scroll
#

well i mean

#

its a good observation

#

and it uses the same pattern

#

but namespaces are not used in commands

signal ether
#

So you're saying I can actually store custom data in mobs and stuff now? I've read the docs on namespaced keys but it focuses more on how to create one rather than what you can do with it afterward...

zenith gate
signal ether
#

do you have a good link for obtaining this forbidden knowledge? :D

glossy scroll
#

?pdc

signal ether
#

cheers

winged storm
#

how do i get the instance of my plyugin

river oracle
undone axleBOT
buoyant viper
#

u just do it

#

tbh

river oracle
#

so true

signal ether
#

I've always just done static MyPlugin instance and set it on enable but that might be bad practice?

buoyant viper
#

an OOP elitist may deem static use to be frowned upon

buoyant viper
#

in the end as long as u can get ur plugin

#

u still get ur plugin

#

so if it aint broke, heavily consider if it needs fixing

signal ether
#

I've always viewed OOP as a tool for use in conjunction with functional programming anyway

glossy scroll
glossy scroll
#

sounds scary, its not

fading lake
#

When its getting the instance of a plugin, it really doesn't matter, when it's literally everything, thats when its an issue

signal ether
#

will do.

glossy scroll
#

so therefore its not worth to have good practice

signal ether
undone axleBOT
river oracle
#

use dependency injection

#

it matters

glossy scroll
signal ether
#

fair

fading lake
#

you don't wanna remember a specific instance of an object where it doesnt matter, which is where static abuse comes from

idle pier
#

@vagrant stratus its Slava Ukrainie, not Ukraini

glossy scroll
#

as the article mention, any unit tests that relies ona singleton pattern can easily break

fading lake
#

exactly, everything more than that is static abuse

#

what you should be saying, is "the way newbs use static is often bad"

glossy scroll
#

im not saying that though lol

signal ether
#

idk why the heck it's called dependency injection though lol

river oracle
#

dependency injection

#

you have a dependency and injection

signal ether
#

but is your own plugin a dependency on itself??

fading lake
river oracle
#

its the fancy way of saying constructor thingy

glossy scroll
#

because many people tend to think of constructors that use many different instances

#

in this case, our constructors use an instance that is meant to only exist once

#

by use, i mean its parameters

#

this is not appropriate here

signal ether
#

@idle pier you in the wrong channel

idle pier
fading lake
#

man just wanted to share his music

glossy scroll
#

#general

river oracle
#

no u ^

tranquil viper
#

I'm making a pig shooting gun and I was wondering what the best way to go about tracking the pigs movement would be. How can I track when the pig hits a block and then create an explosion?

glossy scroll
#

an interesting way to do it is to disguise an arrow as a pig then detect ProjectileHitEvent

#

otherwise i dont really know a simple way

tranquil viper
#

Hm I could, but I feel like I've seen a much better way of doing it in the past somewhere

fading lake
#

ive seen it done by getting the blocks immediately around the pig on a timer and cancelling it causing the explosion when it gets near enough to a block, but that might be intensive

signal ether
#

you could go the yandere simulator route of programming and check every tick :3

fading lake
#

but like mart said, disguising a projectile as a pig is the best idea since it already has that landing mechanic

tranquil viper
#

I'm just going to make a runnable that crashes my server at this point xd

tranquil viper
glossy scroll
#

libsdisguises is my goto for such things

#

if you dont have one

fading lake
#

run speed = every 4th tick

#

ez

signal ether
glossy scroll
#

essentials is not the best role model

signal ether
#

well yeah but

fading lake
#

nah it doesn't depend on it, pretty sure essentialsx is open source

glossy scroll
signal ether
#

oh T_T

glossy scroll
zenith gate
#
healer.setIngredient('W', (RecipeChoice) FeederUtils.createFeeder());
java.lang.ClassCastException: class org.bukkit.inventory.ItemStack cannot be cast to class org.bukkit.inventory.RecipeChoice (org.bukkit.inventory.ItemStack and org.bukkit.inventory.RecipeChoice are in unnamed module of loader java.net.URLClassLoader @2e5d6d97)

Isn't Recipe choice how you use custom items to make another custom item?

worldly ice
#

you have to use RecipeChoice.ExactChoice(...)

#

instead of casting

zenith gate
#

oh IntelliJ just auto casted it...

#

can anyone help me with this? it's not related to spigot but this happens a lot

Failed to delete C:\Users\--------\Desktop\Code\Wired\target\maven-status\maven-compiler-plugin\testCompile\default-testCompile\inputFiles.lst
#

It makes me manually go and delete it...

lime moat
#

Super dumb question, but how would I send a message to everyone?

buoyant viper
#

Bukkit.broadcastMessage

#

?jd-s

undone axleBOT
lime moat
#

Bukkit.broadcastMessage("Test"); It says java 'broadcastMessage(java.lang.@org.jetbrains.annotations.NotNull String)' is deprecated

buoyant viper
#

uh

#

sec

#

ah wait

#

are u using paper api

lime moat
#

Yes, 1.19

buoyant viper
#

thats why

#

paper wants everyone to use adventure text components instead of strings

lime moat
#

Oof, I can't use that in my instance lol

buoyant viper
#

y not

#

is the server not on paper? xd

lime moat
#

Yes and no... we plan to have it switched to spigot every update, hence why I can't really use adventure

buoyant viper
#

ah

#

i say use what you always want to be compatible with

#

so if u want to ensure spigot support use org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT

lime moat
#

Okay, thank you!

crisp steeple
#

code:

File file = plugin.getLoggerFile();
try(JsonReader reader = new JsonReader(new FileReader(file))) {
     JsonArray arr = new Gson().fromJson(reader, JsonArray.class);
     if(arr != null) for(JsonElement element : arr) logs.add(TradeLog.deserialize(element.getAsJsonObject()));
}
quaint mantle
#

Thats a lot of base64

crisp steeple
#

ok fixed it by doing this incase anyone finds this problem in the future somehow

signal ether
zenith gate
#

to create the item ofc.

#

then I make a shaped recipe, then add it to the server making the result my custom item from the ItemStack

signal ether
#

An item stack just represents a stack of an existing vanilla item, not a "custom" one. Don't get my hopes up like that ๐Ÿ˜”

zenith gate
#

Yeah then you use Listeners add what you want to it... Make it have attributes.. whatever you want..

#

I have an item that you create with a custom Recipe, when you right click it your saturation is full... aka a custom item.. cause that is not in Vanilla minecraft.

signal ether
#

OK I thought you meant like, it had its own item id or something

zenith gate
#

Well it does but has more functionality then just that.. can make it do whatever you want..

#

Like I have a bunch of bows on my server that do a bunch of stuff, Like summon lightning on the target, as well as one with a tnt bomving, blows up 16 tnt on the location the arrow lands.

signal ether
#

So the client sees minecraft:bow but it's different on the server side?

#

What I'm confused about is the actual part where you define the new id

zenith gate
#

wym by new id? like modded items with their own ID to use with /give ?

signal ether
#

Well you keep saying your bows are different, but how are you identifying whether it is vanilla bow VS your bow

zenith gate
#

well normal bows don't summon lighting...

#

and using a name..

#

i set a display name then check if they are shooting a bow with that name

#

and if they are, do whatever the bow is suppose to do

signal ether
#

Okay so just item/lore checks then. Hasn't changed from 1.12. I thought you were talking about some new feature

#

Like storing persistent data in the item stack or something

zenith gate
#

I only started doing this around 1.16

strong parcel
#

I am able to save a UUID to JSON just fine, so what is it about an ArrayList that changes things?

ashen quest
#

how can I make an entity (baby villager) jump on a Player entity, want to make it look like its kickin the player in them ballz

ashen quest
#

How do I change an entity on EntitySpawnEvent

dim palm
#

bro wtf

ashen quest
#

wdym bro

ashen quest
tacit dagger
#

how do i setInvul to EntityWither? I have tried with this method but it didn't work

tacit dagger
summer scroll
#

Didn't know Wither have size.

tacit dagger
summer scroll
#

Are you sure 1500 is the valid value?

#

Maybe there is a cap so if it's exceeding the max value it's gonna be set to default.

tacit dagger
#

thank you

cursive kite
#

I am working on a plugin that uses a MySQL database to keep data consistent between servers, but instead of config/hardcoded password/user (since then hackers can in theory hack the server get the config file and read the login) I added made a php server handle requests. If I make a table with server ips and a boolean (ex 127.0.0.1 | true) meaning this server can access the user database and when pulling data just request server ip and if its true provide data

#

How secure would this be?

sacred mountain
#

fmee fmoo

shadow zinc
#

should I send emails asynchronously?

#

because I looked at my spark profiler and it was quite high

#

for emails*

vocal cloud
# cursive kite How secure would this be?

If someone was to hack their server, and steal their data, how much use would a localhost-only sql server username/password be? I don't think your plugins data would be that valuable compared to the other data they'd have access to. Also, if it's IP based and they really wanted to access it they'd just send a request from the server machine. Not to mention that unless you apply some API key any plugin can use your new php database thingy

torn shuttle
#

uh correct me if I'm wrong but even async threads shouldn't have a Thread.sleep() in bungeecord right?

vocal cloud
#

If you're Thread.sleeping you're probably doing something wrong

ivory sleet
eternal oxide
#

It becomes insecure once you use non local

#

locking to a specific IP is good though

#

however you should really have some kind of authentication

#

even if its somethign simple like SSL

vocal cloud
#

Yeah, but if someone hacks your server and can access the config with the db details you've got a bigger issue than your plugins data

eternal oxide
#

true

lilac dagger
#

Why's this giving me a visual glitch on 1.16.5 at least?

eternal oxide
#

what glitch?

ivory sleet
#

Oh the null thing

#

getAttribute can return null if thereโ€™s no attribute instance for the given attribute

lilac dagger
#

not this one

#

the health is resetted but the client still sees the old value

#

until he takes a hit

small current
#

anyone worked with snakeyaml ?

lilac dagger
#

nope

#

keep using the classic one

small current
#

what is that

small current
#

just asking if you checked it or whatever

#

idk your code ๐Ÿ’€

ivory sleet
#

Oh @lilac dagger youโ€™d have to set the normal health to the max health in case itโ€™s above the max health

#

iirc

#

Sth like that is done in implementation at least

eternal oxide
#

That shouldn't be required to just raise the max health.

ivory sleet
#

For setMaxHealth

eternal oxide
#

if he wants to keep the current health the same but increase teh players max

#

It "should" update the client

ivory sleet
#

Well it has been required

#

Since the attribute api is a direct adapter api design to normal nms attributes

iron glade
#

Is there a way to copy something to a player's clipboard?

ivory sleet
#

Idk if they changed it tho

eternal oxide
#

requiring to full heal a player to notify of a maxHealth change?

#

I guess you could set teh current health to max, then reset it to what it was, after teh client gets its update

ivory sleet
#

Not fully heal

#

But if normal health exceeds max health, set it to max health

#

Or sth

smoky oak
ivory sleet
#

Idr the impl that well

eternal oxide
#

That woudl be needed if you were reducing MaxHealth

ivory sleet
#

Yeah

ivory sleet
#

Whichโ€ฆ wellโ€ฆ might be the case for freestyler shrug

formal bear
#

I'm making a backpack plugin, what's the best way to storage items? Presistent data storage to store ingame then sync with database for every minute or something?

smoky oak
#

save when player closes backpack

#

no sync issues

#

database access too is not something that takes too long

ivory sleet
#

Why do you need two data storages?

formal bear
#

I'm just asking, to not make server killer with huge performance issues

ivory sleet
#

Well first of all you probably just want a single storage source

smoky oak
#

well you wont call such methods too often so you should be more worried about corruption and desync than speed here

ivory sleet
#

Whatever you use as moterius pointed out, direct save after an action is ideal as you can keep your storage most up-to-date

drowsy helm
#

if its already in the nbt no point having it on a db

formal bear
#

Ok so no pds ๐Ÿฅด

ivory sleet
#

Pdc?

smoky oak
#

PDC has a completely different issue

drowsy helm
#

just use pdc exclusively

smoky oak
#

i mentioned this yesterday

#

someone pointed out PDC is part of NBT

#

as such it gets sent to the players

#

if the PDC gets too big you bookban the player

ivory sleet
#

I donโ€™t think public bukkit values tag gets sent, does it?

smoky oak
#

I recall that tile entitiy NBT does get sent

drowsy helm
#

you do realise how much data has to be on it to bookban right

#

its A LOT

#

like you ahve to go out of your way to jam that much data onto it

ivory sleet
smoky oak
#

i managed to generate like half a MB of PDC on accident

#

trust me

#

i can manage to do that unintentionally

ivory sleet
#

But yes PDC isnโ€™t that vertically scalable probably

drowsy helm
#

code better then lol

#

thats not a flaw with pdc

#

if i had the option of pdc and a db i would go pdc anyday

ivory sleet
#

^ as long as you use it reasonably, then no issues should arise

smoky oak
#

see I'll just code save, store stuff in separate files, and not have that issue at all

ivory sleet
#

Meh depends

#

I mean databases are usually more horizontally scalable

drowsy helm
#

yeah but for a backpack

#

you aren't holding a lot of data

ivory sleet
#

Thatโ€™s true

sacred mountain
#

๐Ÿ‡ธ๐Ÿ‡ฌ

ivory sleet
#

?

hybrid spoke
#

๐Ÿ‡ฉ๐Ÿ‡ช

drowsy helm
#

๐Ÿ‡ธ๐Ÿ‡จ

vocal cloud
brave goblet
#

๐Ÿ‡ฟ๐Ÿ‡ฆ

lilac dagger
sacred mountain
#

was trying to show my friend that poland indonesia and singapore are not the same flag

#

sorry guys

lilac dagger
#

say i set the max health to 3 hearts then run those 2 lines of code where both max health and current health are 20, the client will show 10 hearts but only 3 hearts full

#

and if i take damage, even 0 it'll update

#

i think the sethealth function lacks an update health count

#

so the client knows

ivory sleet
#

Player::sendHealthUpdate

#

@lilac dagger

lilac dagger
#

oh there is? ๐Ÿ˜ฎ

ivory sleet
#

Yee

#

Well idk when it was added but if youโ€™re on a modern enough version that method should be accessible (:

lilac dagger
#

uh

#

yeah ๐Ÿ˜‚

#

not much help then

#

it's 1.16.5

#

should be pretty recent

#

i guess i gotta use nms for it then

eternal oxide
lilac dagger
#

finally

#

it seems craftbukkit has sendhealthupdate in 1.16.5 just that it isn't to bukkit ๐Ÿ˜ฆ

dire marsh
lilac dagger
#

nice

#

oh well, i was using nms before so no biggie

tawdry lava
#

?api

lost matrix
#

?jd

tawdry lava
#

?spigot

#

i want maven code

#

for spigot

#

?mvn

#

?maven

undone axleBOT
tawdry lava
#

wow

glossy venture
#

?gradle is that a thing

#

no

#

bruh

tawdry lava
#

?gradle

#

?docs

#

?dc

#

?dcs

#

?jd

tawdry lava
#

?h

zenith gate
#

can anyone show me a way how hypixel skyblock does their health system? they have lots of hearts on the action bar ( need to know how to do ) little to none on the actual hearts ( also need to know )

My server is getting people with close to 200 health, and hearts are getting in the way of the screen and they need fixed...

chrome beacon
#

Spigot has heart scaling api

tall dragon
#

yea just use that ^

chrome beacon
#

As for the actionbar simply use chat component api

tall dragon
#

when using that you can make 20 hearts worth 200 for example

opal juniper
#

gradle silly

glossy venture
#

nah gralde betetr

opal juniper
#

probably

#

pr it

#

convert it all to gradle

glossy venture
#

alr

#

also wtf is this

#

use a hashmap

#

or smth

#

one of the fastutil maps

#

bet its faster than this

#

how do i pr smth

eternal oxide
#

?contribute

glossy venture
#

i got the jira access

eternal oxide
#

it tells you in that spam how to pr

glossy venture
#

what

opal juniper
#

im looking at adding a tonne of entity api, but need to do it cleanly lol

#

will give them a read

zenith gate
chrome beacon
#

Yes

#

Should be a position param you can set

zenith gate
#

OKay and im just getting confused here...

#
spigot.sendMessage(ChatMessageType.ACTION_BAR, new String[]{ChatColor.RED + player.getHealth() + ChatColor.GREEN + Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getValue()});

IntelliJ is telling me to add a contract for the getAttribute?

chrome beacon
#

Well that's not a chat component

#

Anyways it's just that Intellij doesn't know if the attribute will exist on the player

zenith gate
#

Yeah, well I don't know what you mean by component, I'm using the spigot API component for sendMessage, and I can only see using ChatMessageType.ACTION_BAR

twilit roost
#

Can bounding boxes be rotated?

chrome beacon
chrome beacon
glossy venture
#

im trying to contribute to CraftBukkit, but maven cant find the bukkit api dependency
i cloned it exactly from the https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse repo
its declared as

<dependency>
    <groupId>org.bukkit</groupId>
    <artifactId>bukkit</artifactId>
    <version>${project.version}</version>
    <scope>compile</scope>
</dependency>

and it says its trying to resolve org.bukkit:bukkit-api:jar:1.18.1-R0.1-SNAPSHOT at minecraft-libraries (https://libraries.minecraft.net/), but it cant find it

#
<modelVersion>4.0.0</modelVersion>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<packaging>jar</packaging>
<version>1.18.1-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name>
<url>https://www.spigotmc.org/</url>
``` this is the project configuration i cloned
opal juniper
#

is it in your local

glossy venture
#

no

#

but its resolving from a website

opal juniper
#

there we go then

#

thats cause it tries local first, and then the repos

#

install it to local, and then try cb

glossy venture
#

alr

chrome beacon
#

Read ^

opal juniper
#

do you?

#

meh idk

#

i mean you need the output

#

but err idk

glossy venture
#

except at the end for testng

chrome beacon
maiden thicket
#

and that too

glossy venture
#

ah

#

i see

glossy venture
opal juniper
#

u need to run it

glossy venture
#

for source projects

opal juniper
#

then u good

glossy venture
#

kt hanks

opal juniper
#

you just need the decompiled jar for applyPatches

next stratus
#

Hey, what's the best way to store multiple objects with a single uuid?

opal juniper
#

what?

#

as in like a map?

next stratus
#

I wanna store a list of objects for each player

glossy venture
#

store player data object

#

and in that object have a list

opal juniper
glossy venture
#

of objects

opal juniper
#

do NOT store the player object

chrome beacon
#

UUID, SomeObjectContainingStuff

chrome beacon
glossy venture
#

not the Player

#

but like some PlayerData

next stratus
#

I wanna store like a map if that makes sense

#

So like Map<UUID, Minion>

chrome beacon
#

Yeah

#

Just create a PlayerData class or smth

next stratus
#

Is there no easier way to just store the Map? ๐Ÿค”

#

I tried doing sql stuffs but damn that is complex lol

chrome beacon
glossy venture
#

you could use something like mongodb

#

for storing more complex objects

#

also pretty simple i think

next stratus
#

I mean, mongo isn't that good is it?

#

I saw how it looked and it's not exactly tidy.

glossy venture
#

?

zenith gate
#
@EventHandler
    public static void onHealthChange(EntityRegainHealthEvent event) {
        if (event.getEntity() instanceof Player player) {
            Player.Spigot spigot = player.spigot();
            spigot.sendMessage(ChatMessageType.ACTION_BAR,
                    new TextComponent("" + ChatColor.GREEN + "" + ChatColor.BOLD + "Health: " + ChatColor.RED + "" + ChatColor.BOLD + player.getHealth() + ChatColor.GREEN + "" + ChatColor.BOLD + "/" + ChatColor.RED + "" + ChatColor.BOLD + Objects.requireNonNull(player.getAttribute(GENERIC_MAX_HEALTH)).getValue()));
        }
    }
    @EventHandler
    public static void onDamageHealthChange(EntityDamageEvent event){
        if (event.getEntity() instanceof Player player) {
            Player.Spigot spigot = player.spigot();
            spigot.sendMessage(ChatMessageType.ACTION_BAR,
                    new TextComponent("" + ChatColor.GREEN + "" + ChatColor.BOLD + "Health: " + ChatColor.RED + "" + ChatColor.BOLD + player.getHealth() + ChatColor.GREEN + "" + ChatColor.BOLD + "/" + ChatColor.RED + "" + ChatColor.BOLD + Objects.requireNonNull(player.getAttribute(GENERIC_MAX_HEALTH)).getValue()));
        }
    }

Anyway to make this always show?

opal juniper
#

is there a way to easily close all open files in intellij

agile anvil
next stratus
agile anvil
next stratus
#

I've criticised someone for using it before as it didn't seem tidy

glossy venture
#

what do you mean tidy

#

you just map documents/objects to keys

#

right

#

in tables

agile anvil
#

It's like putting papers on a bac

#

That's really easy, and powerful

chrome beacon
#

?scheduling

undone axleBOT
chrome beacon
#

^ read this

opal juniper
#

if something internal only has a getter, but no explicit setter as it is done from within another method, should i include a new setter for the api or just the getter

#

i could extract the setter but that would increase the diff

#

by like quite a lot

chrome beacon
#

What are you working on

#

It depends

opal juniper
#

missing entity API

#

specifically, setting a wolf to wet

#

there is a isWet()

#

but no setter

chrome beacon
#

Wouldn't having a setter be a good addition

#

Assuming it works when called in a plugin

opal juniper
#

seems to be where they do it

chrome beacon
#

I'd add a setter

#

Then test to see how it behaves when used in a plugin

opal juniper
#

not sure what this byte is

chrome beacon
#

It's a constant

#

In one of the classes

noble lantern
#

Probably the event packet id

chrome beacon
#

I forgot which one

noble lantern
#

for mc protocol

chrome beacon
#

I don't have access to my PC for a while so I can't help you find it

noble lantern
#

oh its the animation ID actually it seems

#

wait no thats for players

chrome beacon
#

Anyways setting the wolf to wet would just cause it to shake off water

#

So maybe a setter isn't the best idea

opal juniper
#

yeah...

#

it would just cancel immediately

chrome beacon
#

But you could add a shake method

#

Eh that's kind of useless too

twilit roost
#

Does any1 have equation for horizontal helix?
can't find it anywhere

opal juniper
#

Maths ๐Ÿ˜ณ

#

lol

lost matrix
twilit roost
opal juniper
#

pfft just that easy

eternal oxide
#

so flip it

chrome beacon
#

^

noble lantern
lost matrix
twilit roost
#

ye

lost matrix
#

Hm. I would get the normal of your direction vector and rotate it by using the direction as an axis. One moment

twilit roost
#
for(double y = 0;y <= 50;y+=0.05){
    double x = radius * Math.cos(y);
    double z = radius * Math.sin(y);
    w.spawnParticle(part,(float) (loc.getX() + x), (float) (loc.getY() + y), (float) (loc.getZ() + z),0,0,0,0,1);
}
``` this is what im using
works fine for vertical
hot wolf
#

Hey! My plugin depends on the Multiverse-Core api and it does work on my local server, but how can I export the jar to my main server. Does the dependency break, because the path is different?

opal juniper
#

name for the method describing whether the warden is going into or out of a block? isDiggingOrEmerging ?

#

thats the nms name

twilit roost
hot wolf
#

Wdym the server needs it

chrome beacon
#

Main server requires Multiverse

kindred valley
#

can i make a substraction between bigdecimal and an integer?

twilit roost
agile anvil
agile anvil
lost matrix
twilit roost
lost matrix
twilit roost
#

so how do I adapt my code to it?

lost matrix
#

Im thinking. Just wrote an exam so i might send some poop code in a minute.-

hot wolf
twilit roost
#

yeeey poop coode

agile anvil
hot wolf
agile anvil
# hot wolf ye

Then just maven build your project and it will all be fine ^^

hot wolf
#

nice, appreciate it!

agile anvil
#

How do you usually build your plugin?

kindred valley
#

I have always wondered why parabola's exists and where do i use that

eternal oxide
#
double rotateZ = Math.toRadians(loc.getPitch() + 90);
double rotateY = Math.toRadians(-loc.getYaw() + 90);

Vector rotate = new Vector(x, y, 0);
rotate.rotateAroundZ(rotateZ);
rotate.rotateAroundY(rotateY);```
noble lantern
#

man z_aCRYYY

agile anvil
twilit roost
#

spigot resource :DD

eternal oxide
#

you can adjust the + on Yaw to do the rotation aournd origin, vertically

tall dragon
twilit roost
agile anvil
little panther
#

Hey, ive been trying to figure out how to use permission and add them correctly into the plugin.yml. Can anyone send an example of how they do it?

noble lantern
#

You dont need to add permissions to plugin.yml

Simply use Player#hasPermission

Or use the vault permissions checker

chrome beacon
zenith gate
eternal oxide
#

adding perms to the plugin.yml is the correct way to handle permissions

#

under each command just add a line permission: your.command.permission

noble lantern
agile anvil
# little panther Hey, ive been trying to figure out how to use permission and add them correctly ...
BukkitWiki

This rather large tutorial aims at getting you started with plugin development in Bukkit. It is in no way a complete tutorial of all possibilities in Bukkit, but rather a general overview of the basics. It starts with making sure you understand Java, sets up your workspace in an IDE, and introduces the essentials of most Bukkit plugins. These tu...

eternal oxide
#

yes its optional, so is Spigot

#

why not let spigot handle command permissions?

chrome beacon
noble lantern
#

Spigots never handled permissions before? Whenever ive added permissions to plugin.yml it never did anything, simply found it a waste to add it IMO

#

Always had to handle permissions myself with vault/Player#hasPermission

eternal oxide
#

If permissions are not correctly added to the plugin.yml permission plugins can;t detect them

chrome beacon
#

^

#

You want plugins such as LuckPerms to detect your permissions

glossy venture
#

do you think bukkit devs will accept this in a pr?

noble lantern
#

Fair enough then, i never really noticed anything about it when setting that, plus i normally don't use bukkit's command handler so havent touched that file in a while

lusty stream
#

anyone knows what's the spigot-api (player times joined) class

chrome beacon
#

Statistic

lusty stream
#

yes

chrome beacon
#

?jd-s

undone axleBOT
chrome beacon
#

Use the statistic class

lusty stream
#

i can't find it

#

i must be dumb

lusty stream
#

yes but where the player times joined exact class

noble lantern
#

I actually dont think times joined is a statistic but time played it

#

I dont see the keyword "joined" in the docs page when ctrl + f

lusty stream
#

ye me neither

#

hence why im asking

chrome beacon
#

You can use Leave game

#

If they left they've joined

#

Then add 1 if they're online

lusty stream
#

ok will do

#

ty

twilit roost
#

any idea
how is this named?

I would like to make a resource on it but idk the name

noble lantern
#

x-files

twilit roost
#

aaand this?

chrome beacon
#

x-files intro plays

noble lantern
#

last image wont load for me sad, i hope its another x files pattern

chrome beacon
#

Or smth

noble lantern
#

oh that kinda looks like saturns rings

#

at the angle theyre at at least

chrome beacon
#

Ah sounds better

noble lantern
#

You could name it uranus

#

if you make it 90 degrees

twilit roost
#

:))

#

pretty interesting how much u can do with just sin/cos/tan

noble lantern
#

i would rather interact with my own api methods with strictly reflection than deal with any of that math

twilit roost
#
for (int degree = 0; degree < 360; degree++) {
    double radians = Math.toRadians(degree);
    double x = Math.cos(radians);
    double y = Math.sin(radians);
    double z = Math.tan(radians);
    Location loc = at.clone();
    loc.add(x,y,z);
    World w = loc.getWorld();
    w.spawnParticle(particle,loc.getX(),loc.getY(),loc.getZ(),0,0,0,0,1);
}
``` for 1. one
chrome beacon
noble lantern
#

i can do basic maths but that stuff no thank you

twilit roost
#

emm how do I create resource on spigotmc?

noble lantern
#

Should be a button in your resources page

lost matrix
#
  public List<Location> spiral(Location start, Vector direction, double spiralRadius, double deltaForward, double deltaAngle, double distance) {
    List<Location> list = new ArrayList<>();
    Vector normal = new Vector(direction.getY(), -direction.getX(), direction.getZ());
    normal = normal.normalize().multiply(spiralRadius);
    Vector dir = direction.clone().multiply(deltaForward);
    int iterations = (int) (distance / deltaForward);
    for(int i = 0; i < iterations; i++) {
      start.add(dir);
      Location pos = start.clone().add(normal);
      normal = normal.rotateAroundAxis(direction, deltaAngle);
      list.add(pos);
    }
    return list;
  }
chrome beacon
chrome beacon
#

Or smth like that

noble lantern
#

yeh big blue button

#

its on resources page

twilit roost
#

ye but thats for completed plugins
I would like a post

noble lantern
#

Ah its in forums named create thread then

#

You need to go into the right category first

#

then buttons there, its around same position for every catagory

twilit roost
#

oh right got it

hybrid spoke
noble lantern
lost matrix
# twilit roost oh right got it

Btw just discovered a bug with this method. You might need to play around with the normal vector...
Just try to calculate a perpendicular vector to "direction" and save it in "normal"

twilit roost
#

right thx

#

off topic but does any1 have good function vizualier?

lost matrix
opal juniper
#

i dislike geogebra

#

it is very unstable and tends to crash

hybrid spoke
#

?bing

twilit roost
#

maple is paid

undone axleBOT
tall dragon
#

would like to check it out

noble lantern
#

?quora

hybrid spoke
#

?google

undone axleBOT
hybrid spoke
#

?ecosia

lost matrix
#

?duckduckgo

twilit roost
noble lantern
#

?yahoo

twilit roost
#

?yahoo

noble lantern
#

dang

twilit roost
#

?duckduckgo

#

?ddg

noble lantern
#

only bing and google thats gotta be racist

lost matrix
chrome beacon
#

WolframAlpha :)

#

It's great

noble lantern
#

Alternate solution: Shove numbers in until it works

crimson terrace
hybrid spoke
#

wasnt there also a minecraft cheat called wolfram

noble lantern
#

a lot of things are named wolfram ngl

opal juniper
#

wolves

lost matrix
#

A metal for example

crimson terrace
twilit roost
#

just realised im a press piece of poop at mathematical functions..

lost matrix
#

Yeah tungsten is wolfram in german

noble lantern
crimson terrace
#

yes

noble lantern
#

So then how do you say tungsten in german?

crimson terrace
#

the german word is "wolfram"

lost matrix
#

wolfram

twilit roost
#

Wolfram in periodic table is also metal

noble lantern
#

wtf

lost matrix
crimson terrace
#

my first message may have been confusing

glossy venture
noble lantern
#

It was i see now its reversable

crimson terrace
#

wolfram is the german word for "tungsten"

glossy venture
#

what the fuck is a fireball fireball

twilit roost
noble lantern
#

what the fuck is that syntax

hybrid spoke
lost matrix
#

The symbol for tungsten is "W"
No idea why english needed to be extra and call it tungsten.

crimson terrace
#

Wolfram sounds so much cooler

glossy venture
#

and what nms entity is a CraftSizedFireball

chrome beacon
#

I still find tungsten quite funny. Tung means heavy and sten means rock in Swedish

#

So heavy rock

glossy venture
#

is that the fireball fireball

noble lantern
#

"hehe heavy rock"

chrome beacon
#

Very nice

crimson terrace
#

well it is quite heavy

#

aka dense

noble lantern
#

or similar

glossy venture
#

?

noble lantern
#

So it would be the fireball you right click with?

glossy venture
#

nah

mortal hare
glossy venture
#

yeah that makes sense

grim ice
#

how do i use a library with a broken maven repo

glossy venture
#

but is that the fireball fireball nms entity

mortal hare
#

Craft is often used to define CraftBukkit classes

noble lantern
#

Ahhh that makes sense so there must be GhastSizedFireball then

mortal hare
#

so this might be Bukkit implementation of NMS class designed to hook into Bukkit API

noble lantern
#

EnderDragonSizedFireball

noble lantern
#

Would assume it would extend the smaller fireball if so

#

or a method in that class that creates fireball fireballs

grim ice
#

uh

#

how do i use a library with a broken maven repo

noble lantern
#

what lib

#

you can depend on the jar

grim ice
#

ScoreboardLib

noble lantern
#

you use gradle and have jar?

grim ice
#

i use maven

noble lantern
#

i know how to do it in gradle ez asf

grim ice
#

and i dont have jar

chrome beacon
#

You can install the jar to your local maven

iron palm
#

yo i'm having a trouble a bit with sqlite and i can't insert data's.
here's what i wrote at all.

CREATE TABLE IF NOT EXISTS kbffa(uuid CHAR(36) PRIMARY KEY NOT NULL,kills INT(20) NOT NULL DEFAULT 0,deaths INT(20) NOT NULL DEFAULT 0,elo INT NOT NULL DEFAULT 0,maxkillstreak INT(20) NOT NULL DEFAULT 0,balance INT(20) NOT NULL DEFAULT 0,selectedCosmetic VARCHAR(30) NOT NULL,selectedTrail VARCHAR(30) NOT NULL,selectedKit VARCHAR(30) NOT NULL,ownedKits MEDIUMTEXT NOT NULL,ownedCosmetics MEDIUMTEXT NOT NULL);
INSERT OR IGNORE INTO kbffa(uuid,kills,deaths,elo,maxkillstreak,balance,selectedCosmetic,selectedTrail,selectedKit,ownedKits,ownedCosmetics) VALUES(?,?,?,?,?,?,?,?,?,?,?); 
noble lantern
#

maven its more complicated

#

you need to use mvn install-file with the jar

#

sec

iron palm
#

oaf finally

grim ice
#

i dont have the jar doe

chrome beacon
#

Build it?

noble lantern
#

Use first command on top

crimson terrace
noble lantern
#

Dpackaging value is jar if you dont know value for that (if your using jars tbh)

grim ice
#

cant be bothered to add it to my local repo

#

cant i shade it

noble lantern
#

Thats kinda how you would shade it

#

without a repo

noble lantern
#

you add it locall then import

grim ice
#

i dont think u need to add it locally tho

noble lantern
#

same with gradle but its super easy in gradle

iron palm
grim ice
#

to ur maven repo

noble lantern
#

You could use....

#

system scope but

grim ice
#

yes

noble lantern
#

im not gonna endorse that

#

youll have to google how to do that yourself

chrome beacon
#

Just install the jar

lost matrix
#
CREATE TABLE
  IF NOT EXISTS kbffa(
    uuid CHAR(36) PRIMARY KEY NOT NULL,
    kills INT(20) NOT NULL DEFAULT 0,
    deaths INT(20) NOT NULL DEFAULT 0,
    elo INT NOT NULL DEFAULT 0,
    maxkillstreak INT(20) NOT NULL DEFAULT 0,
    balance INT(20) NOT NULL DEFAULT 0,
    selectedCosmetic VARCHAR(30) NOT NULL,
    selectedTrail VARCHAR(30) NOT NULL,
    selectedKit VARCHAR(30) NOT NULL,
    ownedKits MEDIUMTEXT NOT NULL,
    ownedCosmetics MEDIUMTEXT NOT NULL
  );

INSERT
OR IGNORE INTO kbffa(
  uuid,
  kills,
  deaths,
  elo,
  maxkillstreak,
  balance,
  selectedCosmetic,
  selectedTrail,
  selectedKit,
  ownedKits,
  ownedCosmetics
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
chrome beacon
#

It's one quick command

chrome beacon
#

Or if it's a project install that

noble lantern
#

indeed, but will still work if you edit it slightly but like said its horribly non-reccomended

#

They keep saying its gonna be removed

#

i wonder when

iron palm
glossy venture
#

is a CraftPigZombie (nms EntityPigZombie) a zombified piglin

iron palm
#

.

tardy delta
#

primary key not null is redundant

noble lantern
glossy venture
#

ill try

noble lantern
#

The other thingies have a different name

#

forgot theyre names

lost matrix
#

Also INSERT OR IGNORE seems odd

tardy delta
#

oh that actually exists

iron palm
lost matrix
iron palm
#

i see some of my mistakes

hollow siren
#

hello everyone, is this the right channel to get help with code developpement ?

noble lantern
#

yes

hollow siren
#

thx omg

iron palm
tardy delta
#

isnt ON DUPLICATE KEY IGNORE a thing?

noble lantern
#

^

glossy venture
#

jezus this is a pain
never realized how many entities minecraft has

#

gotta paste this in every class

iron palm
tardy delta
#

or INSERT INTO IF NOT EXISTS lol

lost matrix
tardy delta
#

oh

glossy venture
#

to replace the if else mess used for getEntity

#

with a hashmap

#

which i think will be faster

iron palm
glossy venture
#

because instanceof is pretty expensive and repeated if else too

chrome beacon
#

The comment said that the order was very important

twilit roost
hollow siren
#

so my issue is ;
I have a plugin.yml file,
And in my main java class for my plugin, I have an int data, wich I want to store, and read from the yml, how can I do it ?

chrome beacon
glossy venture
noble lantern
glossy venture
#

if you check HumanEntity first it will always return human entity for players too

hollow siren
noble lantern
hollow siren
#

I'll search more forums

iron palm
#

oops

iron palm
glossy venture
#

every subclass

#

or superclass

lost matrix
#
INSERT IGNORE INTO users (PlayerID, Kills, Deaths) VALUES (?, ?, ?);

This will only insert for non-existent entries.

glossy venture
#

i mean

noble lantern
tardy delta
#

doesnt it check some stuff on low level?

noble lantern
#

Storing data in YML is normally frowned upon in here

tardy delta
#

ig

noble lantern
#

Better to use Json or SQLLite as a flate file storage

glossy venture
lost matrix
tardy delta
#

mhhh

iron palm
#

one*

noble lantern
#

why couldnt upsert be called updoot man

lost matrix
iron palm
#

im using update for that

iron palm
#

thats nice

tardy delta
#

so inserting and if its exists updating?

lost matrix
#

Basically insert on duplicate key update

tardy delta
#

lemme check docs