#help-development

1 messages Β· Page 1450 of 1

quaint mantle
#

What error

#

extend EntityZombie instead of Entity

#

Yeah the zombie is probably a good place to start

#

I know that 😦 But i want to make multiple entity class it's just example

wet breach
#

you can extend it if you want, but you also have to implement what you are extending too

quaint mantle
#

okay

quaint mantle
#

So should I implements all of "EntityChicken, EntityCow, EntityZombie, EntityArmorstand, EntitySkeleton" Etc?

wet breach
#

what I meant is if you are extending EntityZombie for instance, you need to implement your entity class at some point otherwise you won't have your custom entities

quaint mantle
#

simply overiding the class won't do you any good on it's own

#

hmm are you saying implements EntitySkeleton?

#

if so, it would be very annoy

#

I don't want to extend each entity type, so I want to create a class that can extend all entities.

wet breach
#

Lets say, your custom entity class is called FlamingSkeleton. Which then extends EntitySkeleton. You will need to implement FlamingSkeleton at some point to have that entity spawn. Unless you are implementing EntitySkeleton and not just simply extending it.

night copper
quaint mantle
#

for example,

eternal oxide
#

You can't easily

wet breach
#

well, not sure you are going to be able to extend them all as easily as you think

quaint mantle
#

sadd:(

wet breach
#

you would first need to extend the most upper common interface they all share

#

and then do some magic with casting

#

possibly would need some reflection in there lol

eternal oxide
#

all bukkit entities extend Entity. You can;t make them extend your class, so you can only extend theirs.

quaint mantle
#

The reason I want to make it is because I'm making an npc plugin and I want to adjust the pathfinder to create an entity type.

#

so the pathfinder is going to create an entity?

quaint mantle
wet breach
#

not the way you think it would

eternal oxide
#

no, you can only extend one

quaint mantle
#

of ALL entities?

#

yaaa

#

like citizens plugin

wet breach
#

that is easy to do, and don't need to have a class extending entities to adjust pathfinder stufff

quaint mantle
#

should've just said that

quaint mantle
#

Just listen to the pathfind event

#

can I adjust pathfinder without custom entity class?

quaint mantle
wet breach
#

you can register custom pathfinder goals and use reflection to change it for entities

quaint mantle
#

okay!!

#

i'll try πŸ™‚

wet breach
#

or use the API to change the pathfinder goals depending which version you are using

quaint mantle
#

I'm not depending apis sorry!

wet breach
#

think recent versions lets you set pathfinder stuff without reflection

#

meant version of spigot

quaint mantle
#

I'm using 1.15.2 πŸ˜‰

#

thanks you all of you guys

#

I'll tryyy

#
  1. pathfinder event
wet breach
#

can do some searching using the terms entity pathfinder goals

#

should be able to find plenty of resources on it

quaint mantle
#

oh!

#

thanks u

junior tinsel
#

Hello! I think i'm missing something. I have created some custom 'items' based on the Material Paper. There are some right click actions etc and everything works fine. I got some of these items in Shopkeepers and that works fine as well with no problems.
Now my question is. Do these 'custom items' have ids or something to identify them? Cause i was looking at other plugins (e.g. GUIShop) where i have to put the items in the config and i have no idea how to reference them? Thanks in advance!

wet breach
#

unfortunately you would need to make your plugin that creates custom items, hook into plugins that you want it to work for since the only difference between the item your custom item is based on and your custom item, is most of the time the lore or some nbt data and not necessarily the name since mc clients wouldn't know what it is.

#

the best you can do with naming is set a custom display name, but that doesn't change the underlying items name

#

some shop plugins are open source however, so the alternative if this is something you are making for your server is to alter the shops source code and compile a custom version of it.

junior tinsel
#

thanks for your answer! Yeah i was thinking that the only way would indeed be display name (including color characters) or nbt? but i haven't played with nbt tags yet.
I don't mind hooking into other plugins. I indeed thought it was like how you just described it but i thought i will ask πŸ˜„
That could be a solution indeed thanks! I'm going to see how we are going to move forward. Otherwise i can setup my own quick gui to buy some items as a plan c.

wet breach
#

well sounds like you are on the right track then πŸ˜‰

quaint mantle
#

hmmm I learned how to make custom pathfindergoal but how can I make entity to run this pathfindergoal without extending Entity class?

#

or did I learn anything that didn't matter?

wet breach
#

reflection is a way to do that

quaint mantle
#

okay

#

i'll learn reflection pathfinder

#

hmmmmmmmm

#

reflection pathfinder tutorial doesn't exists

wet breach
#

you can go the route of creating custom entity classes, but that is usually easier to do if you are only wanting to modify limited entities and not an ideal way for all entities. So reflection is your best bet to limit the amount of code you have to do.

#

that is because reflection isn't specific to anything. But you can find tutorials on how to use reflection for NMS

#

and then you would apply that knowledge to change pathfinder goals on entities

quaint mantle
#

hmm okay

#

but I couldn't find reflection pathfinder tutorial 😦

#

btw, I know a bit of reflection

wet breach
#

this contains information on how to change an nbt tag for noai using reflection

#

basically, same concept for you, just you are wanting to change the pathfinder stuff

quaint mantle
#

thanks!

wet breach
#

reflection can be difficult and one of those things where you are going to have to mess with it a bit

quaint mantle
#

oh! I needed noAI And the reason I needed pathfinder was because I wanted to get rid of mob AI with initPathfinder().

#

it's ok

#

i'll try hard

wet breach
#

lol well then looks like I found the perfect resource for you then πŸ˜›

#

but, if the reason you wanted to alter pathfinder stuff was to get rid of mobAI

#

just know the spigot API has methods to do just that

#

and pretty sure they exist in 1.15

quaint mantle
#

omg

#

lolxD

#

We've come a long way back

wet breach
quaint mantle
#

omg we could do just "setAI"

#

lol

wet breach
#

just have to check that the entity is an instance of living entity and if so, use that method to turn off the AI πŸ˜›

quaint mantle
#

but thanks you. i learened so much about reflection!

wet breach
#

that is the best way to look at it πŸ˜‰

quaint mantle
#

how can I change mob(entity but not player)'s uuid? (to get uuid, we are using "entity#getUniqueID()"

#

in google, people says it's Possible, but they doesn't tell how to do. and they only say "don't do that"

wet breach
#

UUID is created when the entity is spawned thus that is where you would need to change it and it shouldn't be changed so as long as the entity is alive otherwise you will most likely introduce memory leaks since the server would lose track of it.

wet breach
#

usually there isn't a reason to change it

quaint mantle
#

I want to change it cuz i'm making npc

dense goblet
#

Is there a way to make particles visible from further away?

#

same for sounds

wraith rapids
#

you can use the force parameter to have them display at a longer range iirc

dense goblet
#

okay, that means I need to provide a data parameter, can I just set that to null?

wraith rapids
#

tbh i don't know, probably yes

wet breach
#

@quaint mantle just keep track of your npc's UUID's. no need to change it or attempt to change it.

quaint mantle
#

hmm?

#

I want to do entity#.getUniqueID

#

to get my npc's id πŸ™‚

eternal night
#

store it in the PDC instead maybe ?

#

mutating the UUID might have some nasty side effects

dense goblet
eternal oxide
#

Surely the UUID will be filled in when you create teh Entity on the server

#

as you extending existing Entity classes

eternal night
#

oh

quaint mantle
eternal oxide
#

yes its always random

quaint mantle
#

yaa so I want to make my own npc's uuid

wraith rapids
#

why

eternal oxide
#

Just use the UUID the server gives you

quaint mantle
#

but it always random

wet breach
#

it may be random, but you are going to have to keep track of your NPC's anyways. That means somewhere you should be logging your custom NPC's to a file with their location and you can then store their UUID as well.

#

UUID's don't change once they are created

eternal oxide
#

yes, update teh UUID you have when you spawn it

#

you are meaning for tracking it across server starts?

quaint mantle
#

ya

#

or realod

wraith rapids
#

just use the uuid you get from the entity

eternal oxide
#

Yes, just update your UUID reference when you spawn it

quaint mantle
wraith rapids
#

the point of an uuid is to be universally unique

#

you reusing the same UUID multiple times is countercurrent to this maxim

wet breach
#

you can listen for the spawn entity event, check its your NPC via various things and then grab the UUID of said entity

quaint mantle
#

oh okay

#

thanks you guys.

#

i'll change uuid when server reload.

#

wait

#

hmm

#

nvm!

wet breach
#

UUID's persist between restarts, so once you have it, log it and log the location of said NPC as well

#

now, you can reference your entity unless it dies and gets regenerated

quaint mantle
#

ya!!

#

thanks you

quaint mantle
#

like player entities

#

what is actual entite?

#

Like are they actually entities?

#

Usually NPCs are spawned via packets so they aren't actually registered @quaint mantle

#

I'm spawning with world#spawnEntity

granite stirrup
#

Why was I pinged

dense goblet
#

what is the proper way to get the server time in ticks (that doesnt break with daylightcycle off etc)?

granite stirrup
dense goblet
#

who is papi lol

granite stirrup
#

A plugin lmao

#

Placeholderapi

#

There's a api for it so u can use and make placeholders lmao

dense goblet
#

docs?

#

I'd rather not rely on an API when not needed so i think I'll go with incrementing a variable in a runnable (that already exists anyway cause I need to do other stuff every tick)

chrome beacon
#

Sounds like a bad move for performance

granite stirrup
#

Well I guess but read the spigot docs

#

To find the method u need

dense goblet
dense goblet
#

that wont work with variable tickrates unfortunately

#

plus that would actually be less efficient than incrementing a counter

#

if there's no builtin way to directly get ticks then ig the counter is my best option

paper viper
#

uh don't use papi for this lmao. that is for players in game not for code

#

papi stands for placeholderapi, a pretty popular plugin for its placeholders

#

its well documented and stuff, but not viable here

granite stirrup
#

Well yeah but I mean it has a server time placeholder i think

dense goblet
paper viper
#

uh what

#

i cant see the image

dense goblet
#

oh

granite stirrup
#

Epic

#

Embed fail

#

XD

dense goblet
#
public class VanillaUtils {

    private static int tickTime = 0;
    public static void incrementTickTime() {
        tickTime++;
    }
    public static int getTickTime() {
        return tickTime;
    }
[...]

in onEnable:

       new BukkitRunnable() {
            @Override
            public void run() {
                //run these every tick:
                VanillaUtils.incrementTickTime();
                ProjectileManager.onTick();
            }
        }.runTaskTimer(this, 0, 1);
paper viper
#

i know its a utility class, but why not just use a manager instead

dense goblet
#

is there a difference?

paper viper
#

Yes, your use of static here is not proper

#

static is used for constant variables

#

like enums are just public static final fields

#

but you are making the counter mutable

dense goblet
#

VanillaUtils is a static class but java does not support static classes (in the traditional sense)

paper viper
#

?

dense goblet
#

oh no

#

you're thinking of final

#

final makes it immutable

paper viper
#

What?

#

no it doesnt

shadow skiff
#

How could I add a cooldown to the command here, sothat players can't just spam it before all the messages have been sent?

    if (cmd.getName().equals("npcleo") && 
      sender instanceof Player) {
      final Player player = (Player)sender;
      player.sendMessage("Progressing through your Collections unlocks new crafting recipes, brewing recipes, trades, enchantments, and more!");
      Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin)this, new Runnable() {
            public void run() {
              player.sendMessage("Visit resource areas like the and Mine gather items for your Collections!");
            }
          },  20L);
      Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin)this, new Runnable() {
            public void run() {
              player.sendMessage("There is a of the you can gather Oak Logs.");
            }
          },  60L);
      Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin)this, new Runnable() {
            public void run() {
              player.sendMessage("The world is full of resources. Explore the island to discover new items that you can collect!");
            }
          },  100L);
      return true;
    } 
