#help-development

1 messages ยท Page 2227 of 1

eternal oxide
#

yeah I'm wrong

#

damn that zero

#

Math was better without it

lost matrix
#

XD

quartz basalt
#

if i wanted to make a plugin that supports 1.12 -> 1.19 but i want each version to be able to use their materials and not just the api version ones would i need to use nms for that

glossy venture
#

i was thinking, dont you have to convert to radians first?

#

or is java math degrees

summer scroll
quartz basalt
#

if i made the plugin for 1.18 and a player uses the plugin on 1.19 because it needs to support multiple versions but the player wants to use a skulk sensor for example

#

it can be 1.13+ then just an example

glossy venture
#

oh

summer scroll
#

Set the api-version to 1.13 and you're fine.

quartz basalt
#

and thatd support 1.19 blocks as well?

summer scroll
#

But If you don't handle the error yourself, If 1.13 trying to use 1.19 material, it will throw an exception.

#

Yes it should be as long as you're using the 1.19 (latest) api

quartz basalt
#

alright thanks

summer scroll
#

But it might break If there are materials that change names between 1.13 and 1.19

ocean lion
#

How would I take a item given from command and when placed and walked over do //code

quartz basalt
#

is there a place or smthn to compare to see if there are any

ocean lion
#

has to be that specific item from the command

summer scroll
summer scroll
ocean lion
#

I'm making Launch pads. But i dont want to check if the player walks over a pressureplate and if that happens make him jump. I want /launchpad gives the player a pressureplate called launchpad and when placed and walked over jump

summer scroll
#

Alternatively you can listen to PlayerInteractEvent if the block is always pressure plate.

lethal roost
#

did i screw something up here? the code doesn't work when i use a diamond

eternal oxide
#

do you have an item in BOTH hands?

lethal roost
#

yeah

eternal oxide
#

You should also use matchMaterial not valueOf

lethal roost
#

it works fine when i manually specify the material in the past, the code itself works fine, it's just that whenever i try to have it take in a value from a config file, it doesn't work the way it does in the past

lethal roost
rough drift
#

I am adding commands to the commandMap, can I also add tab completion to them?

lethal roost
#

still doesn't seem to work

tardy delta
#

My eyes

lethal roost
#

sorry

#

wait i found the issue, nvrm

iron glade
#

top 10 saddest anime deaths

quaint mantle
# lethal roost aight thx

note that match material is used for minecraft:sth while valueOf is used for enum
they are different

willow stream
#

'

quaint mantle
quaint mantle
# rough drift ?

you can?
cuz literally even if you do it in reflection its still setting inside the map like getCommand()

vocal cloud
lethal roost
vapid junco
#

and you get it for free

quaint mantle
#

just ida pro and reverse engineer that

rough drift
#

not a PluginCommand

#

it has no tab completer

vocal cloud
#

Or just yknow buy it hagrid

vapid junco
#

too expensive

quaint mantle
proper notch
#

worth it imo

vocal cloud
#

Way better than Adobe's pricing Kek

proper notch
#

u do also get a perpetual license to the latest version at the time of your license's expiry.

vocal cloud
#

Plus it gets cheaper every year

vapid junco
#

for me it's not since spigot development is the only java coding i do and i don't do it much

ocean lion
#

who buys adobe

#

?XD

proper notch
#

Yh if I was still just doing Spigot development I wouldn't, but I use the integrated profilers a lot as well as Spring and all the other jazz.

quaint mantle
#

java is stupid im using notepad++ for that
(confused java fans noice)

iron glade
quaint mantle
vocal cloud
#

I use a wide variety of products. PHPStorm, Intellij, DataGrip, Pycharm

ocean lion
vapid junco
river oracle
#

vsc works well for python

vocal cloud
river oracle
#

nothings worse than js

quaint mantle
#

i use a wide variety of products.
MSWords, MSPaint, notepad, notepad++

glossy venture
#

php actually pretty nice

ocean lion
#

MSPAINT

#

KEK

vocal cloud
glossy venture
quaint mantle
#

nah ms paint for the win
layers is for noob

#

I love more primitive tools
more creativity

vapid junco
#

though i've started doing more ts

vocal cloud
#

Who needs transparency

#

TS was created cause people hate JS lol

ivory sleet
quaint mantle
#

everyone hates js

vocal cloud
#

worlds smallest violin

vapid junco
#

does anyone know go here?

ivory sleet
#

Little bit

#

Well GoLang

vapid junco
#

i've been thinking about learning it for like backend api stuff

quaint mantle
#

I know csgo

vocal cloud
#

Spring Boot uwu

vapid junco
#

which i normally use nodejs for

vapid junco
quaint mantle
#

yoooooo

opal juniper
quaint mantle
#

champion

vocal cloud
ivory sleet
#

Vlang, rust or elixir would be goto backend languages

opal juniper
#

that is not worth

#

the added features over the community editions do not warrant that

vocal cloud
#

I mean assuming you're not using it professionally sure

quaint mantle
opal juniper
#

not quite

quaint mantle
#

yesn't

vapid junco
vocal cloud
#

The database integration, profiler, etc are very much worth

quaint mantle
#

ida pro worths much more

opal juniper
proper notch
#

I don't think I could go without IJ Ultimate tbh.

#

IIRC the spring support without it is horrible

vocal cloud
#

Plus I'm supporting a company that provides an amazing licensing system and product

quaint mantle
#

Not supporting a company which ruined minecraft

#

hehe

vapid junco
#

i love microsoft

#

and bill gates

quaint mantle
#

i saw that :)

#

pride gates

vapid junco
#

he hooked cmu up with a new cs building

#

it's very nice

quaint mantle
#

nicee but ruining minecraft is a much bigger sin than good

hushed spindle
#

microsoft should stick at what they're good at

vapid junco
#

you got a point

hushed spindle
#

software solutions not games

quaint mantle
#

yeah exactly

vocal cloud
#

If you think Jetbrains is expensive peek at Windows Server DataCenter MSRP kek

