#help-development

1 messages · Page 1990 of 1

sterile token
#

scratch?

#

lmaoo

#

Who uses scratch?

#

Wasnt it a game?

viral crag
#

its not talking about the scratch language

mellow gulch
#

doesn't matter what language tutorials use, just read the concepts and port to java

sterile token
#

I would love to learn Networking with Netty

#

But doesnt looks simply

grim ice
#

ok it seems too hard for me

viral crag
#

its mostly just IPC

grim ice
#

dont get it

mellow gulch
grim ice
#

well it makes sense why do they teach that in un

#

okay

#

ill try that

mellow gulch
#

he uses a library called ml5, so you'd probably need to find a comarable library or look at its source and port it to java, or just follow along with the concepts and write your own stuff

viral crag
#

ANN are heavily used these days for general problem solving, universities get contracted and funded to do a lot of number crunching and modeling of data

daring lark
#

`private void joinPoliceCommand(Player commandSender) {
UUID playerID = commandSender.getUniqueId();
if(roleManager.isPlayerCriminalMember(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą");
return;
}
if(roleManager.isPlayerPoliceman(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "jesteś już policjantem.");
return;
}
roleManager.addPlayerToPolice(playerID);
commandSender.sendMessage(ChatColor.GREEN + "Zostałeś policjantem.");
}

private void joinCriminalsCommand(Player commandSender) {
    UUID playerID = commandSender.getUniqueId();
    if(roleManager.isPlayerCriminalMember(playerID)) {
        commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą");
        return;
    }
    if(roleManager.isPlayerPoliceman(playerID)) {
        commandSender.sendMessage(ChatColor.GREEN + "jesteś już policjantem.");
        return;
    }
    roleManager.addPlayerToCriminals(playerID);
    commandSender.sendMessage(ChatColor.GREEN + "Zostałeś kryminalistą.");
}`

why when i'm typing /police join it's checking if i'm police but not if i'm criminal but if i type /criminal join it's checking if i'm criminal but not if i'm police. I have no idea what is wrong with this code. btw first time i wasn't using return but i was just checking different options.

tall dragon
#

first off please format it by enclosing with 3 `

daring lark
#

how?

tall dragon
#

place 3 on each side of your code

mellow gulch
#

``` java
code here
```

tall dragon
#

yw

viral crag
#

why would you assign them to the role after checking for it? you end by assigning them to the role you are running - interesting idea that way

daring lark
#

i was checking different optios. First it was all in if statements

#
       UUID playerID = commandSender.getUniqueId();
        if(!roleManager.isPlayerPoliceman(playerID)) {
            if(!roleManager.isPlayerCriminalMember(playerID)) {
                roleManager.addPlayerToPolice(playerID);
                commandSender.sendMessage(ChatColor.GREEN + "Zostałeś policjantem.");
            } else {
                commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą.");
            }
        } else {
            commandSender.sendMessage(ChatColor.GREEN + "Jesteś już policjantem.");
        }
    }

    private void joinCriminalsCommand(Player commandSender) {
        UUID playerID = commandSender.getUniqueId();
        if(!roleManager.isPlayerPoliceman(playerID)) {
            if(!roleManager.isPlayerCriminalMember(playerID)) {
                roleManager.addPlayerToCriminals(playerID);
                commandSender.sendMessage(ChatColor.GREEN + "Zostałeś kryminalistą.");
            } else {
                commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą.");
            }
        } else {
            commandSender.sendMessage(ChatColor.GREEN + "Jesteś już policjantem.");
        }
    }```

now i changed to sth like this.
#

how?!?!?!?

mellow gulch
tall dragon
#

you used 2

#

instead of 3

#

nvm

mellow gulch
#

