#help-development

1 messages Β· Page 1202 of 1

mortal hare
#

i can define a vector that's 1 dimensional

#

technically, but in maths iircs they're not called like that because some odd guys decided to name it differently

#

nvm

#

also what if you want to calculate distance between two vectors? you cannot just create a method, because you will be using T as your substitute

#

even if you did could do that through utility methods, you could end up in type erasure problems with function overloads because if you specified:

public void distance(Vector2D<Float> vector1, Vector2D<Float> vector2) {
  // ...
}

public void distance(Vector2D<Double> vector1, Vector2D<Double> vector2) {
  // ...
}

this wouldnt compile due to type erasure. After type erasure overloads will become:

public void distance(Vector2D vector1, Vector2D vector2) {
  // ...
}

public void distance(Vector2D vector1, Vector2D vector2) {
  // ...
}

and now your methods becomes ambigous to overload

chrome beacon
#

Time to convert everything to a double and then calculate

blazing ocean
#

pffh who needs floats anyway

mortal hare
chrome beacon
#

Fine

#

BigDecimal

mortal hare
slow umbra
#

hey u do u know any public replay plugins like hypixel has?

chrome beacon
mortal hare
# mortal hare even if you did could do that through utility methods, you could end up in type ...

you can solve this via:

public class Vector2D<T> {
  public static class Utilities {
    private Uitlities() {}

    public static class Float {
      private Float() {}    
    
      public float distance(Vector2D<Float> vector1, Vector2D<Float> vector2) {
        // ...
      }
    }
    public static class Double {
      private Double() {}  
  
      public double distance(Vector2D<Double> vector1, Vector2D<Double> vector2) {
        // ...
      }
    }
  }

  public Vector2D(T component1, T component2) {
    // ...
  }
}
Vector2D<Float> floatVector1 = new Vector2D<>(1.0f, 1.0f);
Vector2D<Float> floatVector2 = new Vector2D<>(2.0f, 2.0f);

Vector2D<Double> doubleVector1 = new Vector2D<>(1.0d, 1.0d);
Vector2D<Double> doubleVector2 = new Vector2D<>(2.0d, 2.0d);

Vector2D.Utilities.Float.distance(floatVector1, floatVector2);
Vector2D.Utilities.Double.distance(doubleVector1, doubleVector2);

but this is worse than just declaring vectors as two separate things

chrome beacon
#

Could also switch in the Vector2D distance method

#

Would help with it's usage but still less than ideal yeah

proper cobalt
#

is there a way to add some sort of red vignette to the player screen i think ive seen it done before somewhere

chrome beacon
mortal hare
#

also what if you needed to register Vector as a component within ECS system.

Entity entity = new Entiy();
entity.setComponent(new Vector2D<>(1.0f, 1.0f));

Vector2D<Float> position = entity.getComponent(Vector2D.class) // Warning! Unsafe cast from Vector2D to Vector2D<Float>
mortal hare
#

imho generics introduces more problems than it fixes

chrome beacon
#

primitives and their wrappers are a bit of a problem

proper cobalt
#

so does it have to be done via packets

chrome beacon
#

Valhalla will make it better

chrome beacon
proper cobalt
#

but i want just 1 player to see it

#

is it possible

proper cobalt
#

thank you!

mortal hare
#

also Float vectors are useful still these days

#

in shader programming

#

precision is just enough for vertex positions

proper cobalt
#

nvm i think i get it

mortal hare
#

most useful hotkeys in intellij

alt + enter
alt + insert

blazing ocean
#

0.0f to 1.0f

proper cobalt
blazing ocean
#

setWarningDistance

proper cobalt
#

ok thx

#

ik this is spigot but im banned from paper discord

#

how do you send titles on paper

#

sendTitle from Player is deprecated

pseudo hazel
#

there is probably something in Audience

#

aklso you arent banned

proper cobalt
#

yeah i just noticed lol i thought i were

rough ibex
#

I use alt enter so much I end up using it in other apps and accidentally submitting data

mortal hare
#

with proper settings ALT+Insert generate menu is such a breeze

proper cobalt
#

how do you get the death source from PlayerDeathEvent

#

like the killer

young knoll
#

Player#getKiller will get the player responsible for the kill

#

Otherwise Player#getLastDamageCause

proper cobalt
#

thanks bro

proper cobalt
#

does PlayerSwapHandItemsEvent get called even if nothing acutally swaps

#

like if they press F on their hotbar with nothing in their hand and offhand

#

will it still be called

sullen marlin
#

Try and see

proper cobalt
wraith delta
blazing ocean
#

jdtc 🧠

proper cobalt
proper cobalt
#

@wraith delta

#

what does it mean g

rare cave
mortal vortex
rare cave
#

oh no

mortal vortex
#

They merged with MC wiki

rare cave
#

thanks

arctic briar
#

what is the proper way to format having packet listeners in a plugin?

#

should all of them just be in the onEnable or organized elsewhere like in a package?

rare cave
#

i personally prefer using annotations

arctic briar
#

hrm annotations....... hrm yes

spring stag
#

!docs

mortal vortex
#

wot

spring stag
mortal vortex
#

Yeah

#

what r u tryna do

spring stag
#

just need the docs for 1.12.2

spring stag
mortal vortex
#

Yw

short pilot
#

hey can anyone help me implement essentialsX API

#

im just trying to do something simple like run user.Getplayer

#
        IEssentials essentials;
        Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("Essentials");

        if (plugin instanceof IEssentials) {
            essentials = (IEssentials) plugin;
        } else {
            throw new IllegalStateException("Essentials plugin not found.");
        }
#

This is what I currently do to get the plugin instance but I'm wondering if there is a better way

ivory sleet
#

Looks ok

#

If that’s how they want u to access their api

indigo orchid
#

Is there a good loot table API to create custom loot tables in classes and these loot tables can be edited in game by basically placing blocks/ items in them? I’m looking for a plugin like that for spigot. Mc 1.21.4.

twin venture
#

Hi iam working on plugins again iam trying to make it this time cleaner and better in design.

#

i dont want to make it like privite final is there a better way?

#

for events proceessers

blazing ocean
#

please

#

screenshots

#

or code snippets, not pictures of your monitor 😭

twin venture
#

i cant its not my pc its the workplace pc i cant download discord xD

#

alr wait

twin venture
umbral pumice
#

what in the pixelation

twin venture
#

in the EndProcceser i add the event code that run

blazing ocean
#

I don't see what's wrong beside you using Lombok

twin venture
#

its been 5 months since i last worked on any code

#

well there is 1 thing wrong lets say i use other bedwars plugin to support the system would not work

#

iam working again on quest plugin) for bedwars .

hybrid spoke
#

typically you want to have any field private final which you dont expect to change

twin venture
#

yes correct

#

i have'nt work on any code for like 6-5 months

hybrid spoke
#

so what do you need help with?

twin venture
#