sage dragon
vapid junco
hushed spindle
sage dragon
vapid junco
sage dragon
vapid junco
#

hm

#

there are infinite planets they should be free

vocal cloud
#

Maybe, but not all planets are created equal

eternal oxide
sage dragon
#

๐Ÿคฃ

quaint mantle
#

if you think thats expensive, try buying toilet paper!!

vocal cloud
#

Try gas

eternal oxide
#

cheaper to drive it on scotch

vapid junco
#

nah try buying gas

#

oh someone already said that

limber mica
#

how can I make my jar support Java 17 and below?

waxen plinth
#

Use the lowest java version you want to support

#

If you want to support 8-17, compile for java 8

#

If you want to support 17+, compile for java 17

limber mica
#

oh ok

royal spruce
#

hello there is something in the bungeecord and a son who is the sonoyuncu client cannot login

royal spruce
#

ha okey sorry

hushed spindle
#

?

#

interact events dont trigger when there is a block behind an entity

#

or basically when an entity is too far to be attacked, but a block is close enough to be targeted

#

@lost matrix sorry for the ping but this was what i was talking about, quite wacky

summer scroll
smoky oak
#

ya actually hitting the mob? F3B

summer scroll
#

If you want to detect when player left click an entity, use EntityDamageEvent

hushed spindle
#

no im literally just demonstrating that an interact event is not triggering when it should

#

im not actually trying to attack an entity here but im showing that if you are within that specific range interact events dont trigger

hushed spindle
solid cargo
#

is there a way i can disable tabbing, when writing a command?

hushed spindle
#

wdym? like you dont want tab suggestions?

solid cargo
#

yes.

hushed spindle
#

make a command implement TabExecutor instead of CommandExecutor, and return an empty list

#

if you return null it'll default to player names

solid cargo
#

ah

#

like always

#

?

#

i want them to like

#

disable command /version <tab>

vital trout
#

Someone knows the enum value in Material for floating Water (even with update) ?

hushed spindle
#

i dont know about that one pillow

summer scroll
hushed spindle
#

no difference, same thing

#

doesnt trigger

smoky oak
vital trout
#

Is there a way to prevent the water to flow ? I want to make a floating sphere of water

harsh matrix
#

Is there any way to pass an argument to a Runnable?

river oracle
smoky oak
#

im not entirely sure tho

vital trout
#

Mmh

smoky oak
#

how do i get the plugin specific logger?

river oracle
#

or you can just make your own logger

smoky oak
#

eh

#

i was asking cuz of the prefix

#

but if it's plugin i probably should use the bukkit logger anyways

sullen canyon
#

How can i increase players kb when he was rod hitted?

#

Like hooked

#

I couldnt find right event for this

hushed spindle
#

the GENERIC_ATTACK_KNOCKBACK attribute unfortunately doesn't work for players, so you either have to apply the knockback enchantment or apply velocity to the target manually if you don't want to do this

eager knoll
#

I have a custom ore-mining system which cancels the event and sets the block to bedrock, then gives an item to the player. But, i found that efficiency on the pickaxe causes the block to not do any of that and instead cancel the event and only running the code after mining it twice while holding constantly. Any help?

smoky oak
#

plz use switch

sullen canyon
hushed spindle
#

oh you mean fishing rod

#

PlayerFishEvent should do it

sullen canyon
#

Alright, thank you

hushed spindle
#

and specifically on the CAUGHT_ENTITY state, if you're reeling in

silver pulsar
#

Hi.
I'm trying to store a list of locations and I've used a File to store the data between server restarts. but im having some trouble retrieving and storing the list to a variable. I know that im retrieving the List correctly but when im trying to make it to the variable it breaks.

What ive tried:
public static List<org.bukkit.Location> DrillLocations = new ArrayList<>(); DrillLocations.addAll(FileHandeler.getFile().getList("Cords"));
And:
public static List<org.bukkit.Location> DrillLocations = FileHandeler.getFile().getList("Cords");

vale cradle
#

Does somebody know where to find the Spigot Obfuscation Mapper?

summer scroll
silver pulsar
summer scroll
silver pulsar
#

since the locations are in a list i think you have to save it in another way

loud mauve
#

i want sent pic ?

#

can i ?

tall dragon
#

you need to verify your account to do that

loud junco
#

So - i'm chaning a lot of blocks using NMS, because the basic bukkit methods aren't fast enough, but i ran into an issue - the block changes are not being sent to the client. How can i achieve that? The blocks only update if i right click them. ๐Ÿ˜„

summer scroll
tall dragon
#

what ru using to change the blocks

loud mauve
#

i dont have acc

loud junco
# tall dragon what ru using to change the blocks

public static void setBlockInNativeChunk(World world, int x, int y, int z, int blockId, byte data) { net.minecraft.server.v1_8_R3.World nmsWorld = ((CraftWorld) world).getHandle(); net.minecraft.server.v1_8_R3.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4); BlockPosition bp = new BlockPosition(x, y, z); IBlockData ibd = net.minecraft.server.v1_8_R3.Block.getByCombinedId(blockId + (data << 12)); nmsChunk.a(bp, ibd); }
Yes, i know, 1.8 .. ๐Ÿ˜„ But i don't think that matters in this case

silver pulsar
pliant oyster
#

Send it to both the server and clients

loud junco
#

It seems like it's not sent to the client, the problem is i'm unsure how to send it to them. ๐Ÿ˜„

pliant oyster
summer scroll
loud junco
pliant oyster
#

I don't know I forgot

pliant oyster
loud junco
#

No ๐Ÿ˜„

pliant oyster
#

That's the clientbound block change packet

loud junco
#

Stumbled upon MultiBlockChange

#

seems like a good option

tardy delta
#

People like instantiating bukkitrunables lol

halcyon mica
#

Question, how can I render a block in world even smaller than by putting it on the head of a small armor stand?

quaint mantle
halcyon mica
#

Because as it is right now, it is still a tad too big

halcyon mica
#

Rotation is not acceptable

