#help-development

1 messages ¡ Page 2137 of 1

safe notch
#

good for databases

tardy delta
#

well i mean when im not using the entire screen to open noteblock

fast path
#

just trying to use mysql

#

or sqlite

#

that will be easier

safe notch
#

ye

fast path
#

yml isn't best choice for store large data

#

that will uses much performance when saving

tardy delta
#

im scared by all those asian pfps smh

hybrid spoke
#

<--

tardy delta
#

thats just black

hybrid spoke
#

racist

tardy delta
#

im sorry

safe notch
tardy delta
#

no u

fast path
#

lmao

gusty gorge
#

So there is an InventoryPickupItemEvent, is there also one that detects putting an item back down apart from InventoryClickEvent?

tardy delta
gusty gorge
#

I want to detect if the target slot already has an item of the same type

tardy delta
#

check the item of the clicked slot and see if its null or the type is air

hybrid spoke
#

otherwise compare it with the item on the cursor

tardy delta
#

ah the same type wait

gusty gorge
#

Ok, thank u guys

boreal sparrow
#

when a player leaves, should i save the players inventory contents to file, or is the another way?

tardy delta
#

when a player leaves, minecraft saves its inventory contents to the player files?

sterile grotto
boreal sparrow
#

yes, but basically, the player spawns in the lobby, but i dont want some random items from a skywars game they just left to still be there, but for example, say there was a survival gamemode, i cant just clear the items, since everything would be gone in the survival gamemode aswell

sterile grotto
safe notch
#

Seems like it does

sterile grotto
#

you may consider use BungeeCord to separate your game into different sub servers

boreal sparrow
#

oh ok thanks

rocky bolt
#

hello guys i have a problem with essentials, i trying to kick ban mute someone but everytime it say "/kick player [reason]" or "/ban player [reason]"
but i did everything right
i cant even ban or kick via console

tardy delta
#

/minecraft:ban

rocky bolt
tardy delta
#

ah

rocky bolt
#

can u help me to fix it

tardy delta
#

did you provide a reasaon?

rocky bolt
#

and it say same thing

#

for ban also

#

mute work

tardy delta
#

is player even a player name

rocky bolt
rocky bolt
#

i use pex for ranks maybe i need to type also rank?

tardy delta
rocky bolt
#

okay

compact cape
#

Is there anyway to get an integer related to server tick? I'm trying to update the GUI every for example 5 ticks globally (All open GUIs must look the same) and the update is based on server tick

tardy delta
#

there are some forum posts about how to get the server tps

#

idk which one of them actualy works

tall dragon
#

if ur working with paper. iirc it has a TickEndEvent or somethn

steel swan
#

hey , so there is a worldType called "CUSTOM".
WIth it, i can create a world with whats called a preset.
I can create a world with my plugin, set it tu custom type, but i cant seem to find where to put a preset.
ps : a preset looks like this {"coordinateScale":684.412,"heightScale":684.412,"lowerLimitScale":512.0,"upperLimitScale":512.0,"depthNoiseScaleX":200.0,"depthNoiseScaleZ":200.0,"depthNoiseScaleExponent":0.5,"mainNoiseScaleX":80.0,"mainNoiseScaleY":160.0,"mainNoiseScaleZ":80.0,"baseSize":8.5,"stretchY":12.0,"biomeDepthWeight":1.0,"biomeDepthOffset":0.0,"biomeScaleWeight":1.0,"biomeScaleOffset":0.0,"seaLevel":63,"useCaves":true,"useDungeons":true,"dungeonChance":8,"useStrongholds":true,"useVillages":true,"useMineShafts":true,"useTemples":true,"useMonuments":true,"useRavines":true,"useWaterLakes":true,"waterLakeChance":4,"useLavaLakes":true,"lavaLakeChance":80,"useLavaOceans":false,"fixedBiome":-1,"biomeSize":4,"riverSize":4,"dirtSize":33,"dirtCount":10,"dirtMinHeight":0,"dirtMaxHeight":256,"gravelSize":33,"gravelCount":8,"gravelMinHeight":0,"gravelMaxHeight":256,"graniteSize":33,"graniteCount":10,"graniteMinHeight":0,"graniteMaxHeight":80,"dioriteSize":33,"dioriteCount":10,"dioriteMinHeight":0,"dioriteMaxHeight":80,"andesiteSize":33,"andesiteCount":10,"andesiteMinHeight":0,"andesiteMaxHeight":80,"coalSize":17,"coalCount":20,"coalMinHeight":0,"coalMaxHeight":128,"ironSize":9,"ironCount":20,"ironMinHeight":0,"ironMaxHeight":64,"goldSize":9,"goldCount":2,"goldMinHeight":0,"goldMaxHeight":32,"redstoneSize":8,"redstoneCount":8,"redstoneMinHeight":0,"redstoneMaxHeight":16,"diamondSize":8,"diamondCount":1,"diamondMinHeight":0,"diamondMaxHeight":16,"lapisSize":7,"lapisCount":1,"lapisCenterHeight":16,"lapisSpread":16}

eternal needle
#

is it any way i can do /eco take (username) {amount} from a plugin?

bth it's exssential

crimson terrace
eternal needle
crimson terrace
#

you should probably attach the UUID of the represented player to the head

eternal needle
crimson terrace
#

how do you put the name on the head

midnight glen
#

is it possible to find the target players (@a, Player Name) of a command? I want to check if the command sender is in the same world as the targeted player.

eternal needle
# crimson terrace how do you put the name on the head

public static void openMenu(Player player) {

    ArrayList<Player> list = new ArrayList<Player>(player.getServer().getOnlinePlayers());

    Inventory playergui = Bukkit.createInventory(player, 36, ChatColor.YELLOW + "Sandtak");
    for (int i = 0; i < list.size(); i++) {
        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD, 1);
        ItemMeta meta = playerHead.getItemMeta();

        meta.setDisplayName(list.get(i).getDisplayName());
        ArrayList<String> lore = new ArrayList<>();
        lore.add(ChatColor.GOLD + "Player Health: " + ChatColor.RED + list.get(i).getHealth());
        lore.add(ChatColor.GOLD + "EXP: " + ChatColor.AQUA + list.get(i).getExp());
        meta.setLore(lore);
        playerHead.setItemMeta(meta);

        playergui.addItem(playerHead);
    }