after the first ``` you can say the language and discord will do syntax hilighting

undone axleBOT
sterile token
#

What its your issue?

mellow gulch
#

not mine, i was trying to teach Placek how to do code formatting

sterile token
#

But he still didnt understand the issue

#

Its really fun

#

Hahaha

viral crag
# sterile token What its your issue?

hy when i'm typing /police join it's checking if i'm police but not if i'm criminal but if i type /criminal join it's checking if i'm criminal but not if i'm police. I have no idea what is wrong with this code. btw first time i wasn't using return but i was just checking different options. (edited)
is their issue

#

if they want to use a negative it will never get to the second check as it is inside

mellow gulch
#

@daring lark ^^

quaint mantle
#

Is there anyone who can update plugins to work on the latest version of minecraft or could teach me how too?

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

sterile token
#

player#spigot()#getLocale() return the player language if im not wrong?

#

And what about if player has texture?

#

Im doing a sort of custom api for sending player messages with his lang

#

I read that texture packs can interfeer with that¿?

sterile token
#

Let say if you are english the messages from server are sent in English, if you are spanish they get sent on spanish understood?

#

He?

#

Wait wait

viral crag
sterile token
#

player#spigot()#getLocale() this return the client (minecraft client, the one you set)

#

No your computer lang

#

Who uses chineses language=

#

Btw

viral crag
#

take cyrillic, it will only show in cyrillic if the client has that set, it does not matter if their locale says they are polish

sterile token
#

what the hex is cyrilic?

viral crag
#

if they use UTF, they will get the englishifiedversion of the cyrillic if you have a locale version for it

sterile token
#

Translator say that "Cyrillic" its "cirílico"

#

Oh ok

#

That why translator wasnt working

viral crag
#

"russian" alphabet is cyrillic

sterile token
#

I was wondering to make an api which get your mc-client language. And then check if the lang file exists and then ge tthe messages

#

Allright thanks

#

Changing the context

#

TextComponent doesnt support colors?

#

I tried sending one which contains "&fHi message" from Spigot api and get an exception

#

Oh ok

#

But its possible to use &color-code?

viral crag
sterile token
#

Decide lamo

#

you said Basecomponets, ComponentBuilder and now fromLegacyText

#

I dont understand....

#

i dont wanna set one color

#

I want to have multiple colors on a message

#

I dont want to use ChatColor.Color-Name

#

I just want to use: "&cMy color, &fother color"

#

Im using this:

public String style(String input) { return ChatColor.translateAlternateColorCodes('&', input); }
hasty prawn
#

Whats wrong with that

sterile token
#

Wait i will send my code (component) im sending

#

If not it a mess for asking help

#
TextComponent component = new TextComponent(Chat.style("&6Testing component"));
        component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Chat.style("&3Click to run command")).create()));
        component.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/say executed a command"));
#

That what im sending and getting an exception

#

What diff?

#

Oh ok

#

Why baseComponent?

#

My goal its to be able to show hover messages and execute command/open url

#

Yes i know that

#

because the compoents

#

Make me confuse

#

TextComponent, LegacyComponent, BaseComponent

#

Im too confused

#

Auh now i understand

#

I didnt know BungeeCord repo was stil lalive

#

Last time i join it was down

shy coral
#

How does one decompile SpigotMC without maven compile issues.

cursive crow
#

is it possible to give a zombie the "break doors" ability without using nms?

#

i searched how to do it and all the posts mention nms, but they're from years ago

hexed hatch
#

weirdly, it seems the answer to that question is no

#

that's such a simple thing for the api to cover yet it doesn't

#

make a feature request for that

sterile token
#

I had made a feature request to add cross-server message system without using player instance . But they rejected

young knoll
#

Are there any tutorials to create those fancy UI info bars with resource packs

#

Instead of this boring display

young knoll
#

Define animated

sterile token
#

You can do animations

young knoll
#

Yeah you probably could animate them

sterile token
#

Yeah

young knoll
#

But I just want a basic dynamic ui bar

sterile token
#

So wha tthe problem?

young knoll
#

Like the hunger bar

sterile token
#

Hmn i dont understand

shy coral
#

you can make a scoreboard

young knoll
#

I am looking for a tutorial to make a custom stat bar using resource packs

sterile token
young knoll
#

I was searching spigot only, which was my issue

shy coral
#

is there a tutorial out there for setting up a decompiled workspace for spigot?

sterile token
#

Why do you want to decompile spigot? You can access to the source-code via Build Tools

shy coral
#

like old mcp let you see the source code for the server jar file, but after leaving for over 2 years they stopped developing mcp and maven build for spigot is broken for me

young knoll
#

Run buildtools and maven will work

shy coral
#

I tried

sterile token
shy coral
#

it doesnt though for me

young knoll
#

Then IntelliJ will let you look at the source

#

It should

sterile token
#

It should work

young knoll
#

As long as you run buildtools for the right version

#

And have mavenLocal as a repository

sterile token
#

Because BuildTools maven and Intellij maven are different instances let say

shy coral
#

I tried the maven dependencies that are erroring out are

`<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.20</version>

<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.45.1</version>

<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>

<configuration>
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>`

sterile token
#

Idk where that from

shy coral
#

the pom file

#

pom.xml

sterile token
#

Hmn where that from?

#

Build Tools?

shy coral
#

spigot folder

#

Spigot\Spigot-Server

hybrid spoke
sterile token
#

Idk i use BuildTools and it auto build the spigot-api, spigot-jar dependencies

hybrid spoke
#

would y'all understand whats happening by the javadocs?
its a yes or no question

sterile token
#

And where your code came from...

#

It doesnt make sense

shy coral
#

I just ran build tools and went to the Spigot\Spigot-Server folder that is made

#

in intellij

sterile token
#

You shouldnt do that

#

When you run build tools, it will automatically do all stuff

#

You dont need to compile manually

shy coral
#

I want to modify the server code

#

and not make a plugin

sterile token
#

Oh you want to fork spigot

#

Let say

hybrid spoke
sterile token
hybrid spoke
#

just like from the beginning on

sterile token
shy coral
#

yes, or bukkit

#

if I can I wanna do vanilla

sterile token
#

So you cannot get your project compile?

shy coral
#

but I cant find any sources on how to do so with vanilla

#

no

sterile token
#

What your idea?

#

Explain please

#

Im confuse between vanilla and what you wondering to do

shy coral
#

just modifying entity ai and stuff

#

if the old mcp would work I wouldnt be asking this. old mcp was easier to get things done imo.

sterile token
#

Wait

#

Mcpe and Spigot arent diff things?

#

I think that Spigot its for Java edition minecraft

#

Idk i never understand that Mcpe that many talks

shy coral
#

yes, old mcp was discontinued I just want to modify the server jar file idc if I have to do it with spigot or vanilla, just that I can do it

#

it has be a pain to do since the old mcp was discontinued because there is no tutorials or anything

sterile token
#

So dont use it if it discontinued?

shy coral
#

so I went to spigot

#

and there is errors in the maven project pom file

#

so I cant compile or even run the code

sterile token
#

Allright, but i dont think spigot is designed to do Mcpe servers

shy coral
#

no just mcp

#

minecraft coder pack

sterile token
#

What IDE are you using?

shy coral
#

intellij

sterile token
#

Do you have maven?

shy coral
#

yes

sterile token
#

Allright you cant compile it?

shy coral
#

yes or run it

sterile token
#

How are you doing it?

shy coral
#

run build tools then go into the folder that is created called Spigot/Spigot-Server

#

I tried craftbukkit folder also

#

and same issue with invalid maven pom file dependencies

sterile token
#

So first go to the folder you want to edit, and them right click open as project

#

And intellij will open it

abstract sleet
sterile token
abstract sleet
#

nope, couldn't find any mention of 'bungee' on the Wiki page nor the readme

sterile token
#

So prob try it

#

And if it doesnt work. It because its not supported

abstract sleet
#

I guess it's worth a shot. @sullen marlin, I think this should be clarified in the docs :)

#

@shy coral if you're having issues with maven maybe try invalidate cache or something

sterile token
abstract sleet
#

it's in the org.bukkit package :concerned:

#

whatever

sterile token
abstract sleet
#

The annotations are within the org.bukkit package.

shy coral
#

still no help with

`
<Implementation-Version>${describe}</Implementation-Version>
<Implementation-Vendor>${project.build.outputTimestamp}</Implementation-Vendor>
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>com.puppycrawl.tools</groupId>
<groupId>org.codehaus.mojo</groupId>

