#help-development

1 messages ยท Page 341 of 1

tender shard
#

oh wait

tardy delta
#

.forEach(existingLore::add)

ripe lake
#

Its build tool, It build Spigot, why should I add the dependency?

tender shard
#

addAll is better then forEach

tardy delta
#

love it how batch addAll isnt more optimized

rough drift
#

use lore.addAll

tender shard
tardy delta
#

oh kek it is, must've been some other colletion then

#

linkedlist iirc

haughty granite
#

thank you very much, very useful to improve myself

tardy delta
#

๐Ÿ’€

rough drift
#

You can do this better if you have a method to auto color

#

StringUtils::color

#

or smt

haughty granite
tender shard
#

yes

tardy delta
#

static method

haughty granite
#

I'll do it

tender shard
#

eg like this

    private static class Utils {
        public static String color(String string) {
            return ChatColor.translateAlternateColorCodes('&', string);
        }
    }
    public void onEnable() {
        List<String> existingLore = new ArrayList<String>();
        List<String> loreToAdd = getConfig().getStringList("lore")
                .stream()
                .map(Utils::color)
                .collect(Collectors.toList());
        loreToAdd.forEach(line -> existingLore.add(line));
    }
rotund ravine
#

@tender shard addAll ๐Ÿ‘€

tardy delta
#

he decided to trust me

#

wrong choice

haughty granite
#

why by putting void after static it is impossible to return ?

tardy delta
#

๐Ÿ’€

#

cuz you cant return smth from a void

haughty granite
#

void means what in java?

tender shard
tardy delta
#

ye jsut looked at it

tender shard
haughty granite
#

and if we don't put void we have to return something?

tender shard
austere cove
#

in a gson type adapter, what is the proper thing to do when the data you're reading is invalid?

hybrid spoke
austere cove
#

can u just throw any runtime exception and gson will deal with it?

tender shard
#

here ๐Ÿ˜›

rotund ravine
#

Though not sure about their internal handling

haughty granite
tender shard
serene sigil
#

nope it stiil doesnt work

tender shard
austere cove
#

uhh, loading some internal data which shouldn't fail so I don't want it to be silently ignored

tardy delta
#

JsonSyntaxException

#

and gson will handle it, says chatgpt

#

this stuff is better than stackoverflow

#

@austere cove

hybrid spoke
peak depot
#

how to remove that warning:

remote swallow
#

anti popup

serene sigil
#

ez

tardy delta
#

good one

austere cove
tardy delta
hybrid spoke
#

or JsonParseException

serene sigil
#

?paste

undone axleBOT
serene sigil
hybrid spoke
#

Cannot create additional worlds on STARTUP

serene sigil
#

yes but like how do u fix thid?

hybrid spoke
#

by not loading or creating worlds on startup?

#

delay it by one tick

serene sigil
#

wdym?

quaint mantle
#

Chat.java

#
package pl.playgroudhc.chat;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class Chat extends JavaPlugin{

    @Override
    public void onEnable() {
        Bukkit.getConsoleSender().sendMessage("Uruchamianie czatu ");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player p = (Player) sender;
        if (command.getName().equalsIgnoreCase("pomoc")) {
            p.sendMessage(ChatColor.YELLOW + "================POMOC================");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(ChatColor.YELLOW + "=====================================");
        }
        if (command.getName().equalsIgnoreCase("regulamin")) {
            p.sendMessage(ChatColor.YELLOW + "================REGULAMIN================");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(ChatColor.YELLOW + "=========================================");
        }
        return false;
    }


}
crimson relic
#

...

tender shard
serene sigil
#

...

quaint mantle
#

plugin.yml

tardy delta
#

?paste mate

undone axleBOT
quaint mantle
#
main: pl.playgroudhc.chat.Chat
name: PlaygroundhcChat
version: 0.1
api-version: 1.16

commands:
  regulamin:
    aliases: rules
  pomoc:
    aliases: help
remote swallow
undone axleBOT
crimson relic
#

dont

tardy delta
#

unchecked casts, love it

serene sigil
remote swallow
#

1 tick

quaint mantle
#

?

sour tundra
hybrid spoke
#

in a minute then "getCommand(name).setExecutor(this); error"

sour tundra
#

tbh i'm waitn for that

tender shard
# quaint mantle ```java package pl.playgroudhc.chat; import org.bukkit.Bukkit; import org.bukki...

ChunkManager.java

package de.jeff_media.angelchest.handlers;

import de.jeff_media.angelchest.Main;
import org.bukkit.Chunk;
import org.bukkit.block.Block;

import java.util.HashSet;

public class ChunkManager {

    private static final HashSet<Chunk> CHUNKS = new HashSet<>();
    private static final Main main = Main.getInstance();

    public static void keepLoaded(Block block) {
        if(CHUNKS.contains(block.getChunk())) return;
        CHUNKS.add(block.getChunk());
        block.getChunk().addPluginChunkTicket(main);
    }

    public static HashSet<Chunk> getLoadedChunks() {
        return CHUNKS;
    }

    public static void reset() {
        for(Chunk chunk : CHUNKS) {
            chunk.removePluginChunkTicket(main);
        }
    }

}
quaint mantle
#

??

crimson relic
#

HelloWorld.java

serene sigil
tender shard
# quaint mantle ??

you sent a random class without any context or asking any question, so I did the same

serene sigil
#

i have one more question tho

tender shard
#

oh my bad

quaint mantle
sour tundra
quaint mantle
#

or in command?

tender shard
# hybrid spoke you forgot your pluginyml

plugin.yml

main: ${spigot.main}
name: ${project.name}
version: ${project.version}
description: "${project.description}"
prefix: ${spigot.prefix}
api-version: "1.13"
website: https://www.spigotmc.org/resources/angelchestplus.88214/
authors:
  - mfnalex
  - JEFF Media GbR
database: false
load: POSTWORLD
#libraries:
#  - org.slf4j:slf4j-api:1.6.6
softdepend:
  - Oraxen
  - Multiverse-Core
  - Multiverse
  - Vault
  - WorldEdit
  - WorldGuard
  - Slimefun
  - InventoryPages
  - Minepacks
  - PlaceholderAPI
  - EliteMobs
  - ChestSort
  - ProtocolLib
  - ExecutableItems
  - EcoEnchants
  - ItemsAdder
commands:
#  acadmin:
#    description: "Manage a few AngelChest settings"
#    permission: "angelchest.admin"
  acgraveyard:
    description: "Manage Graveyard settings"
    permission: "angelchest.admin"
permissions:
  angelchest.use:
    description: "Players with this permission will have their items put into a chest on death by an Angel"
    default: true
  angelchest.protect:
    description: "Players with this permission have their AngelChests protected from other players. They can unlock their chests using /acunlock"
  angelchest.protect.ignore:
    description: "Players with this permission can open other player's protected AngelChests"
  angelchest.unlock:
    description: "Players with this permission can unlock their protected AngelChests using /acunlock"
    default: true
  angelchest.tp:
    description: "Allows players to teleport to their AngelChests"
  angelchest.preview:
    description: "Allows to view your AngelChests' contents using /acgui"
  angelchest.fetch:
    description: "Allows players to teleport their AngelChests to them"
  angelchest.toggle:
    description: "Allows players to enable/disable having AngelChests spawned using /actoggle"
  angelchest.others:
    description: "Allows you to run /aclist, /actp and /acfetch for other players"
  angelchest.reload:
    description: "Allows to reload the configuration using /acreload"
  angelchest.debug:
    description: "Allows to use the debug command /acdebug"
  angelchest.version:
    description: "Allows to use the version command /acversion"
  angelchest.admin:
    description: "Allows to use /acadmin, /acgraveyard, /acreload, /acdebug and /acversion"
    children:
      angelchest.version: true
      angelchest.debug: true
      angelchest.reload: true
      angelchest.others: true