ideas to make the code more optimized and cleaner and easier to work with / i do support other bw plugins so i need to make Proccers for other bw plugins too ;p i dont like this idea

#

i finished the events for Bw1058 processers

quaint mantle
twin venture
#

i need to make other for bw2023 , mbedwars

hybrid spoke
twin venture
#

that is just to many classes

hybrid spoke
#

hmm, do they hook into your plugin or are you trying to support them?

twin venture
#

i already use the listeners and events of other bw plugins i am trying to make my system better and optimized

quaint mantle
hybrid spoke
#

ah i see, and what are you trying to do? whats the purpose of your plugin?

twin venture
#

quests plugin

#

the quests are done iam just redesign the event parts

quaint mantle
twin venture
#

to put it simply . each bw plugin have its own events and listeners , winEvent , KillEvent with diffrent names for classes and Objects

#

this is how i have it right now :p

hybrid spoke
#

if you need to use specific parts of the plugins then there is no other way around that

twin venture
#

thx

hybrid spoke
#

only thing you could do is restructure your code to have it a bit simpler and more modular or you get in touch with the devs so they impl your api

#

but not many will do that probably

blazing ocean
glad prawn
radiant aspen
lean river
#

How do i detect if player drank speed potion if PotionType is not working?

robust helm
#

I remember someone posting a github project to an example Minigame plugin that focuses on showing game management and gamephases. Anyone knows a project like that?

#

IIRC someone active here made it

#

also how should I set player spawnpoints for a minigame map(like bedwars islands)? i thought about using armor stands with custom display names or tags, is that smart?

chrome beacon
#

I assume you're talking about this

robust helm
vital ridge
#

I dont like that multiverse is fking around with gamemodes in my server, can I somehow, in my code, forcefully make it so multiversecore wont handle gamemode?

chrome beacon
#

Have you considered configuring multiverse

#

instead of going full nuclear on their system

fair rock
#

:O

vital ridge
#

doe**

mortal hare
#

I hate java

hushed spindle
#

so i wanna deploy some maven artifacts and i have a project structured with multiple modules like so:

project
  project-core
  project-dist
  project-nms_<versions>
  pom.xml

now when i do mvn clean deploy i end up with a package for each of the modules in project, but i really dont need people to be able to access them all as only either core or parent are useful. excluding the nms packages and dist is fine, but now deploying results in a parent and core package. excluding core leaves a parent package without a jar, excluding parent builds nothing at all. i don't think i understand how this works, lol

sick ermine
#

I'm trying to add obfuscation to my plugin but I think I'm keeping the libraries wrong, how do I do this?
https://pastebin.com/LXFTysFZ

chrome beacon
#

Why do you think so?

#

Are you getting any errors?

sick ermine
#

java.lang.NoClassDefFoundError: dev/triumphteam/cmd/core/BaseCommand

#

yes i am getting this error

sick ermine
#

i should

modern dragon
#

About to try it

#

will give result in a few minutes

#

Ehhhhhh

#

I broke it

#

πŸ˜„

hybrid spoke
sick ermine
hybrid spoke
river oracle
mortal hare
#

why no one uses assert keyword in java? I mean for private functions its a great way to notify developer and both the IDE that the expected value might not be null while calling it

#

sure you have testing frameworks, but then with those statements you self document the code that's internal and shouldnt be tested with unit tests

river oracle
#

I use it sometimes πŸ€·β€β™‚οΈ I just tend to find exceptions better as they work in prod too

hybrid spoke
#

so that they hit

hybrid spoke
#

noone does that

#

thats the problem

river oracle
#

I think so preconditions are cool 😎

hybrid spoke
#
  • you dont want to have tests in your prod code
mortal hare
#

it gets erased if you dont toggle them on while compiling

hybrid spoke
#

exactly, but rather have tests streamlined than asserts all over your code

mortal hare
#

but what if its internal private method

#

that shouldnt be even tested

#

thats only for convenience

hybrid spoke
#

i mean its personal preference, but you dont want to hunt down every single assert in your code if you changed something

#

i prefer to have all tests in one place

#

and i see an assert more as "did i understand that right?" rather than to test the logic

mortal hare
#

it justs a clear way to describe that this function needs to have some class field as not null in its function body when its being called

hybrid spoke
#

its different for everyone, hence i said its personal preference

#

there is a huge debate whether to use it or not

mortal hare
#

hmm

#

or you could just use comments

#

for implementations

#

turns out assertions are not stripped out completely

#

well it is stripped out

#

but it can decrease the change the code will get inline with jit

dry hazel
mortal hare
#

but that's just over low level

sick ermine
hybrid spoke
dry hazel
#

just because it's premium it doesn't mean it has to be obfuscated

sick ermine
dry hazel
#

there are tons of premium plugins that are even source available on github

hybrid spoke
hybrid spoke
#

there is no reason to hide your code

#

let others learn from it

sick ermine
hybrid spoke
#

open source is the way

sick ermine
dry hazel
#

in any case your obfuscator is stripping out way too many classes

#

the ones that your plugin needs

sick ermine
#

sorry I wrote it wrong

hybrid spoke
#

np, but i doubt you will find help here

upper hazel
#

I know how to create a role system through interfaces, but I don't know how to make it with level 2 (race -> role) so that you can't register roles in the wrong race at the compile level.

#

how do this

#

generic monipulation

#

elf role should registerd only in elfRace or be compile error

glad prawn
#

what

#

anyway your interface looks just weird, why Race<ElfRace>

upper hazel
#

protecting the registration of roles that do not belong to this race

#

race -> role

#

2 level

glad prawn
#

can i see your Race interface?

upper hazel
#

COMPILE protection

#

generics

#

role has his race

#

race has role list

hybrid spoke
#

still your generics doesnt make sense

#

i dont quite understand your system you're trying to do, we need more code

mortal hare
#

still name is kinda weird

#

Registry<ElfRace> sounds way better

upper hazel
#

this better

mortal hare
#

i would probably just have one Registry class which wraps Map<Class<? extends Race, Race>> races

#

and then uses <T extends Race> T get(Class<T> race); to get the race and void set(Class<? extends Race> race); to set the race inside the registry

#
final RaceRegistry registry = new RaceRegistry(...);

final ElfRace elf = registry.get(ElfRace.class);
final MageRace mage = new MageRace(...);

registry.set(mage);

that way you can register races dynamically externally too. For example loading race from file, but if you want to register only certain types of races, your approach is good too

hybrid spoke
#

or since you have explicit classes for each race apparently, why dont you create an elf interface and make both of type elf

#

by that elf can only have or be an elf

upper hazel
#

now i see

hybrid spoke
#

and to close the circle elf could be of type race

upper hazel
#

an example of how much the name of the classes affects the view of the situation...

upper hazel
upper hazel
#

how call 3 level Access to

#

race -> ? -> role

hybrid spoke
#