crimson terrace
#

cast the sender to a player if it is a player and then get the name @midnight glen

midnight glen
#

What if it is a command block?

midnight glen
eternal needle
#

what?

midnight glen
#

I meant vanilla commands btw

crimson terrace
midnight glen
crimson terrace
midnight glen
hot fjord
#

lol

crimson terrace
#

not sure if you can intercept commands, but maybe try finding something like that?

hot fjord
#

you might be able to cancel playerChatEvent

#

i know i was able to log all commands input by players that way, should work to just cancel the event

#

let me double check

midnight glen
#

but I need it mostly for command blocks

hot fjord
#

i believe this event fires when people type at all and hit enter

eternal needle
#

how woud that help?

midnight glen
crimson terrace
eternal needle
quiet ice
#

That being said not absolutely ANY plugin will use vault but it is a sure enough bet

quiet ice
abstract sleet
#

Unfortunately Vault doesn’t have any documentation for you😁 you’ll need to skim other plugins source code to find out

quiet ice
#

Vault does have documentation though...

#

If you are unable to read a readme page you shouldn't be linking into vault

abstract sleet
#

Blob this project might be too difficult for you, are you sure you want to attempt it?

midnight glen
#

public void CommandBlock(ServerCommandEvent e) {
if(e.getSender() instanceof BlockCommandSender) {
//do stuff
}
}

how do i check the targeted players / entities

eternal needle
#

meta.setOwnerProfile(player.getPlayerProfile()); this line is wrong

tardy delta
midnight glen
tardy delta
#

on command block what?

midnight glen
#

so I renamed CommandBlock to onCommandBlock because you told me to

eternal needle
#

1.18.2

tardy delta
#

doesnt CommandExecutor#onCommand also works for command blocks? atleast i thought so

midnight glen
#

it does, but I need to do it for vanilla commands

#

like /tp and /give

#

also /scoreboard stuff

#

I need to make it so that commands executed in a certain world will only affect that certain world

eternal needle
#

Cannot resolve method 'setOwnerProfile' in 'SkullMeta'

#

Cannot resolve method 'getPlayerProfile' in 'Player'

quiet ice
#

Are you sure that you are binding with 1.18?

#

If so, show us your pom/build.gradle/whatever

eternal needle
#

Variable 'player' is already defined in the scope

upper vale
#

lmao

eternal needle
#

like?

quiet ice
#

why are we here

sterile grotto
#
Inventory inventory = Bukkit.createInventory(null, InventoryType.FURNACE);
player.openInventory(inventory);
quiet ice
#

?

sterile grotto
#

can anyone tells me why this code won't work

quiet ice
#

?jd-s

undone axleBOT
abstract sleet
quiet ice
midnight glen
quiet ice
#

Oh so you mean all commands?

midnight glen
#

will that work for CommandBlocks tho

sterile grotto
sterile grotto
quiet ice
#

Well there is no furnace at the backend, so there is no reason it would just magically work

midnight glen
#

wdym?

#

like @a stuff

#

?

#

ok, thanks

sterile grotto
#

I tired NMS, and I did some researches, most of people met the same problem as I did, and there seems no solution

opal juniper
#

yes that will not work

#

its tied to the block iirc and if the block doesnt exist... well

quiet ice
midnight glen
#

How do I get the command block's / sender's world

quiet ice
#

It will not magically work - you need to set the output "manually" - i.e. smelting logic is done by you

#

That being said there is no API for actually setting smelting progress for some reason

#

Which is odd to say the least

opal juniper
#

is there in paper?

quiet ice
#

nope

quiet ice
#

To be fair, it usually does not make sense to set the progress on a per-inventory basis if it should be synced at a per-block basis

sterile grotto
quiet ice
#

It's Furnace though

eternal night
#

ye ?

opal juniper
#

its gonna be null if you use it on a created inv

upper vale
opal juniper
midnight glen
#

then how do I get the targeted players

quiet ice
eternal night
#

I mean, furnace inventory is one of those bound pretty actively to in world block entities

upper vale
#

Use world.spawnParticle instead

midnight glen
#

I also can't get the world of the sender

#

I know

#

they are issued from a command block

#

but how do I get the affected players?

abstract sleet
#

Command blocks might give you their block or location where you can get the world from

abstract sleet
#

Minecraft handles the selectors

upper vale
#

You need to parse the entity selector yourself

opal juniper
upper vale
#

But you can use Server.selectEntities to easily get the selected entities

midnight glen
upper vale
#

e.setcancelled

midnight glen
#

but that will cancel it for everyone

upper vale
#

?

#

Add if statements

#

I’m a little confused

midnight glen
#

yeah but I want to cancel it for just some players

#

basically I have a server where you load a personal world with an adventure map

#

and when the map executes a command it affects everyone on the server

upper vale
#

You want to change the command’s targeted players? You can’t the command is implemented in another plugin

midnight glen
#

they don;t

upper vale
#

You can cancel current command, modify the selector, redispatch the command

midnight glen
#

is there an e.setcommand

#

yeah there is

#

what is the difference between replace and replaceall?

quaint mantle
#

Hi, one question i created a plugin sends messageswhe a player login

#

but in the console sends error

#

/paste

undone axleBOT
quaint mantle
#

ok

#

@last temple

#

yes

#

exist

#

do you want to send you the config?

#

there is

#

ok thanks

#

and one question

#

can i have the config without the Conifg.

#

yes

#

ok thanks

#

its neccesari the Config:

#

ok thanks i will try it

#

?paste

undone axleBOT
quaint mantle
#

ok thanks i will try

#

oh yes

#

sorry

#

its Welcome.join.text

#

sure?

#

ok thanks

#

thanks you very much bro

midnight glen
#

yay

#

i did it

#

it was simply

@EventHandler
    public void onPlayerCommand(ServerCommandEvent e) {
        if(e.getCommand().contains("@a")) {
            e.setCommand(e.getCommand().replace("@a","@a[distance=..99999999]"));
        }
    }