paper viper
#

it just makes it so it cant be assigned again

#

not immutable

dense goblet
#

static makes it accessible on a class-basis rather than an instance basis

granite stirrup
#

In incrementTickTime why do u need a static ??

dense goblet
#

for the case of ints it is equivalent

paper viper
#

???

#

what?

granite stirrup
dense goblet
#

since they're primitives, a non-reassignable int is effectively immutable

granite stirrup
#

Idk how to do it but yeah

dense goblet
#

but returning to your original point, static is not used for constant variables

#

that is static final

#

or just final if you want it to be constant for an instance rather than for the whole class

#

static is used to make a field instance-independent

paper viper
#

static itself

#

the concept itself

#

is supposed

#

to be used for constants

#

even though final could do that, static is supposed to be used for constant variables

#

that will not change constantly

#

regardless final or not

#

That is the proper use and when you should use it

dense goblet
#

its a variable that can not be re-assigned, so it must be set either in the declaration or in the constructor

granite stirrup
#

Β―\_(ツ)_/Β―

paper viper
#

I am referring to properly using static correctly...

#

ok idk how to explain to this kid

#

@granite stirrup do you know how i could rephrase this

#

lmao

granite stirrup
#

Why are u guys fighting about static lmao

paper viper
#

Because he is using it incorrectly

dense goblet
paper viper
#

I am not trying to be cocky here, I am trying to tell you why you shouldnt use it here

dense goblet
#

then what would be the point of static and static final being two distinct concepts if they should only ever serve the same function?

paper viper
#

Because sometimes you define it later but never change it, and not directly in the static block

#

static variables should remain constant

#

there is a reason why if you look at the bytecode for enums

#

its the exact same as public static final, it remains constant

#

you cant modify an enum class at runtime, right?

#

Therefore, this is why enums use static. It's because they are constant

#

@quaint mantle help me out here

#

lmao

quaint mantle
#

reeeeeeeeeeee

eternal night
#

Example for a non final one would be the server instance stored in Bukkit.

paper viper
#

Pls

dense goblet
#

that doesn't imply anything about static, it implies something about public static final which is a separate concept from just static or public static. Plus, sticking to this concept provides no benefits and makes using utility classes harder to work with

quaint mantle
#

tldr me

paper viper
#

Aight

#

explain to this kid

#

why you shouldnt use static

#

for mutable shit

dense goblet
#

okay explain to me this:
You have a utility class which provides many static functions. Say one of them is used often with same parameters and takes a long time to compute, so you want to cache the last result. How do you do this without using mutable static fields?