sour tundra
#

yes in enable

serene sigil
hybrid spoke
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

serene sigil
#

(that method is called in onEnable)

crimson relic
#

thanks for not giving any info about the error

tender shard
tender shard
#

as you see I only registered one command in plugin.yml

serene sigil
quaint mantle
#

Method invocation 'setExecutor' may produce 'NullPointerException'

tender shard
#

I register about 50% manually and other 45 with acf

crimson relic
quaint mantle
#

Method invocation 'setExecutor' may produce 'NullPointerException'

quaint mantle
#

yes

sour tundra
#

2 bad

serene sigil
quaint mantle
crimson relic
#

by making it not be null

tardy delta
#

ignore it if your command is defined in your plugin;yml

tender shard
quaint mantle
#

ok

serene sigil
#

oh shit

#

nvm

#

alr

tender shard
tardy delta
#

@SuppressWarnings("ConstantConditions")

quaint mantle
#

?

crimson relic
#

you should learn java first

quaint mantle
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
#

?paste

undone axleBOT
quaint mantle
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sour tundra
#

wait

quaint mantle
#

?

sour tundra
#

why u didn't implements CommandExecutor

tender shard
#

because Plugin already extends CommandExecutor

sour tundra
crimson relic
#

good to know

sour tundra
#

i've never created command inside Main class

tender shard
#

that's why you just get the usage when you do not register your own executor / override onCommand - it's set to the plugin by default, and TabExecutor has

public interface CommandExecutor {
  default boolean onCommand(CommandSender sender, Command command, String alias, String... args) {
    return false;
  }
}```
quaint mantle
#

wtf

tender shard
#

what's your problem

tender shard
#

but the result is the same

serene sigil
#

how do you detect if a chat message is really sent and displayed on the players screen? so it isnt cancelled maybe by another plugin

tender shard
#

Listen on MONITOR priority

#

Then see if its cancelled

quaint mantle
#

not working

crimson relic
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
crimson relic
#

you havent described nor given any errors

#

you just paste the same link over and over again

quaint mantle
#

Unkown command

#

[14:09:39 INFO]: XoleszeX issued server command: /regulamin

tender shard
#

Did your plugin even get enabled?

quaint mantle
#

yes

#

is on the list enabled plugins

#

on /pl

tender shard
#

You never registered your own commandexecutor, just declared an inner interface class

rotund ravine
#

Don't need to set the executor if it's your main class

tender shard
#

But they dont have any onCommand method overridden

#

They just declare an inner interface called Chat.CommandExecutor

quaint mantle
#

why this plugin not works?

rotund ravine
quaint mantle
#

and hot to fix it:?

#

how

tender shard
#

override the onCommand(...) method in your class that extends JavaPlugin instead of just declaring an inner interface

rotund ravine
tender shard
#
public class Test extends JavaPlugin {
    public void onEnable() {
        getCommand("commandName").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        // Do something
        return true;
    }
}
sour tundra
# quaint mantle and hot to fix it:?

just use this code:

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public class Main extends JavaPlugin{

    @Override
    public void onEnable() {
        Objects.requireNonNull(getCommand("pomoc")).setExecutor(this);
        Objects.requireNonNull(getCommand("regulamin")).setExecutor(this);
        Bukkit.getConsoleSender().sendMessage("Uruchamianie czatu ");
    }


    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player p = (Player) sender;
        if (command.getName().equalsIgnoreCase("pomoc")) {
            p.sendMessage(ChatColor.YELLOW + "================POMOC================");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(ChatColor.YELLOW + "=====================================");
        }
        if (command.getName().equalsIgnoreCase("regulamin")) {
            p.sendMessage(ChatColor.YELLOW + "================REGULAMIN================");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(" ");
            p.sendMessage(ChatColor.YELLOW + "=========================================");
        }
        return false;
    }

}
#

yml

api-version: 1.16

commands:
  pomoc:
    aliases: ['help']
  regulamin:
    aliases: ['rules']
tender shard
#

also it's pretty weird to use the same commandexecutor for two different commands

tawdry echo
#

create other class which implements commandexecutor

tender shard
#

yeah that'd be a way better idea

sour tundra
tender shard
#

also why do you cast the CommandSender to Player when sendMessage is declared in CommandSender and not in Player?

tawdry echo
#

or better way is using any depency for manage commands like litecommands

tender shard
#

you can just do sender.sendMessage(...)

#

no need to cast it to Player. and if you wanna cast it, then at least check if it's actually instanceof Player before casting it

#

the sender could after all also be a ConsoleCommandSender

heavy depot
#

kann mir jemand helfen habe diesen fehler

sour tundra
heavy depot
tender shard
tender shard
#

it would be a very bad idea to name your main class Main.Main

#

at least call it me.myusername.mypluginname.Main

#

or better, me.myusername.mypluginname.MyPluginName

sour tundra
#

convention

tender shard
#

so how is your main class actually named?

tardy delta
#

?main

hazy parrot
#

I personally see nothing wrong to call your main class main ๐Ÿคทโ€โ™‚๏ธ

tender shard
#

I still think that ```java
package com.jeffmedia.angelchest;