if anyone needs to do it

grim ice
#

can you convert a Structure to a schematic

#

Haskell style nice

half leaf
#

Hey guys

#

so im trying to make a punch bow

#

and everything works fine

#

but i made an event that it cancel the fall damage that caused by the arrow

#

i tried to see why but the code is fine(or thats what i think)

#

also i've got no errors in the console

crisp steeple
#

ok for starters

#

the if else statement after checking if they’re in the list in pointless

half leaf
#

where?

#

o

crisp steeple
#

you just need an if

half leaf
#

i mean it works fine

#

ya i was doing at first else

#

but i thought its maybe wont work

#

and then i changed it

crisp steeple
#

so are you sure that they’re in the list?

#

try making a print statement when the damage event checks if they’re in the list

half leaf
#

uhm

#

o okay wait

#
            if (pBowArrayList.contains(p.getUniqueId())) {
                p.sendMessage("bozo ur in the list");
                if (e.getCause() == EntityDamageEvent.DamageCause.FALL) {
                    e.setCancelled(true);
                }
#

it didnt send a msg

#

so the player isnt in the list???????

#

but how

#

@crisp steeple

eternal night
#

probably because the player is not in the list

#

if I had to guess, it is because you create two instances of your pBowCMD class

half leaf
#

mmmm

#

but

#

i didnt

#

how

eternal night
#

how do you register the command and listener

half leaf
#
        getCommand("pbow").setExecutor(new pBowCMD(this));

       getServer().getPluginManager().registerEvents(new pBowCMD(this), this);

#

ther

eternal night
#

hmmm

#

[18:46] cqveman: mmmm

#

[18:46] cqveman: but
[18:46] cqveman: i didnt
[18:46] cqveman: how

safe notch
#

2 instance lol

eternal night
#

🤔

crisp steeple
#

are you sure they’re ever getting added to it in the first place

#

oh wait

half leaf
#

wym

crisp steeple
#

nvm

half leaf
crisp steeple
#

you’re making 2 instances of the class

eternal night
#

You are creating two instance

half leaf
#

o

eternal night
#

each will have their own instance of the list

crisp steeple
#

make one class for the command and the other for the listener

half leaf
#

ik

eternal night
#

or just

half leaf
#

but i was just lazy

safe notch
#

pBowCMD cmd = new pBowCMD(this);

#

and use that

eternal night
#

^

#

ye that

crisp steeple
#

i mean yeah

half leaf
crisp steeple
#

but having 2 different classes is better organization anyways

eternal night
#

and then obviously cmd instead of the new PBowCMD(this)

safe notch
#

ye

half leaf
eternal night
#

when you register command and listener

half leaf
#

i was just testing this for fun

tardy delta
#

an arraylist with one element is useless, use Collections.singleton instead

eternal night
#

how does that list have a single element

tardy delta
half leaf
#

wait brb

eternal night
#

oh that

tardy delta
#

ye :p

eternal night
#

cool kids just use Lists.of

quaint mantle
#

Is it possible to have spigot and farbic on a server 👀

tardy delta
#

Arrays.asList is also a thing

eternal night
#

spigot and fabric are two different server implementations

tardy delta
#

im on java 17 and i've never actually used List.of 😳

quaint mantle
eternal night
#

Well, mods for fabric

ancient plank
#

i dont recommend

eternal night
#

idk if there is a spigot bridge

#

for fabric

ancient plank
quaint mantle
#

I mainly wanna have Origins + Some other stuff

ancient plank
#

I've never seen a plugin not break when you use them

quaint mantle
#

Which I want to be added

#

but there is no mod for it

sage merlin
#

does anyone know this if you do please help me i have like a server thats wanting this and i can't solve this

pine island
#

did u register the event?

sage merlin
#

i did

pine island
#

wied

sage merlin
#

?

pine island
#

weird*

pine island
#

yh im confused too

safe notch
#

you know you can use e.getEntity().getKiller()

sage merlin
#

e.getKiller() is null

safe notch
#

huh

sage merlin
#

yeah i did that but i got a massive ass error telling me its null so i went with a different apporach

safe notch
#

did you try adding debug messages to every logic?

pine island
#

yes

sage merlin
#

uh no

pine island
#

create a test

safe notch
#

try that it might help

pine island
#

mhm will help you find out the problem

ancient plank
#

should use pastes for errors/code instead of screenshots

pine island
#

/\

safe notch
#

?paste

undone axleBOT
safe notch
#

is the problem like when the player reaches 0 deaths it doesnt ban?

sage merlin
#

like when the player dies nothing happens to the config does not change

crisp steeple
#

getLastDamageCause returns an entitydamageevent?

#

odd

safe notch
#

no errors too?

ancient plank
#

if you're only doing player deaths why not listen to playerdeathevent

safe notch
#

🤔 true lol I didnt even see its entity death event

lost matrix
sage merlin
crisp steeple
#

are you being killed by an entity?

sage merlin
safe notch
#

if its null then its prob fire or something that kills

sage merlin
#

that has to be the death type

#

but there is no way to set the death in a entity death event

lost matrix
#

Im seing that you use configs during a session. Dont do that at all.
Create a PlayerData class or something similar. Put it in a PlayerDataManager that contains a
Map<UUID, PlayerData>. Then on the AsyncPlayerPreLoginEvent -> load the data from a config into the manager
and on the PlayerQuitEvent -> remove the data from the manager and save it in a file again.

#

And at every other point in your code you use the PlayerData objects

sage merlin
safe notch
#

it is still going to be config based tho

lost matrix
safe notch
#

just getting data as player data then manipulating then saving

sage merlin
lost matrix
safe notch
lost matrix
#

Well... even more but then collisions become a problem

sage merlin
#

i phrased it incorrently

safe notch
#

I never realised of the approach of saving player data as an object lol , all this time I used mysql cuz it was instant

eternal night
#

mysql was instant 🤔

safe notch
#

I mean not that delayed cuz it was running on localhost

eternal night
#

and that DB must have been very small

safe notch
#

yea

sage merlin
#

your saying i will store this information in the config when the player leaves i want it to be after a player dies by a player

lost matrix
# sage merlin that was a stupid question lol

Its alright. Your folder structure might look like this:

└──_YourPluginFolder 🗀
   ├──config.yml 🗏
   └──_player-data 🗀
      ├──1750cf0f-59be-4f11-9a02-2a39776ae311.yml 🗏
      ├──dd4e5a63-c2d3-479b-92d7-db77f6607c48.yml 🗏
      ├──da0edcd5-d4df-4bd1-9fa0-e89def6415d7.yml 🗏
      └── ...yml 🗏

You have a config.yml that contains all the configuration for the plugin.
Then you have a player-data folder that contains one file for each player.
If a player joins you simply load his file by using <his uuid>.yml

sage merlin
#

create a custom yaml file and store the data within the manager in it?

lost matrix
#

The manager has nothing to do with any files. It simply holds a Map<UUID, DataClass> of all loaded (online) data.

sage merlin
#

but having lets say 60 yml files isn't it gonna be a bit messy

lost matrix
midnight shore
#

how could i get the first entry of an hashmap?

sage merlin
#

so create a class -> HashMap manager that stores data -> AsyncPlayerPreLoginEvent load the data to config

lost matrix
sage merlin
midnight shore
#

oh

#

but what about a list?

crisp steeple
midnight shore
#

i get the element at index 0?

maiden thicket
#

?learnjava

undone axleBOT
maiden thicket
#

😔

#

arraylist use .get(0), a regular array use [0]

sage merlin
midnight shore
#

i said a list

#

not a hashmap

sage merlin
#

sry read that wrong

midnight shore
#

ty

lost matrix
# sage merlin so create a class -> HashMap manager that stores data -> AsyncPlayerPreLoginEven...
  1. Create PlayerData.class
  2. Create PlayerDataManager.class that contains a Map<UUID, PlayerData>. Create one single instance of it and only use this single instance ever.
  3. on AsyncPlayerPreLoginEvent -> load the data from <uuid>.yml and create an instance of PlayerData
    then put the PlayerData into the PlayerDataManager.
  4. For all events -> get the PlayerData from the manager-
  5. on PlayerQuitEvent -> remove the PlayerData from the manager and save it back into the <uuid>.yml
midnight shore
crisp steeple
#

nothing starts at 1 in programming

#

unless you’re using scratch or something

lost matrix
midnight shore
lost matrix
#

Ah i see

midnight shore
#

ty all

quiet ice
#

Excel also starts counting with 1

crisp steeple
#

lua is quite odd

#

at least from what i have seen about it

maiden thicket
quiet ice
#

How do you embed a hypertext link in javadocs again? Do I really need to use an html anchor element?

maiden thicket
#

psuedocode iirc also starts at 1

quiet ice
#

If someone called a programming language like that I will loose all my hopes in humanity.

midnight shore
#

is there a way to play the drink or eat animation with an item that is not really eatable, like a textured player head?

quiet ice
#

As far as I know not the arm movements themselves, but the effect can be replicated iirc

midnight shore
#

uhm

crisp steeple
#

so not without a texture pack or mod

sacred mountain
#

idfk how lamdas work, but will this convert my hashmap<uuid, killeffectsEnum> into hashmap<uuid, string>?

Map<UUID, String> prop = Maps.transformValues(getEffectsMap(), entry -> entry.getEffectCommandName().toUpperCase());

geteffectcommandname is my own method that returns the value's raw name

tardy delta
#

Maps.transformValues? why not just Stream#map?

#

seems like it turns it into a map with the uuid and the command name in uppercase ye

crisp steeple
tardy delta
#

didnt know (ClassName c) -> {} with the explicit classname was a thing

sacred mountain
#

where should i look to learn lambdas do you recommend anything before i google it

lost matrix
sacred mountain
#

ill try explain a bit better

#

i have a Hashmap<UUID, KillEffects> (killeffects is my enum class), and i want to convert that hashmap into Hashmap<UUID, String>, where string is a method in my enum. so its kinda copied over

lost matrix
#

Ok. What does the method look like?

sacred mountain
#

it's tiny, it just returns my specified string for the enum value

#

public String getEffectCommandName() {
return effectCommandName;
}

#

WATER("&9Water", "water-326"),

echo basalt
#

uhhh

lost matrix
echo basalt
#
Map<UUID, KillEffect> map = ...;
Map<UUID, String> newMap = new HashMap<>();

for(Map.Entry<UUID, KillEfect> entry : map.entrySet())
  newMap.put(entry.getKey(), entry.getValue().getEffectCommandName());

#

idk what's the problem with just writing code in regular java instead of doing dances to use lambda

hasty prawn
#

because fancy

sacred mountain
#

well yes i did that first but i thought it would be more clean to do it in a line or so.

#

and yes

#

fancy

crisp steeple
#

i mean you could also just keep it as an enum and get the string whenever you need it

lost matrix
# sacred mountain fancy

Ok. But still: Why would you ever want that if you already have a Map<UUID, Killeffect> ?
Why do you need to create all that overhead to create another map at all?

tardy delta
#

stream and collectors to map kek

crude loom
#

Is it possible to set 2 scores with the same name in a scoreboard?

misty current
#

no, but you can add random color codes so it looks the same

crude loom
#

Huh, that's smart
Thanks !

misty current
#

np

terse raven
#

is there a way to set the skull texture to a custom png?

echo basalt
#

you'd need to upload the png to mineskin, then get the url and set it on a gameprofile

lost matrix
#

They also have a java library to interact with their rest api

terse raven
#

is there a rate limit?

lost matrix
#

And with the 'new' PlayerProfile api from spigot you can create a ton of skins for your players to chose from.

lost matrix
terse raven
#

and do they expire? because the other method i have been using expires after 3 days

lost matrix
#

But if you lend them a mc account to generate new skins then its even higher. One acc can be used to generate about half a million skins.

terse raven
#

oh my method has been accountless so far, but the skins expire after 3 days and they only work on heads

ivory sleet
#

half million per hour? or what time interval

terse raven
lost matrix
ivory sleet
#

ah okay

terse raven
lost matrix
terse raven
#

i dont have a signature

#

you dont need one for heads

quaint mantle
#

?paste

undone axleBOT
quaint mantle
terse raven
#

could you send your main?

quaint mantle
#

yes

lost matrix
quaint mantle
lost matrix
#

But send us line main.java:51

quaint mantle
#

name: Lex
version: '${project.version}'
main: welcome.lex.lex.main
api-version: 1.18
authors: [ zLexus16 ]
commands:
reload:
description: Reloads The Plugin
usage: /welcome reload

#

theres

lost matrix
quaint mantle
#

ok

quaint mantle
#

public void registerCommands(){
getCommand("welcome").setExecutor(new reload(this));

lost matrix
#

api-version 1.18 but you run a 1.8 server?

quaint mantle
#

is on the line 51

quaint mantle
lost matrix
tardy delta
#

this doesnt make sense too, youre checking if its a player and if not, casting anyways

lost matrix
terse raven
#

so a player would never even reach the cast

tardy delta
#

dunno what that logic s supposed to do

quaint mantle
#

how i can solve this?

crisp steeple
#

by using !

#

i assume you tried to make it check if it wasn’t a player, not if it is

quaint mantle
#

why does he smel

#

what

#

leo

#

you really need to disguise yourself better

#

dumbass

#

?ban @trim surge ban bypass

undone axleBOT
#

Done. That felt good.

ivory sleet
#

oh that troll

#

nice

quaint mantle
#

it was leo

ivory sleet
#

ugh

#

yikes

tender shard
#

who the heck is leo

quaint mantle
#

a really annoying person

tender shard
#

oh I see

#

lol

opal juniper
quaint mantle
opal juniper
#

miss that guy around here

quaint mantle
#

you should get banned with him

#

i hate that guy

#

hee alwaiz talc lik dis 😎

#

shits annoying

opal juniper
#

he doesnt any more

#

not as much

tender shard
quaint mantle
tender shard
#

lol

opal juniper
#

i dont see the issue

quaint mantle
#

ok i can let calling conclure daddy, slide

tender shard
#

Conclure (ping for daddy)

quaint mantle
#

but hes still annoying

#

idk i just dont like him

#

i hate reading encrypted text messages that are supposed to be english

ivory sleet
#

I dont think it was leo

#

but yeah

#

idk maybe they just impersonated leo

quaint mantle
#

"Oops"

ivory sleet
#

mye cuz I talked to them after they got smashed by the hammer

#

not like I know what leo sounds like but ye

quaint mantle
#

what did they say

#

you can unban them if they deny it

ivory sleet
#

not much, I just delegated them to the mail support

quaint mantle
#

wish you could control if the bans deleted the messages

ivory sleet
#

mye

#

would be incredible

vestal dome
#

I need help, how can I make Bukkit events create "HandlerList", so I can register my listener to the handler list

lost matrix
vestal dome
#

because I actually need it to register to every event.

#

like every, like logging all the events that happen

#

because if the handler list is created when the class is loaded, I cannot like, register to the HandlerList and then I miss events that happen, and then I cannot do it.

lost matrix
#

The handler list is rebaked every time an event is registered

vestal dome
#

wdym??

lost matrix
#

Every single time someone registers any event, the whole handler list gets recalculated

vestal dome
#

recalculated? in what way tho?

#

why would it need to?

#

I guess I can go into the HandlerList class 🙂

vestal dome
#

oke, I found what you mean

lost matrix
#

Did that change? Let me take a look at the current SimplePluginManager impl

vestal dome
#

Just look at HandlerList.bakeAll()

#

this still shouldn't be an issue for me tho..

lost matrix
vestal dome
#

I want to log every event

eternal night
#

use a library like reflections and go from there ?

vestal dome
#

wdym?

eternal night
#

I mean, there is no central place every known event is defined

vestal dome
#

well I could load every class on the events package

#

but how?

eternal night
#

use a library like reflections and go from there ?

vestal dome
#

ye, but which

lost matrix
#

Pretty sure that this will produce an unholy amount of data. How do you want to persist all of that?

eternal night
#

it is literally called reflections

vestal dome
#

o_o

eternal night
#

sorry for the confusion there

lost matrix
#

"BlockPhysicsEvent", "PlayerMoveEvent"

#

You really want to log all of that?

vestal dome
#

yes.

lost matrix
#

And how do you plan on persisting all of that data?

vestal dome
#

serializing it.

#

somehow.

lost matrix
#

And then?

vestal dome
#

uh

#

good question,

#

actually don't know, I still know I want to do this

eternal night
#

👀 I mean, you are dealing with a shit load of new data entries every 50ms at best

#

block physics event might trigger a lot more often

vestal dome
#

you're kinda right

eternal night
#

you might want to think of persisting that shit load of data first

#

before implementing it

lost matrix
#

The concurrency also needs to be handled in a smart way. Just creating a new thread on every event would be horrendous.
The only thing i could think of is to batch write it to disk every 10 seconds or so. With an NVMe this should be fine.
But i wouldnt sacrifice bandwidth by using an external DB for something like this. You server only has so much of it.

eternal night
#

Yea you'd definitely have to do batch updates

#

but even then, you'll be buying a lot of storage lol

lost matrix
#

Well if you have a 2 way 1 gbit connection then you might be fine

vestal dome
next zinc
#

Anyone know how I would be able to make the redstone custom colored?

   player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 0, 0, 0, 5);
worldly ingot
#

It accepts data

#

I think it's DustColor iirc

#

DustOptions

#

I was close

next zinc
#

but I'm unable to use it within that line of code it says

#

unless there is a specific spot

#
 player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 0, 0, 0, 5, Particle.DustOptions(Color.FUCHSIA));