paper viper
#

but it isnt a utility class

#

it should be a manager class

#

and you arent even caching at all

dense goblet
#

what is your definition of a utility class

paper viper
#

so idk what you are saying

dense kestrel
#

yo, hows everyone doing

paper viper
#

A utiltiy class DOES NOT mutate static variables and SHOULD NOT

#

in any way

dense goblet
eternal night
#

Neither should a utility class maintain a cache πŸ‘€

dense goblet
#

maybe we have different concepts of utility classes

paper viper
#

no there isnt different concepts, you are just simply in-denial and need to change

eternal night
#

Utility classed should (imo) be purely functional and have no side effects

dense goblet
paper viper
#

???

dense goblet
#

but I see what you mean by no side effects

#

that makes sense, utility is used to calculate stuff while a manager manages (therefore should have side effects)

eternal night
#

I mean a cache is 100% a side effect

#

Yeah

paper viper
#

"There is no good reason to have a mutable object as the public (by default), static member of an interface. Such variables should be moved into classes and their visibility lowered.

Similarly, mutable static members of classes and enumerations which are accessed directly, rather than through getters and setters, should be protected to the degree possible. That can be done by reducing visibility or making the field final if appropriate.

Note that making a mutable field, such as an array, final will keep the variable from being reassigned, but doing so has no effect on the mutability of the internal state of the array (i.e. it doesn't accomplish the goal)."

eternal night
#

If you wanna cache some results do so in a designated class

dense goblet
# eternal night I mean a cache is 100% a side effect

it's a side effect of the function but not a side-effect of the class. If I had a program which needed to retrieve images, I would have an ImageUtils class which would have a function that retrieves an image from a path and a cache (HashMap in this case) to store previous results. In my eyes, the image retrieval function modifying the cache is not a side effect of the class but just a side effect of the function, so it's contained enough to be valid for a utility class.

dense goblet
quaint mantle
#

Mostly it boils down to the reasoning of "does it make sense for this to be static?", things like data managers and carriers (google DAO & DTO) are instance specific. It kinda defeats the whole purpose of OOP if you have a static "StorageProvider" with a single storage system, that will not turn out very well when you decide to allow for other methods, e.g you primarily allow for something like json only, then expand to sql, then mongo, then all of them with a mix & match for certain parts of the system (e.g. you store logs in sql but user data in mongo), that's gonna get messy fast from a design perspective, 100% resolvable with abstraction and using static in a mutable element like that completely defeats the purpose of OOP
https://stackoverflow.com/a/2671636/8083725

Utility classes and functions are at the end of the day "convenience methods", "shortcuts", they don't handle anything in particular that is going to affect the rest of the system, they are a shortcut to something you provide

dense goblet
paper viper
#

did you even read it properly?

#

Such variables should be moved into classes and their visibility lowered.

dense goblet
#

yes

#

say I started with an interface

#

I then move my field to a class (VanillaUtils)

#

and I lower the visibility (private)

#

now I am at the point I originally posted

granite stirrup
#

Wait tickTime doesn't even need to be static lmao

dense goblet
#

same for the 2nd paragraph, it is indeed private and accessed through getters and setters πŸ™‚

dense goblet
paper viper
dense goblet
quaint mantle
granite stirrup
paper viper
#

"There is no good reason to have a mutable object as the public (by default), static member of an interface"

#

i beleive interface in this context is referring to the class

#

like interface of a program

dense goblet
quaint mantle
#

the class isn't (you made it static.. ) but the tick time is

dense goblet
#

what is the crash log?

steep nova
#

I think he means when you actually create the circle object

#

like new Circle()

#

that part of the code

eternal oxide
#

for (int n = 1; i < partic + 1; n++) { You never change teh value of i

#

infinite loop

granite stirrup
#

Coding is fun :)

steep nova
granite stirrup
#

Lmao

dense goblet
#

and then time comparisons would break since I'm using the time for a cooldown

paper viper
#

doesnt /reload reload the static fields?

quaint mantle
#

mmm classloaders :^)

#

If you're working with cooldowns and want it to be time based instead of tick based I strongly suggest you use Instants

quaint mantle
#

Or a plain ol' long gotten from System.currentTimeMillis()

quaint mantle
#

an.. instant

paper viper
#

50 milliseconds is one mc tick

dense goblet
#

I prefer it to be tick based as all other game logic is also tick based

quaint mantle
dense goblet
#

ah I see

paper viper
#

Mhm

#

without any of the slowdowns

#

and stuff

quaint mantle
#

till lag kicks in lol

dense goblet
#

I think I'll go for an alternate solution

#

how inefficient is changing item NBT?

quaint mantle
#
  • instants have a lot of methods if you want to do math with them pretty easily, get a Duration (which also has lots of nice methods) etc
paper viper
#

dont change item nbt every tick

#

please no

#

just dont

#

thats a horrible solution

#

that would be very inefficient

dense goblet
#

my initial solution would only change NBT when you shoot and the new one would decrease a counter when you hold a weapon that's going through a cooldown but I see thats not a good idea

crude charm
paper viper
#

read up

#

Zoi

dense goblet
#

I need a cooldown for an item

crude charm
dense goblet
crude charm
#

and runnable

quaint mantle
#

tick based sounds suitable

#

but

dense goblet
#

hm now that I think of it, I'm gonna need a hashmap + runnable combo anyway for automatic weapons so could squeeze that in there too

quaint mantle
#

you shouldn't have a decreasing counter/latch

maiden briar
#

Can somebody give me an json example of bungee's click and hover event?

dense goblet
#

question - if the player moves an item in their inventory or drops it to the ground, does the ItemStack reference become invalid?

quaint mantle
#

you should store the start time and then check

if (now - start > cooldown) {
  // cooldown's over
} else {
  // cooldown is still in effect
}

tick based sounds suitable still

dense goblet
quaint mantle
crude charm
#

ye do what I said hashmap and runnables

#

if they in the hash they have a cooldown

dense goblet
#

but say I shoot on tick 1000 and then restart the server

#

that will cause problems

#

maybe initialising the tick counter as current unix time / 20 could do the trick

#

and store it as a long

dense goblet
#

say offhand hotkey

#

so I'd have to track the stack with events which is a PITA

#

gonna have a hashmap for players to figure out if they're holding down the mouse or not, cause the item use event is only received every 4+ ticks

maiden briar
#

Thanks

quaint mantle
#

Create your own :)

maiden briar
#

Btw, if I want to send a kind of this message with bukkit's sendMessage, is this possible?```json
{"text":"Test","bold":true,"italic":true,"underlined":true,"strikethrough":true,"obfuscated":true,"clickEvent":{"action":"open_url","value":"test.com"},"hoverEvent":{"action":"show_item","contents":"cake"}}

quaint mantle
#

The component's content is empty

#

That's gonna get ignored by the client

maiden briar
#

So I have to fill something in at text?

quaint mantle
#

mhm mhm

maiden briar
#

Ok, and can I pass this to bukkit's Player#sendMessage ?

quaint mantle
#

I don't think so, you can turn that into a BaseComponent[] with the ComponentSerializer and then send it

maiden briar
#

Ok

#

Because what I am trying is I want to create my own TextComponent class, but I don't know how to send the json to bukkit

quaint mantle
#