eager knoll
quaint mantle
#

that's what java does to a man

tall dragon
quaint mantle
#

ever heard of switch or enums, is there a match keyword in java I'm not sure
there's many alternatives to just a bunch of else if statements

halcyon mica
#

There is no way to render a block smaller?

pliant oyster
quaint mantle
#

and Java has enums aswell I'm sure of that

tardy delta
#

Ferris in the status

eager knoll
quaint mantle
#

just need to find a way to make use of the keywords, that's why they exist

tall dragon
#

if you put it in the hand of an armorstand

#

it might be smaller

#

than on the head

quaint mantle
#

and a bunch of else if's hardly provide either of those points

#

hate how people just said switch is more efficient than if
they have literally the same performance, or worse

tall dragon
quaint mantle
#

nah i meant some people out there

#

just saying

#

oh, yeah that's right

#

good point, you should prioritize using if else but in this case rownox I would just be using a switch statement

tall dragon
quaint mantle
#

the readability is roughly the same tho
you ccan always open a new scope and add a comment above it ๐Ÿ˜

tall dragon
#

its just readability

quaint mantle
#

there's also ternary operators and as far as I know they're optimized by the compiler anyway soo. Like to have the same ops as if ... else ...

quaint mantle
halcyon mica
#

Moving it back a bit seems to work

#

But I still need to adjust for rotation then

quaint mantle
#

in some cases like enum switch is much better
but in some cases it takes much more time to type

#

java isn't all that fast either so I don't see a point in having to use if ... else unless we're going for record times

#

if you use switch make sure to add braces in the cases
switch without braces is utterly confusing for me

quaint mantle
tender shard
tall dragon
#

and switch can be usefull if you have alot of cases resulting in the same outcome

tender shard
#

also switch is a funny word

tall dragon
#

we should switch it to something else eh.

#

how about superniceelaboratefancyif(){}

tender shard
#

i like the word switch

tall dragon
#

wonder why it was called that

tender shard
#

probably the dude who invented it was into bdsm

tall dragon
#

its not rlly "switching" is it

tender shard
#

switch means you're switching roles

tall dragon
tender shard
#

as if i'm the only one who knows that smh

tall dragon
#

uhh i mean

#

that was not the first thing that comes to mind when i think about switch

tender shard
#

its probably called switch in java because of these things

pliant oyster
#

fr

#

??

#

just stating...

#

mind ur own buisness

tall dragon
#

yea! leave the man alone!

tender shard
#

what's your problem lol

pliant oyster
#

Lmao nah

tender shard
#

better don't look at my profile then

tall dragon
#

slutty twink eh?

#

respectable

eternal oxide
# silver pulsar do you mean `Cords: - ==: org.bukkit.Location world: world x: 1.0 y: 119....

Savingjava final List<Location> save = new ArrayList<>(); Bukkit.getWorlds().forEach(world -> save.add(world.getSpawnLocation()) ); getConfig().set("test.locations", save);
Loading```java
List<Location> load = new ArrayList<>();
load = getConfig().getObject("test.locations", load.getClass());

load.forEach(loc -> Bukkit.getLogger().info(loc.toString()));```Its an unchecked cast, but it works to load a List<Location>.

#

you wouldn;t need to create a List first, just pass teh class

tall dragon
#

not if you use proper serialization ๐Ÿ™‚

eternal oxide
#

its quite odd that the config has no getLocationList when it has getLocation and getList for all the other types of get

smoky oak
#

i hate serialization

tall dragon
#

why

smoky oak
#

i dont understand it

#

ergo

#

it never works

eternal oxide
#

It took me a while to get my head around it

smoky oak
#

what I've started doing is this:
Make a note what object it is
Shove into toBase64
then use that note and string to restore it

#

which is admittedly a terrible solution

#

but the only i managed to get consistently working

tall dragon
#

?paste

undone axleBOT
eternal oxide
#

Well that will work. It will take up a lot more space, but it works.

tall dragon
#

i do it like this

#

SerializedMap can parse the data to both yaml and json

smoky oak
#

and other way too?

tired atlas
smoky oak
#

i use yaml in my stuff

#

wait what happens if you add another entry to the map

#

does it still restore it using default values for the new fields when loading?

tall dragon
#

wdym

eternal oxide
#

you mean you alter the fields in your Class

#

depends on the deserializer how it will handle it

#

most won;t

smoky oak
tall dragon
#

it will set the added field to a default value

smoky oak
#

huh

eternal oxide
#

perhaps

smoky oak
#

i kind of expected it to throw NPE

eternal oxide
#

json yes as it uses reflection to read the fields

#

yaml, I'm not so sure

smoky oak
#

probs the same

#

i mean

#

you turn it from json and yaml into a map

#

then deserialize that map

#

so both would be missing that entry

tall dragon
#

in my deserialize method i can provide default values for each object im deserializing

#

the thing ive shown does not use that just yet

smoky oak
#

ah

#

so that example does err out because map.get returns null for new fields and old objects?

tall dragon
#

right now it will yea

smoky oak
#

so ur doing like this?

int tmp = map.getInteger("StorageLimit");
result.storageLimit = tmp==null ? 0 : tmp;
harsh totem
#

I have this: block.isPreferredTool(item). the item is a diamond pickaxe and the block is stone.
why does it return false?

tall dragon
smoky oak
#

ah

tall dragon
#

100 being default in this case

smoky oak
#

right

#

forgot map has default parameters lol ๐Ÿ˜…

rotund pond
#

Hello, how could I get the amount of Item crafted in ItemCraftEvent please ? (with shift click)
I tried event.getInventory().getResult().getAmount() but it gives me 1 everytime

tender shard
#

also an int cannot be null

smoky oak
#

0 vs null mf

#

im fairly sure only boolean cant

tender shard
#