#

shows that dustoptions is undefined for type particle

echo basalt
#

@vestal dome you do realize there's a method to subscribe to all events

lost matrix
# vestal dome I have 2TB.

Lets make a quick educated guess.
1 serialized String might be 30 chars long on average. Lets make it 32. So assuming we allow one byte per char this would be 32 bytes per entry.
With 50 players online i would at least assume an average of 750 playermove events per second. Then ~500 block physics events and
lets be generous and add 1k for the rest of the events per second to it.
Averaging 2250 events * 32 is 72MB of data every second. The write speed of modern HDDs ranges from 80-180 MB/s (for sequential writes)
Minecraft uses quite a bit of that already for chunk/world/player data.
So with a plain enterprise hard drive you would compromise your servers stability big time by simply logging the data.
Lets get to the capacity problem. A day has 24 * 60 * 60 = 86400 seconds.
Lets be fair and say that on average you only have to log half of 72MB/s (36MB/s).
This results in 2.7648 GB/d and around one TB/y

Might look acceptable but as soon as you get a bigger clientele this could shoot up to several Terabytes per year.

next zinc
#

Yeah I just tried adding the second one and still gives off an error

echo basalt
#
Bukkit.getPluginManager().registerEvent(Event.class, new Listener() {}, EventPriority.NORMAL, ((listener, event) -> { serialize(event);}), plugin);
grim ice
#