`

#

it gave me errors on describe and project.build.outputTimestamp (they do not have the "*"s

#

rest of the pom file is fine just those

#

I am literally pulling hair out because I never had this issue with working with the old minecraft coder pack modifying the source code for the server jar file

abstract sleet
fossil lily
#

How can I cancel knockback without canceling damage? I tried to set a vector to 0, but it didnt work :(

public class TrainingDummy implements Listener {
    @EventHandler
    public void onDamage(EntityDamageByEntityEvent e) {
        Entity entity = e.getEntity();
        String uuid = entity.getUniqueId().toString();
        if (uuid.equals("9152680c-4d5b-2a84-acff-26d704f725fe")){
            Vector v = new Vector(0, 0, 0);
            entity.setVelocity(v);
        }
    }
}
shy coral
#

which forum should I post it in spigot help?

paper viper
fossil lily
#

thanks

paper viper
#

Yeah

#

e.getDamage

fossil lily
young knoll
#

You could also probably set the velocity to 0 1 tick later

fossil lily
lavish hemlock
#

Do I use the Chat API ChatColor or standard Bukkit ChatColor...?

#

I remember hearing that you shouldn't use one in Spigot/Bungee or whatever

#

Just trying to remember

vocal cloud
#

Bungee one is really nice

hexed hatch
#

bungee for the fancy things

vocal cloud
#

Bungee for when you like having more colors then meets the eye 👀

young knoll
#

Just use bungee always

vocal cloud
subtle folio
#

Hey, im trying to use NMS on 1.18.1 and im trying to make a npc. in this line it says it needs a EntityPlayer and not a world server but how can I define that if im trying to make one? EntityPlayer npc = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(worldServer entityplayer stuff here));

patent horizon
fossil lily
#

It happens when I try to damage an entity, the damage goes through but it throws this big mess of stuff

young knoll
#

Do you happen to be calling .damage from a damage event

fossil lily
#

Yea

young knoll
#

That triggers the damage event

#

Which then calls .damage again

#

And well, you see where this is going

hasty prawn
#

yay recursion HYPERS

fossil lily
#

fun

#

okay

#

thanks

young knoll
#

Just toggle a Boolean before you call .damage

#

And then ignore the event when the Boolean is set

worldly quest
#

is there any way to compare two items in with just item meta or name ive tried literally everything and it all just seems to return false

#

with items with lore and just regular items

dusk flicker
#

getDisplayName equalsIgnoreCase other getDisplayName?

#

show some code, etc, you arent giving us much details

worldly quest
#

is there any way to compare the recipe in the crafting table and a custom recipe

young knoll
#

Sure

worldly quest
#

how would i do that

young knoll
#

You want to compare the items in the table or the recipe itself?

worldly quest
#

uh i think either one works

#

is there a big difference

young knoll
#

CraftItemEvent and PrepareItemCraftEvent both have a getRecipe

#

And that recipe should always be a keyed recipe, so it will have a unique namespaced key

worldly quest
#

yeah i tried e.getRecipe == shapedrecipe but it didnt work

#

where shapedrecipe was my recipe

young knoll
#

Yeah you would probably want .equals

#

Or like I said, compare the keys

worldly quest
#

oh ok ill try that rn

#

ok

#

how would i get the key from the recipe?

young knoll
#

You’ll have to cast it to Keyed

worldly quest
#

ah ok tysm

young knoll
#

Afaik any recipe in the crafting table will always be keyed

worldly quest
#

yup comparing the keys worked tysm

drowsy crest
#

Hey hey! I'm trying to get a plugin debug server working with pterodactyl (remote debugging)

I've been able to connect to the server in debug mode but I'm confused on how to actually push any new changes

#

All I have right now

#

Is there any way to set the plugin directory where it'd get hotswapped remotely?

worldly quest
#

im having problems with CraftItemEvent. im removing a set amount of items on craft but due to the actual recipe that requires one item when i shift click the slot it doesnt actually remove those items

#

anyone know how i fix this without just disabling shift clicking to craft

young knoll
#

You’d probably have to cancel the shift click, so the math yourself, and then add the items to the players inv

worldly quest
#

yeah tried canceling it and resetting the items in the crafting table but you can just close it if you time it and get the item for the recipe with one item

quaint mantle
#

Can anyonw hlp me i have a question over the mtwapens how can i add wapens?

rough drift
quaint mantle
#

How to add a gun

#

Oh but which command i have to use

#

If i do that than is there a error

#

Can you speak netherlands

#

Oh ok i find itn thx for you time:)

misty ingot
#

how do I get the uuid of a player who is offline? I need the uuid for Bukkit.getOfflinePlayer()

#

but I dont have the object yet

#

I need the uuid to get the OfflinePlayer object

#

I cant just use the uuid of the OfflinePlayer object to get the OfflinePlayer object

#

yeah it is

#

but the Bukkit.getOfflinePlayer(uuid) is not

#

which others can I use if any?

#

is it an external api?

rough drift
#

yes

misty ingot
#

could I have a link to it?

rough drift
#

gib second

eternal oxide
#

what offline player are you trying to get?

#

a specific one?

#

do you already have a uuid or name?

misty ingot
#

Basically I have a /ban <player> command

#

the user enters the name of the player

#

I obviously need offline players to be bannable

#

so thats why

eternal oxide
#

then use Bukkit#getOfflinePlayer(name)

misty ingot
#

its deprecated

rough drift
#

its fine

#

you can use it if you just need from an argument

#

no its because names aren't unique past a single session

eternal oxide
#

it performs a blocking web request to Mojang if the player doesn;t exist

#

its fine to use for a ban check

#

The alternative, is to use Bukkit#getOfflinePlayers()

#

then iterate to see if the player has been on your server

rough drift
#

^

eternal oxide
#

use == to compare enums

rough drift
#

yes

#

^

primal island
#

I have a NMS issue, i am getting NoClassDefFoundError.
pom.xml file: https://pastebin.com/ZRepu15q

java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component

rough drift
#

what ide are you using

#

yeah

grim ice
#

ngl replit is a cool thing to learn

#

cuz like

#

u can try out random performance expensive things

#

really easily

visual tide
#

i mean yes to test stuff but it's just gonna cause you massive pain if you want to use it in production

#

stick to a proper paid host for that

grim ice
#

it has 1gb ram and 1gb storage

#

lel

hollow beacon
#

using discord in browser

grim ice
#

took 241.023 seconds to run lol

grim ice
#

why should i use the app version

hollow beacon
#

fair

raw ibex
#

is there a way to put all tools and armour in a list instead of doing it manually

raw ibex
grim ice
#

nope

quasi flint
#

Respekt the drip

raw ibex
grim ice
#

lmao

#

im trying to help u bud

raw ibex
#

its cos

#

it's for a random armor and tool generator

grim ice
#

ahh

#

that makes sense

#

if its ran one time then do

#

loop thru materials and check if it ends with chestplate, or leggings boots or helmet

#

or sword, pickaxe, axe, shovel, hoe

quasi flint
#

Caching

grim ice
#

yea

raw ibex
#

caching?

#

wdym

grim ice
#

e.g

#

instead of reading a config everytime

#

u store key value pairs in a hashmap onenable

#

and then u just interact wit hthe hashmap

raw ibex
#

how does that help

grim ice
#

Better design

raw ibex
#

but how would that apply to me

grim ice
#

and for stuff like mysql

#

better performance

#

instead of looping each time thru the materials

#

cache the list of tools/armor generated

#

and just check that list

raw ibex
#

generated?

#

i dont understand

grim ice
#

you generate the list by looping thru materials

#

and add the materials which are a tool

#

or an armor piece

raw ibex
#

but how do i see if they're a tool

#

or amor

#

how do i tell

sacred mountain
#

check the type?

raw ibex
#

ok

raw ibex
#

it's not workiing

#

i can only get isblock()

hollow beacon
#

what's "not working"

raw ibex
#
                for (Material b : Material.values()) {
                    if (b.isBlock()) {
                        blocks.add(b);
                    } 
                }```