public class Main extends JavaPlugin implements AngelChestPlugin``` is totally fine. But calling it Main without any proper package name is ofc... bad lol

heavy depot
#

how do i change the main class because this is a source code i downloaded and wanted to make it to version 1.19

sour tundra
#

my god

hazy parrot
#

Well if package structure is like that... You probably don't want to use that source

tender shard
#

wasn't the Main.Main person someone else?

#

oh no

#

it was them

hazy parrot
tender shard
#

show the main class' source code, including package and class name

heavy depot
tender shard
#

damn wtf

crimson relic
#

๐Ÿ’€

tender shard
#

well if that's actually the name, then you didnt include the Main.Main class in your .jar

#

which makes sense, IntelliJ doesnt show the "java class file" symbol

#

your sources root is messed up

#

classes should be inside src/main/java and not just in the root folder

hazy parrot
#

Snake case mm

tender shard
#

?notworking

crimson relic
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tawdry echo
#

just not working bro ๐Ÿคก

tender shard
#

yeah well he keeps ignoring everything we say the whole time anyway, obv it's "not working"

tardy flame
#

Mfnalex

#

It's not working

crimson relic
#

wait are you saying you cant read minds?

tardy flame
#

Bru

#

Don't you see

tender shard
#
public class Test extends JavaPlugin {
    public void onEnable() {
        getCommand("commandName").setExecutor(this);
    }

    public interface CommandExecutor {
        default boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            
            return true;
        }
    }
}

Obviously this ^ will not work

#

I wonder why people ask questions here anyway if they ignore all answers they got

heavy depot
#

So rubbish source code

quaint mantle
#

Hi, I would like to compile a PAPI addons for java 8 but I don't know how to do it because with github workflow it asks me to set the version of gradlew but I can't ^^

tender shard
#

how does your workflow file look like?

hazy parrot
#

doesn't all gradle projects have gradle binary included ? Why would it need version

tender shard
#

usually yes, but it's not required

eternal night
#

I presume the target java version is the issue ?

tender shard
#

idk they claimed the issue is that github action complains that there's no version defined for gradlew

#

like, they are using some gradlew workflow that wants you to specify a gradlew version?

#

tbh I'd just upload the gradlew file to the repo and then use a "normal" action that just calls your included gradlew

tender shard
quiet ice
#

I'd recommend gradle 7 though

#

6.5 is very outdated most likely

tender shard
#

however it'd be way easier to just upload gradlew yourself and just use the generic setup-java action

eternal night
#

but then the minecraft kiddies hack you

tender shard
eternal night
#

kekw indeed

tender shard
#

however without gradlew in the repo, nobody who clones it would be able to run it anyway without downloading it themselves

eternal night
#

yes just don't accept random binaries from random people kekw

tender shard
#

(almost = most people)

quiet ice
#

IJ will automatically execute the build tasks by default

#

Hence even opening a gradle project is dangerous

haughty granite
#

getDisplayName() returns the nickname (modified or not)
getName() returns the real nickname
is it true ?

timber crescent
quiet ice
#

real nickname is an interesting way of putting it

#

Probably not wrong if you mean the username with that

tender shard
#

getDisplayName() will return whatever another plugin set it to in setDisplayName(), or the same as getName() if it wasn't set to anything

quiet ice
#

Ugh, apparently paper is deciding to break a bunch of plugins right now - time to investigate whether my awful hack is affected by it.

haughty granite
quaint mantle
tender shard
#

did you add the with: gradle-version stuff?

warm light
#
Plugin[] plugins =Bukkit.getServer().getPluginManager().getPlugins();

this code stores only loaded plugins or all?

tender shard
#
 - uses: gradle/gradle-build-action@v2
   with:
     gradle-version: 7.6
 - run: gradle build
#

sth like this should work

haughty granite
#

I started with gradle and quickly switched to maven

#

gradle is too obscure

tender shard
#

I think so too

tender shard
remote swallow
#

normally i see people starting with maven and swapping to gradle

quiet ice
#

Yeah, I also started with gradle and swapped to maven

#

And even outside of bukkit work I am more or and more working without gradle

tender shard
#

btw is 7 a valid version or should it be 7.0? idk

#

and you are NOT supposed to run gradlew, but gradle

tender shard
#

so just add another

- run: gradle build
``` at the end
quiet ice
#

You'll want 7.6

tardy delta
#

what are those gh workflow things?

quiet ice
#

7.0 was released two or so years ago - at least it feels like that

tender shard
#

e.g. compile it and check if it failed

tardy delta
#

o

warm light
tender shard
#

wdym "store plugins without loading them"?

quiet ice
#

Just crawl through the plugins folder

#

A simple ZipInputStream should suffice

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quiet ice
#

I am afraid we cannot work with that

tender shard
#

why does EVERYONE ignore ?notworking today

#

yes, it's unfixable

#

because you do not answer our questions

warm light
tender shard
#

wouldnt it be easier to make people put their addons into your plugin's folder instead?

#

I mean, why do the addons for your plugins need to be bukkit plugins in the first place?

quiet ice
haughty granite
#

you have to send your code

#

and explain what you are trying to do

warm light
quaint mantle
quiet ice
haughty granite
#

uh

remote swallow
#

this is help dev

#

for development help

quiet ice
#

it is a bit weird to work with classloaders at first but ultimately very much possible

tender shard
remote swallow
#

whats you command code look like

tender shard
haughty granite
#

send the command you are trying to use

remote swallow
tender shard
#

and what is the problem? just spawn an ArmorStand, then add resistence in the consumer