Because what I am trying is I want to create my own TextComponent class
why tho?

maiden briar
#

Then I can control it

quaint mantle
#

...?

#

Just use bungee chat TextComponent?

maiden briar
#

Ok, but I want to see if it's possible

quaint mantle
#

Uh sure..

#

In case you are not aware, Spigot includes the bungee chat api

#

I don't think Bukkit supports json components

maiden briar
#

Ok, thanks

#

Can't I use ComponetBuilder, and then return it?

quaint mantle
#

hm?

maiden briar
#

Yes I try

quaint mantle
#

what?

shy wolf
#

help

#

how to sned player to a world

#

any one? help?

quaint mantle
#

not everyone is here every single second of their lives to help

ivory sleet
#

Hello emoily

quaint mantle
#

hello Conclure's dog

sharp bough
#

does this type of documentation have a name and a list of all the @ that you can have

#

?

eternal oxide
#

javadocs

sharp bough
#

lol

crude hound
#

hi can you help me to know how to get, add or remove a tag from an entity?

crude hound
#

like I need to add an nbt in a villager (with the Tags list) to open a gui

dense kestrel
crude hound
#

(in 1.8)

dense kestrel
#

you want to change an NBT tag right?

crude hound
#

yes

dense kestrel
#

then use NBTAPI

#

works fine in 1.8

crude hound
#

thx

dense kestrel
#

np

cyan oyster
#

help

#

im new

dense kestrel
#

with?

cyan oyster
#

development

#

why is this wrong?

dense kestrel
#

send it

cyan oyster
#

package test.Procupune.helloworld;

public class Main extends JavaPlugin {

}

#

i cant send image

dense kestrel
#

you want to do what???

minor vapor
#
```java
CODE
#

yikes

#

LOL

#

do that next time

dense kestrel
eternal oxide
#

You have no imports so your project is probably setup wrong and it will not know what JavaPlugin is.

dense kestrel
#

we need to know whats wrong though to help XD

cyan oyster
#

BRUH

#

i got warned for spamming

eternal oxide
#

you can;t type the same message twice or the bot removes it

eternal oxide
#

What IDE are you using? Eclipse or InteliJ?

cyan oyster
#

Ecilpse

eternal oxide
dense kestrel
#

well swap to Intellij to start

eternal oxide
#

Don;t,. ignore anyone who tells you to swop

dense kestrel
#

XD

#

its better

minor vapor
#

It comes to personal preference, use what you will

eternal oxide
#

Anyone who blankly tells you to change IDE with no valid reason is a fool. Ignore them

minor vapor
#

^

dense kestrel
#

πŸ™„

#

Intellij has better shit to help someone new to coding Minecraft plugins

eternal oxide
#

If at some point you dislike the IDE you choose, then change. Or change if you find an IDE you prefer better

#

InteliJ has shit that HIDES bad programming practices for a beginner

#

I'd say InteliJ is better for people who already know how to write plugins. Having everything done for you behind the scenes is not good for learning.

cyan oyster
#

i will still use Eclipse

eternal oxide
#

Good. Follow that tutorial I showed you. It explains every step of making a plugin

noble gust
#

[15:58:04] [Spigot Watchdog Thread/ERROR]: Current Thread: Server thread
[15:58:04] [Spigot Watchdog Thread/ERROR]: PID: 15 | Suspended: false | Native: true | State: RUNNABLE
[15:58:04] [Spigot Watchdog Thread/ERROR]: Stack:
[15:58:04] [Spigot Watchdog Thread/ERROR]: java.net.SocketInputStream.socketRead0(Native Method)
[15:58:04] [Spigot Watchdog Thread/ERROR]: java.net.SocketInputStream.socketRead(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: java.net.SocketInputStream.read(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: java.net.SocketInputStream.read(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.InputRecord.readFully(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.InputRecord.readV3Record(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.InputRecord.read(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
[15:58:04] [Spigot Watchdog Thread/ERROR]: sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)

#

please help me

eternal oxide
#

?paste

queen dragonBOT
noble gust
eternal oxide
#

so many issues, but you seem to be in teh wrong channel. You need #help-server

dense kestrel
# eternal oxide I'd say InteliJ is better for people who already know how to write plugins. Havi...

Sorry, was in a Tetris game so couldnt respond, but Intellij diffidently has wayy more built in features to help with development. Also, hes new and seems to want to code Minecraft plugins (he could just use the Minecraft Development Kit and it will set most everything up for him). Also, Intellij will tell you when you are fucking up and when you are writing useless code better than Eclipse will. On top of that, on Intellij will better predict what you want to write next and have better auto completions for you. Thats why I think as a beginner he should 100% start on Intellij.

minor garnet
eternal oxide
#

As for auto prediction, if you give that to a beginner its all they will ever use and learn almost nothing from it.

#

Its better to program in NP++ than to have things automated for a beginner

dense kestrel
#

Idk, i mean when I started I attempted to use Eclipse and honestly it made me feel like giving up because it was so confusion, Intellij helped a lot.

dense kestrel
#

which line is 41?

eternal oxide
dense kestrel
#

i started like 9months ago or so probably

eternal oxide
#

Yep

dense kestrel
#

honestly, at this point i dont really get stuck anymore

#

so i just try to help other people XD

ebon crescent
#

I saw that you cannot access APIs from an asynch task. What exactly does that mean? I’d like to save log files every time the the server itself saves, which I tried using a world save event for, but is that allowed?

dense kestrel
#

Basically you are not supposed to access Bukkit methods in an async task, just use a normal task

eternal oxide
quiet ice
#

Even reading is a bit concerning from time to time

#

Tho FIO (actually, IO in general) should be async here

ebon crescent
#

Yeah, I’m not worried about IO, I’m more concerned about whether I can run an async task from within a world save or I should schedule it independently

quaint mantle
#

I didn't coded it

#
    @EventHandler
    public void weather(WeatherChangeEvent e){
        e.getWorld().setStorm(false);
    }``` This will keep the weather clear right
minor vapor
#

just cancel the event?

quaint mantle
#

Yeah but then if it's raining before the plugin is loaded :smug

#

oh no nitro emotes

minor vapor
#

that's why #toWeatherState() exists

#

iirc it's true if it's not changing to clear