tha guy was awesome

#

he was funny tbf

next zinc
#

That would definitely explain it

next zinc
#

lmao ty

grim ice
#

i truly hate people who are against getters

#

I dont know how they hate such an awesome concept

echo basalt
#

what, encapsulation?

#

or are you hating on kotlin

grim ice
#

best part is theyre polymorphic

echo basalt
#

I can't tell

crisp steeple
#

i’ve heard it causes an exception

echo basalt
grim ice
#

i do hate kotlin for it

#

but thats not what im saying

crisp steeple
#

¯_(ツ)_/¯

grim ice
#

im saying that people against the use of getters, and instead like public variables suck

crisp steeple
#

kotlin has getters lol

lost matrix
echo basalt
crisp steeple
#

alright then

#

i guess that would work

echo basalt
#

addEventObjective(PlayerEnterRegionEvent.class, (event, player) -> ...);

grim ice
#

btw

#

my Configuration implementation worked on the first try :o

echo basalt
#

:o

grim ice
#

its not in spigot btw

echo basalt
#

fancy

#

reminds me when I thought I fixed my skyblock's world system

grim ice
#

reminds me

echo basalt
#

turns out it was a cached world that failed to wipe

grim ice
#

Rate code

#

please dont mind the readme

#

i havent worked on it yet