myWorld.spawn(myLocation, ArmorStand.class, armorstand -> {
  armorStand.addPotionEffect(...);
}
remote swallow
#

are you actually making a plugin?

tender shard
#

is there even a resistence enchantment or attributemodifier?

remote swallow
#

dont think so

quaint mantle
remote swallow
tender shard
#

then why you are in the development channel

#

why don't you just ask on that plugin's discord

#

you asked in the itemedit channel

#

didnt you say the plugin is called itemtag?

#

there's literally two channels there:
1st Plugin
and
2nd Plugin

And you asked in the 1st Plugin channel "I need help with 2nd Plugin"

haughty granite
#

what is the problem with format.lastLogin?

rotund ravine
#

How would i know?

#

You didn't set it properly.

#

Wait

tender shard
#

SimpleDateFormat doesnt have a field called "lastLogin"

rotund ravine
#

You are just using it all improperly.

haughty granite
#

oh

rotund ravine
#

formater.format(lastLogin)

quaint mantle
haughty granite
tender shard
# quaint mantle

no clue. I always try to use both gradle and GH actions as few as possible, both are a pain

haughty granite
#

with player.getExp() to get the level you have to do what math operation?

hazy parrot
#

if you want level, use getLevel

haughty granite
#

less message more reading of the doc

#

thank goksi

tardy delta
#

plugin.logger? like cmon man

#

theres literally a getLogger method

rotund ravine
haughty granite
tender shard
rotund ravine
#

Oh, yeah that looks like java

tender shard
tardy delta
#

and whats with people not using Arrays.asList for lore

haughty granite
tender shard
#

I guess sth like this would do:

    public static int getXpLeftUntilNextLevel(Player player) {
        int currentLevel = player.getLevel();
        float currentLevelProgress = player.getExp();
        int xpRequiredFromCurrentLevelToNextLevel = com.jeff_media.jefflib.ExpUtils.getXPRequiredForNextLevel(currentLevel);
        int xpTheyAlreadyHaveInThisLevel = (int) (currentLevelProgress * xpRequiredFromCurrentLevelToNextLevel);
        return xpRequiredFromCurrentLevelToNextLevel - xpTheyAlreadyHaveInThisLevel;
    }
tender shard
#

I'd just upload your own gradlew file to github, then simply run the setup jdk action, then do run: gradlew build

tender shard
haughty granite
#

when I use player.getPlayerTime() to know my total playing time, is it the server that returns it to me or is it my local statistics?

tardy delta
#

server

#

what even is get player time

austere cove
#

how do I get all possible data values for an item in 1.8?

#

i hate legacy versions

austere cove
#

yes i know

#

#getMaxDurability() returns 0 for blocks, and some items (like potions) have inconsistent data values

rotund ravine
#

It's materialdata

#

shit

#

stuff like this

#

Idk much more

tender shard
tardy delta
#

what time are we talking about?

#

client time?

tender shard
#

yes

#

e.g. in angelchest you can have a per-graveyard local time, so for players it'll always be midnight when they enter your scariest graveyard, while the time runs normally on the server, and only for players inside that graveyard it looks like midnight

#

or you could use it to have monsters not burn in daylight

#

just set the server to night but the player time to day

#

it just sends a packet to the client "yo the current time is now XX"

#

iirc

#

Ugh why do people insist on hosting their own maven repo when its down 50% of the time

austere cove
rotund ravine
#

So old

tender shard
#

Yeah its pre 1.13

austere cove
#

yes :(

tender shard
#

It was already deprecated when i uploaded my first plugin 5 years ago lol

austere cove
#

i need it for a thing

tender shard
#

Which thing?

ancient plank
#

a thing

tender shard
haughty granite
#

when I click on my item in my gui menu, I want him to confirm in the chat his teleportation, how can I do?

#

TextComponent?

tardy delta
#

sent message and listen for chat event

#

or that

haughty granite
#

what is the best?

tender shard
#

create a command like "/mypluginconfirm". then send a Clickable component to them that runs this command

tardy delta
#

clicking on text component does not execute the command immediately :(

tender shard
#

basically you wanna have a Map<UUID, PendingData> where PendingData is a data class that holds all the information you need. then your commandexecutor does whatever it wanted to do in the first place, and clear the player from that map again

tender shard
#

only for chat messages, it doesnt

tardy delta
#

isnt there only SUGGEST_COMMAND?

haughty granite
#

I will try to find examples

tender shard
#

?jd-bc

tender shard
#

?jd-bcc

tender shard
#

RUN_COMMAND immediately runs it

tardy delta
#

oh never seen it

#

whats the class again? cant find it

#

md5 package ig

tender shard
#

net.md_5.bungee.api.chat.ClickEvent.Action

tardy delta
#

alr

tender shard
#

wasnt it always experimental?

heavy depot
#


import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class ItemBuilder {

    public static ItemStack createItem(Material material, int anzahl, int subid,boolean unbreakable, String displayname)
    {
        short neuesubid = (short)subid;
        ItemStack i = new ItemStack(material, anzahl, neuesubid);
        ItemMeta m = i.getItemMeta();
        m.spigot().setUnbreakable(true);
        m.setDisplayName(displayname);
        i.setItemMeta(m);

        return i;
    }
    public static ItemStack createItemWithID(int ID, int anzahl, int subid, String displayname)
    {
        short neuesubid = (short)subid;
        @SuppressWarnings("deprecation")
        ItemStack i = new ItemStack(ID, anzahl, neuesubid);
        ItemMeta m = i.getItemMeta();
        m.setDisplayName(displayname);
        i.setItemMeta(m);

        return i;
    }

} ````
#

I have an error with m.spigot

undone axleBOT
hybrid spoke
heavy depot
#

How do I fix the error now?

hybrid spoke
#

by not invoking a non existent method?

tender shard
#

do not call methods that dont exist

tender shard
#

doing someItemMeta.spigot() is like doing somePlayer.asdawizfawuwafawfkuawvf()

tawdry echo
#

That's gonna work tf

rough drift
#

Also, do note that in newer versions of java, if you have to use a switch statement you can just

return switch(thing) {
  case a -> object;
  case b -> {
    // processing
    yield object;
  }
}
#

yield is a special keyword in switch blocks to set the switch block's return type

#

If I am not mistaken, this can also be done with variable assigning

#

Do not get confused with Void, which is a class, sometimes used in generics as SomeClass<Void>

tender shard
#

yield is for things like this:

int value = switch (greeting) {
    case "hi" -> {
        System.out.println("I am not just yielding!");
        yield 1;
    }
    case "hello" -> {
        System.out.println("Me too.");
        yield 2;
    }
    default -> {
        System.out.println("OK");
        yield -1;
    }
};
rough drift
#

Note that a lot of other default types, such as boolean, int, double etc have their object counterparts to be used in generics, Boolean, Integer, Double etc

tender shard
#

it's the same as doing

int value = 0;
switch (greeting) {
    case "hi":
        System.out.println("I am not just yielding!");
        value = 1;
        break;
    

etc

rough drift
#

Just cleaner

tender shard
#

yeah

rough drift
#

Though alex one ting

#

the -> auto adds a break

#

you don't need one if you use ->

tender shard
#

oh yeah I meant to not use ->

rough drift
#

oh lol

tender shard
#

this is what I meant

rough drift
#

you still need brackets

tender shard
#

no

#

you can use brackets but dont need to

#

in this case they wouldnt do anything

rough drift
#

You're right

#

I forgot how that worked

tender shard
rough drift
#

Also, @haughty granite, very nice thing you probably might need:

label: {
  // Code inside this codeblock is special, if you use "break label;" you can return out of this block, leaving the rest of the function working normally

  System.out.println("Hello!");

  if(condition) break label;

  System.out.println("I will only print when condition is false!");
}

label can be named anything that's a valid variable name

tender shard
#

the { blocks } are needed if you wanna reuse local vars / redeclare them

rough drift
#

ah yeah

thin delta
#

Is there a way to make it where a player has no hitbox? Like you can shoot arrows through them?

tender shard
#

Np

thin delta
#

Another question... Can you remove the ability of flying for people in creative?

warm light
#

look like its not possible to add depend/soft after plugin is loaded.
then if my plguin's addon need another plugin to run, how can I handle it?

remote swallow
tardy delta
#

pdc

dim bluff
#

hey, I changed the config.yml file manually on intellij, added the arguments I'd like. But when I compile to the jar, the config.yml stays the same as before the changes, how can I debug that?
i tried:
-deleting the config folder
-messing with saveConfig()

remote swallow
#

wheres the config

icy beacon
#

saveDefaultConfig()?

tardy delta
#

you have to overwrite the old one in the plugins folder

icy beacon
#

yeah

#

and i think it's also getConfig().options().copyDefaults() or something

tardy delta
#

no

#

unless you set defaults

icy beacon
#

i have it in all like my plugins lol

icy beacon
#

yeah

#

yep

dim bluff
#

so

#

this final FileConfiguration is the edited config?

#

i'm doing that

#

onEnable =

  saveDefaultConfig();
tardy delta
#

saveDefaultConfig only saves a config.yml to the plugins folder if it wasnt there already

remote swallow
#

im only doing 2 projects atm

#

looks like its time to make a new library

dim bluff
#
List<String> nickList = plugin.getConfig().getStringList("FlyAccess");
  for (String nick: nickList){
    if (nick.equalsIgnoreCase(p.getDisplayName())){
      plugin.getConfig().set("FlyAccess",plugin.getConfig().getStringList("FlyAccess").add(p.getDisplayName()));
      plugin.saveConfig();
    }
  }

so it would be plugin.saveDefaultConfig() instead of saveConfig()?

tardy delta
#

why are you saving in a loop?

dim bluff
#

i tested after aswell

#

ok

tardy delta
tardy delta
#

what are you trying to do?

dim bluff
tardy delta
#

save it in the player pdc

#

?pdc

tardy delta
#

ig you were storing uuids before

dim bluff
#

?uuid

tardy delta
#

what

dim bluff
#

sorry

tardy delta
#

save it as a string

#

well

dim bluff
tardy delta
#

i mean store a boolean in the persistent data to indicate whether they have flight allowance or not

dim bluff
#

but I wanna know why this isn't working anyways

#

I mean, i'll need to use config at some point

tardy delta
#

why what isnt workin

#

what add

#

ah ye, but should rely on pdc

dim bluff
#

in that case i'm trying to make a list of players with fly access

#

oh sure

#

i'll fix that

warm light
#

look like its not possible to add depend/soft after plugin is loaded.
then if my plguin's addon need another plugin to run, how can I handle it?

#

it can be happend that dependency plugin will load after my plugin

tardy delta
#

just depend or soft depend on it, if soft depending, you can check whether its actually present

#

why is that whole stuff in the load block

tender shard
tardy delta
#

byte

tender shard
#

Yeah ik

tardy delta
#

takes the same size

#

jvm isnt even aware of the existence of booleans

#

just fancy number

#

i love wasting 7 bits

dim bluff
#

now i'm confused because that worked, but the config didn't change

warm light
#

Ahh, I can easily add soft/depend on my main plugin. but what if my addon need it?

eternal night
tardy delta
#

boolean takes a byte of memory

eternal night
#

yea ehm, you are not going to allocate a single bit ??

tardy delta
#

as the os does not support it yes

remote swallow
#

store a single binary

eternal night
#

so what the fuck would the JVM do

#

beyond offering you a shared pool of booleans

#

which, BitSet exists kekw

warm light
tardy delta
#

wat

remote swallow
#

depend on the main plugn

warm light
#

like one of my addon need Plugin A but its not in soft/depend on my main plugin

so it can be happend that Plugin A load after my main plugin.

remote swallow
#

make it depend on plugin a?

warm light
#

Plugin A is not my plugin. its random

remote swallow
#

make your plugin

warm light
#

like from other dev

remote swallow
#

depend on plugin a

tardy delta
#

love it how crunch does some of the exact same things as i do

#

without me even have looked at the code

warm light
# remote swallow make your plugin

Wait. let me fully explain.
so one of my addon need BedWars1058 plugin. but BedWars1058 is not in my main plugin's depend list.
so it can be happend that my plugin loaded fiirst. then BedWars1058

#

I can add that depend on my main plugin. but what if another person want to make an addon of my plugin that need another plugin as depend ?

chrome beacon
#

No good way around that

dim bluff
#

config.yml :

FlyAccess:
- Player

code:

 p.sendMessage(getConfig().getStringList("Admins").get(0));

output:

Player

My whole config doesn't make sense, or I'm messing something up very badly

tardy delta
#

i told you to use pdc

warm light
#

but the problem is, I have a different folder for addons & it needs to be loaded when my plugin get loaded. can't change this because, it store many data from addons then work with it on my main plugin

dim bluff
#

then i'll move to pdc

remote swallow
#

@chrome beacon can probably explain more

warm light
tardy delta
#

its simple, you just get a data type, create a key and map it to a value

dim bluff
tardy delta
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

#

spigot docs are shit

remote swallow
#

they are fine

unborn kiln
#

Is there a way to make multiple armor stands follow the same path as one armor stand but just farther back in the path? I want to make it so that one armor stand has vectors to follow a player but the rest of the armor stands will follow in the same path but behind it. (sorry for making this sound confusing, it's kinda hard to explain)

chrome beacon
dim bluff
humble tulip
chrome beacon
#

Which is why I said there isn't a good way around it

humble tulip
#

With JavaPlugin.getPlugin("name")

tardy delta
#

PluginManager#loadPlugin

humble tulip
#

Alternatively, you can just load dependencies 1 tick after startup

#

Which is worse imo

chrome beacon
#

๐Ÿ‘€

worldly ingot
#

Yep. Been around since forever

#

There's a disable one as well

chrome beacon
#

Didn't know that

tardy delta
#

looking through stash is fun

sterile token
#

Is there any player join and quit event for bungee?

dim bluff
sterile token
#

Right, but i have seen in bungee you cant get the proxied player directly, so without pp i cannot get their uuid

#

wait, maybe i added Velocity instead of Bungee

#

Yeah it was tho

#

PlayerDisconnectEvent is called only when left complete the proxy right?

#

ok, thanks morice

#

Yes i was meaning that

#

๐Ÿค”

#

What is that

#

Suddenly appeared on my idea projects folder

dim bluff
sterile token
#

Because there you getting the "Admins" list, but your config doesnt have any "Admins" list

#

๐Ÿค”

icy monolith
#

How do i kickd a player if they have texture packs disabled and kick if they declined it?

dim bluff
dim bluff
edgy crystal
#
    public void onJoin(PostLoginEvent event) throws InterruptedException {
        ProxiedPlayer player = (ProxiedPlayer) event.getPlayer();
        String uuid = player.getUniqueId().toString();
    }```
sterile token
edgy crystal
#

thats a mashallah code

#

bungeecord

icy monolith
#
    public void onResourcePackStatus(PlayerResourcePackStatusEvent event) {
        Player player = event.getPlayer();
        public void run() {
            switch (player.getResourcePackStatus()) {
                case DECLINED:
                    player.kickPlayer("You have been kicked for declining the texture pack.");
                    break; 
                case FAILED_DOWNLOAD:
                    player.kickPlayer("You have been kicked for failing to load the texture pack.");
                    break; 
                default:
                    break;
            }
        }
    }```

I do have one like that, but the issue here is that the second i join i get insta kicked. I have my texture packs enabled
sterile token
#

Its Bunge or Bungee? Im currently confused haha

icy monolith
#

so PlayerResourcePackStatusEvent.getStatus()?

#

ok

dim bluff
#

config yml

rough drift
#

In a player move event, is the player's location still the same while the event is executing? (So does player.getLocation().equals(event.getFrom()) return true?)

undone axleBOT
rough drift
#

I can't right now

#

that's why I asked

robust light
#

is it somehow possible to have more events in a single EventHandler?

rough drift
#

I would've otherwise lmao

rough drift
tardy delta
#

just heard that somewhere

rough drift
#

Yeah it does

sterile token
rough drift
#

Every second

tall dragon
#

every 20 ticks when the player is not actively moving

#

else every tick

rough drift
tardy delta
#

player location is event.getFrom() iirc

tall dragon
#

getFrom will probably not be equal

tardy delta
#

i forgot

tall dragon
#

hence u see anti cheat plugins teleporting people back

#

when illegal movements are made

sterile token
#

yes you are right Epic

mortal hare
#

has anyone tried to create custom vanilla glsl shaders here?

rough drift
#

check on the minecraft commands discord

#

they got a ton of resources there

icy monolith
#

It worked for people that decline it, but people that have set there texture pack to disabled in server list dont get kicked. This might be that they dont even activate the event, but idk

#

Maybe i should tp all to black box and if they accept cuz thats the only thing i can confirm properly. And then i tp them to spawn

torpid blaze
#

Hey, Can enyone tell my why I get a java.util.ConcurrentModificationException when calling the refreshAllScoreboards() Method?

public class StatsScoreboard {

    private Scoreboard scoreboard;
    private Objective objective;

    public void refreshScoreboard(Player player){
        MapList mapList = new MapList();
        Map map = mapList.getByPlayer(player.getUniqueId());

        this.scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();

        for (Team team : Bukkit.getScoreboardManager().getMainScoreboard().getTeams()){
            Team tm = player.getScoreboard().registerNewTeam(team.getName());
            tm.setSuffix(team.getSuffix());
            tm.setAllowFriendlyFire(team.allowFriendlyFire());
            team.getEntries().forEach(e -> tm.addEntry(e));
        }

        if (scoreboard.getObjective("stats") != null) {
            scoreboard.getObjective("stats").unregister();
        }

        this.objective = this.scoreboard.registerNewObjective("stats", "stats", ChatColor.GREEN + "" + ChatColor.BOLD + "  Stickfight   ");
        this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);

        int index = 0;
        ArrayList<MapPlayer> pls = map.getPlayers();
        Collections.sort(pls, new Comparator<MapPlayer>() {
            @Override
            public int compare(MapPlayer o1, MapPlayer o2) {
                double kd1 = (o1.getDeaths() != 0 ? ((double)o1.getKills()/(double)o1.getDeaths()) : o1.getKills());
                double kd2 = (o1.getDeaths() != 0 ? ((double)o1.getKills()/(double)o1.getDeaths()) : o1.getKills());
                return kd1 < kd2 ? 1 : -1;
            }
        });
#
for(MapPlayer pl : map.getPlayers()){
            this.objective.getScore((pl.getUuid() == player.getUniqueId() ? (ChatColor.DARK_PURPLE + "" + ChatColor.BOLD) : ChatColor.LIGHT_PURPLE) + Bukkit.getOfflinePlayer(pl.getUuid()).getName() + "  " + ChatColor.GRAY + (pl.getDeaths() != 0 ? String.format("%.2f", (double)pl.getKills() / (double)pl.getDeaths()) : (double)pl.getKills())).setScore(index);
            index ++;
        }

        this.objective.getScore(ChatColor.BLACK + "  ").setScore(index + 4);
        this.objective.getScore(ChatColor.WHITE + "Map: ").setScore(index + 3);
        this.objective.getScore(ChatColor.YELLOW + map.getName()).setScore(index + 2);
        this.objective.getScore(ChatColor.BLACK + " ").setScore(index + 1);
        this.objective.getScore(ChatColor.WHITE + "K/Ds: ").setScore(index);

        player.setScoreboard(scoreboard);
    }

    public void refreshAllScoreboards(int mapId){
        MapList mapList = new MapList();
        Map map = mapList.getById(mapId);

        if(map == null)
            return;

        try{
            for(MapPlayer pl : map.getPlayers()){
                if (Bukkit.getOfflinePlayer(pl.getUuid()).isOnline())
                    refreshScoreboard(Bukkit.getPlayer(pl.getUuid()));
            }
        }catch (Exception e){
            System.out.println(e);
        }
    }

    public void removeScoreboard(Player player){
        player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());

        for (Team team : Bukkit.getScoreboardManager().getMainScoreboard().getTeams()){
            Team tm = player.getScoreboard().registerNewTeam(team.getName());
            tm.setSuffix(team.getSuffix());
            tm.setAllowFriendlyFire(team.allowFriendlyFire());
            team.getEntries().forEach(e -> tm.addEntry(e));
        }
    }
}

sterile token
#

?paste

undone axleBOT
twin venture
#

anyone know how i could fix this problem? i know i need to add mysql library to my plugin , but i dont want to add it directly , my plugin size will increase rapidly .
RuntimeException: java.lang.ClassNotFoundException : com.mysql.cj.jdbc.Driver

eternal night
#

spigot ships and older mysql driver iirc

#

or well, older version would ship older ones

#

what version of spigot are you using

sterile token
sterile token
twin venture
#

my plugin version is 1.8.8 , but i added support for all newer version

eternal night
twin venture
#

yeah

eternal night
#

?1.8

undone axleBOT
twin venture
#

i know

sterile token
#

1.8 ๐Ÿ’€๐Ÿคก

eternal night
#

but yea, 1.8 does not have that feature

twin venture
#

please don't

sterile token
#

Yes

twin venture
#

yes

#

i understand , and know really .

sterile token
#

So definitly best option is use a library for custom dependnecy loading

twin venture
#

thank you i will look into it ๐Ÿ˜„

sterile token
#

Right if need else just ask

#

And sorry for 1.8 i was being stupid because im 1.8 dev so i understand you. But now i only looking for 1.16+ comissions

twin venture
#

i just use it , i know its very old , i just don't really need all the new minecraft / bukkit features in the newest version 1.12.2+ for the plugin iam devoloping .

serene sigil
#

how do you make an end world (i know that part already) that has no ender dragon?

pseudo hazel
#

kill it? xD

torpid blaze
heady hamlet
#

Create and apply NBT tags to an item.
How to create your own NBT tags and apply them to custom items that are created through the ItemStack? And also how to apply them? For example, I want to create a tag in which it will be possible to enter a string value and with it I can issue an item using a command on the server. Version 1.8.9
I must say right away that I searched the Internet for guides, but I did not find a suitable one ๐Ÿ˜ฆ
Ping me please

sterile token
#

?1.8

undone axleBOT
sterile token
#

I would suggest moving out from legacy versions, your best option is to code 1.16 up

#

Because mostly people here only code on newer versions and you wont get much support as working with newer versions

heady hamlet
#

I like her for pvp

river oracle
#

Pvp pluginsss

heady hamlet
river oracle
#

Yes yes uwu

sterile token
#

So if you dont use newer versions u cant expect to get much support, cuz a few ppl use legacy versions

#

๐Ÿ‘

remote swallow
#

anyone thats used bstats know why this for some reason doesnt send any data for the storageType```java
private void setupBstats() {
Metrics metrics = new Metrics(this, BSTATS_ID);
metrics.addCustomChart(new SimplePie("onlineMode", ServerUtils::getMode));
metrics.addCustomChart(new SimplePie("storageType", this::getStorageType));
}

private String getStorageType() {
    return storageType;
}
dry yacht
sterile token
#

Oh yeah, that why you must use newer versions ๐Ÿ˜‚

serene sigil
#

if (event.getPlayer().getWorld().getEnderDragonBattle().getEnderDragon() != null)
event.getPlayer().getWorld().getEnderDragonBattle().getEnderDragon().damage(1000);

regal scaffold
#

How would I do it if I wanted to send a message when a player joins on a specific server which is connected to bungee but I can set what the message is in a single bungeeconfig depending on what server I want the message to be sent on.

Like:

BungeePlugin: Config has server list/messages to display

SpigotPlugin: Just listens for event and then communicates with bungee to display the message?

remote swallow
#

plugin messaging channels iirc

regal scaffold
#

Thanks ebic will look into it. Just finishing some stuff here before I continue

dry yacht
sterile token
# dry yacht Go live on in your little dream world, :).

I don't know why people find it so hard to understand that using legacy versions is worse for them, because it makes programming much more complicated. Since as the versions advance the apis are getting better and better. But they always said to me, every master has his own little book.

serene sigil
#

how to make a player join a different world when joining? (do i use PlayerJoinEvent or PlayerLoginEvent?)

lost matrix
remote swallow
#

7smile7 appears after like 3 months

lost matrix
#

Semester is over :)

remote swallow
#

party

lost matrix
#

Not quite. Still have one more exam and then i start with my thesis PES_Yikes

serene sigil
#

i have another question: how exactly does Player#hasPlayedBefore work? in the docs it just says that it returns true when he had played, but how does it know that and can i modify it?

lost matrix
#

This is saved in the players data file. On default its in the main world folder.

serene sigil
#

in playerdata?

lost matrix
#

\server\world\playerdata\<UUID>.dat

serene sigil
#

oh, ok thx!

#

and if i delete one will it also like delete all player data?

lost matrix
#

Yes

serene sigil
#

i see

lost matrix
# serene sigil i see

Whats your overall goal? Maybe you shouldnt rely on "hasPlayedBefore()" if you need to delete the playerdat file

lost matrix
serene sigil
#

my overall goal is that when a player first joins a server, they spawn in a void-type world where they have to type in chat what world they want to be on (its a little more complicated, but basically a player only spawns in that world when they join the first time)

lost matrix
remote swallow
#

chart exists on the page, no idea what you mean by the 2nd one, and its been like 45 min since i restarted to add it

#

oh wait

#

my brain just brained

#

ill add a sysout now

serene sigil
lost matrix
serene sigil
#

alr

echo basalt
#

haven't seen 7smile7 in like months

#

miss you man

torpid blaze
#

?paste

undone axleBOT
torpid blaze
lost matrix
torpid blaze
#

I don't know where I am doing it

#

I could not find anything

dry yacht
# sterile token I don't know why people find it so hard to understand that using legacy versions...

I don't have a hard time understanding it at all. If it makes your codebase so much more complicated to add support for older versions, your codebase is structured poorly in the first place. I know from my own experience that you can support the majority of features plugins nowadays bring to the table on 1.8-present with ease, as long as you know how to abstract properly and don't just throw that buzz-term around to act like you do.

It's all about the principle for me. These versions exist, and if I choose to want to support them, I will. Every plugin-developer is free to choose. But when you guys start to suffocate that free will, I'm just not going to watch silently. But again: None of us is going to change their opponent, that's for sure, :).

dry yacht
lost matrix
#

several things in fact

        }catch (Exception e){
            System.out.println(e);
        }

->

        } catch (Exception e) {
            e.printStackTrace();
        }

For once

echo basalt
remote swallow
#

i add the sout, and it gives the data

#

im gonna scream

naive bolt
torpid blaze
echo basalt
#

I don't mind supporting old versions, but the newer APIs are a lot easier to work with because it just had a lot more development time

torpid blaze
#

I didn't want the try catch at all

quiet ice
dry yacht
naive bolt
#
                Structure s = CopyBuild.clipBoard.get(player.getUniqueId());
                HashMap<Vector, BlockData> blocks =  CopyBuild.clipBoard.get(player.getUniqueId()).getBlocks();

                for(Map.Entry<Vector, BlockData> vector : s.getBlocks().entrySet()){
                    int new_x = -vector.getKey().getBlockZ();
                    int new_y = vector.getKey().getBlockY();
                    int new_z = vector.getKey().getBlockX();
                    Vector newVector = new Vector(new_x, new_y, new_z);
                    BlockData blockData = blocks.get(vector.getKey());
                    blocks.remove(vector.getKey());
                    blocks.put(newVector, blockData);
                }
lost matrix
echo basalt
#

If it's all a choice why are you here, advising people? It's their choice if their code is bad or not

torpid blaze
#

ok

quiet ice
buoyant viper
quiet ice
#

Hence either use ConcurrentHashMaps or use a helper collection where you store your changes until you apply them on the main map

dry yacht
echo basalt
#

?howoldis1.8

#

?1.8

undone axleBOT
echo basalt
#

idk the command

#

we're not here to call each other stupid

lost matrix
# quiet ice if possible, use ConcurrentHashMap

Depending on the size of the collection it might be a better idea to copy the entry set into an immutable list.
So

for(Map.Entry<Vector, BlockData> vector : s.getBlocks().entrySet()){

->

for(Map.Entry<Vector, BlockData> vector : List.copyOf(s.getBlocks().entrySet())) {

Often yields a better performance than concurrent maps

remote swallow
echo basalt
#

We're here to talk about benefits of updating, or how dumb it is not to

dry yacht
echo basalt
#

If someone wants to use 1.8, and they have a valid reason, they're still worthy of being helped

echo basalt
#

I swear this argument is stupid asf

lost matrix
quiet ice
#

Thus avoiding your CME

naive bolt
#

stupid intelij wouldnt import it for a second

quiet ice
#

List#copyOf is J10+

#

Just use new ArrayList<>(X)

lost matrix
#

Before that you can use ^

dry yacht
# echo basalt I swear this argument is stupid asf

Because you don't care about what I care about. That's fine! :) Different people are going to value different things.

Calling ?1.8 when somebody wants to operate on 1.8 is still disrespectful and provocative.

crimson relic
#

?1.8

undone axleBOT
sterile token
#

?1.8

undone axleBOT
echo basalt
#

?1.8

undone axleBOT
echo basalt
quiet ice
#

Oh god, spigot is degenerating too much these days...

dry yacht
quiet ice
#

Perhaps it always was degenerated

dry yacht
#

Stupidity always shows in the end.

echo basalt
#

mans too philosophical

remote swallow
echo basalt
#

you really love the clown

torpid blaze
#

?paste

undone axleBOT
echo basalt
remote swallow
torpid blaze
quiet ice
#

Just use CopyOnWriteArrayList \s

lost matrix
lost matrix
quiet ice
#

Yeah

lost matrix
#

ok ^^

quiet ice
#

I mean, COW ArrayList works, but probably not ideal

lost matrix
#

XD yes

echo basalt
#

I mean... lobby servers can be lightweight if you just want to slap existing plugins and not bother about switching to third-party server software

quiet ice
#

But I don't know the code so ยฏ_(ใƒ„)_/ยฏ

echo basalt
#

and you don't care about new stuff

echo basalt
#

What if I made a translation layer for bukkit ๐Ÿค”

#

so that spigot plugins can run

quiet ice
#

Those always fail in the end

chrome beacon
#

Yeah

quiet ice
#

I would support such an effort - sure but I don't think that will work in the long run

echo basalt
#

I mean

#

better than nothing

quiet ice
#

Especially since Minestom has no longer any Mixin support

lost matrix
quiet ice
#

I really liked their Classloading system - as broken as it was

torpid blaze
#

in refreshAllScoreboards

#

for(MapPlayer pl : map.getPlayers())

lost matrix
# torpid blaze the for loop

Alright then

for(MapPlayer pl : map.getPlayers()){

->

for(MapPlayer pl : List.copyOf(map.getPlayers())) {

Will fix it without me rambling about this code structure and how you could design it more robust...

quiet ice
#

Yeah, I'd use COW for that

#

But copyOf works, albeit being the opposite of COW

lost matrix
#

Where does MapList even come from?

#

And why is there a Map with raw types?

torpid blaze
#

A Costum List of a costum Object

#

Map is a costum Object

quiet ice
#

It's spelt "custom" for reference

torpid blaze
crimson relic
#

my code

opal juniper
#

*code

#

all code

crimson relic
#

mojang code*

echo basalt
#

*e

quiet ice
#

error: Does not compute.

quiet ice
#

I probably can develop a Good, Cheap and Fast product.

#

Just give me a few years for that

echo basalt
#

me doing 5$ commissions because I ordered dessert with my pizza

lost matrix
#

lul

echo basalt
#

I think my quickest 5$ commission was done in 12 minutes

quiet ice
#

damn, an hourly wage of 60$. That is good

slow oyster
#

Anyone know how to turn on log levels above INFO in Spigot?

twilit roost
#

how can I hide someone from displaying in Players TABList?

echo basalt
#

that's not an hourly wage of 60$

quiet ice
#

Well still below industry standard, but still decent

echo basalt
#

it's more the opposite

opal juniper
quiet ice
echo basalt
#

my standard is like 20$/hr cry_2

#

I'm gonna get a raise in like 2 weeks but still

lost matrix
echo basalt
#

I just can't bother importing stuff

#

and writing code nowadays

quiet ice
#

I did 5 * (60 / 5) = 60. Not sure where the 12 went

echo basalt
#

my UI lib is like writing stuff in MS-paint

echo basalt
#

5 * 12 = 60

#

yeah it sums up to 25/hr

#

my damn pizza has been sitting for like 15 minutes wtf is this

river oracle
#

The pizza is awake

echo basalt
#

idk why I'm ordering pizza again, they ran out of nice dough yesterday and the replacement italian dough gave me food poisoning last night

quiet ice
#

not good

echo basalt
#

imma do it again

opal juniper
#

i love when people use my software in a completely unsupported environment and tell me it isn't working and that i need to fix it asap

quiet ice
#

Ah, could be me

lost matrix
#

Im so tempted to try tackling an rpg server again after mojang announced those...

quiet ice
#

Alternatively be like sponge and say that everything is working as intended

remote swallow
#

whos the first plugin to remove the netherite upgrade one

river oracle
#

Me

quiet ice
#

Honestly, 1.18 is the last decent minecraft version

echo basalt
#

we should make a plugin that it literally only lets you use old features of the game

quiet ice
#

After that it is just a downwards spiral

echo basalt
#

like OldCombatMechanics but it applies everywhere

#

the new blocks are disabled

#

just because

quiet ice
#

Viaversion be like:

remote swallow
#

forcefully remove them from the game

echo basalt
#

viaversion is a packet translator

#

I mean like

#

1.19 performance but with 1.5 features

river oracle
#

Lol

lost matrix
river oracle
quiet ice
#

There is little need for 1.16.5 imo

twilit roost
#

any clues what Player#hidePlayer or Player#showPlayer does?
It does nothing to me..

quiet ice
#

1.18 has all but replaced it

wet breach
river oracle
#

Only 2 divides I know of are 1.8 | the decent humans

sterile token
quiet ice
#

1.12 is considered "decent" to you???

twilit roost
quaint mantle
lost matrix
wet breach
#

ah ok

echo basalt
#

quest systems are very peculiar

#

It's like you have active stuff and passive stuff

#

active stuff be like

#

kill 25 enemies in the span of 3 seconds

#

where you gotta track multiple stuff

#

like how many enemies, in how much time

#

I guess active is not the right term but whatev

wet breach
#

well with scoreboards you can easily have quests being tracked displayed

echo basalt
#

there's also just those that are like

#

"click 5 times"

#

I guess what would be ideal is more of an Objective system

#

with an ObjectiveType enum where each value has a trigger type deal

#

and then like... some criteria for time or place

#

I'd call it Restriction maybe

mortal hare
#

woah opengl is so cool ngl

echo basalt
#

I guess that's the right think

#

restrictions act as filters

remote swallow
#

i need a gif that i can send for pdc

opal juniper
remote swallow
#

that just smacks a postit on someone

echo basalt
#

once all filters pass, you can add progress towards the objective or something

lost matrix
#

This was a system i wrote for a server last year. I whish i would have mad it scriptable but it was more than enough for their needs.

echo basalt
remote swallow
#

smackig postit

mortal hare
#

its sounds so difficult but its only an api, the difficult part is the math equations

buoyant viper
#

click 6300 times in 5 minutes

mortal hare
#

nvm

#

that's just a builder with a hardcoded strings

#

reasonable enough

lost matrix
# mortal hare woah this is hardcoded

Sure but there was also a quest generator which could use the builder to dynamically generat daylies.
And the strings are hardcoded because translation was not by job ^^

mortal hare
#

you just demonstrated an example why java is so much hated

#

๐Ÿ˜„

#

too much boilerplate, but its so readable

#

i prefer writing more than not understand it at all

buoyant viper
#

thats kotlin without a Doubt duke

opal juniper
#

my teacher cant read java so i have to describe my work to him

echo basalt
#

oh god not java vs kotlin again

buoyant viper
#

java is fun until u use generics

echo basalt
#

unsafe

mortal hare
#

pointers

#

references

#

seg faults

buoyant viper
#

personally i __fastcall all my methods

lost matrix
#

When valhalla comes i will be fine with javas generics (probably)

mortal hare
echo basalt
#

they overcomplicate so much and just remove em on compile

mortal hare
#

best one i've ever watched

quiet ice
#

The second favourite is the UnsafeValues

twilit roost
#

Even tho I executed Player#hidePlayer for every player
I still can see other players in TabList

API Version: 1.8.8

buoyant viper
#

CraftMagicNumbers

quiet ice
#

After that it probably is DataOutputStream

opal juniper
#

๐Ÿ’€

echo basalt
#

that's not a problem in 1.19 skullWazowski

quiet ice
echo basalt
#

my fav nms class is probably uhh

mortal hare
echo basalt
#

entity? idk

buoyant viper
#

mines EntityPlayer

lost matrix
buoyant viper
#

or ServerPlayer whatever it is now

mortal hare
#

yeah i hate build systems of c/c++

#

its so raw

quiet ice
#

they are absolute dogshit compared to maven or let alone gradle

naive bolt
#

how do i actualy rotate a block not just its position

opal juniper
lost matrix
#

Thats why i switched from c++ to Rust for my low level/high performance projects. Cargo is a gift.

lost matrix
buoyant viper
twilit roost
#

ig

quiet ice
#

Or well maven can do everything but the IDEs refuse to accept that

buoyant viper
#

can it fix my broken marriage?

sterile token
#

I need some help to design my command framwork tab completation. I was planning something like this, but im not really sure how to code it tho:

List<Command> commands = getCommands().stream().filter(sender::hasPermission).toList();
Completer completer = new Completer();
completer.register(0, commands.stream().map(Command::getName()).toList());
completer.complete(args);
quiet ice
buoyant viper
sterile token
buoyant viper
#

or done within one stream at least idk

mortal hare
#

are vertex calculations being done on the cpu or the gpu

buoyant viper
mortal hare
#

ik fragment shaders fills the polygons with color

lost matrix
# naive bolt how do i actualy rotate a block not just its position

Could be something like this

  public void orientBlock(Block orientableBlock, Axis axis) {
    BlockData orientableData = orientableBlock.getBlockData();
    if(!(orientableData instanceof Orientable orientable)) {
      throw new IllegalArgumentException("Only apply this method on orientables");
    }
    orientable.setAxis(axis);
    orientableBlock.setBlockData(orientable);
  }

But its been a while. Could be Directional as well.

quiet ice
swift lark
#

Hey, does anyone know a way to check if a player is touching a certain block sideways?

lost matrix
#

What do you mean by certain block? A Unique block or a type of block?

naive bolt
swift lark
#

type of block

naive bolt
#

and if it should work or not

swift lark
#

Do you know csgo surf? i want to make that a gamemode but with honeyblocks