quaint mantle
#
   @EventHandler
    public void weather(WeatherChangeEvent e) {
        if (e.toWeatherState()) {
            e.setCancelled(true);
        }
    }```
minor vapor
#

should do the trick

opal juniper
#

Does anyone have or know of or can tell me a way of making + registering custom Entities

#

As in a custom mob

dense kestrel
#

you can spawn entities if thats what ya mean

opal juniper
#

I would like to be able to make a custom Mob, and be able to register it with NMS so that it would appear with, for example, /summon

minor vapor
#

I don't believe you can modify the list of entities used in summon, I'm not sure if it uses the enum name or not

eternal oxide
#

you could intercept the summon command in the pre event

opal juniper
#

However, is there like a resource for making custom entities, i cannot really find an up-to-date one

sage swift
#

mythicmobs not suit you?

opal juniper
#

mf read that as 'my thic mobs'

#

I would kinda like to try it myself tho

ornate heart
#

Anyone know why I would be getting an "Invalid Book Tag" error whenever I open up this book? I'm trying to make clickable text. I've pretty much copied the code from the guide that's straight from spigot. https://www.spigotmc.org/wiki/interactive-books/

Here's my method:

private void writeInGrimmoire(PlayerData playerData, ItemStack grimmoire){

       BookMeta bookMeta = (BookMeta) grimmoire.getItemMeta();

       BaseComponent[] page = new ComponentBuilder("Click me")
           .event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://spigotmc.org"))
           .create();

       bookMeta.spigot().addPage(page);

       //set the title and author of this book
       bookMeta.setTitle("Interactive Book");
       bookMeta.setAuthor("gigosaurus");

       grimmoire.setItemMeta(bookMeta);

   }
tribal holly
#

Someone know if a big quantity of mob spawner in a chunk with a lot of meta data for each can generate lag ? (arround 120)

#

there is no entity inside it but i got more than 50k entity on my screen for any reason (don't know if player head is like an entity but there is not a lot)

quaint mantle
tardy delta
#

how can i get the persistentDataContainer of a block that's already placed down? Someone said me it's possible

minor vapor
#

it just says what they put in the book

quaint mantle
#

ohh

outer crane
# tardy delta how can i get the persistentDataContainer of a block that's already placed down?...

since this video that i found on google exists, probably you can https://www.youtube.com/watch?v=oy7R-v7H17w

Time to learn Persistent Data Containers! This tutorial goes over a very basic persistent data container that holds the owner of a chest and does not allow other users to open the chest. I hope this tutorial helps you all understand PDC. More to come about Persistent Data Containers, but I figured since this in my first tutorial about it we shou...

β–Ά Play video
plain quest
#

i have a github repository and i want to edit it live with intelliJ is it possible and if so how would i do it?

outer crane
#

live?

plain quest
#

i just wanna be able to make changes and have them uploaded on github

#

not necessarily live

#

@outer crane

minor vapor
#

You can use VCS and clone the repo in the IDE

ornate heart
digital plinth
#

hmm how do i add a new string to an existing yml sector?

#

config.add is not a thing

tardy delta
#

does this work?

if(event.getBlock().getType() instanceof Container && event.getBlock().getType() instanceof Lockable)

?

#

it says that it's always true

dire marsh
#

how is that not giving you a straight up error

ornate heart
tardy delta
#

well i have this now

if(!(block.getState() instanceof Lockable && block.getState() instanceof TileState && block.getState() instanceof InventoryHolder
)) {
            return;
        }
...
#

ow Block block = event.getBlock();

eternal oxide
#

checking tilestate twice?

tardy delta
#

whoops

#

i mean InventoryHolder

dire marsh
digital plinth
#

ymlfile.get().add is not valid either

#

is there a way to add a new string to a exiting yml sector?

ornate heart
#

It's a written book with lore and display name changes

#

also did some stuff with pdc

#

I've gotten the text to show up before

#

but every time i try to do stuff with clickable text it breaks

#

For example, this code works:

private void writeInGrimmoire(ItemStack grimmoire){

        BookMeta bookMeta = (BookMeta) grimmoire.getItemMeta();
        bookMeta.setTitle("Blank");
        bookMeta.setAuthor("Destiny");

        String firstPage = "";
        String firstPageHeader = StringUtils.colorString(config.getDisplayNameColor() + getCenteredHeader());
        firstPage += firstPageHeader;

        //20 characters wide
        String underHeader = "&0-------------------\n";
        firstPage += underHeader;

        BlackCloverPlugin plugin = (BlackCloverPlugin) CoreLib.getInstance();
        String plusSign = "&2[+]&0";
        String manaLine = plusSign + " " + plugin.getMaxRegen(getTier()) + " Mana\n";
        firstPage += manaLine;

        // The spells
        for(SpellWrapper spell : spells.values()){

            String spellName = org.apache.commons.lang.StringUtils.capitalize(spell.toString().replace("_", " ").toLowerCase());
            String spellLine;
            boolean isUlt = spell.getKEY().isUltimate();

            if(isUlt){
                spellLine = "\n" + plusSign + " Ultimate: " + spellName + "\n";
            }else{
                spellLine = plusSign + " Spell: " + spellName + "\n";
            }

            firstPage += spellLine;

        }

        firstPage = StringUtils.colorString(firstPage);

        bookMeta.addPage(firstPage);
        grimmoire.setItemMeta(bookMeta);

    }
quaint mantle
digital plinth
quaint mantle
#

@digital plinth so ig you want to like update it right?

digital plinth
#

yes

#

add a new string without removing the old ones

dense kestrel
#

but it shouldnt reset the whole file

digital plinth
#

okie lemme test it

quaint mantle
dense kestrel
#

@digital plinth ^ That is exactly what you would do (but just make sure you save it after ofc)

#

it will work just fine

#

but all comments will clear

wraith rapids
#

yeah, the version of snakeyaml spigot uses, like all things spigot uses, is like half a decade out of date

#

so it'll nuke all comments if you save anything in any way other than with saveDefaultConfig

dim bronze
#
playerHandle.e(((CraftBlock) player.getLocation().getBlock()).getPosition())
val pose = DataWatcher.a(Entity.class, DataWatcherRegistry.s)
val data = DataWatcher(playerHandle)
data.register(pose, EntityPose.SLEEPING)
playerHandle.playerConnection.sendPacket(new PacketPlayOutEntityMetadata(playerHandle.getId(), data, false))

Trying to make the player appear to be sleeping, any ideas why this doesn't work? Right now it just makes the screen fade for a few ticks then goes back to normal

sage swift
#

does List support null elements

wraith rapids
#

depends on the List impl

#

generally yes

#

there are some like linked blocking queues or something that don't but most standard impls do

quaint mantle
#

LinkedBlockingQueue is not a List

#

It's... a Queue

quaint mantle
opal juniper
digital plinth
#

allowdrop.yml is created

#

hmmmmmmmmmmmmmmm

#

did i miss something

quaint mantle
#

i dont think so

visual tide
#

will matchMaterial return null if it doesnt know the item?

visual tide
#

thats just about material

dusty herald
#

that link directly shows matchMaterial

inner drift
#

hey, i made a custom spectator mode and i am struggling to cancel sounds that are coming out of the players in that mode
i have tried cancelling the packets using ProtocolLib but it says the Named Sound Effect packet is ready-only and shall not be cancelled
any ideas?

pulsar path
#

how can I get the first player inside a boat (the boat operator)? I have the boat entity e

inner drift
#

Entity#getPassengers returns a list of the passengers so you can get the first passenger from there

pulsar path
#

oh I'm so stupid sry

#

thx

opal juniper
#

i can have a look

quaint mantle
#

?jd

quaint mantle
#

oh protocollib docs sry

opal juniper
#

no

#

yeah

quaint mantle
opal juniper
inner drift
#

i have looked at the docs too and it's weird

#

because the error says that the packet is read only

opal juniper
#

Can i see the error?

inner drift
#

let me send the code maybe you guys can find something wrong with it

#

yea sure

queen dragonBOT
inner drift
#

ty lol

opal juniper
#

And the code please

inner drift
opal juniper
#

hmm

#

i mean, the error does kinda tell you the issue

#

You may need to send a packet to stop the sound, instead of cancelling it

inner drift
#

alright let me try that

opal juniper
#

have a look for the packet on wiki.vg probs

sage swift
#

can i clone a stream somehow? if i try to do multiple operations on the same one, it tells me it's already closed

opal juniper
#

i don't think thats the issue

#

ah, i see your idea

mortal hare
#

anyone up for a challenge?

sage swift
#

no

opal juniper
mortal hare
#
23 - 0
22 - 1
21 - 2
20 - 3
19 - 4
18 - 5

17 - 6
16 - 7
15 - 8
14 - 9
13 - 10
12 - 11

i have these numbers but every 6th element i want to start fom zero (transform the numbers to start from 0 again)
is it possible to do this with some kind of math logic and without if statements

inner drift
#

can't believe i missed that, thanks lol

mortal hare
#

for example

17 - 0
16 - 1
15 - 2
14 - 3
13 - 4
12 - 5
#

i can do this with for loop and incrementing the i by 6 to tget this result, but im thinking a way to do this algebraic.

opal juniper
#

How are you inputting numbers in / when are you getting info @mortal hare

sage swift
#

ghost ping

#

spoooky

quaint mantle
#

the sending message is bcz you have there player.sendMessage

#

java.lang.ClassCastException: class java.lang.String cannot be cast to class org.bukkit.Material (java.lang.String is in module java.base of loader 'bootstrap'; org.bukkit.Material is in unnamed module of loader 'app')

#

😦

quaint mantle
smoky elbow
#

a

quaint mantle
#

no

#

you are pretty much adding every material as one string

sage swift
#
        Stream.of(Material.values())
        .filter(Material::isBlock)
        .collect(Collectors.toSet());``` πŸ‘