eternal oxide
#

a type is a Material

raw ibex
#

but i cant check if its armor

hollow beacon
#

there is no out of the box answer for that

#

easiest way (not the best) is to check if the material name contains armor

raw ibex
#

ok fine

vocal cloud
#
if(stack instanceof ArmorMaterial) {

        }

?

hollow beacon
#

is that a thing?

#

damn

somber sequoia
#

How would I get a player from their name, even if they are offline

hollow beacon
#

getOfflinePlayer?

somber sequoia
#

isnt that depracted

ivory sleet
#

Yes

#

But not deprecated due to removal

#

Read the deprecation message

hollow beacon
#

it's deprecated because names can change iirc

ivory sleet
#

^

shell hedge
#

Hello... how do I remove lore text from itemstack in 1.18 ?
I tried this, but it's not working:

meta.lore().remove(0)
somber sequoia
#

a ok thank you mane

hollow beacon
ivory sleet
#

Which also implies some sort of database query (thru the mojang api) might need to be queued thus it can ultimately result in a dos if used on server thread

shell hedge
hollow beacon
#

shouldnt have

#
ItemMeta meta = item.getItemMeta();
meta.lore().remove(0);
item.setItemMeta(meta);
#

i think

#

wait

#

isn't there an updateInventory method?

shell hedge
#

This isn't working

    public static ItemStack remLore(ItemStack item){
        ItemMeta meta = item.getItemMeta();
        if(!meta.hasLore()) return item;
        meta.lore().remove(0);
        item.setItemMeta(meta);
        return item;
    }
ivory sleet
#

Well every method runs on the thread it’s invoked on obv

tardy delta
shell hedge
#

in 1.18 setLore and getLore are deprecated...

ivory sleet
#

The issue is that getOfflinePlayer(String) might make a name to uuid lookup

#

Which can require a fetch from the mojang api

quaint mantle
#

Is it hard to make a custom attribute modifier?

tardy delta
#

try lore.clear() if thats a method

ivory sleet
#

Yes dopi

#

You need to get the lore with lore()

#

Then set it back with lore(List<Component>)

grim ice
#

i thought that only existed in forge

ivory sleet
#

Assuming you use paper

quaint mantle
tardy delta
#

is he using paper lol

vocal cloud
shell hedge
# ivory sleet Then set it back with lore(List<Component>)

Tried it with set again:

    public static ItemStack remLore(ItemStack item){
        ItemMeta meta = item.getItemMeta();
        Component component = Component.text("");
        List<Component> itemLore = new ArrayList<Component>();
        itemLore.add(0, component);
        meta.lore(itemLore);
        item.setItemMeta(meta);
        return item;
    }

But the empty string adds an empty line to the lore...

tardy delta
#

are you using paper?

shell hedge
#

yes

tardy delta
#

oh lol

#

is there no clear method?

#

or set a Collections.emptyList as the lore?

#

idk

#

or just a new arraylist

shell hedge
tardy delta
#

lol

#

anyways does anyone has a cooldown api?

hollow beacon
#

write it yourself

tardy delta
#

i need to save them in a database too and im looking for a good way

hollow beacon
#

timestamp

grim ice
#

ok im gonna make one ig

tardy delta
#

yee i know that

grim ice
#

pog idea

shell hedge
# shell hedge yea, it is! let me try