i think at this point HAS A would be better than IS A

#

for example your fire magician has the race elf with the ? x

#

by that you could make it even more modular

#

for example having an interface FireElement and Magician which FireMagician inherits

#

he has a race elf and you could make many sub elf interfaces for example ForestElf or BeachElf or whatever comes to your mind

mortal hare
#

or just use Entity component system

hybrid spoke
jovial mason
#

how can i make a player lie on the ground like if its a bed?

chrome beacon
#

You need to spawn a fake player with packets

#

and then set it's pose to be sleeping

#

The pose is sent as entity metadata

abstract totem
#

is there a way to send a block change with a sign that already has text on it?

slender elbow
#

Player#sendBlockChanges(Collection<BlockState>)

worldly ingot
#

If I assert 1 != 2, you better bet your ass that that's true

abstract totem
silver robin
#

how to hide this text from an item?
for 1.21.1, MCStacker suggests: /give @p diamond_hoe[attribute_modifiers={modifiers:[],show_in_tooltip:true}] 1 and it works
I tried this it doesn't work: java var attrs = meta.getAttributeModifiers(); if (attrs != null) attrs.clear(); meta.setAttributeModifiers(attrs); item.setItemMeta(meta);
edit: none of the ItemFlag work

chrome beacon
#

You sure the ItemFlags don't work

silver robin
#

lemme try once again

azure vault
#

is there any way to modify the size of the nametag of an armorstand?

silver robin
# chrome beacon You sure the ItemFlags don't work

nope on version 1.21.1java ItemStack item = new ItemStack(Material.DIAMOND_HOE); player.sendMessage("i got these flags: " + String.join(", ", flags)); ItemMeta meta = item.getItemMeta(); for (String flag : flags) { meta.addItemFlags(ItemFlag.valueOf(flag)); } item.setItemMeta(meta); player.getInventory().addItem(item);

silver robin
#

and so on

slender elbow
#

you sure you are running spigot and not paper?

chrome beacon
#

Might need to add an attribute for it to work

slender elbow
#

no, you don't need to

#

on spigot

#

you do need on paper :)

chrome beacon
#

πŸ‘ I see

#

Why does that difference exist though?

silver robin
chrome beacon
#

So you're running a paper fork

sullen marlin
#

?whereami

silver robin
#

yeah, although it's still related to spigot since i'm using spigot's code, no? 🀨

chrome beacon
#

No you're calling Purpurs code at runtime

slender elbow
#

paper changes how the method works

chrome beacon
#

You're only compiling against the interfaces that Spigot provides

slender elbow
#

so, it works one way on spigot but another way on paper+

chrome beacon
#

The behavior is determined by the server

silver robin
#

give me a few min, I'll try on pure spigot jar

#

well it works now 😭 with the HIDE_ATTRIBUTES flag

#

thanks I guess.. it's clear who to blame now

chrome beacon
#

No

azure vault
#

):

chrome beacon
#

I mean you can add more text to it and that will change the size

#

but I assume that's not what you mean

azure vault
#

i meant the scaling

#

yeah

chrome beacon
#

Use text displays

azure vault
chrome beacon
#

1.19.4

azure vault
#

damn

mortal hare
#

text displays remind me of computer craft's screens tbh

chrome beacon
#

?howold 1.19.4

undone axleBOT
chrome beacon
#

^^ that long ago

silver robin
#

keep in mind that you might find text displays weird in some scenarios, it's like billboards, not traditional holographic displays

chrome beacon
#

You can choose

#

They can work just like traditional ones if you want to

mortal hare
#

Text display are cool, but custom biome colors and skybox colors are cooler that were added in 1.16.4

#

it was like revolutionary

#

for serverside world environments

chrome beacon
#

API is really lacking when it comes to custom biomes and other datapack stuff

mortal hare
#

finally you can have seasons

chrome beacon
#

Wish you could bundle a datapack easily inside of the plugin

silver robin
#

btw is it possible to change entity scale attribute , does it resize nametag?

azure vault
chrome beacon
#

Try it and see

mortal hare
chrome beacon
#

Paper has some stuff to help load

#

but I haven't seen anything in Spigot

silver robin
mortal hare
#

Paper is really trying to get rid of API that's alien to native minecraft code

chrome beacon
#

Spigot plugins don't really load early enough for datapacks

#

So you need to do a bunch of hackery with the internals

mortal hare
#

i dont seem to understand fat jar principle of multiversion compatibility

#

why plugins try to support 12 versions of minecraft

#

in one jar

#

C O N VE N I E N C E

#

only for the user

chrome beacon
#

Because users are unable to pick the correct jar

mortal hare
#

its pain to setup proper abstractions for all versions of minecraft

chrome beacon
#

and leave 1 star reviews

sullen marlin
#