white obsidian
#

no idea if anyone has tried this but I'm trying to put a spring boot application into a bungeecord plugin and it keeps removing the bungee.yml when i package the jar how do i stop this?

sage swift
#

or do this java Set<Material> blocks = new HashSet<>(); for (Material material : Material.values()) { if (!material.isBlock()) continue; blocks.add(material); }

wraith rapids
#

enumsetreee

sage swift
#

shhh

#

why would you use a list

wraith rapids
#

πŸ‘€

#

why would you use String

sage swift
#

why would you use the name

wraith rapids
#

that is literally the worst performing way of possibly doing it

#

you do not need order

#

you do not need duplicate elements

#

therefore you do not need a list

sharp bough
#

what a way to remove something in https://paste.md-5.net/uvaqijohod.bash like if i want to remove location.1.loots.1.items.2 i would normally take the data from the next one until i reach the last one and then delete that one, but is there a better way?

sage swift
#
        EnumSet.of(Material.STONE, Stream.of(Material.values())
                .filter(Material::isBlock)
                .collect(Collectors.toList()).toArray(new Material[0]));``` here
sharp bough
#

like rename locations.1.loots.1.items.X

wraith rapids
#

those are all maps

#

no actual lists are involved anywhere there

#

i'm not sure what your question is

#

just take the value you have at path a and set it to path b

sharp bough
#

but i need to remove and rename the section

wraith rapids
#

move the last section in the place of the section you removed

sharp bough
#

si its like 1,2,3,4

#

and not 1,3,4

wraith rapids
#

or does the order matter

sharp bough
#

it does

wraith rapids
#

if the order matters you need to shift all of them

#

set 2 to 3, set 3 to 4, set 4 to null

sharp bough
#

yea thats what i have been doing

#

but i was wondering if theres a better way

wraith rapids
#

aside from actually using list types, not really

sharp bough
#

but if the order doesnt matter

#

i could replace the last one

#

with the one im removing

#

no

#

the one im removing

#

with the last one

wraith rapids
#

yes

sharp bough
#

and set the last one to null

#

thats helpful thanks

wraith rapids
#

ideally you would use a list but map lists look kind of cancer in yaml and most end users don't know wtf to do with them

#

and the whole serialization thing with lists is kind of shit tier

#

using lists and leveraging on serialization would look like this

locations:
- world: world
  X: -331
  Y: 107
  Z: 153
  spawned: false
  unlocked: false
  clicked: false
  timeleft: 0
  loots:
  - ==: com.mydomain.myplugin.MyLootClass
    items:
    - ==: org.bukkit.inventory.ItemStack
      type: QUARTZ_BLOCK
    - ==: org.bukkit.inventory.ItemStack
      type: CHEST
    - ==: org.bukkit.inventory.ItemStack
      type: WOOL
      damage: 14
      meta:
        ==: ItemMeta
        meta-type: UNSPECIFIC
        display-name: Β§rΒ§6Β§lSuper Wool
        lore:
        - Β§rΒ§rthis is a test
        - Β§rthis is another test!!
        enchants:
          LURE: 0
        ItemFlags:
        - HIDE_ENCHANTS
  - ==: com.mydomain.myplugin.MyLootClass
    items:
    - ==: org.bukkit.inventory.ItemStack
      type: IRON_ORE
#

not exactly legible

granite stirrup
#

do u guys know why when i do /reload confirm my memory usage goes up

wraith rapids
#

because it leaks a ton of shit

granite stirrup
#

lmao

wraith rapids
#

there's a reason why using reload isn't recommended

#

like, aside from all of the shit that just generally blows up

granite stirrup
#

uh then how do i reload my plugin to work on it ;-;

wraith rapids
#

use a plugin manager

#

like plugman

#

and reload your plugin specifically

granite stirrup
#

plugman just reloads without like updating

#

;-;

wraith rapids
#

no it doesn't

errant drift
#

just restart' the server

#

all issues are solved

granite stirrup
wraith rapids
#

though you will want to first unload the plugin

#

then switch the jar

#

and then load the plugin back in

errant drift
#

what server jar you using if it takes ages to restart?

wraith rapids
#

switching the jar on the fly can cause issues

granite stirrup
#

but when i do /reload confirm it works

#

i dont have to unload the jar

#

and i tried that in plugman didnt work

wraith rapids
#

well, idk what you're doing, but it does

#

i use plugman everyday for reloading my plugins on my test serbur

granite stirrup
#

nah i did unload the plugin put new one in then load it again

#

and its the same

#

;-;

#

not the new jar

wraith rapids
#

and how are you determining whether it updated or not

granite stirrup
#

i tweak shit to test

wraith rapids
#

you probably just overlooked something

#

try it again

granite stirrup
#

i dont have plugman ;-; rn

wraith rapids
#

plugman might also not be the best

#

it's kind of shit

#

i know red the txt man has a plugin manager but idk how good it is

granite stirrup
#

i did see a version of plugman that was like a community made one i think

wraith rapids
#

to do the serialization/list based approach above, you would make your MyLootClass implement ConfigurationSerializable, and then set things to List<MyLootClass>

granite stirrup
#

or not idk

wraith rapids
#

you'd then have to getList from the config, and cast the List to List<MyLootClass>

#

which is gay

granite stirrup
wraith rapids
#

but also the best you're going to get with the bukkit config api

#

without making a dedicated MyLootList class

errant drift
#

plugwomen is better I think

granite stirrup
#

im getting plugman-improved 2.2.2

errant drift
wraith rapids
#

but, regardless of the plugin manager plugin you use or whether you use /reload or a plugin manager

#

you don't want to switch the jars on the fly

#

not all of the plugin's classes are loaded from the jar into memory at startup

#

if your onDisable or whatever causes new classes from your jar to be initialized after you've swapped the jar, your server could hard crash

#

as in total and complete fucking instant death where the JVM explodes

quaint mantle
#

neither it's guaranteed all references to classes are discarded everywhere

#

that's where the jvm gets dumb

#

jfc what a nightmare

wraith rapids
#

on bukkit's end, the classloader is dropped

solemn shoal
granite stirrup
wraith rapids
#

but if anything refers to any of the classes from that classloader, the classloader will still be strongly referenced

worn tundra
solemn shoal
#

plugman likes to break things lol

quaint mantle
#

yea

wraith rapids
#

which will keep all of the classes belonging to it also in memory

#

which will keep all static fields and shit in memory

errant drift
#

it's like jumping into or jumping out of a moving car

wraith rapids
#

plugman does not "very often fail to reload even the simplest of plugins"

granite stirrup
#

but i dont want to have to restart the server every time

wraith rapids
#

literally never seen it fail to reload a simple plugin

#

only things it has issues with are plugins with dependencies

errant drift
worn tundra
#

And isn't it a sign of a good plugin that is able to handle things like reloads?

wraith rapids
#

i concur

#

all of my plugins are reloadable

granite stirrup
#

my server takes like ages to start so i dont want to have to restart

wraith rapids
#

even the ones with dependencies

granite stirrup
#

its not even the plugins its mostly the worlds

#

it just takes forever

#

to load

#

1 world

wraith rapids
#

a plugin shouldn't need a dependency manager to reload all of its dependents/dependencies

#

the plugin should be able to handle that itself

solemn shoal
#

all of my plugins are reloadable too but its generally bad practice

#

even tho i do it myself

quiet ice
#

I mean, some plugins will expect that the server is empty when it is loaded, but that is rare

worn tundra
#

Should be like a usb that extends the servers functionality

granite stirrup
#

viaversion is even reloadable but it can still break lmao

wraith rapids
#

f.e if you're hooking to worldguard, instead of registering a new flag and exploding because the registry is closed, you should try to obtain your already-registered flag

solemn shoal
#

oh i have a reference to my onJoin on a player loop in my onEnable

wraith rapids
#

you don't need to reload worldguard to reload your plugin

#

which would be the naive assumption made by a plugin manager

quiet ice
#

I have many of these fields static final and won't change that

wraith rapids
#

likewise, if you absolutely depend on a plugin, you should listen to plugin unloads and disable yourself when that plugin disables

solemn shoal
#

my only dependency so far has been vault

wraith rapids
#

i have a plugin that depends on towny, worldguard and slimefun and it's still reloadable

#

which is something of a fucking miracle if you ask me

solemn shoal
#

my plugins depend on ColorLib

wraith rapids
#

but that should be a library and shaded in

solemn shoal
#

which, is litterally just shaded into my plugin

#

yeah

#

it IS a library

wraith rapids
#

good

#

too many people write their libraries as if they were plugins

solemn shoal
#

oh so do i

wraith rapids
#

the number of "x API" and "x Lib" plugins that are actual plugins with plugin.ymls is insane

quiet ice
#

Wait, what is ColorLib?

wraith rapids
#

where they could just as well be libraries

quiet ice
#

Does it free me from my 1k line Monolith full of switch statements?

solemn shoal
#

colorlib has a plugin.yml

#

but thats mainly because it can be ran as a plugin to test

#

tho i should probably make it output a test jar for that

wraith rapids
#

somewhat dubious but as long as it doesn't need to be loaded separately as its own plugin to be used, it should be fine

solemn shoal
#

@quiet ice 1k line monolith of switch statements?

sage swift
#

holy shit geol

wraith rapids
#

why aren't you just like

quaint mantle
#

yea 1k lines xd

wraith rapids
#

constructing this dynamically

#

it's kind of gay i guess but this is even gayer

solemn shoal
#

colorlib only handles text colors

#

so you can use 1.16's RGB colors without breaking 1.15 and older

quiet ice
wraith rapids
#

like, iterate over all materials with a color name in their name

sage swift
#

if (toString.contains("RED"))

wraith rapids
#

and based on the remaining parts of the name, add them to separate maps

solemn shoal
#

yeah

wraith rapids
#

f.e GREEN_CONCRETE would be of type _CONCRETE and of color GREEN

#

then populate an EnumMap<Material, EnumMap<Color, Material>> with them so you can do lookups from material -> group -> other color in that group

quiet ice
#

Well, that is a better idea I guess

wraith rapids
#

the only issue is that you will get weird partial groups if some materials contain color names but aren't actually colorable

#

like uh

#

red rose or whatever

quiet ice
wraith rapids
#

yeah

#

but, imo that is still more manageable than this

#

you could still hardcode an enum of colorable types like you're doing right now

#

and that'd solve it

#

but then it wouldn't be completely dynamic

kind coral
#

how would i make something like this?

lets say i have a list of objects, and a player can have multiple objects related to it, how would i set like this?

quiet ice
#

I would need to refractor that class either way given that It will be a pain to update

wraith rapids
#

f.e a ColorGroup enum with a constant called BANNER with a constructor of (Material.RED_BANNER)

granite stirrup
#
String ver = a.substring(a.lastIndexOf('.') + 1);``` wait is there a better way to get the server version? this is all i could find XD
lost matrix
wraith rapids
#