omg, it's actually that simple:

    public static ItemStack remLore(ItemStack item){
        ItemMeta meta = item.getItemMeta();
        List<Component> itemLore = new ArrayList<Component>();
        meta.lore(itemLore);
        item.setItemMeta(meta);
        return item;
    }

haha I was kinda stupid I think xD thanks anyways

tardy delta
#

java 7 kek

grim ice
#

a cooldown in a database?

ivory sleet
#

meta.lore(Collections.emptyList()) would be enough tho @shell hedge (and avoid redundant object creation)

tardy delta
#

ye because the server restarts every day and otherwise its gone

grim ice
#

u can just write it

#

in a file

tardy delta
#

nah i dont work with files

grim ice
#

a whole db just for that?

tardy delta
#

not?

hollow beacon
tardy delta
#

nah im saving other stuff too

hollow beacon
#

database programming

ivory sleet
#

Well do it one per line

grim ice
#

o

#

its basic logic

#

no need for some library

ivory sleet
#

Lengthy but ye

grim ice
#

just store the cooldown in a hashmap, then put it in the database ondisable and stuff

tardy delta
#

i was looking for integrating it with the user data and a way to figure out what type of cooldown it is

grim ice
#

u have mutliple cooldowns?

tardy delta
#

i better just try something lol

#

ye some commands have a cooldown

hollow beacon
#

make a cooldown object

grim ice
#

Cooldown<Cooldownable, Integer>.getPlayerCooldown()

#

make ur command class implement cooldownable interface which has a hashmap

#

hashmap<player, integer>

hollow beacon
#

no

grim ice
#

or maybe not thats just an idea

quartz anchor
#

anyone know how to fix this

tardy delta
#

what methods does that Cooldownable interface has?

hollow beacon
#

😎

#

give some code

quartz anchor
#

i am running mvn clean install inside <BuildTools Folder>\Spigot

#

of course there is no code from me

grim ice
#

getCooldowns() which is a hashmap

tardy delta
#

ah

grim ice
#

player, integer

tardy delta
#

i was thinking of a cooldownmanager or smth

#

and i was wondering too if i would change a Set<Home> where Home is a record(name, UUID, Location) to a Map<name, Home> where Home is a record(UUID, Location) so i can do lookups more easily and i can use the Map#remove method which returns the home object?

hollow beacon
#

swap the logic

#

make a player data class

#

and put the homes in there

#

so you can also put the cooldowns in there

grim ice
#

^

#

btw what do u think about my suggestion

tardy delta
#

the thing i said had nothing to do with cooldowns kekw

hollow beacon
#

im just helping you from an headache

#

cuz the strucure will be dog poo

grim ice
#

or in the player data

#

getCooldowns()

#

will return a Cooldowns class

#

then u use

#

getCooldown(CooldownType.KICK_COMMAND)

tardy delta
#

UserSnapshot represents all the user data that is loaded from the database

grim ice
#

mayb

tardy delta
#

ok ill try something

grim ice
#

is that a core

hollow beacon
#

personally i'd change the commands itself

#

make a wrapper for CommandExecutor

#

called something like CooldownableCommandExecutor

#

which keeps a cooldown with it

#

and on command just do

userSnapshot.setCooldown(this);

#

many approaches

#

whatever floats your boat

tardy delta
#

and then holding a Map<UUID, Cooldown> of these

public class Cooldown {
    private final long end;

    public Cooldown(long duration, TimeUnit timeUnit) {
        end = System.currentTimeMillis() + timeUnit.toMillis(duration);
    }

    public long timeLeftInMillis() {
        return end - System.currentTimeMillis();
    }

    public long timeleft(TimeUnit timeUnit) {
        return TimeUnit.MILLISECONDS.convert(timeLeftInMillis(), timeUnit);
    }