int asd = map.get("nonexistent)"

#

will throw an NPE

smoky oak
#

no it'll throw a syntax error

eternal oxide
#

lol

tall dragon
#

i use a custom implementation of LinkedHashMap for my class

#

which does use #getOrDefault behind the scenes

hexed hatch
#

and rotate the arm in a way that makes it display nicely

harsh matrix
#

I just made the player inventory close using a Runnable because the Javadocs said so and my server crashed :/

summer scroll
#

show code

harsh matrix
#
public static void closeInventory(@NotNull Player p) {
        BukkitScheduler scheduler = Main.plugin.getServer().getScheduler();
        scheduler.runTask(Main.plugin, new CloseInventoryRunnable(p));
    }

    private static class CloseInventoryRunnable implements Runnable {
        final Player p;
        CloseInventoryRunnable(Player p) { this.p = p; }

        @Override
        public void run() {
            Utils.closeInventory(p);
        }
    }

grim oak
#

Im writing the dependencies in my plugin and put PAPI as a softdepend, so when im writing my code will I always have to put PAPI stuff in a try block?

chrome beacon
#

^^ optional but will make your code cleaner

smoky oak
harsh matrix
tardy delta
#

? scheduling

grim oak
tardy delta
#

Smh

#

?scheduling

undone axleBOT
smoky oak
#

even if its only one line

chrome beacon
summer scroll
#

yeah show that

harsh matrix
chrome beacon
#

So you made an infinite loop

summer scroll
#

Loop task

chrome beacon
#

No wonder it's crashing

harsh matrix
#

oh wait I am stupid

smoky oak
#

i mean you can kick someone

#

that close the inventory

tall dragon
#

invert the checks?

#

ah

desert tinsel
#

I am stupid actually

tender shard
#

it's spelt stoopit

zenith gate
#
SmithingRecipe(org.bukkit.NamespacedKey, org.bukkit.inventory.ItemStack, org.bukkit.inventory.RecipeChoice, org.bukkit.inventory.RecipeChoice)' in 'org.bukkit.inventory.SmithingRecipe' cannot be applied to '(org.bukkit.NamespacedKey, org.bukkit.inventory.ItemStack)'
        SmithingRecipe LeatherBootsRare = new SmithingRecipe(new NamespacedKey(getPlugin(), "LeatherBootsRareRecipe"), new ItemStack((LeatherBootsUtilsRare.createLeatherBootsRare())));

What is this problem? it says it cannot be applied but what does that mean?

covert karma
#

is there an easy way to make skeleton shoot faster?

#

also ghast and blaze maybe?

chrome beacon
#

You can call launchProjectile on them to force them to shoot

covert karma
zenith gate
worldly ice
#

you're missing 2 recipe choices

desert tinsel
#
public void reloadFiles() {
        warpsC = YamlConfiguration.loadConfiguration(warps);
        settingsC = YamlConfiguration.loadConfiguration(settings);
    }``` why it doesn't work, I do not get any error, but it does not work (my messages is same)
zenith gate
worldly ice
#

did your register your recipe?

zenith gate
#

shit nope.

#

Not that it matter still didn't work..

grim oak
#

if i have the following text in my config where the user can enter as many 'rewards' as they like how would I loop over the rewards. would for (Object reward : plugin.getConfig().getList("command-rewards")) work?

command-rewards:
  reward-1:
    players: 1
    commands:
      - "/say helloworld"
      - "/say this is a command"
      - "/msg %player% 1"
  reward-2:
    players: 1
    commands:
      - "/say helloworld"
      - "/say this is a command"
      - "/msg %player% 2"
tender shard
zenith gate
#
public static void LeatherBootsRareRecipe(){
        SmithingRecipe LeatherBootsRare = new SmithingRecipe(new NamespacedKey(getPlugin(), "LeatherBootsRARE"),
                new ItemStack(LeatherBootsUtilsRare.createLeatherBootsRare()),
                new RecipeChoice.ExactChoice(LeatherBootsUtilsCommon.createLeatherBoots()),
                new RecipeChoice.ExactChoice(CompactSugarUtils.createCompactSugar()));
        Bukkit.addRecipe(LeatherBootsRare);


    }

That's the recipe..

tender shard
worldly ice
tender shard
zenith gate
#

mhm....

worldly ice
tender shard
#

yep

worldly ice
#

mb

tender shard
#

so uppercase is no problem

#

in inventoryclickevent, print out the items you used as recipe ingredients, and also the ones you've added into the slots

#

and check if they are equal

green prism
#

Good evening! I am making a plug-in of agencies where I have entered the permissions to hire/fire the employees of a certain agency. To get a list of all the players who have permission to do a certain thing, would you advise me to do a getOfflinePlayers() and check the permission with vault? I accept any kind of advice. Thank you!

waxen plinth
#

Why should you ever need to enumerate all players that have a specific permission?

#

That sounds like a really bad idea

#

It's not how permissions are meant to be used

green prism
tall dragon
#

sounds like it might be better to store these permissions on your own object

#

for example an AgencyPlayer

green prism
#

what do you think about that?

tall dragon
#

store their company as an id as well?

woeful flicker
#

What is the correct way to change a spawners type?
Here i have this code, but it doesn't change the spawner type.

@EventHandler
    public void blockPlace(BlockPlaceEvent e) {
        Player p = e.getPlayer();

        if (e.getItemInHand().getItemMeta().getPersistentDataContainer().has(main.spawnerkey)) {
            CreatureSpawner spawner = (CreatureSpawner) e.getBlock().getState();
            switch (e.getItemInHand().getItemMeta().getPersistentDataContainer().get(main.spawnerkey, PersistentDataType.STRING)) {
                case "sheep":
                    spawner.setSpawnedType(EntityType.SHEEP);
                    spawner.update();
                    break;
            }

        }

    }```
green prism
#

(MySQL) I made two tables "Agencies" and "Employees" with in one the information about the agency with an ID of recognition and in the other the employees in the form of UUID with reference to the id of their company. What if I add a "Permissions" column or something like that? And use that instead of perms for ordinary people? In your opinion? @tall dragon

tall dragon
#

i would create an enum with all possible perms

#

and store the ordinal of their perms as list

green prism
tall dragon
#

yes

#

the permissions all representing an enum entry

green prism
tall dragon
#

๐Ÿ‘

formal bear
#

Linux?

ornate patio
#

how do you get the items inside a brewing stand with NMS

golden turret
#

which packet is sent when the player mounts an entity?

ornate patio
#

mob.level.getBlockState(blockPos).is(Blocks.BREWING_STAND); i have this to check if its a brewing stand, not sure how to access the items in it though

golden turret
harsh matrix
#

How do I check if an inventory is my custom gui?

tall dragon
#

i use xampp for this

limber owl
#

how would I make efficient gui inventory menu with custom items and custom commands to execute without using too many if statements or switches

tall dragon
#

with a menu framework

mortal hare
#

man its such a bummer that minecraft's NMS containers are so hardcoded into packets

#

creating your own merchant inventory would make trade selection semi desynced

#

due to if (container instanceof MerchantMenu)

#

instead of checking menu type

ornate patio
mortal hare
#

you can create custom inventories where you can store items like chests

#

for example i managed to make trading inventory

green prism
mortal hare
#

which can store items

#

and not return

mortal hare
#

when its exited

#

it basically acts like a chest

formal bear
#

sudo apt update && sudo apt install -y mariadb-server

mortal hare
#

but trading functionality is broken

#

well trading is not broken, you can still trade, but trade selection from GUI is

formal bear
limber owl
grim ice
#

um

#

help

#

how do i display japanese characters in jlabels and stuff

#

rn they appear as boxes

mortal hare
#

change encoding?

tall dragon
#

use different encoding id guess

grim ice
#

ok

#

alr its fixed

#

ty

golden turret
#

using a delay of 3 ticks makes the the player disconnects for flying

ornate patio
#

how do I get the inventory of a Block

tall dragon
#

if its a chest u mean?

ornate patio
#

if its a brewing stand yes

lost matrix
humble tulip
ornate patio
lost matrix
#

Specifically for Brewingstand:
Block get-> BlockState cast-> BrewingStand get-> getInventory

ornate patio
#

I don't see any method to get BrewingStand

tall dragon
#

BrewingStand stand = (BrewingStand) block.getState()

#

should be able to call getinventory on that

ornate patio
#

alright

humble tulip
#

Make sure the block type is brewingatand tho

smoky oak
#

can you react to the server kicking a player and possibly interrupt that kick using the api?

opal juniper
#

well an instanceof will suffice

smoky oak
#

k

ornate patio
smoky oak
humble tulip
#

Why are u using nms stuff for a brewingstand?

#

And blocks

brittle lily
#

Hey Guys How Can I remove enchantement text from tools, Thanks!

ornate patio
lost matrix
tall dragon
tender shard
ornate patio
#

i have no choice

brittle lily
humble tulip
ornate patio
#

this code is inside my custom horse

tender shard
ornate patio
#

It's meant to consume to seeds inside the brewing stand

humble tulip
#

Oh ok

ornate patio
#

i love when NMS errors it crashes the whole server

smoky oak
#

cant you try catch nms stuff?

ornate patio
#

yeah but like

#

this is an unexpected error during testing

smoky oak
#

do one try around the whole block

#

one catch at the end

#

then

#

broadcast ERROR: Stacktrace

ornate patio
#

i know lmao

tall dragon
#

which i why you should minimine nms ๐Ÿ™‚

smoky oak
#

better than deleting the server

ornate patio
tall dragon
#

yea i said u shoulnt minimize it

#

sometimes u dont have a choise

#

for example i too rather use nms than the ridiculously slow Block#setType

grim ice
#

uhhh im getting a filenotfoundexception when trying to get a file from my resources folder, (im not using spigot btw) i solved this before but i forgot

grim ice
#

its not my code that has the problem

grim oak
#

Hi sorry I know this is vague, but Ive made a plugin and I dont know why its not starting up, theres no error message or anything, its just not enabling in the first place. anyone know what may cause this?

grim ice
#

i decompiled my jar

#

and it doesnt have the resources folder

tender shard
#

that's normal

#

the resources are in the "root" of the .jar

grim ice
#

o

#

somebody one told me to decompile so i can check if it got included or not

tender shard
#

/src/main/resources/text.txt will be /text.txt in the .jar

grim ice
brittle lily
#

Guys Hey! I'm setting Players data on my config I should set some settings. How Can I check player has already did that or didnt? When Player Do settings Him Unique ID is setting on Config. So I mean I need to check there is a unique id or isnt when player tried same settings again.

grim ice
#

the files in my resources folder

#

do not exist in the jar at all

tender shard
#

are you using mvn package to compile?

grim ice
#

yes

tender shard
#

?paste your pom

undone axleBOT
grim ice
#

also it works in my ide but not in the jar thats why its definitely in my pom

vast raven
#

Using the method .remove(ItemStack) in the class inventory, does it remove all similar items as the parameter's one or just 1?

grim ice
lost matrix
grim ice
tender shard
#

hm idk looks good

grim ice
#

aaa

grim oak
#

My plugin isnt enabling on start up. Idk if its related to my plugin yml, but ik its definitely in the right directory. I put my plugin yml below just incase something is wrong there

name: Plugin
version: 1.0.0
author: vaindev
main: me.vaindev.plugin.Plugin
api-version: 1.18
softdepend: [PlaceholderAPI]

commands:
  plugin:
    description: General Plugin Commands
    usage: /<command>
    permission: plugin.reload
    aliases: [sr, rewards]

permissions:
  plugin.reload:
    description: Allows you to reload the plugin
    default: op
tall dragon
grim oak
#

there is no error

tall dragon
#

well idk plugin.yml looks ok

vast raven
lost matrix
# grim oak there is no error

If a jar is inside the plugin folder then one of two things can occur:

  1. The plugin enables
  2. An exception is thrown

There is no other possibility

tardy delta
#

name: Plugin :kekw:

vast raven
#

Maybe a pl with the same name or some other plugin that gives problem to yours

grim oak
vast raven
#

Or maybe the dependence to PLACEHOLDER API.

tardy delta
#

lol

tall dragon
tardy delta
#

its PlaceholderAPI

grim oak
#

!paste

tardy delta
#

?paste

undone axleBOT
grim oak
#

whats the command for paste bin

vast raven
grim oak
#

ah ty

grim ice
#

aaa

tardy delta
#

algorithms weird

#

shut up pls ๐Ÿ™

tall dragon
#

yup

tardy delta
#

why is it helping me with stuff that doesnt work lol

tall dragon
#

they do start at 0 in java ๐Ÿ˜„

tardy delta
#

lmao i changed one line in the code i got and it worked

lost matrix
#

calling your variable N and var... wow

#

and pi XD

tardy delta
#

shut up the program give it those names

#

its stupid ๐Ÿ™„

hasty prawn
#

No way it named something var

#

Either way you should've fixed it smh

tardy delta
#

those fuckers are running some old java version

lost matrix
#

Even then. N and pi are almost as bad.

grim oak
grim ice
#

um

#

can someone help

grim ice
#

?paste

undone axleBOT
grim ice
#

this is my pom

#

but im getting a file not found exception

#

when trying to access a file

#

from resources

chrome beacon
#

Show how you access the file

smoky oak
#

and the error

lost matrix
tender shard
#

didnt you say the file isn't even in your jar?

grim ice
#

JapaneseGenerator.class
.getResource("/" + (i + 1) + ".json").getFile()

tender shard
#

then you shouldnt worry about the exception but why the file isn't ther ein the first place

#

show a screenshot of your project structure

#

if you like you can additionally send a picture of a hyena but that's not required

humble tulip
tender shard
humble tulip
#

when u sent screenshots, it looked like ur statements were in a separate file

tardy delta
smoky oak
#

satisfied now

grim ice
#

src
| _ main
|_ java
|_ resources
|_ 1.json

tardy delta
#

ahm

humble tulip
#

String createDataTable = "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " (UUID VARCHAR(36) NOT NULL PRIMARY KEY, CONTENTS MEDIUMTEXT, INT NUMSLOTS, INT MAXSLOTS, TEXT TEMPLATE);";

lost matrix
tender shard
ivory sleet
humble tulip
#

that's how my statemtns look

grim ice
#

its not under java

humble tulip
#

i dont have ultimate but it looked like you have the statements in a separate file

#

that looked way more organised

tardy delta
#

@Language("SQL") uwu

ivory sleet
tardy delta
#

altho not ideal

grim ice
#

sooo uhh

lost matrix
ivory sleet
#

2Hex, if you only used gradle

#

(/s)

grim ice
lost matrix
tall dragon
#

Ew gradle

humble tulip
#

Is there a better way to do this?

#
private String getWhereConditionForUUID(int num) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < num; i++) {
            stringBuilder.append(getDataTableName()).append(".UUID=?");
            if (i == num - 1)
                stringBuilder.append(";");
            else
                stringBuilder.append("OR ");
        }
        return stringBuilder.toString();
    }