echo basalt
#

static aboose

grim ice
#

Where

echo basalt
#

main

grim ice
#

what

#

what line

#

I see no static abuse>

compact haven
echo basalt
#

also you could reuse some getters y'know

grim ice
compact haven
#

the constants are fine, but why can't you just pass an instance

#

I do it, we all do it, it's good practice

grim ice
#

That isnt static abuse.

compact haven
#

it sure is

grim ice
#

you dont call anything you dislike static abuse

compact haven
#

static meant for constants only, not for state

echo basalt
#

And split up some methods like not doing number conversions on a listener

grim ice
#

@ivory sleet

#

I need your opinion

echo basalt
#

also wtf is this command class

grim ice
#

is having a static getter to a private variable static abuse

compact haven
#

they shouldn't be static at all

#

idk how Forge's API works but there has to be a way to dependency inject

echo basalt
#

sorry for light theme, can't really bother re-setting up spigot dark theme

eternal oxide
#

If you have a static getter you shoudl be usign the singleton instance instead

echo basalt
#

thing is he has a singleton for a utility method

#

but static getters on main

grim ice
eternal oxide
#

yes

grim ice
#

That's great info

eternal oxide
#

unless its a constant

grim ice
#

Good thing i asked here

#

ty all

#

any thing more btw?

compact haven
#

indeed, & also don't be so quick to reject our criticisms aha

grim ice
#

so the only way to pass objects around without singleton pattern

#

is with DI

compact haven
#

well obviously it's not the only way, as you have seen, but it's the best way

grim ice
#

well everything other than the configuration class

#

is a singleton

#

but its not enforced

compact haven
#

it's not

#

a singleton is not just static, that's not what a singleton is

grim ice
#

a singleton implies that only one instance will be made

compact haven
#

that only one instance can be made

#

if you don't control the implementation of the class you're using, you can't make it a proper singleton

#

singletons need to have a private constructor & a public method to get the global instance

quaint mantle
#

how would i make a message saying "ending in 15 mins" then it goes down to 10, 5, 1, 45 secs, 30 secs, 10, 5, 3, 2, 1, would i have to make a lot of runTaskLaters

eternal oxide
#

you could do it in one

quaint mantle
#

how

eternal oxide
#

just an array of times to fire the message

ivory flume
#

How do I split the config file into multiple ones, does the API support that

#

or do i need to write my own saving/loading mechanism for that

crisp steeple
#

create your own config file

#

or make configuration sections inside the main one

ivory flume
#

sections get super messy imo

#

k ty

river oracle
#

anyone fimilar with adding permissions / removing permission from a player

#

I'm to braindead to figure this out

eternal night
#

preferably use luck perms api

#

instead of your own permission system

buoyant viper
#

GM4L

river oracle
eternal night
river oracle
#

I'm ont hat website rn

river oracle
#

thanks pal I connected my 2 braincells together thanks to you

eternal night
#

glad I could help those two braincells 👍

ivory sleet
grim ice
#

static getters without a singleton pattern are static abuse

#

others already told me they are tho

ivory sleet
#

meh

river oracle
#

nice profile picture Conclure

ivory sleet
#

I mean static isnt really favored ofc, since its more procedural and object oriented

#

and usually comes with inherent tight coupling

#

but whats the scenario 2hex?

river oracle
#

I only really use static for Util methods and Constants

ivory sleet
river oracle
ivory sleet
#

:3

grim ice
#

i have a static getter for a few variables that are only initialized once

#

in my main class

ivory sleet
#

mind link me?

grim ice
#

well one isnt initialize once

#

ok

ivory sleet
ivory sleet
#

static factory methods

#

stateless objects

river oracle
ivory sleet
#

fair

river oracle
#

what is a stateless object

ivory sleet
#

an object that once created does not change the values of its instance variables

crisp steeple
#

instancers are kind of just a factory-lite

grim ice
#

so what do u think

ivory sleet
#

I mean its probably fine here

#

Like you're throwing away partial testability, abstraction and some reusability

#

but usually you tend to only change and want these properties for certain things regarding a minecraft mod

grim ice
#