the ctor would then find the associated colors

kind coral
dry beacon
#

Why does the if statement return even if I'm looking at one of those blocks?

Block b = player.getTargetBlock(null, 5);
if (!(b.getType() == Material.DAMAGED_ANVIL) || !(b.getType() == Material.CHIPPED_ANVIL)) return;
quiet ice
#

But that plugin doesn't acknowledge the existence of 1.13+ food types, so I could declare that a feature

wraith rapids
#
users:
  uuid:
    locations:
    - location1
    - location2
    - location3
quiet ice
lost matrix
kind coral
granite stirrup
#

anyone know a way to get the server version

#

πŸ˜„

kind coral
#

oppure getServer().getVersion()

#

idk

quiet ice
lost matrix
granite stirrup
# kind coral oppure getServer().getVersion()

u sure those are things cuz rn i haveString a = Bukkit.getServer().getClass().getPackage().getName(); String ver = a.substring(a.lastIndexOf('.') + 1); it works fine but idk if its the best way

#

i just found it on some forum post XD

lost matrix
granite stirrup
dry beacon
mortal hare
#

solved it

granite stirrup
mortal hare
#

i-((i/6)*6) would repeat the range

#

because i/6 is integer based divide and it will drop the decimal point value

quiet ice
wraith rapids
#

a block can't be both a damaged and a chipped anvil at the same time

#

one of those conditions will always be true

#

if it's a chipped anvil, it's != damaged anvil

#

if it's a damaged anvil, it's != chipped anvil

quiet ice
#

In brief, always simplify your if statements to the bare minimum, otherwise you will get confusions

wraith rapids
#

god the gitlab site performs like shit

#

and i thought github was bad

sharp bough
#

current code:

