#help-development

1 messages · Page 1965 of 1

undone axleBOT
merry kindle
#

is it only there

lost matrix
#

Yes

wet breach
#

?cla

undone axleBOT
lost matrix
#

^

#

This also lets you know how to fork

#

kind of

vast junco
#

How can I send an EntityStatusS2CPacket (that's the name in the minecraft code) to a specific client with spigot? It's fine if it uses protocollib, or if it uses the base spigot api.

sharp flare
#

how can I make an armorstand go folllow my location after hitting a block, the snippet works but when I move different direction its broken, I suck at vectors so any help is appreciated

lost matrix
vast junco
#

figured it out, EntityStatusS2CPacket is not the classname in spigot, but with protocollib, its enum is PacketType.Play.Server.ENTITY_STATUS

lost matrix
sharp flare
#

its in a weapontask class

restive tangle
#

My yml should look like this

maps:
  mapName:
    spawnpoints:
     '1':
        x: 
        y:
        z:

If I do config.getConfigurationSection("maps").getKeys(true),I'm getting all the mapNames right?

#

It's been a while since I've used yml files

lost matrix
sharp flare
#

thats great but I was trying to make the armorstand return back to the player just like a trident with a loyalty enchant

midnight shore
restive tangle
#

I already do that, I'm just wondering what config.getConfigurationSection("maps").getKeys(true) gets me

#

Does it start from mapsName: spawnPoints : ...?

midnight shore
#

It should get only the map names

restive tangle
#

so if I do

for(name in  config.getConfigurationSection("maps").getKeys(true)) {
  for(spawnpoints in  config.getConfigurationSection("$name.spawnpoints").getKeys(false) {
    
  }
}

It's Kotlin, my yml is going to be

maps:
  mapName:
    spawnPoints:
      - "X:028,Y:928,Z:09"

will spawnpoints in the second loop give me each of the array value or all of them at once?

red sedge
#

how can I use setDurability

#

im confused

midnight shore
restive tangle
#

So it'll give me each of the values independently?

midnight shore
#

I think it should give you value1: “string” and so on

restive tangle
#

Huh?

red sedge
#

it will give you a stringlist

#

i believe

lost matrix
#
    YamlConfiguration configuration = ...;
    List<Location> locations = ...;
    // Write locations
    configuration.set("locs", locations);
    // Read locations
    List<Location> readLocations = (List<Location>) configuration.getList("locs");
#

Same goes for ItemStacks

#

And everything else that implements Serializable

bitter frigate
#

Hello,
I Look for how I can teleport the player with my plugin on the map by multiverse. Can you put the doc or drop the code.
Excuse me for because I from French
Ping me

glad iron
#

If thats what you want to do you first have to obtain the World by doing World world = Bukkit.getWorld("the-name-oft-the-world"). You can then telport the player by doing player.teleport(new Location(world, x, y, z))

echo saddle
#

sbrk(-1)

opal juniper
#
@EventHandler
public void onReload(ReloadEvent event) {
    getLogger().info("I see you reloaded, lemme help you with that.");
    Bukkit.shutdown();
}
lost matrix
tardy delta
#

lmao

opal juniper
#

thats more of an if version == 1.8

lost matrix
#

Well... they got it comming

echo saddle
#

pancakes.

lost matrix
#

ok maybe add a

    if(Bukkit.getVersion().contains("1.8")) {
      
    }

Then you wont have a guilty conscience

lost matrix
opal juniper
#

hehe

rough drift
#

is there a way to get the .jar file of the server that is currently running? (Because so far i've only been able to get the .jar of my plugin)

rough drift
#

and...

echo saddle
#

pancakes with frosting

rough drift
#

how do you do that

#

(sorry i phrased my question wrong)

tardy delta
#

what does Bukkit.getWorldContainer() returns?

lost matrix
#
URL bukkitUrl = Bukkit.class.getProtectionDomain().getCodeSource().getLocation();
rough drift
#

or the folder the worlds are stored in

rough drift
tardy delta
#

im always confused when i see urls, it lets me think at links

echo saddle
#

yes.

rough drift
echo saddle
#

refactor everything

ivory sleet
#

Bukkit::class then

naive bolt
ivory sleet
#

Or maybe not

rough drift
opal juniper
rough drift
#

nvm

#

found it

ivory sleet
#

Hmm oh yeah that’s just if it’s a kotlin class now when I think of it

opal juniper
#

it literally tells u lol

naive bolt
rough drift
#

its Bukkit::class.java.protectionDomain.codeSource.location.path

wary harness
#

is it possible to create NMS instance of block

ivory sleet
#

Oo lol

wary harness
#

like fake one

lost matrix
naive bolt
#
  private void setupSQL() {
    if(this.getConfig().getBoolean("sql.enabled")) {
      this.SQL = new MySQL(this);
      this.data = new SQLGetter(this);
lost matrix
#

Because a Block is a part of a Chunk which is a part of a World.
Those are strongly coupled.

wary harness
#

net.minecraft.server.v1_16_R3.Item.getItemOf(((CraftBlock)b).getNMS().getBlock()).getItem().createItemStack()))

rough drift
wary harness
#

this will return for example is block is CARROTS it will return item stack of CARROT

lost matrix
#

And... why do you not just do that with the spigot api?

ivory sleet
#

::sendBlockChange

#

Which iirc is basically one layer above packets

lost matrix
wary harness
wary harness
#

and CARROTS is only a block

#

ITemStack stack is CARROT

#

same for POTATOS and POTATO

lost matrix
#

I see

wary harness
#

and some others farmign blocks

visual tide
wary harness
#

and I don't know why spigot didn't imeplements getItemOf which is there from 1.7 or earlier in NMS

tardy delta
rough drift
#

97.6

visual tide
#

1.21.8 isnt even that unlikely tbh

#

so

rough drift
#

yeah

#

we'll all just be 956 years old by then

wary harness
# lost matrix I see

thing is I just need this once when plugin loads to convert wrong values from config in case user puts CARROTS it will convert it to CARROT and store that type in map for farming drops

ivory sleet
#

Yeah they don’t consider the one in their version semantics to be major so not unlikely 1.80 would arrive in the conceivable future

visual tide
rough drift
wary harness
#

not good for me

lost matrix
wary harness
#

I love my comments

#

I live for them

rough drift
ivory sleet
#

Sometimes you really need to explain some stuff tho

#

For instance if you have a config value which determines what database types are available, then listing them in a comment might not be so bad

rough drift
wary harness
ivory sleet
#

Yeah

lost matrix
rough drift
ivory sleet
#

I mean I’d say comments are to some extent necessary where you can explain edge cases for certain values and what not

#

In code it’s somewhat different

lost matrix
#

Stole most of it from redempts crunch lib

rough drift
ivory sleet
#

Crunch is very crunchy uwu

rough drift
wary harness
ivory sleet
#

MrAxeTV yeah I can agree they are at least when almost no one is willing to maintain them

#

I mean regex is just built different so understandable why parsers actually try to explain every single thing there in an expression

rough drift
#

fair enough

ivory sleet
#

Btw IkeVoodoo have you tried scala by any chance?

rough drift
#

but i plan on

rough drift
ivory sleet
#

Yeahh asking since you code kotlin, which I also use but some of its features really get me on my nerves

lost matrix
#

Also wtf

rough drift
rough drift
ivory sleet
#

Idk it isn’t superfluous in terms of features

#

Like I hate the extreme type inference kotlin does but that’s a you-problem that regards me specifically, but the way it handles interoperability with properties is a bit painful imho

rough drift
#

like

ivory sleet
#

The best features of kotlin is coroutines and null safety

rough drift
#
val test = try {
  someFunction()
} catch(e: Exception) {
  return
}
ivory sleet
#

try catch expressions yeah

rough drift
#

kt has coroutines?!

ivory sleet
#

Yeah

rough drift
#

oh shi

ivory sleet
#

Not in std lib iirc

#

But it does danceDog

#

Oo yeah default immutability is very handy

rough drift
#

there's also var

#

which is val

#

but mutable

ivory sleet
#

Yeah but for instance a normal Map does not provide mutator methods

#

which is just sexy

rough drift
#

fair

#

also

#

i just realized

ivory sleet
#

owo

rough drift
#

technically scala, kotlin and java can coexist in one project

ivory sleet
#

Yeah lol

rough drift
#

ALL THE JVM LANGS

ivory sleet
#

🙏🙏🙏🙏

rough drift
#

they all work together

#

the 5 infinity stones lmfao

ivory sleet
#

Oo

rough drift
#

or was it 6

ivory sleet
#

Yeah forgot clojure lmao

rough drift
#

i forgot

ivory sleet
#

Too many

rough drift
#

imma learn them all

lost matrix
#

You mean. Brick, Rock, Pebble, Gravel and paper mache shaped like a rock

rough drift
#

XD

ivory sleet
#

🥲

rough drift
#

clojure messed up

#

their things don't align vertically

lost matrix
#

Clojure. Imagine having a jvm and then using a functional language for it.

rough drift
#

ah yes

#

'("my" "weird" "list")

ivory sleet
#

Afaik clojure is just notoriously known for massacring everything with parentheses

rough drift
#

groovy is kotlin but slightly modified

ivory sleet
#

Yeah

#

The worse version of kotlin

rough drift
#

only thing i like

ivory sleet
#

Mye

rough drift
#

theres only one language for the jvm missing

#

one that allows you to do

#
class A {
  operator fun add(B other): AB {
    return AB(this, other)
  }
}

println(A() + B())
```Borrowed some syntax from kt
#

the + would convert to .add

ivory sleet
#

operator overloading

#

:p

rough drift
#

yes

#

i love it

#

yk what, i might make it lmao

ivory sleet
#

can be the most confusing shit out there as well as the most handy shit out there

rough drift
#

imagine vectors in spigot with op overloading

ivory sleet
#

ye

rough drift
#

(vec1 / vec1.length) * distance

ivory sleet
#

believe kotlin even got infix functions

#

which can be to some help from time to time

#

like

#

vec1 add vec2

#

instead of vec1.add(vec2)

rough drift
#

i've been using that without knowing

#

lol

ivory sleet
#

🥲

sacred mountain
#

lol

#

conclure do you give financial help if i ping you

ivory sleet
#

tbf im not proficient in kotlin entirely so I dont blame you due to its overwhelming amount of features

rough drift
#

hol' up, i just realized

ivory sleet
rough drift
#

i have a parser implementation in js that is pretty easy to modify

ivory sleet
#

oo

rough drift
#

i might make a jvm language just for the fun of it

vale ember
#

via js?

rough drift
#

(i made multiple language syntaxes and working parsers, never managed to execute one tho)

rough drift
# vale ember via js?

yeah you take the output AST, convert it to bytecode the jvm can read and feed it to the jvm as a .class

ivory sleet
#

interesting

#

enormous effort but nice

vale ember
#

i am afraid of thinking that one can write jvm language with dynamic typed, interpreted language 🙃

rough drift
#

enums are not required

#

they can be replaced with ints/strings

vale ember
#

well, yes, technically it is possible, no doubt, but it's still not the best idea i guess

rough drift
#

i mean it runs pretty fast

vale ember
#

(undefined)

rough drift
#

and it gives correct output

rough drift
vale ember
#

you're very lucky

rough drift
#

meh ig

#

also ill just quickly write a parser for

class Hello {

}
#

vsc be slow

#
{
  "type": "Program",
  "body": [
    {
      "type": "ClassDeclaration",
      "name": "Hello",
      "body": {
        "type": "ClassBody",
        "body": []
      }
    }
  ]
}
#

tada

#

done

vale ember
#

ig the hard part is to translate that into java bytecode

rough drift
#

yep

#

ik a bit about bytecode tho i can't write it

#

now, back to figuring out how to get the server jar

vale ember
#

🤔

rough drift
#

making auto updater for my plugin (using spiget, calm down)

#

and its uh, almost working

ivory sleet
#

almost 🥲

rough drift
#

so as you can see, the server jar is the classpath

#

and the jar is my plugin

#

and if i put it as the bukkit class

#

i get the paper api

#

lemme try using Bukkit.getServer

opal juniper
rough drift
#

why not?

#

it just downloads the plugin and asks you if you want to restart the server

#

if you do it restarts and its done

#

no weird loading is done

#

it goes:

download .jar
place it in update folder
Restart

opal juniper
#

Say you accidently post an update with a bug/flaw and then suddenly everyone has the bugged version. If they are running your plugin on a production server it could ruin their server

rough drift
#

the auto update is triggered manually, its just convenience so people don't download from the wrong place or the wrong ver

vale ember
#

make users be able to disable auto update via config

opal juniper
#

make the default disabled angryeyes

rough drift
#

It goes: "There's an update available, do you want to install it?" if you do, you update

#

otherwise not

opal juniper
#

🤨

#

whatever you do you but im not helping

rough drift
#

Process of updating:

/lsversion (tells you if its outdated)
/lsversion download (downloads latest version if available)
/lsversion apply confirm (applies the new version)

vale ember
#

cool thing

tardy delta
#

would it be a good idea to change
player.sendMessage(Lang.HOME_TELEPORTED_TO.get(name));
to
Lang.HOME_TELEPORTED_TO.sendTo(user, name);?

neon nymph
#

Hello guys, not sure if this is where I should ask this but, how would one request access to post premium resources? Or do they just automatically enable us when we reach the requirement?

tardy delta
#

looks fancy atleast 😳

neon nymph
vale ember
#

it's cleaner and don't have double )) at the end + no useless .get call

undone axleBOT
quaint mantle
tardy delta
#

then i just make a method #sendAsTitle

vale ember
quaint mantle
#

You will have a lots od methods breaking SRP principle

tardy delta
#

or leave the #get method there

#

mhm

vale ember
#

leave get method and add sendTo also

#

cuz it's very common usage and will lead to cleaner and more readable code

neon nymph
neon nymph
#

Great, thanks!

rigid loom
#

can i obtain the Y level of the bedrock ceiling in the nether or do i have to hardcode it?

minor garnet
#

how transform vector to auler angle?

lost matrix
minor garnet
#

the problem is my topic

lost matrix
minor garnet
#

i made a code where I did for when a player looks at an armor stand another armor stand on top rotating around it, the problem is that, from the moment the armor stand appears it doesn't rotate in the player's position, unless that you move too close to her

i made a code where I did for when a player looks at an armor stand another armor stand on top rotating around it, the problem is that, from the moment the armor stand appears it doesn't rotate in the player's position, unless that you move too close to her

https://paste.md-5.net/ibemicakuz.java

midnight shore
#

Hi guys, how can i make an entity move following a spiral?

lost matrix
#

Try that before dabbling in euler angles

minor garnet
#

what

#

of both entities location?

#

because whenever the entity spawn it doesnt turn towards me, it looks north you know?

minor garnet
#

now if i move a little to the side it doesn't turn, now if i get too close or move too sharply it turns back to me

#

?

#

@lost matrixwhat did you decide?

gritty urchin
#

is there a conversion of yaw range to direction

#

e.g. NORTH, EAST, SOUTH and WEST

#

or a method to get the direction

#

a player is looking in

warm light
#

not sure

young knoll
gritty urchin
tardy delta
#

is there some convention about where to place static methods?

tardy delta
#

oh

gritty urchin
#

just only use them where it is necessary

tardy delta
#

ik yea

gritty urchin
#

where an instance can't be used to access the method

young knoll
#

You’re on your own then

#

Legacy

warm light
#

how to check if player is trying to renaming a special item?

tardy delta
#

why do static fields not work in enum initializers?

#

it says illegal forward reference

#

but static methods do lmao

#

because the constants are loaded before the fields i guess?

#

and the methods on class load?

ivory sleet
#

Feels like you should look at some java bytecode

deft forum
gritty urchin
#

have u registered the event

#

@deft forum

delicate lynx
#

"doesn't work"

#

what does that mean

deft forum
#

yes

deft forum
next stratus
quaint mantle
#

@lapis widget can I get your help with something simple?

lapis widget
#

idk

quaint mantle
#

So I'm currently learning about inheritance and I am wondering about this

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
deft forum
#

its good

quaint mantle
#

How come CommandSender implements or extends Player only when it's a Player that has executed the command

deft forum
#

its a HumanEntity

#

in the boolean

#

sender

glossy venture
#

Its the other way around

#

Actually Player extends HumanEntity which extends CommandSender

tardy delta
#

is there a method to stop players food level decreasing?

#

i could listen for the food change event but idk if theres anothe way

glossy venture
#

Maybe set saturation level idk

eternal oxide
#

set saturation in a runnable

tardy delta
#

hmm lemme use foodlevel change event then

lapis widget
glossy venture
#

Oh nevermind

minor garnet
#

so?

quaint mantle
quiet ice
#

Does anyone have a fast UUID -> Object map implementation? (only lookups need to be fast, setting can be semi-slow and I do not really care about iteration nor about thread safety)

vale ember
#

what are you doing that you care so much about performance (isn't hashmap good enough)?

#

just interesting

quiet ice
#

Basically I am doing an integration into squaremap (something like dynmap) and i need to cache the colors of the players (so I do not create tons of java.awt.Color instances). Though now that I think about it, I should just go with a strictly defined color pallete and do an array lookup based on the hashcode of the uuid

#

Yeah, that is probably going to be faster than anything else

glossy venture
#

I think the vector from toVector contains the position

#

Not the direction

ivory sleet
#

I believe UUID can cause collisions with the mere Object::hashCode else I’d have recommended Int2Obj or sth

quiet ice
#

Yeah, sadly it does. But even if it wasn't an array lookup based on the hashcode and a modulo operation is probably going to be faster

pulsar vessel
#

hey looking for some devs to help with a new minecraft network launching some time befor easter

it is a good network has and i9 11th gen and 64gb ram

tardy delta
#

?services

undone axleBOT
quiet ice
tardy delta
#

which one?

#

ofEpochSecond i guess

quiet ice
#

hm

#

But then you can also remove the LocalDateTime.from

sacred mountain
#

im making a console logging utility, how would i create an enum that contains warn, info, error, etc and use it in a switch in my Logger class?

#

i currently have LogType enum with all those but im not sure how to reference it

vale ember
#

wat

tardy delta
#

smth like this

vale ember
#

wdym?

sacred mountain
#

well im trying to make a utility class

vale ember
#

wdym not sure how to reference it?

sacred mountain
#

and it would be nice to have preset stuff like WARN in the params

#

so i made an enum

vale ember
#

and?

#

what's the problem?

tardy delta
#

i'd make a Logger class with a LogLevel enum inside >_>

quiet ice
tardy delta
#

imma try that

vale ember
#

But why would you ever want custom logger? Bukkit have it's own,,,

quiet ice
#

Stupidity of devs

tardy delta
#

they want to support color codes in console kekw

quiet ice
#

There are hundreds of people using Logger.getLogger("Minecraft") and write a logger around it

vale ember
#

I don't understand why would someone ever wan't to make custom logger???

#

There is java's standard for simple things and log4j/slf4j for serious things

#

And bukkit have Bukkit.getLogger() which uses java logger afaik

opal juniper
quiet ice
#

Which you shouldn't use either

tardy delta
quiet ice
#

Bukkit.getLogger should get deprecated

opal juniper
#

why?

quiet ice
#

Because as far as I know it doesn't log which plugin uses it

opal juniper
#

no it doesnt

#

but for example if you want to add a handler to the entire logger which someone was trying to do the other day it is needed

quaint mantle
#

How can I smoothly fill the blocks around the coordinate?

opal juniper
#

define smoothly

tardy delta
#

worldedit kekw

quaint mantle
opal juniper
#

like what do you mean

quaint mantle
#

Put blocks of 1 around the player

opal juniper
#

just get the blocks and do Block#setType

quaint mantle
#

How to put them in a circle of 1?

opal juniper
#

circles and mc dont really go together - do you mean one on each side?

quaint mantle
#

If for, puts mngovenno

tardy delta
#

🔴 🔴 🔴
🔴 player🔴
🔴 🔴 🔴

#

like that?

#

lmao beatiful circle

quaint mantle
#

🔴 🔴 🔴
🔴 player🔴
🔴 🔴 🔴

#

By 1, starting from 1 block

opal juniper
#

get players location, and then add offsets and change the block

quaint mantle
dense jewel
#

Hi, I need help

#

I cant import library to bungee plugin

delicate lynx
#

do you use maven or grade

#

how are you importing

dense jewel
#

I try with jar

#

manual

#

and I try with maven

#

all time say this

delicate lynx
#

are you using the shade plugin on maven?

dense jewel
#

what is shade?¿

quiet ice
#

(answer is no)

#

Unless they are trolling

dense jewel
#

but you can see my project

ornate scarab
#

does anyone know how to convert a string to an nbt compound?

quiet ice
#

basically you should be using maven or gradle and use the maven-shade-plugin or the gradle-shadow-plugin respectively

#

Using your IDE's build option usually is not a good compromise

grim ice
#

Cannot access me.hex.durable.Durable

#

why cant i access my main class

#

tf

sour socket
#

Ok, so

quiet ice
dense jewel
#

wait I check this

grim ice
#

thats all

quiet ice
#

Also, when does it happen? Runtime or compile time?

grim ice
#

compile

#

my ide tells it to me

quiet ice
#

Perhaps it isn't public

drifting sonnet
#

@quiet ice

quiet ice
#

so you defined it as class Durable extends JavaPlugin { instead of public class Durable extends JavaPlugin {

drifting sonnet
#

Can I dm you?

quiet ice
#

what for?

grim ice
#

it is public

drifting sonnet
vale ember
dusk flicker
#

Just ask it here, more people can help

grim ice
#

public class Durable extends JavaPlugin

sour socket
#

I'm making a bossbar plugin that displays a bossbar with a message, and every 30 seconds, it changes to another message and/or color.

warm light
#

Every world has UID?

quiet ice
sour socket
#

I want the admins to be able to add an infinite amount of messages into the config, and the plugin randomly selects one of the bossbar titles/colors in the config.

#

I don't know how to do this

#

Let me show you my code

dusk flicker
#

Put it in a paste

#

?paste

undone axleBOT
dusk flicker
#

If I had to guess you will want to use a ConfigurationSection, I don't have much experience with the config api but I bet you can find a lot online

sour socket
sour socket
grim ice
#

i invalidated caches just in case its why, ide is reloading wait a sec

sour socket
#

@ivory sleet

grim ice
#

Yep it works now

#

fuck intellij <3

tardy delta
ornate scarab
#

does anyone know how to convert a string to an nbt compound?

tardy delta
#

intellij broken

sour socket
tardy delta
#

then whats not working

#

the bossbar itself is persistent, you only have to adapt the title or the color once in a while

sour socket
tardy delta
#

fileConfiguration.getString(path)

sour socket
#

Hmm

tardy delta
#

ye

grim ice
#

and i want to do something similar to it, do you mind

tardy delta
#

people working with my code kekw

grim ice
#

Lel do you mind though

tardy delta
#

its old af the one youre using

grim ice
#

o

tardy delta
#

oh wait it is my old plugin, i improved it

grim ice
#

ic

ornate scarab
#

does anyone know how to convert a string to an nbt compound?

mortal hare
#

if its SNBT you can use NbtUtils.snbtToStructure() (Mojang Mapped, search for spigot mappings)

grim ice
mortal hare
#

i.e text chat NBT type

grim ice
#

oh nvm

#

figured it out

grim ice
#

the old one or new

#

I figured that its accessing config at run time

#

so if ur talking about that ik

mortal hare
#

if i open Inventory via player#openInventory() does InventoryCloseEvent for existing opened inventory triggers or not?

#

eh ill test it myself

blazing scarab
ornate scarab
mortal hare
#

its NMS class

#

do you use mojang mappings

#

or you use obfuscated spigot mappings

ornate scarab
#

I'm not sure what that is honestly, I'm sorry

#

spigot I assume

grim ice
#

even the new one?

mortal hare
blazing scarab
tardy delta
arctic moth
#

is there a way to store a map in pdc?

ornate scarab
arctic moth
#

or array of locations

ornate scarab
#

im trying to convert a nbt which i saved into a string back into a nbt

blazing scarab
#

Magma cringe

#

on 1.12.2 you have sponge

ornate scarab
#

agreed, I do need the plugin skript to work tho so there's no way around it

blazing scarab
grim ice
#

@tardy delta btw

#

cant u just override the toString function

#

instead of making .get()

quaint mantle
tardy delta
mortal hare
ornate scarab
arctic moth
#

what do pdc tag_container and tag_container_array do

quaint mantle
#

sorry

tardy delta
#

xd

quaint mantle
#

a nested persistent data container

#

@opal juniper

arctic moth
#

lol

#

how would i make that

quaint mantle
#

using TAG_CONTAINER data type

mortal hare
#

Yea Compound tags could be nested

#

and they can be nameless

quaint mantle
#

@quaint mantle

#

??

#

hi

#

hi

arctic moth
ornate scarab
#

@mortal hare do u perhaps know how the JsonToNBT class works?

quaint mantle
# quaint mantle hi

Как можно каждую секунду ставить блоки вокруг игрока?

quaint mantle
quaint mantle
#

Ну это понятно

#

А как именно?

mortal hare
quaint mantle
#

Если я в цикле делаю, у меня сразу 3 блока ставится

tardy delta
#

meh i hate the fact that you cant combine switch cases with brackets and ones without

quaint mantle
#

Мне нужно начиная с 1 блока и ставить вокруг до конца

#

подумай чуть-чуть

#

2й день думаю)

ornate scarab
#

rip

arctic moth
quaint mantle
mortal hare
#

So these are util factory classes

#

for PersistentDataContainers?

arctic moth
#

oh i ssee

#

u just use set for each key in it

quaint mantle
mortal hare
arctic moth
#

and what does tag_container_array do

mortal hare
#

i suggest reading this

#

There is a table

#

containing all the NBT tag types

quaint mantle
leaden mason
#

I ask mod claim Home

wooden fable
#

Is there a way to get the block of a LeavesDecayEvent?

young knoll
#

Does it not have a getBlock

wooden fable
#

nope

quaint mantle
#

How can I smoothly fill the blocks around the coordinate?

#

one sec block

chrome beacon
somber sequoia
#

is there any way to see the full stacktrace? so that in the console it shows the whole stack instead of a part of the stacktrace and ... n more at the end?

young knoll
#

Look in the logs

maiden briar
#
java.lang.IllegalStateException: Infinite loop in property interpolation of §f - §eCurrent maximum health: %(maxHealth)§e.: maxHealth
at org.apache.commons.lang.text.StrSubstitutor.checkCyclicSubstitution(StrSubstitutor.java:701) ~[commons-lang-2.6.jar:2.6]

Anyone knows what this error means?

StrSubstitutor sub = new StrSubstitutor(values.getMessageValues(senderType), "%(", ")", '\\');
String format = sub.replace(senderType == CommandSenderType.CONSOLE ? defaultMessage : formatted.get(senderType));

("&(white) - &(yellow)Current maximum health: %(maxHealth)&(yellow).")

wooden fable
#

I thought it wasn't there haha, thanks.

regal lake
#

Is it possible to change the prices of a villager per user ?
Hero of the village, discounts etc. should work too.

chrome beacon
#

Yes it's possible

regal lake
#

How ?
I tried it.. but i don't event find a method which returns the base price without discount and multiplier.. 😄

tardy delta
#

the villager just wants to scam you

regal lake
#

@tardy delta Thanks for that helpful answer 😅

chrome beacon
#

I belive you use getIngredients

tardy delta
#

np

chrome beacon
potent pecan
#

is there a way to block the entity rotation(and eventually movement) without disabling its ai?

chrome beacon
#

Why not disable the AI?

young knoll
#

setAware(false)

regal lake
#

Let me test it with getIngredients , but the method sounds kinda wrong 😄
I want to change the base price of a item, so if you get a discount you get the discount based on the new base price.
I don't want to show the special price always 😄

potent pecan
chrome beacon
#

ah okay

potent pecan
#

and if i disable the ai that method doesn't work

young knoll
#

Hence

#

setAware(false)

potent pecan
#

ok, thanks

#

what about for legacy versions?

tardy delta
#

lmao you need fucking brackets to make this work

visual tide
#

or

#

colons

#

😐

tardy delta
#

does that still work

visual tide
#

p sure yes

tardy delta
#

i like the fancy way with arrows

grim ice
#

how to change how much an armor piece gets damaged on hit event

quaint mantle
#

return switch(args.length) {
case 0 -> null;
case 1 -> emtpyList()
}

#

Shoukd work

visual tide
#

or that

tardy delta
#

without the return 👀

#

returning a switch whaaat

quaint mantle
#

Returning switch's result

tardy delta
#

what is yield for then?

quaint mantle
#

What

glad iron
tardy delta
#

oh

visual tide
naive bolt
#

[16:32:11 INFO]: [DiscordMembers] Loading DiscordMembers v${project.version}
why doesnt it show the actual version

quaint mantle
#

Do yoy use gradle

naive bolt
#

no

#

maven

lapis widget
# naive bolt no

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>

in the pom.xml

quaint mantle
#

How do you build the plugin

naive bolt
#

DiscordPlaceholder build

naive bolt
#

so my pom is diffrent

tardy delta
#

hehe ide is confused

tiny wolf
#

Ok, I do actually know vectors and stuff, how tf do spigot's vectors work?

#

they are weird

quaint mantle
#

why

lost matrix
tiny wolf
young knoll
#

Are they moving up

tiny wolf
#

yes

#

I am a

fringe basin
#

salve

opal juniper
#

if you are moving upwards i see no reason for it to be negative

worthy sphinx
#

can anyone help me with my server?

young knoll
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tiny wolf
#

that's why I dont understand why it is..

young knoll
#

Well

#

Share some code I guess

tiny wolf
#
(event.getTo().getBlock().getType().equals(Material.WATER)) {
            if (player.getVelocity().getY() > 0) {
                player.getVelocity().setY(0.0);```
eternal oxide
#

are you using setVelocity after?

opal juniper
#

that ^

young knoll
#

You can’t just setY

#

You need to setVelocity

tiny wolf
#

that doesn't matter

opal juniper
#

player.setVelocity(player.getVelocity().setY(0.0))

tiny wolf
#

in this case

eternal oxide
#

You are only affecting the Vector you obtained from getVelocity.

tiny wolf
#

Im saying from the start it will never trigger

opal juniper
#

so if you sysout the velocity u are saying its negative

tiny wolf
#

correct.

#

well Im sending it to the player but same concept

opal juniper
young knoll
#

Assuming they are jumping it should be positive

#

Otherwise it will be negative

eternal oxide
#

he's in water so must be swimming up

tiny wolf
#

no

#

it should still be handled the same

tardy delta
#

does anyone knows how i can prevent a file can be deleted when my plugin is running? a lock maybe

tiny wolf
#

as they are not in swim mode

tardy delta
#

what

tiny wolf
#

odd I think out of water it does go up

#

in positive

young knoll
#

Security managers are deprecated for removal aren’t they

dry pike
#

Has anyone ventured into the AI chatbot territory? I’m looking for some basic Java based tools to play around with and get my feet wet. My goal is to eventually implement this into NPCs on my server?

arctic moth
#

did i do something wrong or is this just intellij being shit

mental zodiac
#

Show the hall Code block

arctic moth
mental zodiac
#

Rewrite the void somethimes that helps

arctic moth
#

nope

#

its just freaking out rn

supple abyss
#

check if api spigot is present

arctic moth
#

yep

supple abyss
#

what's above that code

arctic moth
#

tried reloading maven, didnt help

#

oh i forgor a bracket

#

smh

supple abyss
#

yep

arctic moth
#

but how did it get deleted

#

it was there before

#

now its not

#

lol

midnight shore
#

Sometimes when pasting code, the last character gets removed

arctic moth
#

and i was in a different tab, so idk how it couldve gotten remove

#

and i didnt paste

midnight shore
#

Did the IDE crash?

arctic moth
#

nope

#

i did restart it but that was after it got broken

midnight shore
#

Probably when you created the first curly bracket the ide got bugged and replaced the last one with the one you created

#

Or idk

#

If it happens over and over try to reinstall INTELLIJ and if it still does that change ide

sterile token
#

Sometimes its helps and if doesnt work, File/invalidate cache its another alternative

sacred mountain
#

anyone know why this is happening (not my screenshot, but i have the same result)

#

its just Bukkit.getConsoleSender().sendMessage("asd")

sterile token
#

Paper or Spigot?

sacred mountain
#

spigot

sacred mountain
#

so instead of sending a message to the console i just use the logger

arctic moth
#

sure

sacred mountain
#

why does that happen tho

naive bolt
#
          int X = plugin.getConfig().getInt("box-loaction.x");
          int Y = plugin.getConfig().getInt("box-loaction.y");
          int Z = plugin.getConfig().getInt("box-loaction.z");
          int Yaw = plugin.getConfig().getInt("box-loaction.yaw");
          String world = plugin.getConfig().getString("box-location.world");

how do i turn this into a teleportable location

arctic moth
#

¯_(ツ)_/¯

sterile token
arctic moth
#

same thing

#

i always use log because im a boomer lol

sacred mountain
#

?

arctic moth
#

they do the same thing

naive bolt
#

i want to make an X,Y,Z world and yaw into a Location i can use in player.teleport();

sterile token
sacred mountain
#

oh

#

i have a location to string and string to location util lol

arctic moth
#

lol

sacred mountain
#

its for my config layout

#

i know its not needed

sterile token
#

Spigot support:

getConfig().set("location", location);

sacred mountain
#

huh they have

#

oh

#

:pain:

lime bane
#

Being a brand new programmer to java, is it me, or is tab completion the best thing to ever exist in programming?

sacred mountain
#

||//__

me irl

naive bolt
sacred mountain
#

it auto completes like whole lines

lime bane
#

:0

sterile token
sacred mountain
#

its gotten used to how i code

#

AI tab complete

#

very kewl

lime bane
#

It's like the program is programming itself lmao

#

I'm using Intellij, I love it

sacred mountain
#

get the tabnine plugin i recommend

sterile token
#

Atleast one day its was used more than 16gb

sacred mountain
sterile token
sacred mountain
#

bruhhhh

lime bane
sacred mountain
#

mine is currecntly using

#

1.5 gig

#

of ram

#

how did yours

#

huh

sterile token
#

Compiling moren than 12 modules project with maven

lime bane
#

I was like, "64GB RAM an issue? No way???"

sacred mountain
lime bane
#

Jesus

sacred mountain
lime bane
#

So I'm reading about tabnine, is it really that good???????

sterile token
#

But 63 of what 1mb?

#

AHAH

sacred mountain
#

its legit all util classes

quaint mantle
#

With 8 gb of ram.. Sometimes my system dies completely while compilinf something

solid cargo
#

why doesnt this add anything to the config

sacred mountain
#

i only have like 10 classes that do something

#

but its expanding ;)

sacred mountain
#

with the value in

lime bane
#

Hopefully a Ryzen 9 3950x and a Ryzen 9 5900x should compile stuff pretty fast for me xD

solid cargo
#

it worked minutes ago

sterile token
solid cargo
#

now it just died

sacred mountain
#

idk i dont use the general stuff

#

mines rly simple

#

lol

sterile token
solid cargo
sacred mountain
#

smh

#

idk how to automatically add them all and assign a unique variable

#

im just.

sterile token
lime bane
#

I'm on tabnines website, and they act like developers type super slowly lmao

solid cargo
#

if i dont do toString it colors red

sterile token
sacred mountain
solid cargo
sacred mountain
#

i never type anything

sterile token
sacred mountain
#

u spelt it right

#

the first time

sterile token
#

EclipseShit its should be called

#

that the correct one

sacred mountain
#

yes

#

true

quaint mantle
solid cargo
#

wdym i dont use eclipse

sterile token
sacred mountain
#

i use lombok

#

very sexy

lime bane
#

||I was scared that NordVPN had somehow got in IntelliJ||

young knoll
#

Lol you can't pass a uuid as a string

sacred mountain
quaint mantle
#

Fuck lombok

lime bane
#

xD

sterile token
#

I hate doing getters and setters

#

They took many lines of code

#

And it hurt my eyes as using loops without lambda

quaint mantle
#

Just don't lol

lime bane
#

What java version should I use for developing Minecraft 1.18.x+ plugins?

quaint mantle
#

Encapsulate the state and move the logic into object itself. Dont treat objects like bags of data

lime bane
#

Is 17 okay?

quaint mantle
#

Yes

sterile token
sacred mountain
#

eclipse is like discord light mode

#

pretty much

sterile token
#

Oh please delete it

#

My eyes are burnning

sacred mountain
#

my bad

#

i have my sunglasses on

sterile token
#

I dont have light and the bedroom its all ligthed

sacred mountain
#

😎

sterile token
#

cuz your screenshoot

#

haha

sacred mountain
sterile token
sacred mountain
#

i might make a sun plugin

#

when u look at the sun

#

u die

sterile token
#

Why you jave cooldown message triplicated

sacred mountain
sterile token
#

I have that inssue i dont know how to fix it

sacred mountain
#

uh

#

maybe ur looping it

#

or sum

sterile token
#

Hmn nop

sacred mountain
#

send cod

sterile token
#
public final class Cooldown {

    private final String name;
    private long end;

    public Cooldown(String name, Long time) {
        this.name = name;
        this.end = System.currentTimeMillis() + time;
    }

    public void stop() { this.end = 0; }

    public boolean hasExpired() { return System.currentTimeMillis() >= this.end; }

    public String getName() { return name; }

    public long getRemaining() { return this.end - System.currentTimeMillis(); }
}
lime bane
#

How do you enable colors like that?

sacred mountain
#

also what do u mean

#

triplicated

sacred mountain
#

use java after the ```

arctic moth
#

what happens if you do Material.COMPASS.createBlockData() lol

sterile token
lime bane
#
public final class Cooldown {

    private final String name;
    private long end;

    public Cooldown(String name, Long time) {
        this.name = name;
        this.end = System.currentTimeMillis() + time;
    }

    public void stop() { this.end = 0; }

    public boolean hasExpired() { return System.currentTimeMillis() >= this.end; }

    public String getName() { return name; }

    public long getRemaining() { return this.end - System.currentTimeMillis(); }
}```
sterile token
sacred mountain
#

ye

lime bane
#

I didn't know it worked with java :0

#

I only remembered it support CSS

sacred mountain
lime bane
#

xD

tardy delta
#

Not even <em>

orchid steppe
#

Hey can anybody tell me how i can make a 10 second delay in my script 🙂

arctic moth
sacred mountain
#

.runtasklater

sacred mountain
arctic moth
#

lol

sterile token
orchid steppe
sacred mountain
#

wait

#

scheduler

#

idk

young knoll
#

?scheduling

undone axleBOT
sacred mountain
#

i love this plugin

tardy delta
#

Bukkit.gegScheduler().runTaskKatet

#

Latet

#

Later

#

Grr

orchid steppe
#

i cant code i cant even script 😦

sacred mountain
#

nice spelling lmfao

sacred mountain
orchid steppe
#

kk

sterile token
#

Hey people

sacred mountain
#

hey verano

sterile token
#

With Loombook you can stop doing try-catch with throws methods?

#

Right?

sacred mountain
#

loombook 💀

#

idk i just use Getter and Setter

tardy delta
#

@SneakyThrows ye

sacred mountain
sterile token
sacred mountain
#

u spelt it a slight bit wrong

sterile token
#

Imagine i have lot of headachers caused from doing class instances (getters and setters) without Loombook

sacred mountain
#

yeah i like loombook too

sterile token
#

I was anti-loombook but them i started to get life problems caused i get really stressed with class isntances, so i ended up finding a solution

sacred mountain
tardy delta
sterile token
#

I hate that libraries that do things a way that its ugly for developers. Ugly making refence for example, having 4000 lines of just getters and setters

sacred mountain
#

no more try catch

tardy delta
#

Will Will Smith Smith Will Smith smh this autocorrection

sterile token
tardy delta
#

Ye Smith Liek that

#

Smth

#

Stupid phone

sacred mountain
#

so does that mean every exception that is thrown will be caught

#

and i dont have to catch individual exceptions

tardy delta
#

Nothing is caught

#

It just prevents you from writing "throws Exceptions"

ivory sleet
#

Unpopular opinion but Lombok is useless

tardy delta
#

I don't use Lombok smh

ivory sleet
#

That’s good

tardy delta
#

Kekw

ivory sleet
#

Don’t smh

tardy delta
#

🤝

ivory sleet
#

🙏

sterile token
#

WHAT YOU RECOMMEND SO?

quaint mantle
#

I heard at some point theres risks of using it or smth so I stopped using it too

tardy delta
#

😱

sterile token
#

How you like having 4000 lines of fucked Getters and setters on code and considering it clean LMAO

#

LMAO

tardy delta
#

Wha

sterile token
#

I dont understand people

ivory sleet
#

What

tardy delta
#

I don't understand english

ivory sleet
#

If you hate verbosity so atrociously hard, like if you truly detest the verbosity java comes with, then use sth more succinct

sterile token
#

I get mad

ivory sleet
#

Like there are so many options out there

sterile token
#

I dont understand people some times

tardy delta
#

My phone doesnt understand my typing

sterile token
#

I use java because its the only language for plugins

tardy delta
#

Changing every English word tonanither language

ivory sleet
#

Untrue

sterile token
#

If not i will be writen them in C#

ivory sleet
#

Clojure, Kotlin and Scala also works

#

and any jvm language in principle

tardy delta
#

Clojure sound like conclure lol

ivory sleet
#

Lol

quaint mantle
#

isn't there some where you can write plugins in python or js

sterile token
#

Cuz Kotling and Scala, kooks really ugly like javascripts, they dont giveme good impressions

sacred mountain
tardy delta
#

Js mehh

sacred mountain
#

where

#

i wanna know