    public boolean isExpired() {
        return end < System.currentTimeMillis();
    }
}```
hollow beacon
#

lol

#

do you need the cooldown somewhere else than the player?

tardy delta
#

nah i dont think so

raw ibex
vocal cloud
tardy delta
#

but i also need an identifier to know for what command the cooldown is

#

some enum i guess

raw ibex
raw ibex
vocal cloud
#

YanSigh What version of MC

raw ibex
#

1.18

#

@vocal cloud i'm using a material not an itemstack

tardy delta
#

probably same thing in 1.18?

raw ibex
dense geyser
#

I'm using the worldcreator to create a void world but when my plugin is disabled or removed, new chunks start generating again like a normal world, how should I do it to stop that from happening (1.8.8)

raw ibex
#

@tardy delta it doesn't work for me

vocal cloud
#

Need to have NMS

young knoll
#

You can check for armor using EnchantmentTarget.ARMOR

safe edge
dense geyser
#

worlds are infinite and the worldcreator is not a plugin

#

@safe edge so when my builders want to make a map, it loads a void world so they create one, they publish it using a different command and it registers to my database and moves to my maps folder in a different place in my server

so far I'm using this

WorldCreator creator = new WorldCreator("test");
creator.environment(World.Environment.NORMAL);
creator.type(WorldType.FLAT);
creator.generatorSettings("3;minecraft:air;2");
fading lake
quaint mantle
#

what is the event for when player clicks with item on block or in air?
i think its PlayerInteractEvent but it only works on block not in air

fading lake
#

I dont think the worldgenerator carries over, at least not in my experience, so it might just be a case of loading a load of chunks in close proximity to the spawn point when its made so they dont load in later when the map is cloned

fading lake
quaint mantle
#

my eventhandler is @EventHandler(ignoreCancelled = true) and i even tried out with priority = EventPriority.HIGHEST

fading lake
#

HIGHEST is one of the last ones to be executed

#

I think

tardy delta
#

if i hide player X for all players on the server and X quits the server and rejoins, is he still invisible for all players?

fading lake
#

maybe

tardy delta
#

ye the last one

quaint mantle
#

which priority should i try

fading lake
#

LOWEST but be careful setting things there

quaint mantle
#

okayy ill try it

#

nope still not working

fading lake
# fading lake not usually

if I remember, all that method does is sends the packet to the player to remove the target player. If the player rejoins, then it a new entity, you can reload it on PlayerJoinEvent

tardy delta
fading lake
quaint mantle
#

alright thank you

next stratus
#

What's the fastest way to do a 3d for loop?

fading lake
next stratus
#

that's the thing.... it depends on how big the schematic is the user specifies

#

It could be fairly big or it could be tiny

tardy delta
fading lake
next stratus
#

It'll be far bigger than 100 for sure

hybrid spoke
#

what's y'all personal preference when ordering instance vars?

private final Runnable callback;
private final String name;

private final OtherValue value = new OtherValue();
private final Value val = new Value();

public Constructor(Runnable callback, String name) {}

or

private final OtherValue value = new OtherValue();
private final Value val = new Value();

private final Runnable callback;
private final String name;

public Constructor(Runnable callback, String name) {}
fading lake
next stratus
#

how hard is a binary search? I've never heard of / used before tbh

fading lake
#

I'd look it up, I'm shit at explaining it, but basically it searches an array by repeatedly halfing it

tardy delta
#

cool

next stratus
#

Is it bad I've never heard of it before?

fading lake
#

Its uses for very large arrays

#

Has the lowest big O notation

next stratus
#

so you use while, correct?

grim ice
#

anyone available to check out the structure

#

and tell me how could I improve it

fading lake
#

there is an Arrays.binarySearch() method if that helps @next stratus

next stratus
#

I've never done these things before and I wanna scream 🥲

fading lake
#

like I say, im shit at explaining it

#
drowsy helm
#

i mean theres not a whole lot to go off of

hybrid spoke
#

binary search isn't that hard

fading lake
#

its usually recursive

next stratus
#

I think it's hard because I've not used it before

hybrid spoke
#

its not hard, it just looks complicated at the first look

tardy delta
hybrid spoke
#

screw greeks, baeldung has a way better article

tardy delta
#

cant close it

fading lake
#

we love sites like that

grim ice
#

LMFAO

#

u cant close teh site

#

??

next stratus
#

?

grim ice
#

oh

#

u mean the login

#

ok

tardy delta
#

you can lol

hybrid spoke
# grim ice and tell me how could I improve it

i can't really say anything since i don't know the purpose of this. i personally would rename the packages since they seem misleading. also if you try to implement an interface-impl api design i would recommend making a multi-module project

next stratus
glossy venture
#

You need an ordered array for binary search

#

Variable name

fading lake
#

Interesting cooldown module 2Hex

next stratus
#

oh i noticed my fuck up

fading lake
#

we've all done that at least 10 times before and been totally flabergasted

next stratus
#

i'm not awake yet, k?

glossy venture
#

Set for efficient iteration and map for quick lookup

next stratus
#

I never realised you could iterate a schematic before pasting idk if that's bad i didn't know that

tardy delta
fading lake
tardy delta
#

2Hex you need Optional.ofNullable here or it will throw a NoSuchElement ex

glossy venture
#

Ok then use lookup

#

But maybe keep the name in the record for if you want to get the name from the home object

grim ice
#

ye ty

tardy delta
#

mye seems stupid to keep the name in two places so thats why i was asking

glossy venture
#

What if you want to print the name of the home

desert loom
glossy venture
#

You would need to go through the map and find it

tardy delta
#

the only time im printing is, is when i print a list of all the homes of that player

#

so i just loop thro them, no lookup

glossy venture
#

Ok you do you but its not necessary

young knoll
#

You ever have an error in a 1 tick runnable

#

Heh

next stratus
#

lol does it spam?

#

wait ofc it would

#

i really am having a day of being dumb

glossy venture
#

I once had a log file of half a gigabyte

next stratus
#

you

#

WHAT

tardy delta
#

lol

glossy venture
#

I had an error in a client side mod

next stratus
#

but

#

half

#

a

#

GIG?

#

that's like 500 MB?!

glossy venture
#

I didnt notice

next stratus
#

at least it wasn't 500gb

glossy venture
#

It was also quite a long error

next stratus
#

just curious, if you had a 500gb error file could you destroy it instead of putting it into trash?

#

because if you try to delete it then it trashes it

tardy delta
#

wdym destroy?

#

ah shift + delete

#

then it doesnt go to bin

next stratus
#

wait what

#

are you joking

tardy delta
#

ye in windows

#

try it

next stratus
#

is it bad i've been using windows for years and didn't know that

glossy venture
#

you also have a limit of the size you can put in the bin i think

#

at some point it will just permanently delete it

next stratus
#

my recycle bin is taking a shit trying to load

tardy delta
#

ye

glossy venture
#

lmao

next stratus
#

shit

#

i deleted my cv

young knoll
#

Yeah I don’t think the bin would accept a 500gb file

tardy delta
#

you can set a maximum capacity for the trash bin

#

mine is default 15 gigs

next stratus
#

mine accepts 50gb lol

#

idk why

glossy venture
#

do you have long file paths on

#

theres a limit on path length in windows

#

by default

next stratus
#

I've only got about 15tb of storage so ye

glossy venture
#

actually idk if its by default

young knoll
#

260 by default

glossy venture
#

yeah

#

you need to edit the registry to ensble long ones

#

at least i had to

#

maybe they xhanged it in newer versions

tardy delta
#

i have pretty bad experience with regedit

next stratus
#

I'm gonna miss having all day coding but hey I got a new job so we good

young knoll
#

Nah you gotta edit the registry

#

Or use group policy if you have access to that

next stratus
#

btw, i'm currently outputting

[13:22:36] [Server thread/INFO]: material: com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_18_R1.PaperweightBlockMaterial@10a19d7f
[13:22:36] [Server thread/INFO]: blockVector3: (-14, 30, -111)

using

Bukkit.getLogger().info("material: " + clipboard.getBlock(blockVector3).getMaterial());

is there a way to get the bukkit mat?

#

oh wait dw

#

bukkitadapter exists aha

#

whoever created the BukkitAdapter is fucking amazing

tardy delta
#

are you in the enginehub discord?

next stratus
#

ye

#

It feels so weird being able to test code without loading the game lol

tardy delta
#

oh that little mf there banned me

#

for helping people

next stratus
#

oh? sk or?

tardy delta
#

sk?

next stratus
#

ye

tardy delta
#

what is sk

next stratus
#

sk89q

tardy delta
#

oh no not him

#

winjanzy or smth

#

that mf kicks or bans everyone

next stratus
# young knoll Hmm?

I'd normally have to load the game and actually create a mine for it to do the iterating but I'm now iterating in the onEnable

next stratus
tardy delta
hybrid spoke
#

i mean

#

you can always test your model with unit tests

#

and minecraft should usually only be the frontend

grim ice
next stratus
#

I remember not long ago, if I didn't know how to do something I'd just say "screw it, i don't know how to do it no point trying to learn it" and now I push myself 🙂

grim ice
#

why is my ide like that

tardy delta
#

had i too

grim ice
#

the project tab

tardy delta
#

after merging stuff from github

grim ice
#

just fucking died

hybrid spoke
grim ice
#

how to fix that

tardy delta
#

i got a message "maven load script found" and it reloaded everything

next stratus
tardy delta
#

oh ur using gradle

subtle folio
next stratus
subtle folio
tardy delta
#

if ur using maven do mvn reload

hybrid spoke
#

or pull again from github

#

you just bashed your files with voodoo magic

grim ice
#

does nothing

next stratus
tardy delta
#

lol i have it everytime when i rebase or merge shit on github

subtle folio
hybrid spoke
next stratus
subtle folio
#

you legit use maven plugins?

next stratus
#

?

tardy delta
#

shading plugin lol

grim ice
subtle folio
hybrid spoke
#

revert

tardy delta
hybrid spoke
#

go back to a previous commit

tardy delta
#

fixed it for me

grim ice
#

i wrote stuff tho

next stratus
#

maven is

    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.18.2-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>

gradle is

compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'

I prefer gradle but no point trying to convince you as you've chosen that one

grim ice
#

and i still didnt commit it

subtle folio
grim ice
#

kekw

tardy delta
#

LOL

sharp flare
#

a bit offtopic, does PR's from github are able to delete stuffs that came from the branches and merge it to the main that also deletes the file there?

hybrid spoke
#

you're fucked hex

subtle folio
grim ice
#

not really

#

ill just copy paste the folder

next stratus
#

it looks cleaner it being on one line imo

grim ice
#

and make a new project in intellij

hybrid spoke
#

if you did the same i did once years ago

#

its gone

next stratus
#

more compact and easier to read

hybrid spoke
#

even in the folder

subtle folio
next stratus
#

ye soz

subtle folio
next stratus
#

how so

subtle folio
#

when its all separate say I just wanted to look at the version

#

I can j loook for <version>

tardy delta
next stratus
#

just look at the end?

subtle folio
#

and not the 3rd :

next stratus
#

version is always at the end so easier

subtle folio
#

ok its j example

hybrid spoke
#

i would only prefer gradle over maven if i have to do special things while building

next stratus
#

I think the reason i've been so into gradle is because i was forced to use it

subtle folio
#

by like your coding partners?

hybrid spoke
#

same. at work using gradle.

next stratus
#

well

#

In another discord they kept saying "use gradle"

hybrid spoke
#

but maven still >>

grim ice
#

wtf

next stratus
#

FOR 3 WEEKS

grim ice
#

the files exist

#

but

subtle folio
#

lmfao oops

grim ice
#

intellij doesnt

#

read

#

them at all

next stratus
#

and i went "fuck sake, i'll use it shut up"

undone axleBOT
subtle folio
#

yeah XD

#

peer pressure moment

next stratus
#

i do like it tho

#

🤷‍♂️

subtle folio
#

¯_(ツ)_/¯ not gonna judge

hybrid spoke
young knoll
#

Bukkit

#

Most things are in Bukkit

hybrid spoke
#

?pdc

next stratus
#

I remember before using build tools and I used to import it into eclipse damn those were the days

#

now i can't get away from gradle

#

so i'm not alone?

hybrid spoke
#

download jar > add to artifacts

#

done

next stratus
#

i don't think i'll get over my biggest fuck up in coding

subtle folio
next stratus
#

got offered a job coding on a server in 2016 right?

subtle folio
#

uhuh

next stratus
#

I said "lol, no thanks server will die within 6 months"

subtle folio
next stratus
#

it was called mcprison before now it's mchub

#

it gets worse dw

#

the devs get paid TWO THOUSAND A MONTH

#

yeah... i hate myself

hybrid spoke
#

well, big servers aren't always nice

next stratus
#

i know the owner lol

hybrid spoke
#

it can be very stressful

next stratus
#

i found him his wife 🤷‍♂️

#

i was like hey <name> you might wanna hire <name 2> she's real nice and good at moderating it went so well they got married and got a kid now

hybrid spoke
#

well, thats something special. worked for several. pressure is real

rough drift
hybrid spoke
#

yup. tests by contents goes through but a playerbase of 5000 at the same time will always find several bugs

#

and you have to fix them within minutes

young knoll
#

I can hire developers that will also find me a wife?

#

Nice

next stratus
#

yes

rough drift
#

everybody hiring devbukkit now:

next stratus
subtle folio
#

who

next stratus
#

FUCK i hate myself

rough drift
#

big brain time

subtle folio
next stratus
#

oh btw

hybrid spoke
#

just apply ¯_(ツ)_/¯

next stratus
#

I did slightly do a middle finger to them

rough drift
#

hold on what

next stratus
#

I copied their private mines plugin

#

and well made a ton lol

#

yeah, but mines the only fair priced one out there iirc

#

I think the price is fair for the support I give and the features I offer

#

🤷‍♂️

young knoll
#

Make it $9.99

#

10x the sales

#

Kappa

hybrid spoke
#

not kappa

#

big brain

rough drift
#

Spigot -> 2 notifs
Notifs -> EssentialsX was updated

grim ice
#
ructure/.git/HEAD.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.```
#