smoky oak
#

im on clean compile package verify, do i need to do install?

lost matrix
#

You cant depend on the spigot jar anymore

tender shard
#

why aren't you using maven or gradle?

#

then you have to do this shit:

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

tender shard
#

using maven would be way easier

humble tulip
#

use 1.19?

smoky oak
#

elaborate

tender shard
#

when it says 1.18, replace that with 1.19

smoky oak
#

yea use that

lost matrix
#

I would start a new project. Converting can be very cumbersome.
Just get the minecraft dev plugin for intellij and generate a spigot maven project.

dusk flicker
#

@vagrant stratus

tardy delta
#

lmao

worldly ice
#

lmao

#

guys no way free nitro

lost matrix
tardy delta
#

wat would discorwnitro be

humble tulip
#

lets say i wanna get data from my sql table where id is 1,6,4,7 or 9
do i have to append where id=1 or id=6 or id=4... or is there a way to submit an array of ids?

lost matrix
#

@quaint mantle One ban pls, sir

tardy delta
#

lmao

#

"he got hacked"

dusk flicker
#

hacked = stupid

lost matrix
#

Doesnt matter. Dont click on shady links

tardy delta
#

and use the twofactor stuff

#

lol

paper geode
#

being stupid should be bannable

#

twofactor doesnt do shit against being stupid