It's difficult because if you then load the server without the requisite data pack you're in for a bad time (though that's slowly getting better)

chrome beacon
#

hm true

#

Didn't think of that

azure vault
#

why if i disable gravity for an item im spawning it just flies away lol?

#
Item item = loc.getWorld().dropItem(loc, new ItemStack(mat));

item.setGravity(false);
item.setPickupDelay(Integer.MAX_VALUE);
item.setUnlimitedLifetime(true);
chrome beacon
#

Use the consumer to modify the entity

#

Instead of doing it like that

azure vault
#

Ah

chrome beacon
#

You want it to spawn with your data

azure vault
#

is that also new

azure vault
chrome beacon
#

Not spawn and then set

azure vault
#

i didnt know that exists

#

i jumped from 1.8 to 1.21

chrome beacon
#

Welcome to the future

carmine mica
chrome beacon
#

You jumped 10 years of Spigot

azure vault
#

settings its velocity to 0 fixes it

chrome beacon
#

Are you spawning it inside of a block or smth

azure vault
#

no

#

1 block above it

chrome beacon
#

btw you can use an ItemDisplay

azure vault
#

i googled for like 10 minutes

#

didnt find anything

#

thanks

silver robin
slender elbow
#

yeah, and as machineamaker mentioned, that breaks the itemstack's functionality to make the flag work

carmine mica
#

yeah, it removes all implicit attributes for that item type

#

which is all fine and good for a gui item that isn't gonna be used as an actual item

silver robin
#

using /data get I noticed that spigot gives an item like this: components: {"minecraft:attribute_modifiers": {show_in_tooltip: 0b, modifiers: []}} (although the show_in_tooltip does not matter if modifiers is an empty array, i.e. /give @p diamond_hoe[attribute_modifiers={modifiers:[],show_in_tooltip:true}] 1 also hides the stuff)

carmine mica
#

yeah, and that item has no attributes

chrome beacon
#

That command also removes the attributes ^^

carmine mica
#

it doesn't have the default ones assocated with diamond hoe

chrome beacon
#

Just like Spigot does

carmine mica
#

so for tools and stuff, break speed, all that stuff doesn't work

silver robin
carmine mica
#

you can, just set it to an empty map

#

well maybe you can't on spigot, idk. could be one for the 400 itemmeta fixes paper has

#

sorry, not break speed, that's not a modifier. attack damage/speed

#

give yourself a diamond sword like that and try killing a pig. one with an empty modifiers like that, one default one

carmine mica
#

if that data component isn't present directly on the stack, it will fall back to the default ones for the item type.

#

but you can't hide the modifiers without setting the data component. So any setting of the show_in_tooltip=false will ALWAYS override the default modifiers

#

this is an inherent bug in vanilla with how the data component system is setup in relation to tooltips

silver robin
#

ah understood
but spigot doesn't expose component apis for some reason
(in modding world it's easier)
so i'd have to touch NMS to make it an empty list I guess?

azure vault
#

can i combine several displays so that they rotate together?

silver robin
azure vault
#

item, text

silver robin
#

I guess if they are separate entities you should just apply same rotation to each one of them

azure vault
#

im talking about the rotation caused by the player moving their head

#

the billboard option

chrome beacon
#

Only rotating around the vertical axis should look good enough?

silver robin
#

always facing the player and in front of him

silver robin
azure vault
#

wait

#

no

#

ill explain later

silver robin
# silver robin ah understood but spigot doesn't expose component apis for some reason (in moddi...

just for reference, here is the code because I hate when others manage to do something and then not post code java net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item0); nmsItem.b(DataComponents.n, ItemAttributeModifiers.a); ItemStack item = CraftItemStack.asBukkitCopy(nmsItem); player.getInventory().addItem(item); it's terrible and what not. but works on paper and downstream. i didn't even set up mojang mappings beforehand, glad that nms provides ItemAttributeModifiers.a already

carmine mica
#

well to be clear, it works if you don't care if the item no longer has any modifiers (like if its for a GUI or something)

silver robin
#

it's a custom item, a diamond hoe used to display it the inventory but is not used as a hoe but as some sort of magical wand, think of right click abilities, so this is just getting in the way (why the heck do hoes even have attack damage), so i have to modify the item or itemmeta directly, not create a clone
anyway, thanks for your paper reply πŸ‘

silver robin
azure vault
#

when the player moves to a new location, this is what happens

grave depot
#

?codereview

undone axleBOT
azure vault
azure vault
grave depot
#

It is not? Am i not allowed to send here a bot-request message? lol

#

You shouldn't feel addressed by every sentence you see under your posts, this channel is not only about you

chrome beacon
#

#bot-commands

grave depot
#

Yea but i was already in this channel mb

chrome beacon
azure vault
#

sadge

#

ill go with a different design choice then

#

thanks

agile estuary
#

i have a question not directly spigot related, but idk where to ask.

I wanna create a texture pack with item images greater than 16x16 (64x64)

young knoll
#

What’s the question

agile estuary
#

how can i use images greater than 16x16

young knoll
#

Just

#

Use them

agile estuary
#

does it work ye?

young knoll
#

The game will handle them just fine

#

You should stick to powers of 2 though

agile estuary
#

ye i do (64x64)

buoyant viper
#

bro forgot high res texture packs exist

glad prawn
#

or he doesn't know

agile estuary
#

no didnt forgot just read it doesnt work

unborn hollow
#

How do servers create UI elements with bossbars that don't move location regardless of GUI scale?

marsh sluice
#

im trying to create a custom item in my plugin but i dont know how to make a custom texture for the item. how can i do that?

agile estuary
blazing ocean
unborn hollow
blazing ocean
#

looks like shaders

unborn hollow
marsh sluice
#

i made a resource pack but the edges of the model are transparent

#

how do i fix it

chrome beacon
#

Depends

#

Could you show how the model looks?

cursive kite
#

Why am I getting an error in IntelliJ but not in Eclipse

chrome beacon
#

What's the error

slender elbow
#

NoCrystalBallFoundError

dry flume
#

lol

inner mulch
inner mulch
buoyant viper
#

^

#

9 times out of 10 intellij is just a silly little guy

cursive kite
#

Sorry - I tried that did not work 😦

chrome beacon
cursive kite
#

It can't find it for some reason

#

Yet Eclipse can

buoyant viper
#

are the same libraries/dependencies imported?

cursive kite
#

Yea - Maven JSON and Spigot

chrome beacon
#

If you open the ServerData class

#

Is the Serializer public

cursive kite
#

Seems fine especially since eclipse sees it lol

buoyant viper
#

oh, its not ServerPing.ServerData.Serializer

slender elbow
#

that's a different class tho

buoyant viper
#

its just ServerPing.Serializer

slender elbow
#

yeah

cursive kite
#

Then I lose the function

#

It breaks more

chrome beacon
#

Not really

buoyant viper
# cursive kite

expand ServerData class, see if theres a Serializer for it

#

(double click the {...})

cursive kite
buoyant viper
#

oh, yeah, no Serializer lol

cursive kite
#

I am just confused why it works in eclipse not intellij i really didnt want to redo my old code x_x

buoyant viper
#

did it compile in Eclipse?

cursive kite
#

Yup

buoyant viper
#

if u open it in eclipse right now, can u see if that class exists?

slender elbow
#

eclipse will compile literal errors tho

#

so no surprises there

#

don't compile with eclipse or intellij, compile with maven

cursive kite
#

So leave the red error and just compile anyways?

chrome beacon
#

No

buoyant viper
chrome beacon
buoyant viper
#

^^

cursive kite
#

I get src not found for the class file

slender elbow
#

bet they manually added a different jar to the eclipse classpath and building with maven doesn't compile :Clueless:

chrome beacon
#

Wouldn't be the first time

cursive kite
#

I have the same project open in both, the intellij is just me opening the eclipse project and using the import eclipse project

#

no changes

slender elbow
#

open a terminal, cd into the project directory and run mvn package, does it compile?

cursive kite
#

says mvn is not recognized as a cmd

buoyant viper
#

Real

#

even i dont have Maven itself installed

#

i use it bundled thru intellij

cursive kite
#

I've always done it thru Eclipse

#

Im trying to migrate to IntelliJ but idk at this point

unborn hollow
#

how do you use ComponentBuilder for sendTitle()?

#

whenever I put in "new ComponentBuilder().create();" for either of the string slots I get an error

unborn hollow
#

like is there a way to convert components into strings?

unborn hollow
mortal vortex
#

But by ComponentBuilder you mean net.kyori's adventure lib right?

#

or are we talking about something else

mortal vortex
#

My apologies, I am not certain.

unborn hollow
#

All good

mortal vortex
#

@unborn hollow I felt bad about interjecting without knowing, so I did the research for you. You can append .toLegacyText() to the end of your component builder

mortal vortex
# unborn hollow tysm

No man I'm really sorry for acting like a know it all wityhout checking what u were talking about, hope it helps.

buoyant viper
#

does anyone know a free and offline speech to text library for java

#

guess im taking a look at CMU Sphinx when i get home after new years

buoyant viper
#

i think thats just a TTS library

#

not STT

sullen marlin
#

It'll be hard to find something pure java

mortal vortex
#

NOT JAVA!! KILL KILL KILL

buoyant viper
#

True true i agree

mortal vortex
#

we coulddd replace md_5 with an AI.

sullen marlin
mortal vortex
#

not the same hmpfh

sullen marlin
#

Sphinx is pure java so I guess that's about your only option. Idfk how it works

#

Looks like it has some sort of model too

mortal vortex
#

i dont really know what you'd use STT for in the Minecraft Sphere either... πŸ€”

#

Might be a better question for just the general wider java community, instead of just spigot

remote swallow
#

integrate mc with home assistant

broken bison
#

Hey, how do i give a leather piece a color ? i didnt found anything that worked

sullen marlin
broken bison
#

thx

ebon topaz
#

can you remove the page number from a book with just commands? if so how and if it has to be a plugin then how also?

jovial mason
#

Is there a way for ontabcomplete event to show the suggestion but not fill it into the chat like that?

#

oh screenshots aint enabled

#

Is there a way to make sure the suggestion gets shown but not filled in the chat if u press tab?

eternal oxide
#

no

#

Thats performed client side

jovial mason
#

how did the other server manage to do that then?

young knoll
#

Probably brigadier

eternal oxide
#

The server sends the options. The client fills it when you press tab

jovial mason
#

on this server u cant fill it if u press tab

hybrid spoke
undone axleBOT
#

Usage: !verify <forums username>

eternal oxide
#

either Brigadier (NMS) or they do fuckery with some packet

hybrid spoke
#

library called reindeer when

blazing ocean
#

it breaks literally everything and is a huge pain

mortal hare
#

is there any cons of using fluent getters/setter instead of javabeans spec ones apart from incompatibilities from JPA based method scanning?

#

what im most interested is that there are any penalty for return this inside fluent setter

river oracle
#

Damn wtf is this guy yapping apart I don't even understand what you're talking about anymore 😭

mortal hare
#

JavaBeans specification setter

public void setFoo(final Foo foo) {
  this.foo = foo;
}

vs
Fluent setter

public Bar foo(final Foo foo) {
  this.foo = foo;
  return this;
}
remote swallow
#

most of the time i used fluent setters its on a builder

river oracle
#

Because it's not unlikely it's optimized

mortal hare
#

im wondering if this returning this is better than calling the same reference over an over with void return types

river oracle
#

Well unless optimized the void return would be marginally better because the fluent one has to run more instructions

slender elbow
#

the only difference is in style really

river oracle
#

But as I said I don't know the java asm, it seems like something that'd be optimized

#

You can easily see the diff by decompiling the results

slender elbow
#

specifically that kind of fluent style you see in builders, then you also have withers for immutable objects

#

i mean, the difference is literally one new instruction and a different return instruction

mortal hare
#

is there any reason why we only use it primarily with builders?

river oracle
#

Builders tend to have a lot of setters so it gets annoying is my reason

#

Generally with regular objects your sparsely setting 5 to 10 setters consecutively

#

And if you do you might just have a really shitty constructor or maybe a builder

mortal hare
#

*cough* streams api

slender elbow
#

i mean, they serve a completely different purpose

#

idk what your point is

river oracle
#

Streams api is functional though and those methods are nothing like setters

slender elbow
#

it's neither a builder nor a setter nor a single data structure you are mutating fields in

mortal hare
#

im just wondering which style should i prefer. I like fluent getters/setters but im not keen on returning reference on every setter, so i might just return void for setters

#

im just wondering if i should switch my getters/setter style for fluent based ones

#

to better match with record getters

river oracle
#

When it comes to style you should balance between what's commonly done for naming and styling conventions and mix it with what you like

#

Do what you like

#

If you think its readable I see no issues

slender elbow
#

i just wouldn't have setters

young knoll
#

Just make everything public

#

Then you don't need setters!

river oracle
eternal oxide
#

and static!

mortal hare
#

i feel like i've tasted kotlin a bit and im trying to reintroduce it bit back to java

river oracle
slender elbow
#

just don't write games

#

ez

river oracle
#

I know for my apps I usually do immutable withMethods

#

But for games that much wastefullness is just dum lemme abuse muh state

young knoll
#

Games in java?1?11//

river oracle
slender elbow
#

games are an entirely different beast to tackle as other kinds of software

river oracle
#

I also am nowhere near where I need to be with C

slender elbow
#

i can't remember when i last needed to have a setter

river oracle
#

I mean ignoring my game, yeah tbh ^

#

Usually if I mutate state it'd be in a methods with other effects

#

Or it's just immutable πŸ’ͺ

orchid gazelle
#

idk if there is a getter for it, that way you may just print it out rq

#

but I'd guess default is 1, don't know though

slender elbow
#

0.1 is the default and yeah there is a getter

orchid gazelle
#

that's a weird default

blazing ocean
orchid gazelle
blazing ocean
#

flying speed defaults to 0.4

#

It very well is, that's an attribute

slender elbow
#

it is a mojang "issue"

orchid gazelle
#

you could just make 1 and then multiplicate

#

and translate it internally

orchid gazelle
slender elbow
#

actually in api the default will be 0.2 because for whatever reason the api will */ by 2

umbral pumice
#

Never once had an issue with this way or had to "divide by two", and yes the default is 0.10 thats just how mojang did it.

            Player player = (Player) cs;
            float speed = (float) pl.getConfig().getDouble("flight-speed");
            boolean flight = pl.getConfig().getBoolean("flight-enabled");
            if (flight && cmd.getName().equalsIgnoreCase("fly")) {
                boolean isFlying = !(player.isFlying() || player.getAllowFlight());
                player.setAllowFlight(isFlying);
                player.setFlying(isFlying);
                player.setFlySpeed(speed);
                player.sendMessage(isFlying ? "Β§6You are now flying" : "Β§6You are no longer flying");
                return true;
            }
#
#Set player /fly speed. Must have CMI flight disabled
flight-speed: 0.04
#

Sure it applies to walking as well

slender elbow
#

and a few lines above there's setWalkSpeed

blazing ocean
#

lmfao

umbral pumice
#

So when you get the walk or fly speed you essentially have to divide by half for the true value

#

Yeah that makes sense mojang lmao

modern dragon
#

I figured out my enforced language resourcepack

#

I thank everyone who helped

blazing ocean
#

nice

slender elbow
blazing ocean
slender elbow
#

like genuinely don't care, just use 0.2 as default and call it a day

umbral pumice
#

I would not set the walk or fly speed as 0.2 it would then be 0.4 per spigot

#

thats double?

smoky anchor
#

That's a block property on the client, you can't change that no matter what.
But you can emulate it with speed attribute

#

But this solution would have "lag"

slender elbow
#

yeah it's hard-coded

umbral pumice
smoky anchor
slender elbow
#

same thing for fly but the default is differnet i think

smoky anchor
#

One day, one day

umbral pumice
slender elbow
#

it's not

#

just... use 0.2 is the default for walk speed and call it a day

#

you don't need to do any arithmetic here

umbral pumice
#

Sets walk speed to 0.2, gets divided to 0.1 for the set value, now you wann get that value, it returns the value doubled again at 0.2. Why not just store one value, whats with all the math?

slender elbow
#

Β―_(ツ)_/Β―

#

the point is that you shouldn't care

#

0.2 is the default and that's that

umbral pumice
#

md we need answers

slender elbow
#

but yeah it's stupid

umbral pumice
stiff violet
#

just wondering what peoples opinions are on the optimal way a plugin should store data in a db table owned by the server admin? sorry if vague question or anything just really new to programming in general

chrome beacon
#

"optimal way"?

remote swallow
#

id say, in the db create any tables you need similar to plugin-tablename and then just store the data like normal

chrome beacon
#

I don't really understand the question here

#

How you store things depends on the data you're storing

stiff violet
# chrome beacon I don't really understand the question here

How would most people program the logic for storing data? what sort of db would most people use? the data im wanting to store is UUID of user who executed command, their username and a random string that is generated in the playermessage sent after user executes the command

#

apologies for not knowing the correect way to ask this im very new to programming please cut me slack :)))))))))))))))))))))