wtf

#

it doesnt exist

midnight shore
#

Hi. How can I use a project in another one using Maven? What exactly should I setup?

grim ice
#

jitpack :o

midnight shore
#

Okay

#

Ty

next stratus
# young knoll 10x the sales

lol i don't do it for the sales i just want to make a easy way for people to have private mines without having to pay out a crazy amount for such a plugin

grim ice
#

btw

#

anyone haas an idea of a library

#

i can make

hybrid spoke
#

inventory management

next stratus
#

HexLib

grim ice
#

inventory management is milked

#

creating npcs is also milked

midnight shore
#

Or Pets would be really useful. Something like hypixel SkyBlock

hybrid spoke
#

there is no good and efficient inventory management lib yet

grim ice
#

what is HexLib supposed to do? build hexagons or convert hex to binary?

grim ice
rough drift
visual tide
tardy delta
#

lol just write an util method for that

visual tide
#

isNullOrAir

grim ice
#

when u pay me a couple thousand dollars then sure ill do something the same as hsb

#

lel

hybrid spoke
grim ice
#

inventories are cringe tho

rough drift
#

welp

grim ice
#

any other ideas?

rough drift
#

Adding it to my OmniLib for spigot

#

i have to rewrite it anyways

visual tide
#

Make a lib for custom block breaking