tardy delta
#

dont be stupid anyways kekw

grim ice
#

java.io.FileNotFoundException: file:\C:\Users\pcc\Desktop\JapaneseSensei\target\JapaneseSensei-1.0.jar!\5.json (The filename, directory name, or volume label syntax is incorrect)

lost matrix
humble tulip
#

hmm

grim ice
#

@lost matrix still btw

humble tulip
#

ok

quaint mantle
#

who banned him

tardy delta
#

if it was silent i guess optic

#

his ways of doing it

quaint mantle
#

one of my friends got hacked

#

im guessing it was him

grim ice
#

anyone?

#

im getting file not found exception

#

java.io.FileNotFoundException: file: .........\target\JapaneseSensei-1.0.jar!\5.json (The filename, directory name, or volume label syntax is incorrect)

#

actually

tardy delta
#

is it there?

lost matrix
grim ice
#

its saying syntax

#

its not there btw

lost matrix
#

Ignore the exception

tardy delta
#

the resources folder is included in the final jar right?

grim ice
#

no

lost matrix
#

If its fked then you can try defining your resources by prepending the basedir

            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
pulsar kite
grim ice
#

yeah but i dont have an exclamation mark in it...

lost matrix
tardy delta
#

my brain is hurting

grim ice
humble tulip
lost matrix
tardy delta
#

ok i lost it at the "n sort"

glossy venture
#

only 10% loss

tardy delta
#

this my stuff