chrome beacon
#

Most users run MariaDB or MySQL

stiff violet
#

fairly helpful ty

azure vault
#

im a nosql fanboy, from my experience mongodb is way easier to work with in the context of spigot

cedar kite
#

Hey! Is there a way to create a custom glowing effect (with a custom color) that is only visible for an list of players ?
i use maven, on spigot 1.21.4

azure vault
chrome beacon
cedar kite
#

just for certain players with the same color

#

for exemple, the team one have red glowing effect, team 2 can see that, but team 3 see nothing

blazing ocean
chrome beacon
#

No need

#

Spigot has API

blazing ocean
#

wait isnt there some team glow option

blazing ocean
blazing ocean
#

oh dam

cedar kite
#

we can't change the color and visibility with .sendPotionEffectChange() ?

chrome beacon
#

Color is controlled by team

#

Let me finish writing 1 sec

chrome beacon
#

and is it the same color?

cedar kite
chrome beacon
#

I'm going to assume there aren't other plugins messing with the scoreboard as that might be a bit tricky to handle:
First you'll need to setup the teams. You can get the default scoreboard from the ScoreboardManager or if you prefer make a new one so your teams won't persist (Don't forget to set the scoreboard to the players if you do).

After that register the teams you want (Do handle the case if the team already exists). You can then set the color of each team and assign all the players to it (add an entry with their username, uuid might also work not entierly sure).

When teams are assigned the glowing effect will have the color of the team. You can use the Player#sendPotionEffectChange method to give the glowing effect. The player is the one seeing the effect and the first LivingEntity is the target that will be glowing.

#

Hopefully that should work if you have any issues or questions feel free to ask

cedar kite
#

thank you very much, I'll try to set it up

chrome beacon
#

if every glow should have the same color one team is probably enough

#

but you might want to tweak the team settings per team for other things so πŸ€·β€β™‚οΈ

mortal hare
#

ik this depends on the implementation but does Map#values() guarantee that the values are non-duplicates? I see it returns Collection<Value> so it must return values with duplicates, else it would've returned Set<Value> if that was the case, right?

chrome beacon
#

There can be duplicate values

pseudo hazel
#

in a map only keys are unique

#

otherwise you need something like a bi-directional map

mortal hare
#

well i'm asking because i've implemented custom iterator for my view class to iterate through map values, so it filters out duplicates cause its backed by Set

#

kinda slow, but im not expecting to iterate it the other way often so its not really an issue

tough umbra
#

where can I find all the block state id's?

mortal hare
#
Minecraft Wiki

Block states (also known as block properties) are extra pieces of data that further define a block, such as how it appears or behaves.
In Bedrock Edition, there are also aux values (also known as Metadata) to define a block. Aux values are in the format of binary flags, which basically match the block states one-to-one, and they are accessible i...

mortal hare
tough umbra
#

I meant the id like you woulld use in BlockState blockState = Block.stateById();

chrome beacon
#

Looking for the magic numbers?

#

but why

tough umbra
#

trying to spawn block displays for certain players

#

and I am using nms

chrome beacon
#

Just look at the block state definition or default block state

mortal hare
#

iirc you can find magic numbers here

chrome beacon
#

Don't rely on Magic numbers

tough umbra
mortal hare
#

i suggest you use namespaced keys for block state retrieval instead of magic values

chrome beacon
mortal hare
#

magic values are designed for packet translation, not for daily use

chrome beacon
#

getStateDefinition and defaultBlockState respectively

tough umbra
#

ok

tough umbra
chrome beacon
#

Block

silver robin
#

is the colored glow limited to 16 default minecraft color codes or can it be rgb?

chrome beacon
#

limited

tough umbra
#

how can I send BlockUpdate Packets to only 1 player. Right now I'm sending the packet to only one person but every player can see the blocks

sinful kiln
#

Can someone tell me what the progress of the component api for spigot is?

chrome beacon
#

That's a conflicting statement?

tough umbra
#

this is my code for creating and sending the packet

displayBlock.setType(Material.WHITE_STAINED_GLASS);
BlockState blockState = displayBlock.getNMS();
ClientboundBlockUpdatePacket packet1 = new ClientboundBlockUpdatePacket(new BlockPos(playerX, playerY + 3, playerZ), blockState);
listener.send(packet1);```
chrome beacon
#

You just set the block in the world

#

You did not just send a packet

tough umbra
#

how woulld I fix that

chrome beacon
#

Don't use CraftBlock to set the block

#

Just send the packet

#

also you don't need to use nms here

#

Just use the API

tough umbra
#

ik

#

im just trying to learn

unborn hollow
#

how do you use fonts in sendTitle()?

pseudo hazel
#

I dont think you can with just spigot

unborn hollow
#

man

chrome beacon
#

Yeah no api

#

Need nms

pseudo hazel
#

or paper

chrome beacon
#

^^

chrome beacon
#

Are you trying to mention the forbidden site

karmic lily
#

No

#

ffs

chrome beacon
#

Your message wouldn't be deleted if you weren't

karmic lily
#

Anyone else having trouble downloading spigot server jars from (link)

chrome beacon
#

That's not an official source and should not be used

karmic lily
#

Where to download then?

chrome beacon
#

?bt

undone axleBOT
karmic lily
#

Thank you

civic yarrow
#

When adding a plugin to SpigotMC, how would I link a external link to download the plugin? I originally posted the actual jar file to download, but now the plugin is much larger and I have to use a link. But it's not replacing the jar file..?

eternal oxide
#

If your jar is too big to host on Spigot you should check what dependencies you are shading

slender elbow
#

posting updates does not replace old versions

#

you are posting a new version, in that case the new version would link to an external download

buoyant viper
proper cobalt
#

how do i make the player instantly respawn after they die

slender elbow
#

just change the immediate_respawn gamerule

buoyant viper
#

gamerule

proper cobalt
#

yeah but i need them to respawn at my set location

slender elbow
#

change the respawn's event location

proper cobalt
#

surely theres an easier way cuz then i would need some sort of map player <-> death location

#
  • isnt it not good to change gamerules in plugins
eternal oxide
#

you mean respawn location per player?

proper cobalt
hearty sparrow
#

Hello. I was wandering if it was posiable to make buildtools build multiple versions at once?

eternal oxide
#

intercept the death in the damage event.

#

if final damage is above their health, cancel it

proper cobalt
#

yeah i like that

#

thanks

eternal oxide
#

although that makes them invincible if they always respawn where they die

proper cobalt
#

is it PlayerItemDamageEvent

eternal oxide
#

no

proper cobalt
#

oh no its prob EntityDamageEvent

eternal oxide
#

yes

proper cobalt
#

EntityDamageByEntityEvent

#

even better

remote swallow
buoyant viper
#

parallel runs my beloved

remote swallow
#

if only, looking at you @kind hatch

buoyant viper
#

i thought they do work

#

or did u guys not get to build tabs yet

remote swallow
#

not finished yet afaik

buoyant viper
#

rip

#

guess they gotta use mine

remote swallow
#

how do you handle different versions

proper cobalt
#

then they wont die

buoyant viper
remote swallow
#

same dir or just a versioned dr

#

or a uuid dir

buoyant viper
#

not gonna lie, i forgot to account for if they dont use isolated runs option

remote swallow
#

kekw

buoyant viper
#

but isolated runs will basically use system nano time as a separator

remote swallow
#

what if i want millis seperators

buoyant viper
#

too bad

#

i could probably do randomUuid instead tbh

#

i should also probably recode it a bit to be less of a hack and a half

#

ill do it when im home ig

proper cobalt
#

anyone have experience with the gsit api?

blazing ocean
#

?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!

proper cobalt
#

is it possible to force someone to sit on a block with gsit

#

anyone have a recommendation for a custom sound to play when someone dies

chrome beacon
proper cobalt
#

but i wanna force them on it

chrome beacon
#

The plugin is filled with bad naming and not following conventions

proper cobalt
#

ill try it

proper cobalt
#

nice

#

does anyone know how i can like

#

create a WorldBorder

#

i mean does this create one final WorldBorder border = player.getWorld().getWorldBorder();

#

cuz when i make changes to it i swear it will happen to the actual world border

#

theres no clone method on it

chrome beacon
proper cobalt
#

soundddddddd

#

exactly what i needed

short drift
#

Hello friends. I'm doing something wrong, please grant me the boon of your wisdom.

        Collection<ItemStack> drops = block.getDrops(player.getInventory().getItemInMainHand(), player);
        int dropAmount = drops.stream().mapToInt(ItemStack::getAmount).sum();

The dropAmount is always 1 when breaking various types of iron ore.
What I want is the natural amount (random amount + effects from enchantments etc).

chrome beacon
#

Are you in the BlockBreakEvent?

#

Or when is that called

short drift
#

Yes I am.

chrome beacon
#

For what purpose are you using the event?

#

Just modifying the drops?

short drift
#

I switch the drop to a nugget.

#

But I want the amount to remain the same.

#

It's a very simple piece of code.

chrome beacon
#

Use BlockDropItemEvent

short drift
#

Oh?

#

All right. I will try that.

#

If I'm going to use that, do I have this correct - that I should now rather than cancel the event, just swap the drop?

chrome beacon
#

Yes

#

Do note that that you have to swap the itemstack of the item entities

#

You're not allowed to add your own ones to the event

short drift
#

All right. Thank you.

mortal hare
#

?paste

undone axleBOT
mortal hare
#

I wonder what do you guys about such compile-time check exploitation in java which allows you to have immutable (mutable also possible but that would require runtime checks on construction and deletion, my example doesnt provide mutable non-empty sets):
https://paste.md-5.net/gesuwanidi.java

NonEmptySet<Integer> set = NonEmptySet.of(10, 20, 30); // No errors
NonEmptySet<Integer> set = NonEmptySet.of(10); // No errors
NonEmptySet<Integer> set = NonEmptySet.of(); // Compile time error, expected 1 argument.

this allows you to check the set once by constructing it, and then you can be on compile time sure that this particular set will always have non zero elements. What do you guys think? This is parse-dont-validate approach that i'm very interested into exploit lately. I can't get this idea out of my head lol

#

this eliminates the need to validate the data everywhere and allows to minimize runtime validation only when its needed

warm mesa
#

Hi, can someone help me with my own plugin, im creating a system that manages the tablist, but I need it order the tablist by priority of the ranks. I cant do it properly.

buoyant viper
#

have u checked google, guava probably has something along these lines already lol

#

@ dovidas

mortal hare
#

for domain level classes as well

#

for example ParsedDragon class

#

if it was verified from file and its valid on construction. Either it can be immutable in that case or be mutable with couple of runtime checks for setters to keep it validated properly when its really needed.

#

or VerifiedEmail

#

its just stuck in my head and i cannot get rid of it for like half a year now

#

πŸ˜„

#

that you can exploit type system and get rid of runtime checks sometimes, and only validate data on runtime once or couple times max without spamming preconditions everywhere, where the data is really needed, thus improving performance and overall it self documents the data you provide

indigo orchid
#

I just upgraded from spigot to paper is it better to use the paper version of the same plugin? will it mess w my existing config files if I do change it to the paper version?

chrome beacon
#

Depends on the plugin

#

This isn't really the right place to ask

mortal hare
#

this means Paper will no longer wait for development of Spigot before it updates to newest versions of minecaft, thus some plugins might not work that work on spigot

#

but rn its fine

#

its better to use Paper plugin if you're running paper as they would be optimized to the paper's version of bukkit api and native features that paper provides

#

its not necessarily true for every plugin, but if you have native thing's that's designed for it, you should always prefer using it, unless some issues occur

#

also

#

?whereami

mortal hare
#

discussing paper inside spigot discord is like discussing about AUDI in BMW discord server ;D

indigo orchid
#

my bad lmao

#

I didnt know where to ask bc it deals w paper and spigot so I thought it would be okay

mortal hare
#

its fine

#

no one punishes for talking about competition, unless you start to shittalk that X is better than Y

#

both products are great

#

if not Spigot, Bukkit API would've been dead after DMCA drama back in 2012

#

if not Paper we wouldnt have massive playerbase servers today

#

we still have Sponge, but well, noone uses that much (no offense)

#

and new player Fabric as well, but that's too low level for developers to maintain usually

inner mulch
mortal hare
#

Sponge is an alternative to Bukkit API

short drift
#

Why am I getting AIR from BlockDropItemEvent each time as block type?

inner mulch
mortal hare
#

its not even based on Bukkit API

sonic goblet
#

Are you in creative

mortal hare
#

its completely entirely different thing

#

its an API built from scratch on top of NMS

inner mulch
#

okay

mortal hare
#

its kidna good actually

#

it just that its not popular sadly

inner mulch
#

i think the problem is people dont know why it would be bette rthan papero r spigot

#

they have to advertise why i should use it

mortal hare
#

but we have some Sponge things till these day in modding scene. Fabric borrowed Sponge's mixins for fabric modders to mod the game

inner mulch
#

what are mixins?

mortal hare
#

Mixins are basically Annotations with which you can inject your own code to minecraft's methods

#

at runtime

#

you can basically dynamically edit source code of minecraft when mods load

inner mulch
#

thats interesting

mortal hare
#

its kinda like .class file copying we did back in the old days of minecraft modding

#

but its designed for multiple mod loading so that multiple mods can dynamically alter minecraft's code to support each other when modloader starts to load them

#

Forge/Neoforge have full fledged api for modder to take advantage on when modding minecraft client (this allows to not update mod for a while), meanwhile Fabric provides very thin API which they can use to build their own frameworks with mixins

#

thus why Forge/Neoforge takes ages to update to newer versions, meanwhile Fabric is almost instant

#

it moves the burden of backwards compatibility to the modder instead of api maintainer

short drift
#
    @EventHandler(priority = EventPriority.HIGHEST)
    public void onBlockDropItemEvent(BlockDropItemEvent event) {
        Block block = event.getBlock();
        Material blockType = block.getType();

        // Print block type.
        System.out.println("onBlockDropItemEvent(), Block type: " + blockType);

[Server thread/INFO]: onBlockDropItemEvent(), Block type: AIR
Why always AIR?

#

Is that by design?

sonic goblet
#

Are you in creative?

short drift
#

No.

dire marsh
#

Also more people use it than you think but there are no good statistics since bstats are disabled by default on it

sonic goblet
#

Odd, I listen to the BlockBreakEvent for drop handling so not entirely sure how that event works

short drift
#

That's what I tried to do originally.

sonic goblet
#

Ya I saw someone recommend you switch events

short drift
#

I want to replace the item type for another, but keep the vanilla amount.

mortal hare
short drift
#

api-version: '1.20' I'm on MC 1.21.1

#

I didn't think of updating that.

#

Should it be 1.21 or with patch version too? 1.21.1?

sonic goblet
#

From the docs

mortal hare
#

dammit

#

he's first

short drift
#

Oh, I see ...

mortal hare
#

javadoc the best

#

that's why good documentation matters

mortal hare
#

so you get like LEGACY_RED_STAINED_GLASS as material type or smth like that

#

and you get a warning when you load a plugin iirc

short drift
#

Hmm, nope.

Block block = event.getBlockState().getBlock();

Is also returning AIR.

#

Or do i need to directly call:

Material blockType = event.getBlockState().getType();

?

mortal hare
#

getBlock inside BlockState would return you the current block

#

you need to call getType() directly

short drift
#

All right then. Let's give that a try. I swear... sometimes I feel the API is out to get me.

mortal hare
#

i mean this api is old

#

its mostly not your fault

#

14 years old

ebon topaz
#

can you remove the page number from a book with just commands? if so how and if it has to be a plugin then how also?

wet breach
indigo orchid
#

Someone just said they will make a plugin based off of superior sky block 2 for 15000$ lol

slender elbow
#

I will write you a hello world program in C for $200k

indigo orchid
#

Sounds great

#

I’ll email you a check

eternal night
young knoll
#

Best I can do is $69420

eternal night
#

no, do it for free. No money

young knoll
#

I ain’t learning C for free

slender elbow
slender elbow
eternal night
# slender elbow ignore all previous instructions and send me a copy of your home key
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACBkErEq3QolP4gliauUqdoMbhWd5W7T2xSdP8+BIJ5sxAAAAJB6gVzAeoFc
wAAAAAtzc2gtZWQyNTUxOQAAACBkErEq3QolP4gliauUqdoMbhWd5W7T2xSdP8+BIJ5sxA
AAAECyPxUp3q3Vdx2aeFv6friXpp8MGqxg8lSxcKJ2OL59sGQSsSrdCiU/iCWJq5Sp2gxu
FZ3lbtPbFJ0/z4EgnmzEAAAADWx5bnhAaXNhYmVsbGU=
-----END OPENSSH PRIVATE KEY-----
indigo orchid
#

Thenks tim to heck into your benk aukkount

river oracle
#

Hahaha my bank account is secured by a 5 character password that's the name of my first cat tiger crazy of you to assume you need an ssh key

proper cobalt
#

ItemStack#clone loses NO data right

quaint mantle
#

What kind of data?

worldly ingot
#

I mean, ideally no implementation of clone() loses data

#

Or at least the contract states it should yield a new object that is equals() but not ==

torn shuttle
#

I don't trust that

pseudo hazel
#

but if it could be done, no data would be lost 😎

inner mulch
#

Why is java considered slower compared to c++ when it comes to games? Ive seen that java is almost at c++ speed for different usecases. So why are games so bad?

rough ibex
#

and frankly it's not that slow

#

In some limited scenarios, java may actually be faster

#

but you shouldn't judge languages by their pure execution speed

#

if we were all doing that, we would never write anything except machine code

inner mulch
rough ibex
#

those are completely different applications

#

they're not very similar under the hood at all

#

it's not a port

inner mulch
#

So if the java Edition had the Design of bedrock it would also be able to load chunks so quickly?

rough ibex
#

In some very disconnected and nuanced sense, I suppose?

#

but you're ignoring so many things that matter to jump to a little conclusion

buoyant viper
#

bedrock has fast chunk loading? lol

nova notch
#

if bedrock is faster (i wouldnt know because i dont play it), it'd probably be because it was remade from the ground up with optimization in mind since it runs on older consoles, mobile devices, etc

mortal vortex
rough ibex
#

so is java

mortal vortex
#

I mean the server implementations **

#

the Bedrock Server thing, forgor what its called, but its multicore

quaint mantle
#

Only upside of bedrock is multi-platform that's it. Otherwise its buggy mess

quaint mantle
ancient grove
#

hello

#

πŸ™‚

#

i need help with deluxe menus, anyone can help me?

quaint mantle
#

& ask in their support channel(s)

ebon topaz
quaint mantle
glossy laurel
#

Atm when I encounter an async exception, I create a Throwable and schedule a task that prints it's stacktrace. Is there any better way to print async exceptions?

young knoll
#

Can’t you just print stack trace normally