wdym throw away abstraction?

ivory sleet
#

static is extremely concrete and implementation detailed

#

thats kinda one point of static

#

or well

#

effect

grim ice
ivory sleet
#

there's no inheritance, nor polymorphism

#

mye

grim ice
#

hm

ivory sleet
#

tho that probably doesnt concern you here

grim ice
#

It does, I don't wanna throw away benefits when there is another solution

#

ill stick with dependency injection i assume

arctic moth
#

How would I move the explosion in onentityexplode

#

Or do I just have to remove it and create new explosion

echo basalt
#

in theory, you could shift every block on the blocklist by your offset

ivory sleet
#

alright 2hex, I mean you could just couple the config, and the other current objects you declare under the static variables into a context object

#

(like with a record or sth) and pass that

grim ice
#

so have a data class to pass around with DI?

#

but all of them arent related to each other much

ivory sleet
#

mye, well immutable data carrier which would facade your highest ordered modules

worldly owl
#

hey, sorry for interrupting, but how do i setup a redis pubsub without freezing the server?

ivory sleet
#

yeah, if you can, solving it by distributing more classes would be way more robust

#

but if you just want to get away from static in particular

worldly owl
# grim ice async

i have 0 idea how to do async with java, isnt the try {} catch {} stuff async because thats what im doing

ivory sleet
#

the biggest threat of using static here I could see is if initialization happens in multiple threads

echo basalt
#

new Thread(() -> ...).start()

ivory sleet
#

?di

From times to times, the usage of DI implies that classes have large constructors, which arguably decreases the maintability and readability of a class. Intermittently, this suggests that the class may be responsible for more than one major reason to change (formally known as the single responsibility principle), in which a conceivable solution would be to chop the class into smaller classes.

worldly owl
#

ty

undone axleBOT
grim ice
#

I see

#

So having a class

#

with many parameters inn the constructor

echo basalt
#

TBH I just pass my main class and have it as a sort of hub

#

with tons of getters

grim ice
#

is a sign of breakiing srp

echo basalt
#

unless it's a data class, or mostly data-based

ivory sleet
#

Let me get straight to the point, having a static singleton that holds a bunch of other objects isnt much worse than passing a data/context object that holds the other objects

#

its almost equally coupled (not really, but from an oo view its deplorable)

worldly owl
echo basalt
#

either

worldly owl
#

ah kk ty

echo basalt
#

CompletableFuture is more advanced

ivory sleet
#

leaked what exactly are you trying to do?

echo basalt
#

where you can link futures together and do stuff like