public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int size = input.nextInt();
        int[] var = new int[size];
        // populate the array
        for (int i = 0; i < size; i++) {
            var[i] = input.nextInt();
        }

        // sort in ascending order, first the small stuff
        Arrays.sort(var);
        
        int diff = Math.abs(var[0] - var[1]);
        for (int i = 0; i < var.length - 1; i++) {
            int newDiff = Math.abs(var[i] -  var[i + 1]);
            if (newDiff < diff) {
                diff = newDiff;
            }
        }
        input.close();
        System.out.println(diff);
    }```
lost matrix
glossy venture
#

oh no nvm missed the sort

worthy yarrow
#

How would I check if a UUID arraylist does not contain a certain UUID?

glossy venture
#

lol

lost matrix
tardy delta
#

!list.contains(uuid) lol

humble tulip
#

but use a set

tender shard
lost matrix
tardy delta
#

im wondering what it means with "modification of the input"

humble tulip
#

how do u change the input

#

like from unsorted to sorted

#

so sorting the input is the modification

tardy delta
#

just an Arrays.sort ^^

tender shard
#

i don't think that the dude who wrote this exercise wants you to use arrays.sort lol

humble tulip
#

they asked what modification of the input allows for a single loop with time complexity O(n-1)

#

the asnwer is sort the input

tardy delta
#

well a linkedlist may be better for this purpose i guess?

#

cuz the array can have 100k elements

humble tulip
#

they didnt say to sort it did they?

#

they just aske dwhat do u have to do to the input to only use n-1 comparisons

tender shard
#

oh I was thinking about the previous exercise then

tardy delta
#

nah but that code is basically what they gave me and i need to optimize ๐Ÿ‘€

tender shard
#

I think he sent another exercise before that too

tardy delta
#

na

tender shard
#

then it was someone else on a another discord lol

humble tulip
#

i'm confused as to what ur doing honestly

tardy delta
#

here you go

grim ice
tardy delta
#

lets use a linkedlist for the sorting tbh

lost matrix
lost matrix
humble tulip
#

isnt the whole point of this to write algorithms?

tardy delta
#

isnt it better for sorting the elements? as i assume Arrays.sort needs to recreate that array multiple times?

humble tulip
#

why dont u write your own sorting algorithm?

tardy delta
#

ah best thing

humble tulip
#

is there a name for a sorting algorthm that iterates an array, checking that every next values is more than the one before it and if not swaps them? then repeat until array is sorted?

brittle lily
#

Hey Guys How Can I Create Health bar like Ender Dragon, Wither...

humble tulip
#

i feel like that's a good way to sort

tardy delta
#

Bukkit.createBossbar

#

?jd-s

undone axleBOT
brittle lily
#

Thanks!

tardy delta
#

internet tells me that it isnt really efficient for big collections

humble tulip
#

oh ye bubble sort sucks

#

it's easy to understand tho

lost matrix
#

lets do monkey sort. Shuffle the array randomly until its sorted.

golden turret
#

how can I clear all player statistics?

grim ice
#

JapaneseGenerator.class
.getResource("/" + "1.json").getFile() is giving me a file not found exception

#

is this the right way to access files in resources folder anyways?

next stratus
#

Hey, Sorry if it's a random question but is there a way to keep some falling blocks together even after landing on the ground?

lost matrix
grim ice
#

so what do i do lol

lost matrix
humble tulip
#

jk

next stratus
tall dragon
humble tulip
#

what are you doing?

#

how does tnt "land" and break

next stratus
#

I wanna make that tnt ball fall naturally but not break upon hitting the ground

humble tulip
#

well tnt doesnt fall naturally does it?

next stratus
#

So my goal is it to "fall" to the ground and upon impact I want something to happen.

humble tulip
#

are you using fallingblocks?

next stratus
#

yeah, I'm using falling blocks.

lost matrix
next stratus
#

I was thinking of the armor stand option ๐Ÿฅฒ

#

why did i forget them smh

lost matrix
# grim ice

Alright. And whats the content of your resources folder?

grim ice
#

1.json 2.json

#

3.json

#

4.json

#

5.json

next stratus
#

oh no the power i got >:)

tall dragon
#

oh yea

#

that should do wonders for fps!

next stratus
#

I'll hide them dw

humble tulip
#

not that bad if thye're invis

tardy delta
#

we all love lag

#

especially when it has to do with millions of armorstans

tall dragon
#

they were invis too

lost matrix
# grim ice

No idea what you are doing. Create a new project and only add the json files there. Then compile and see if they are in your jar.

tall dragon
#

yet it brought be down to 60 fps

#

when i normally have arround 700-1000

#

yet in my case

#

it was probably a few 1000 of them ๐Ÿ˜„

next stratus
#

is it possible to make them all fall in sync?

tall dragon
#

ur tryna create some kinda big comet?

next stratus
#

well maybe

#

it's gonna drop down from a height then do something upon landing

tall dragon
#

well i know something like that is possible

#

i just dont know how its done

humble tulip
#

and then just tp them to their location+vector

ornate patio
#

is the Marker entity useful?

next stratus
#

i'm gonna hella destroy intellij soon very soon

#

constant. fucking. freezing.

#

it also eats up the cpu ๐Ÿ˜

tardy delta
#

looks kinda straight

next stratus
#

intellij was so good now it's so shit

quaint mantle
#

why is it shit

tall dragon
quaint mantle
#

seems like you need to dedicate more memory to it

next stratus
tall dragon
#

seems like ur pc is just shite

grim ice
#

im using 2021 version

quaint mantle
#

i run it without any issues

tall dragon
#

same

next stratus
#

I got 32GB RAM

quaint mantle
tall dragon
#

still intellij could be setup to only take like 2g

tardy delta
# lost matrix It doesnt

ahhhh i guess they meant to put the input in an arraylist rather than an array and sorting that array, cuz Integer implements Comparable or smth?

grim ice
#

cpu using more than what its supposed to use:
everyone: dedicate more ram!!!!

#

more ram = fix everyting!!!

tall dragon
next stratus
#

i9-9900k or something like that

grim ice
#

FIRST GENERATION?

#

ok

next stratus
#

my bad

grim ice
#

lol

tall dragon
#

well check in ur task manager

grim ice
#

ur pc is pretty much high end

tall dragon
#

i have an amd ryzen 6 core proccessor or something

#

rarely gets over 30 % usage

#

maybe when building, indexing but thats it

#

though i do think amd is better for this kinda stuff

grim ice
#

dude

#

even if amd is better

#

a cpu like that wont suffer like that

#

in intellij

tall dragon
#

no. it indeed should not

grim ice
#

also @lost matrix no

#

same thing even in the new project

#

(with the same pom so duh)

next stratus
#

intellij is using 87% cpu :/

tall dragon
#

i can have 3 intellij instances at once open and not hit that

chrome beacon
#

I've seen that happen before

#

Restarting fixed it

#

Anyways you really should be on the latest version of Intellij

tardy delta
#

is there a collection that adds elements in the order based on their Comparator implementation?

#

iirc TreeSet does but i need an indexed collection

tardy delta
#

ill take that as a no kekw

chrome beacon
#

You could just sort it after inserting your value

tardy delta
#

ye but isnt sorting it at insertion more efficient?

tall dragon
#

probably not

tardy delta
#

thinking in terms of a large integer list

#

hmm

tall dragon
#

sorting algorithms are made for that

eternal night
#

In what world is sorting at insertion not more efficient

tardy delta
#

๐Ÿคทโ€โ™‚๏ธ

tall dragon
#

woulnt it have to find the position of that object every time there is an insertion?

eternal night
#

Yes but because the list is sorted that can be binary tree speed

#

good old log n

tardy delta
#

so its a good thing to write my own arraylist impl that sorts the elements on insertion

eternal night
#

I am sure smth like this exists XD

tardy delta
#

basically a treeset with get method kekw

#

treeset takes in a comparator thro constructor

chrome beacon
tardy delta
#

toArray kekw

#

but ye if i really wanted to i could do a TreeMap<int, int> where the key is just the index ๐Ÿคทโ€โ™‚๏ธ

grim ice
#

hey

#

um

#

my resources folder isnt being copied to inside the jar when i package

tall dragon
#

still eh?

humble tulip
#

Just build with intellij

quaint mantle
#

is not bot

humble tulip
#

The old fashion way

quaint mantle
#

is not bot

smoky oak
#

what arguments do you use?

quaint mantle
#

is not bot

grim ice
#

yes

tardy delta
#

heh how its that done automatically then

lost matrix
grim ice
#

yes

#

i did

smoky oak
#

again maybe its your arguments

grim ice
#

and it still happens

grim ice
lost matrix
smoky oak
#

when you hit build theres arguments passed to that

grim ice
#

im not even in spigot

lost matrix
#

yes it can

#

maven filters some type of files

smoky oak
#

i use 'clean compile package verify' for mine

grim ice
#

i tried with filtering off

sterile token
#

How can i design the protection plugin for each player having many protections?

#

Atm it working with 1 per player

grim ice
#

and its still like that

tall dragon
#

did u add the same pom tho

grim ice
#

yes

smoky oak
#

can you screenshot the top right corner

tall dragon
#

well dont

lyric grove
#

would this be a good idea performance wise?

worthy yarrow
#

org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: main/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0 How do I fix this?

lyric grove
tall dragon
#

try with clean pom

grim ice
lost matrix
grim ice
smoky oak
#

you use intellij just do a screenshot

grim ice
#

why though is smth there

lost matrix
smoky oak
#

yea the button you hit when compiling

chrome beacon
kind coral
#

how would i exclude a file from a shade except one?

grim ice
#

i use package

lyric grove
lost matrix
kind coral
#

like i have many files that have like
namenameimportantname
namenamecheapname

#

i want to keep important

smoky oak
#

try 'clean compile package verify'

grim ice
chrome beacon
#

You can set the target release to an older version

grim ice
#

man this is frustrating

lost matrix
chrome beacon
#

I'm going to assume they run 1.8

#

With Java 8

lost matrix
lost matrix
grim ice
lost matrix
grim ice
#

oh that

#

u couldve just said "intellij maven tab"

#

anyways i used that

#

same thing

lost matrix
#

Show your pom again pls

lyric grove
lost matrix
# grim ice no

Change the config to this:

                    <resource>
                        <directory>${basedir}/src/main/resources</directory>
                        <includes>
                            <include>*</include>
                        </includes>
                    </resource>
grim ice
#

?paste

undone axleBOT
grim ice
#

this is my pom before

#

i still didnt add the includes one tho

#

imma add it tmrw

lost matrix
grim ice
#

imma start using gradle if this doesnt work

#

i failed maven and maven failed me ๐Ÿ˜ญ /j

lost matrix
#

Gradle is a lot more complex and you will find a lot less help because the community is way smaller.
It really takes you a while until you get a proper setup.

lyric grove
humble tulip
#

Ppl who work on anticheats are masochists

subtle folio
#

best anticheat no cap:

lyric grove
jade perch
subtle folio
#
@EventHandler
public void hitEvent(EntityDamageByEntityEvent e) {
  if (!(e.getEntity() instace of Player p) && !(e.getDamager() instance of Player d)) return;
  if (p.getLocation().getDistanceFrom(d.getLocation) > 3) {
    ban(d);
  }
}```
#

thank me later

lost matrix
#

Oh nice. Another 1.8 anticheat. Really missed one of those. I wish we had 20 already. Then we could actually have a choice blobimfine

subtle folio
jade perch
#

Get better internet or be banned

subtle folio
#

just make lag a bannable offensive

#

EXACTLYYYY

grim ice
#

losing cuz ur opponent is lagging kinda sux

#

but u should only kick

subtle folio
#

does getPing() exist?

jade perch
#

definitely needs ban

lost matrix
#

Creating a proper anticheat actually involves a fk ton of complicated statistical math.
Ive helped someone that worked on an internal anti cheat for a bigger server and it was nuts.

subtle folio
#

they can appeal with proof of new router

subtle folio