rough drift
#

?

visual tide
#

Cuz it's a nightmare 🙂

hybrid spoke
#

a shape lib with extras like splines

midnight shore
#

Well

visual tide
grim ice
rough drift
#

Okay just give me a few ideas

#

ill try to make them

hybrid spoke
#

pure math

visual tide
#

Particle image display

grim ice
#

why pain

subtle folio
#

is there any good 1.18.1 npc api?

visual tide
#

Particle video display :0

hybrid spoke
#

or something like labymod have, a screen with TV senders ingame

rough drift
#

current plans for my omnilib

#

its basically a lib with alot of mini libs

visual tide
#

Hm

subtle folio
#

npc lib
(joke)

rough drift
#

wrong one

midnight shore
#

NMS LIB

young knoll
#

LibLib

rough drift
rough drift
midnight shore
subtle folio
rough drift
#

eeeeeeeeeee it should work

#

try it

hybrid spoke
#

or make an astronomical ballon plugin. then you can have a sun as a ballon which ends up in a supernova after a few minutes and turns into a black hole fucking with your whole world

young knoll
#

Worked for me

subtle folio
young knoll
#

I used it on 1.18.2 the other day

#

Still worked

subtle folio
#

waht huh

#

send me your jar

young knoll
#

Latest from Jenkins

subtle folio
#

on spigot 1.18.2?

#

i must have brain damage thank you

rough drift
#

@hybrid spoke Gib details about what an inventory lib would do

#

I am bored and don't want to work on my plugin rn xD

midnight shore
#

Custom advancements lib

rough drift
#

added to my todo list

rough drift
hybrid spoke
#

add me to the code reviews and i will cry about your api-design

#

ask @opal juniper

rough drift
#

wdym code reviews

#

custom items you mean?

#

o

#

sure

hybrid spoke
#

+keep track of inventories

rough drift
#

that's the current thing

#

anything more

hybrid spoke
rough drift
rough drift
#

what do you thikn

#

think

#

anyways one thing

rough drift
#

yeah

#

nah

grim ice
#

make an option for it

#

maybe

rough drift
#

this is a lib not a plugin

#

ill just forget on plugin shutdown

#
// Creating an inventory
InventoryWrapper wrapper = InventoryProvider.register("plugin:inv-name");

// Getting an inventory
InventoryWrapper wrapepr = InventoryProvider.get("plugin:inv-name");

// Removing an inventory
InventoryProvider.unregister("plugin:inv-name");
hybrid spoke
#

oh and also think of serializing and deserializing

rough drift
tardy delta
#

whats the name of the lib?

rough drift
#

OmniLib, not on gh yet

tardy delta
#

👀

rough drift
smoky oak
#

on the topic of that

molten hearth
#

anyone got any idea how to detect when PlaceholderAPI reloads itself

smoky oak
#

how do you interface with libraries?

hybrid spoke
#

make sure you can link 2 inventories

rough drift
hybrid spoke
#

oh also that

#

more thought of parenting

rough drift
#

wdym

smoky oak
#

do inventories have PDCs?

hybrid spoke
#

but bindings would also be cool

rough drift
#

cipher just give me the ideas you have

tender shard
smoky oak
#

damn

hybrid spoke
molten hearth
rough drift
#

so parenting and binding?

molten hearth
#

and only works when I reload my plugin

hybrid spoke
#

those are exclusive

tender shard
#

the following stuff has PDC:

  1. Entities
  2. Tile-Entities
  3. ItemMetas
  4. Chunks
    (in the future: 5. Worlds)
hybrid spoke
rough drift
wooden fable
#

Hey, i want to change the leaf decay distance. With custom trees, the leaves that are outside the distance decay immediately, but we want the leaves to decay when the tree is chopped down.
It's not just configurable in a config so I guess I'll just have to make a plugin for it, what's a good way to approach this?

viral crag
#

the event is still being run would be the guess

viral crag
lavish hemlock
#

It's a little unstable though.

#

I can't contribute to it atm cuz freelance but I'm just saying, the baseline is there if you feel like PR-ing. Otherwise, go ahead and make your own thing.

#

Self-reminder: PR some shit to RedLib to fix a few issues with Messages

opal juniper
rough drift
#

wdym