Main.get().getConfig().set("locations." + locID + ".loots." + lootID, Main.get().getConfig().get("locations." + locID + ".loots." + totalLoots));
        Main.get().getConfig().set("locations." + locID + ".looots." + totalLoots, null);
        Main.get().saveConfig();```
wraith rapids
#

that's like a section reference or something iirc

#
  • ".looots." +
sharp bough
#

loooooool

#

thank you

#

i need a new keyboard

quaint mantle
#

What is the difference between setBoots() and setItem(int, item) ?

chrome beacon
#

One sets the slot in the boots slot the other sets an item in any slot

wraith rapids
#

Repeated nodes are initially denoted by an ampersand ( & ) and thereafter referenced with an asterisk ( * ).

quaint mantle
#

I mean if the setItem slot is the same as the boots slot

wraith rapids
#

none

#

but setBoots is more verbose, so unless you need to dynamically switch which equipment slot you are setting, use setBoots

#

and for dynamically choosing the slot you might want to use the equipment slot enum

mortal hare
wraith rapids
#

you should give your dog some 250v cables to chew

mortal hare
#

Also that keyboard costed like 10$

#

He ate my earphones too 😐

#

these were good bass earphones

#

sadly

#

this

#

shitty

#

monster chewed them

sharp bough
#

plus my keyboard from time to time does this little double press like instead of typing "hello there" it types "hello there"

mortal hare
#

if i would shoot a picture of my setup you'll be laughing how the keyboard is still alive.

quiet ice
#

If the house burns down in the next few days we will know why

mortal hare
#

I hanged it on the flower pot

#

in order to get connection

#

with the USB port lol

wraith rapids
#

sounds like worn out butterfly switches

quiet ice
#

I do such things with my phone charger

sharp bough
quiet ice
#

It's impossible to connect that thing properly

mortal hare
#

USB C solved phone charging problems for me

#

at least

sharp bough
#

yall dont get tilted by that

mortal hare
#

i've never gotten any charging problems with cables after switching to usb c

sharp bough
#

everytime i have to put my charger or any cable "in an angle for it to work", then thats the last time im using it

mortal hare
#

it such a great technology

#

Round connector TM

wraith rapids
#

phones should just use standard usb a jacks

#

it's not like you can't fit one of them on the thing

sharp bough
#

lol

mortal hare
#

what's the difference between USB A and C?

wraith rapids
#

a is the one you plug to your pc

#

c is the tiny fucking little shit that breaks it you look at it wrong

#

you could totally fit a usb a jack on most mobile phones, it'd just involve shifting some components around

sharp bough
#

like phones now days , i used to have " a brick ", one of those old nokia phones, i swear i put a pencil across it was just fine

wraith rapids
#

but no everything needs to be tiny and slim and delicate and fragile

#

just like the people

mortal hare
#

oh

sharp bough
#

lol

mortal hare
#

you mean

#

the OG usb port

wraith rapids
#

yes

#

the "normal" usb

#

model A

mortal hare
#

yea

granite stirrup
#

i think i broke my plugin πŸ‘€

mortal hare
#

or better

#

just audio jack cable

#

which is powerful enough

#

to charge

unreal quartz
#

nah

#

i say we stick one of these bad boys on them

granite stirrup
#

it errored to disable my plugin and errored to enable it XD

mortal hare
#

audio jack cable is the most satisfying cable

#

to plug

wraith rapids
#

i suppose you could do that but that'd be pretty confusing

mortal hare
#

and one of the easiest

#

yea

#

that would be weird

wraith rapids
#

you'd have 2 of 3.5mm jacks and you wouldn't know which one is for the headset and which one is for charging

#

usb is good because it's already been standardized

#

issue just is that all of the smaller models are super fragile

mortal hare
#

USB C is a big improvement compared to Micro USB

wraith rapids
#

tbh the round plugs used back in the day were very good

mortal hare
#

in terms of durability

wraith rapids
#

but standardization was a big issue

#

every brand had their own plug

mortal hare
#

that shitty Micro USB is such pain in the ass compared to USB C

wraith rapids
#

C is still pretty shit

mortal hare
#

well

#

if you want to break

#

it breaks

#

just like A ports will

wraith rapids
#

it's gonna break if you look at it wrong

#

A is like a heavyweight champion compared to it

odd sentinel
#

so if I open a custom inventory with player.openInventory how can I detect when that's closed? do I need to use the InventoryCloseEvent and compare if the inventory is the one I opened?

wraith rapids
#

that is the simplest way yes

odd sentinel
#

ok I'll just do that

#

I just dislike the idea of technically having to check on every single inventory close

wraith rapids
#

i suppose

#

but, that's what you will be doing with event buses designed like bukkit's

#

all events are global

granite stirrup
#

bruh plugman fucked up my plugin i think XD

wraith rapids
#

there are no events you can subscribe to in a particular context

sage swift
#

ignoreCancelled

#

🀯

wraith rapids
#

you just listen to all of the globally happening events and check if the context matches

#

that is, you can't listen to InventoryCloseEvent in the context of a specific inventory

#

you'll have to listen to them all and check whether the context is the one you want

sage swift
#

you should also implement InventoryHolder instead

wraith rapids
#

supposedly that's haram

#

but people still do it so idk

sage swift
#

as is using legacy chat to paper

wraith rapids
#

well, paper's reason for that is that they don't want to support the old shit

#

which is their problem

#

it's not an issue with your project

#

i don't remember for what reason you shouldn't use the inventoryholder for detecting the inventory though

#

so it could be a valid reason

#

but, people do it anyway so probably not

#

do whatever

warm galleon
#

who canb call me and completely spoonfeed me the dictionary of mysql skills

sage swift
#

officially stated somewhere that implementing classes not specifically designed for implementation is not supported

wraith rapids
#

i vaguely remember someone saying something about its persistence not being guaranteed or something

#

but seeing as it works just fine and people do it anyway, that's probably a hypothetical

sage swift
#

if it didnt work people wouldnt use it 😎

wraith rapids
#

hey @warm galleon you're and completely spoonfeed me the dictionary of mysql skills

wraith rapids
#

you asked me to call you and completely spoonfeed me the dictionary of mysql skills

errant drift
#

watch codedreds youtube video on mysql @warm galleon

warm galleon
#

i am

quaint mantle
#

is it possible to reorder the args in onTabComplete?

#

I don't want them alphabetically

wraith rapids
#

they're sorted by the client i'm pretty sure

sage swift
#

i don't think they are

river goblet
#

They're not. They're sorted by whichever strings are put in the list first.

wraith rapids
#

based on the question i'd think they are but tbh i haven't tested

quaint mantle
sage swift
#

what if you put some invisible colors in front

#

like Β§gOwner

#

Β§hAdmin

#

etc

#

Β―_(ツ)_/Β―

ripe marlin
#

can some1 reccomend me a series of tutorials or tutorial that will help me get going on coding plugins, I found some yt ones but others have said they have problems

#

the only one i've found so far is outdated

wraith rapids
#

youtube guides are generally cancer

ripe marlin
#

😭

eternal oxide
#

What is your chosen IDE?

ripe marlin
#

intellij but that shouldn't matter right?

wraith rapids
#

it matters for the tutorial

warm galleon
#

jk

eternal oxide
ripe marlin
#

I only see blank plugins tut

eternal oxide
#

Thats getting started

#

further down there is creating a command, using events

#

and config files

ripe marlin
#

kk

#

thx