CompletableFuture.runAsync(() -> ...).thenRun(() -> ...);```
worldly owl
ivory sleet
#

what library do you use?

worldly owl
echo basalt
#

Then just use a daemon thread

worldly owl
ivory sleet
#

:c

worldly owl
#

bruh now its complaining about my chatevent reeee

echo basalt
#
Thread thread = new Thread(() -> jedis.subscribe(channel, this));
thread.setDaemon(true);
thread.start();
ivory sleet
#

myeah just launch a thread like Illusion said

worldly owl
#

aight tyty

ivory sleet
#

hopefully you use a jedis pool tho

worldly owl
#

oh no i dont i tried it and assumed thats why the server was locking up lmao

echo basalt
#

and return objects to the pool

worldly owl
#

ill go change that backk

echo basalt
#

🤦

#

I remember forgetting to return stuff to the jedis pool

grim ice
#

@ivory sleet in conclusion, I should divide my classes more and use DI

echo basalt
#

and just letting the objects die

#

and wondering why jedis wasn't workin after a bit

grim ice
#

So I don't break SRP or static abuse

ivory sleet
worldly owl
#

i have 0 idea what returning it means

ivory sleet
#

yeah

#

well there are tons of design patterns as well that might help you with this

grim ice
#

And to not sacrifice some benefits that static removes from me in this caae

echo basalt
#

you take a kid out of that pool and feed it a sandwich

#

are you just gonna let that kid stay outside and get sunburn

worldly owl
#

but how would i return it?

#

theres the issue i was having with a jedispool!

grim ice
ivory sleet
#

I'd start with learning facade, adapter, proxy, delegation/forwarding, lazy initialization, observers... well all of them

Remember there's nothing new about design patterns, they're just formalized patterns that have been around for ages, we just gave them canonical forms and names such that we can think and talk in terms of them

echo basalt
#

just a very bad example

worldly owl
#

wtf does that mean

#

google did nothing earlier

dusk flicker
#

it tried to evict you but failed

echo basalt
#

you're likely lacking apache common pools

worldly owl
dusk flicker
#

yep

worldly owl
#

fair play

worldly owl
echo basalt
#

man tried to evict you through an apache helicopter and failed smh

worldly owl
#

true

#

imagine

echo basalt
ivory sleet
#

but yeah in short term keep the code base SOLID 🙌

worldly owl
#

ah kk found commons-pool2 on mavenrepo

#

ayyy my plugin works now ty guys ;D

ivory sleet
#

pog

worldly owl
#

i mean the chat sync is absolute crap but its meant as an example

#

okki im uploading this to github to work on it tmr byeeee

compact crane
#

Hi, how can I tell the Villager in code that he is forgetting his bed and work block. (Like when I take down the Villager's bed and block).
Thanks in advance!

dusk flicker
tender shard
#

do villagers actually have an assigned bed?

dusk flicker
#

I didn't think so

tender shard
#

I thought they always just head to the nearest bed

dusk flicker
#

I dont think they have one, nothing in the code says they do ¯_(ツ)_/¯

tender shard
#

hm wait

#

do villagers actually sleep at all?

dusk flicker
#

the built in sleep param just takes a location for them to sleep at

#

ye

tender shard
#

oh

#

opk

#

ok*

#

and do they actually have any "assigned work block"? I also thought they simply get a profession and look for the nearest matching work block

#

I probably don't play this game often enough lol

dusk flicker
#

they do match to that block and that gives them the profession

tender shard
#

yeah but is that block now "reserved" to this specific villager?

dusk flicker
#

if the block is broken & you havent traded with them to lock it in they will lose the profession

tender shard
#

hm

#

then it's probably somewhere in NMS

dusk flicker
#

I think it has something to do with it but honestly I havent messed with it enough

tender shard
#

or in CraftVillager

ivory sleet
#

yeah

ivory sleet
#

the block would be reserved

tender shard
river oracle
#

?paste

undone axleBOT
worldly owl
#

AAAH intellij light mode

tender shard
#

VillagerData saves the VillagerType and VillagerProfession

#

but neither of those stores a location

tender shard
worldly owl
#

yes but why flashbang yourself?

dusk flicker
#

alex likes light mode

#

alex show picture of your discord

river oracle
#

Working with LP Api and having issues adding permissions I have 1 permission adding fine, but once it gets added all other permissions I'm trying to add are frozen. Using a basic util method All permissions increment I've tested all of them so the error has to be in my lpUtils class

Util Method
https://paste.md-5.net/hanepuhopi.cpp
LpUtils
https://paste.md-5.net/marohedafa.java

worldly owl
#

NONONONO

#

NO NEED TO SEND A DISCORD PICTURE

river oracle
#

LIGHTMODE

dusk flicker
#

send it alex

worldly owl
#

ITS FINE YA KNOWWWW I LIKE EYES

dusk flicker
#

do it

tender shard
river oracle
dusk flicker
#

perfect

worldly owl
#

OW WHY

dusk flicker
#

on a side note clean your fucking keyboard

tender shard
#

I have to support my local energy supplier

worldly owl
#

BRUH YOU JUST LOVE MILITARY GRADE FLASHBANG YOURSELF AT NIGHT

dusk flicker
#

military grade is such a shit term

#

military grade = cheapest shit ever

worldly owl
#

yes but e

tender shard
dusk flicker
#

ah

#

you must have a fuck load of pollen lol

tender shard
#

there's this weird pollen-spawning tree right in front of my balcony lol

dusk flicker
#

I have a keyboard I use in the machine shop where I work and it aint even that bad

worldly owl
#

me being a dumbass looking at how to make a permissions plugin

dusk flicker
tender shard
#

whenever I go to vacation, I simply put my keyboard into the bathtub lol

#

when I come back, it's dried again and I can again use it

dusk flicker
#

lol

ornate scarab
#

hey, is there a way to register a left mouse button click event? (no i dont mean damage, playerinteractentity event or stuff like that)

I mean simply the action of clicking ur left mouse button

worldly owl
ornate scarab
dusk flicker
#

no actually

worldly owl
#

ive never done mongo with java, ik theres spigot docs on it but still

dusk flicker
#

like its very simple

#

Mongo is nice

worldly owl
#

oh is it?

tender shard
worldly owl
#

ye its pretty nice on JS

tender shard
#

e.g. PlayerInteractEvent

dusk flicker
#

mongo has a nice java api

river oracle
#

I like mongo

dusk flicker
#

all you really need to is make the actual db manager where you connect to it, otherwise just a method to get collections and thats about it, everything else is search methods and just uploading documents

worldly owl
#

wait do if im doing mongo do i want morphia or the regular mongodb one

dusk flicker
#

I just run normal mongo

worldly owl
#

aight bet

river oracle
#

I used Mongo Reactive Streams API

tender shard
#

mongo is a german insult for "disabled people". I never understood why they used this word for the database thing lol

dusk flicker
#

LMAO

river oracle
#

lo

dusk flicker
#

people that use mongo are mongo /s

worldly owl
#

lets go

#

gamign

dusk flicker
#

I wont lie my mongo methods are fucking huge

worldly owl
#

the docs say to apt-get install mongodb but why do that when 🌟 docker 🌟

dusk flicker
#

oh im gonna get fucking killed

worldly owl
#

why

tender shard
#

for real, the word filter sucks...

worldly owl
#

ok thats not the blocked word

#

there

#

thats dumb

dusk flicker
#

sooo my partner I work with wanted to have the rank color I use show up on /list but like, its coded in a way atm where it is the old chatcolor enum rather than hex

worldly owl
#

depp

river oracle
dusk flicker
#

and to change that id prob have to wipe the db

worldly owl
#

gg

tender shard
#

it's an actual disease

worldly owl
#

also gg modded discord my guy

tender shard
#

is it also not allowed to say "diabetis" or "cancer" here?!

worldly owl
#

goosemod?

dusk flicker
#

cancer

#

haha

river oracle
#

its not even a bad word

#

diabetis

dusk flicker
#

wow that code is cancer!

river oracle
#

cancer

tender shard
tender shard
#

unfortunately the staff ignored my forums post about this useless word filter

dusk flicker
#

@vagrant stratus dont ignore alex

#

:/

for legal reasons this is a joke

worldly owl
#

if i were to, say, make a rank system, would minecraft automatically handle the hex colors in chat or do i have to do that

river oracle
dusk flicker
#

its nice

tender shard
dusk flicker
#

oh I know

worldly owl
#

if someone kills you

#

dont tell them to go fuck themselves

#

call them a mongo loid

worldly owl
tender shard
#

to be honest, "harmless" insults work way better than real ones anyway

river oracle
#

I can also say kill urself but nah mongo loid is where they draw the line

#

too far

dusk flicker
#

I store stuff as strings and on the chat event (or actually papers) I just format the msg

#

I'll find my thing rq

worldly owl
tender shard
#

noone cares whether someone on the internet calls you a "motherf**" but when someone calls you a "useless nitwit", then you start to think about your life choices lol

river oracle
#

so accurate

worldly owl
#

yes i hink my life choices

dusk flicker
worldly owl
#

i agree

ivory sleet
river oracle
#

LP API can go die Idon't get it so therefore it is bad

ivory sleet
#

like it stores a list of blocks or sth iirc

tender shard
worldly owl
ivory sleet
#

and no not the villager data one

#

wat

#

the lp api is god ascend

#

flexible, robust and feature rich

tender shard
#

I stopped looking at it, it's just sooo frustrating that Ctrl+Shift+F does NOT work in decompiled stuff 😦

river oracle
#

its like getting held up on assigning one permission ASakashrug

tender shard
#

or the "Find usages" thing

river oracle
#

and wont assign others

worldly owl
#

hell yeah