#help-development

1 messages ยท Page 521 of 1

eternal oxide
#

bad design?

tall saffron
#

whats the event?

eternal oxide
#

Yes you can change the enum, but you will NEVER assign the same ID to different code.

#

no

#

you change one ID and you get ONE item which is no longer special

#

You seem to be ignoring NEVER REUSE AN ID

#

You can not account for other probrammers being idiots

#

You can comment yoru code is all

#

Nothing is idiot proof if you are allowing end users to modify your code

#

they could CTRL+A and delete,

#

oops your code was not idiot proof

#

If you create an ID of "FIREBALL" and some other dev replaces your code, there is absolutely no way you could programatically prevent that

#

Doesn;t matter if you use Int ID's or Enum.

#

Enum would be better and easier to manage

#

for ID's not teh associated code.

#

for the love of god don;t put your actual executable code in the ID enum

#

You'd end up with an Enum like we have in Materials

#

If you use an Enum for key other devs can;t mess up

#

if they add a function then yes they add to the Enum

#

Enum keys are unique

#

they can;t add a duplicate

#

and you use the actual Enum.name() not ordinal

#

if you used ordinal I can see your argument

#

which is why you use #name()

tardy delta
#

fuck that developer ig

#

theres already that much awful code

scenic onyx
#

How do I reload the plugin

opal juniper
#
  1. stop the server
  2. start the server
scenic onyx
#

create a command that switches the plugin off and on again?

opal juniper
#

you can implement something that does that I suppose

#

its not going to be the same though

scenic onyx
opal juniper
#

you just have to reset any variables / listeners that you need

scenic onyx
atomic swift
#

whats the difference between PlayerInteractEvent#hasBlock() and PlayerInteractEvent#isBlockInHand()

tardy delta
#

the first one probably gets updated after the event completes

wise mesa
#

based on the javadoc it looks like they return the same thing

atomic swift
flint coyote
#

no it's not the same. hasBlock() returns if you interacted with a block (right clicked a placed one)

wise mesa
#

ah

#

that makes more sense

wise mesa
#

bruh what is this

#

Ass-pressure is crazy

atomic swift
# wise mesa

why does it say inform the user? that doesnt make sense

wise mesa
atomic swift
#

yes be we arent users we are devs

wise mesa
#

you are a user of the api

#

different context of user

#

and someone probably just wrote it without even thinking

ember estuary
#

How can i manually re-render a map whenever i like?
Without using a custom MapRenderer extending Spigots MapRenderer, in which the render function would be triggered every few ticks
I'd like to use a MapCanvas, but idk where i could get it from? do i just create my own?

wise mesa
#

and its been there for 10 years after

runic edge
#

Hey I wanted to ask if anybody knows how to get a custom player head into an Inventory. For example the oak head with an "A" on it (https://minecraft-heads.com/custom-heads) or any other heads from that site. Thanks in advance

quiet ice
#

?jd-s

undone axleBOT
weak bear
#

Do you know How can I update my scoreboard without create new lines ?

ember estuary
#

Have you found a better way to do it?
I've been searching for hours, but can't find any...

karmic salmon
#

could i make it like if something.equal("true" or "false")

tardy delta
#

what are we talking about

quiet ice
#

You probably are talking about if (something.equals("true") || something.equals("false"))
|| is the booleanic "or"-operator (technically | (logical or) is also okay but noone uses that one)

tardy delta
#

lets just do Boolean.parseBoolean(something)

quiet ice
#

At this point you should avoid using strings for true/false types of questions and use booleans (or Boolean if you need to use them within a collection)

zealous osprey
quiet ice
#

Well for some reason they have something that should be a Map<UUID, Boolean> but always represents it as a Map<UUID, String> so I made them aware of the possibility of using Boolean

zealous osprey
#

ahhh, gotcha. Makes sense

#

But out of interest, how do you guys make boolean attributes in commands?
Cuase I normaly use flags that you can add to enable/disable certain aspects of more complicated commands

quiet ice
#

I just use true/false

#

I.e. it'll look like /ench laser 4 @a false true

tardy delta
#

lets give this to a 5 years old :)

quiet ice
#

Gotta love how the children are laughing at the proposition

tardy delta
#

"arm for kids" ๐Ÿ’€

young knoll
#

Seems weird to compile scratch into assembly but okay

quiet ice
#

I mean something has to do it

tardy delta
#

its really for kids

#

i remember the time i had to manually encode x86 into binary ๐Ÿฅฒ

atomic swift
#

how do i get a players EquipmentSlot with PlayerInteractEvent#getHand()

young knoll
#

Player.getEquipment.getItem(slot) iirc

atomic swift
#

thx

pseudo hazel
#

kinda weird question but if I have some files of my plugin that only get used when the plugin is used for a public server and some files that are only used for private servers, what do I call the packages to put the files in?

#

I cant create packes with the names public or private

static ingot
#

wdym by "private servers," like you're allowing special features for specific servers that shouldn't be usable on other servers?

#

i'd question naming a package based on that tbh

hazy parrot
#

That doesn't really make much sense imo

#

Release different version for public and use different for yourself

#

At least that is what I would do

static ingot
#

yea. like in a multi-module project. have a premium module and a normal module or something of the sort, with a core module doing the major lifting

tardy delta
#

the moment someone forks your projects and makes the private features public ๐ŸŽ‰

quiet ice
#

I think it is more like dedicated server vs integrated server

static ingot
#

that is still questionable

quiet ice
#

Though these two terms cannot be used in this context but the idea is the same

hazy parrot
#

Yeah it's pretty vague, should probably wait for his explanation

pseudo hazel
#

let me explain myself

#

I am creating a bingo plugin where one half of my users want to just use it on a small server with a group of friends

quiet ice
#

I am 60% sure that they mean "open to public"-servers with public and with private they mean "server among friends"

pseudo hazel
#

and one half wants to use it on server networks

#

and now I have some classes and stuff pertaining to each part

#

but the names private and public were preoccupied by intellij or whatever

#

so I am just looking for better names

quiet ice
#

java. public and private are keywords according to the JLS

pseudo hazel
#

yeah sure

eternal oxide
#

Does the plugin do the same thing on both?

pseudo hazel
#

generally

eternal oxide
#

Then I have zero clue what you are asking

pseudo hazel
#

but I mean, the "public" version can manage more games at once for example

eternal oxide
#

So you are talking features for paid versus unpaid?

vivid skiff
#

How can i remove the delay from a shield like the paper api Player#setShieldBlockingDelay() ?

pseudo hazel
#

no not premium or anything

quiet ice
#

Though honestly that would still be ๐Ÿฆ€

pseudo hazel
#

well

#

how else would you do it xD

quiet ice
#

Merge both into one package

pseudo hazel
#

I mean right now its all in a big blob in my main package

#

I could do that too

quiet ice
#

Perhaps you can find multiple packages that are similar enough

#

Otherwise I can suggest the terms singleton vs networked

pseudo hazel
#

hmm

young knoll
#

Can't you just make it always behave as networked

pseudo hazel
#

those are decent suggestions

#

well maybe, but its more annoying to use as a user

young knoll
#

Let it be able to manage multiple games regardless

pseudo hazel
#

because it also has like stuff to set up so games can be played automatically and such

young knoll
#

Even if it's only running one

ember estuary
#

PacketPlayOutPosition posPacket = new PacketPlayOutPosition(0, 0, 0, 0, pitch, Set.of(PacketPlayOutPosition.EnumPlayerTeleportFlags.a, PacketPlayOutPosition.EnumPlayerTeleportFlags.b, PacketPlayOutPosition.EnumPlayerTeleportFlags.c, PacketPlayOutPosition.EnumPlayerTeleportFlags.d), 1, true);

Whenever i send this packet, my player gets kicked with the message "Invalid move player packet received".

What am I doing wrong? How to fix? It worked fine in previous versions, but now in 1.19+ it seems to be broken.

pseudo hazel
#

anyways I will play around with some of the options yall have given me, thanks

ember estuary
#

Its meant to set the players pitch and yaw to a specific position while keeping his momentum which would be removed if i used a normal teleport packet

young knoll
#

Obfuscated NMS

#

Guh

ember estuary
#

Maybe my explanaions helps? xD

young knoll
#

Why are you not using remapped

ember estuary
#

how

hazy parrot
#

?nms

slim wigeon
young knoll
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.Inventory.getType()" because the return value of "org.bukkit.event.inventory.InventoryClickEvent.getClickedInventory()" is null

ember estuary
#

maybe just add an

if (event.getClickedInventory() == null) return;

slim wigeon
livid dove
#

Was I halucinating when I thought there was an article on better GUI practices?

young knoll
#

There is

livid dove
#

I wonder... ?gui

#

?gui

#

Welp i tried lol

pseudo hazel
#

there is no command

#

you need to find the article

#

its by smile

#

the reward for finding it is that you can read it ๐Ÿ˜›

eternal oxide
#

there is, by 7smile7 I think

livid dove
#

Aye there it is

#

He made me smile as his approach was the same as me and a friend just did in a non minecraft plugin and were were here like "Wait spigot devs DONT do this?!?"

slim wigeon
dense falcon
#

How give permission with a commands like: /add_perm PERMISSION

echo basalt
#

Create a permission attachment

agile anvil
#

You'll probably prefer using an existing plugin

flint coyote
dense falcon
agile anvil
#

?jd-s

undone axleBOT
young knoll
#

Luckperms supports timed perms

#

Idk about regional

agile anvil
dense falcon
#

I mean give a permission to a player.

#

Imagine you have a permission whose name is "rm.perm.add" and you want to give it to a player.

agile anvil
#

You have to use the PermissionAttachment object to give string permissions to a player

undone kernel
#

?paste

undone axleBOT
flint coyote
#

I was just giving an example. Maybe someone wants to hand out a permission when a specific mob is killed

#

or only at full moon lmao

#

Are those PermissionAttachments permanent or do they automatically get removed on reconnect?

#

I never tried using them

young knoll
#

They are lost on restart

#

Idk about relog

ember estuary
agile anvil
ember estuary
#

Had the same thought. But what else would i pass as the Teleport ID?

agile anvil
ember estuary
#
        ClientboundPlayerPositionPacket posPacket = new ClientboundPlayerPositionPacket(0, 0, 0, pitch, 0, Set.of(
                ClientboundPlayerPositionPacket.RelativeArgument.X,
                ClientboundPlayerPositionPacket.RelativeArgument.Y,
                ClientboundPlayerPositionPacket.RelativeArgument.Z,
                ClientboundPlayerPositionPacket.RelativeArgument.X_ROT), (int) (Math.random() * Integer.MAX_VALUE), false);

using mojang mappings now, maybe that helps understand my code

flint coyote
ember estuary
#

what to put instead of (int) (Math.random() * Integer.MAX_VALUE) ?

undone kernel
agile anvil
undone kernel
flint coyote
#

and are you sure you updated the plugin?

#

And not moved it some wrong location/forgot to restart?

undone kernel
#

I recompiled it It's not in the wrong location

agile anvil
#

The proper way is to stop, remove plugin, compile, move, and start (yeah it's long, yeah...)

flint coyote
#

I always use /rl and only do a full restart if I run into weird issues

#

most of the time I do not though

undone kernel
#

so basically i'm fucked or smth

#

time to create a new project

flint coyote
#

you are missing something

undone kernel
flint coyote
#

Maybe you are moving the wrong file, check if it's creation date is actually as of now

#

try changing the version in the pom to see it reflected in the name

#

do a full restart

agile anvil
#

How do you compile it? I mean which process of maven do you use?

undone kernel
#

I just press the green button to compile it

weak bear
#

Do you know How can I update my board without re showing it

#

just update it

flint coyote
dense falcon
#
package fr.program;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class RMEventListener implements Listener {

    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent msg) {
        Player player = msg.getPlayer();
        String message = msg.getMessage();
    }
}

``` How can I add something before the message of the player with this event?
#

Ex: the player send "Hello", I want to have "Yo Hello".

flint coyote
#

use setFormat()

remote swallow
#

Msg.setMessage

agile anvil
flint coyote
weak bear
#

like that

weak bear
agile anvil
#

Damn, please paste it here

#

?paste

undone axleBOT
dense falcon
flint coyote
#

event.setCancelled(true)

undone kernel
#

Where might the console be in intellij I only see the terminal

weak bear
undone kernel
#

or do you mean windows cmd

flint coyote
#

the terminal is a windows cmd

agile anvil
weak bear
agile anvil
#

However I recommend using a lib like FastBoard

undone kernel
quiet ice
agile anvil
opal saffron
quiet ice
flint coyote
#

yes quack duck gave u the answer

#

I'd still install maven

undone kernel
flint coyote
#

how so?

agile anvil
#

Why?

undone kernel
#

it's struggling right now it can barely run intellij

quiet ice
agile anvil
#

Never really found the performance impact of PATH actually

undone kernel
agile anvil
#

Outch Intel core duo ๐Ÿ˜ณ

quiet ice
eternal oxide
#

4gig memory is your issue

undone kernel
opal saffron
#

ough

quiet ice
#

But yeah, memory is more of an concern

agile anvil
#

Actually this processor is really okay

quiet ice
#

The CPU is probably fine

eternal oxide
#

you'd do better running Eclipse over InteliJ on that PC

flint coyote
#

Didn't know such low specs are fine for win10 lmao

undone kernel
eternal oxide
#

less than 4 gig as you have on board video with shared memory by the looks

undone kernel
quiet ice
#

Unlike gradle maven doesn't make use of daemons to "improve" performance, so ironically you'd be fine

sullen marlin
#

Probably fine?

#

E8500 is like 15 years old

undone kernel
#

I think that's better then my other cpu

sullen marlin
#

Launch Date: Q1'08

quiet ice
undone kernel
#

my uh intel pentium dual core e5460

agile anvil
#

(not windows ofc)

quiet ice
#

Running out of memory can be big ouch if you are not careful

undone kernel
dense falcon
#

How I delete a replace a name of the key in a config.yml ?

Or just delete the key.

undone kernel
#

with the worst specs

dense falcon
undone kernel
#

yeah my memory is fine

agile anvil
#

1066MHz ?ยฟ

undone kernel
#

a dell exclusive speed

agile anvil
#

I love dell

undone kernel
#

me too

flint coyote
#

I'm suffering just by watching those specs though :x

#

Imagine living without an SSD

agile anvil
#

But you'll have to insert some more coins to get a decent hardware lmao

undone kernel
#

I wouldn't even be using this pc if my pc motherboard didn't break

#

before I had a i3 10100 and a 3060 with a 500gb samsung ssd

#

but the motherboard broke and I'm stuck with this piece of shit

quiet ice
vast ledge
undone kernel
vast ledge
#

noice

undone kernel
#

the only good thing about this pc is that it can somehow run minecraft at 60+ fps (1.8)

eternal oxide
#

a brick can run 1.8 at 60 fps ๐Ÿ˜›

flint coyote
agile anvil
undone kernel
#

2 chunks no fancy graphics

echo basalt
#

1tb m.2 ssds are like 50 bucks now

#

so

flint coyote
#

my secondary drives are all empty

undone kernel
#

if I ran shaders you'd probably hear a nuke

undone kernel
echo basalt
#

for what? 100x less speed?

undone kernel
#

yes

quiet ice
eternal oxide
#

OS on SSD, disable swap file on that drive and install all applications to another drive. Always my prefered setup.

vast ledge
#

Am i outclassing myself here?

echo basalt
#

ayo how you got neofetch

#

in windows

vast ledge
#

scoop install neofetch

flint coyote
vast ledge
flint coyote
#

in 2016 they were like 1GB=1โ‚ฌ but that quickly changed till 2018

undone kernel
agile anvil
undone kernel
#
'iwr' is not recognized as an internal or external command,
operable program or batch file.```
vast ledge
#

windows powershell has it

undone kernel
#

hold on 3 minutes while I open up powershell

vast ledge
#

xD

quiet ice
undone kernel
#

it hasn't loaded the shell yet

vast ledge
#
echo basalt
#

there ya go

vast ledge
echo basalt
#

do I care

vast ledge
#

no

echo basalt
#

I paid like 200 bucks for it

undone kernel
#

bruh tf is this

 iwr -useb get.scoop.sh | iex                                                                         Initializing...
PowerShell requires an execution policy in [Unrestricted, RemoteSigned, ByPass] to run Scoop. For example, to set the execution policy to 'RemoteSigned' please run 'Set-ExecutionPolicy RemoteSigned -Scope CurrentUser'.```
vast ledge
#

xD

undone kernel
#

oh it's finally doing something useful it's downloading

remote swallow
#

Win 10 pro sus

echo basalt
#

ebay key for 1$

vivid skiff
#

Is possible to remove the blocking delay from the shield?

undone kernel
echo basalt
#

no โค๏ธ

undone kernel
#

bash version

echo basalt
#

I have 8x as much ram as you

undone kernel
#

do you get the old experience of having a slow computer? I bet you don't

echo basalt
#

I did

#

I had a linux mint pc when I was like 6 because windows xp was too heavy for that pentium cpu

#

I also started coding on a 4th gen intel laptop

#

with 4gb ram

undone kernel
#

I also used to have a pentium*

echo basalt
#

and worked on it for years until I saved up in 2020 and built a shitty pc

echo basalt
#

I had 16 at the time

undone kernel
#

that's still not bad

echo basalt
#

ram size doesn't matter tho

#

but like

undone kernel
#

what cpu did you have in 2020

echo basalt
#

I bought an 80$ ebay gpu

#

ryzen 3 3100

#

was the cheapest new cpu

undone kernel
#

that's really not bad

#

that's worse then my first laptop

undone kernel
echo basalt
#

I still have a few gt210's

undone kernel
#

but now that i'm stuck with this dell optiplex which doesn't have a gpu slot I can't put it in there

undone kernel
echo basalt
#

idk I got furious at that pc and tossed it out

atomic swift
#

apparently "steel_lock"==null

#

how come when i run getLock(ItemStack) i get null but when i log 1 of the Strings in the method i get "steel_lock" and the method im trying to check has "steel_lock" as a key

sullen marlin
#

?nocode

undone axleBOT
#

Itโ€™s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

atomic swift
#

i sorta fixed it by removing a line that checks if its null

weak bear
#

How can I update the board with lib FastBoard pls for players

opal saffron
echo basalt
#

not useful imo

hasty prawn
#

^ just null check

echo basalt
#

I'd rather learn about java first rather than stressing over minor features

steady rivet
#

I'm seeing that in 1.19.4 ChatColor class is deprecated. Is there a new class to use instead that I'm not seeing?

dense falcon
#

Why when I have the permission but not op I see a "red command"? I mean the name of the command when I type is red, not white like if I was op.

steady rivet
dense falcon
# steady rivet did you set your permission to default to op for the plugin.yml of the command?
name: RankManager
version: 1.0
api-version: 1.19
main: fr.program.Main
commands:
  create:
    description: Crรฉation d'un rang
    permission: rm.create
  remove:
    description: Supprime un rang
    permission: rm.remove
  list:
    description: Liste tout les rangs
    permission: rm.list
  spr:
    description: Donne un rang ร  un joueur
    permission: rm.spr
  scr:
    description: Donne une nouvelle couleur ร  un rang
    permission: rm.scr
  snr:
    description: Donne une nouvelle couleur ร  un rang
    permission: rm.snr
  addperm:
    description: Donne une permission ร  un rang
    permission: rm.addperm
  removeperm:
    description: Retire une permission ร  un rang
    permission: rm.removeperm
#

I added in a permissionattachment "rm.list" to test but when I type my command whose name is "list", I see it like if I had not the perm.

steady rivet
steady rivet
#

right now you have it set so that in order to use the command you people to require the permission rm.list in order to use your /list command

atomic swift
#

why can't i add nbt to doors

hasty prawn
#

Why would doors need NBT data

atomic swift
#

why not

hazy parrot
#

Why would you use nbt

#

?pdc

hazy parrot
#

?blockpdc

undone axleBOT
steady rivet
#

didn't realize that was a paper thing lol

subtle folio
#

adventure text

#

kyori

#

fart

remote swallow
#

minmessage

delicate lynx
#

adventure โค๏ธ

atomic swift
#

why isnt the item setting set to air
player.getEquipment().getItem(event.getHand()).setType(Material.AIR);

sullen marlin
#

use equipment.setItem

atomic swift
#

thx

red otter
#

Hey, i have a problem with packetwrapper
this is my code:

        values.add(new WrappedDataValue(5, WrappedDataWatcher.Registry.get(Boolean.class), true));```

and the problem is:
```java.lang.NullPointerException: Cannot invoke "java.lang.Class.getConstructors()" because "com.comphenix.protocol.wrappers.WrappedDataValue.HANDLE_TYPE" is null```
sharp bough
#

is there any good api for async tasks other than the normal bukkit api or papermc?

#

i need to make a plugin with a lot of async tasks and im looking for better options

echo basalt
#

CompletableFuture ??

#

.

unkempt escarp
#

For people that have been working with item displays, is it just me or is interpolation duration a bit buggy? Sometimes the display spawns immediately at the final step of the transformation but other times it animates correctly

sharp bough
echo basalt
#

It's a java feature

remote swallow
#

this

echo basalt
#

I wrote that guide because people were confused

wet breach
#

since you can make it a daemon thread

sharp bough
echo basalt
#

or make a thread exec

#

that makes daemons

#

anyways going to bed now

wet breach
#

you only need 1 as a daemon

#

all the others should be a child of it

echo basalt
#

been awake since like 6am

#

nearly 2am now

wet breach
#

in this manner you don't have to worry about the threads shutting down, as soon as the main does, the daemon will too and the child threads

#

but yeah you could put the thread exec on the daemon thread and probably the best to do ๐Ÿ™‚

wet breach
#

nor will it take much

#

the only reason I suggest making your own thread instead of using Bukkit tasks is that the tasks are tied to the tick rate of the MC server

#

the thread system you create wouldn't be tied to that and instead is bound to the cpu speed making your queries faster

sharp bough
remote swallow
#

T

#

are they rolling it back out now

#

makes sense

#

how do i make a list

#

in markdown

#

adds up

tough dagger
#

does anyone know how to make/where i can find a plugin that can give players revive passes and let the players type a command to use them?

wet breach
#

you are in the development channel

tough dagger
#

oh were do i post that then

wet breach
#

well if you read the channel names it should be obvious #help-server

tough dagger
#

well development sounded like the name for the channel where people create plugins but alr

wet breach
#

you are asking for a plugin already made

#

it is also not the channel to illicit services either

#

that is located on the forums

wary topaz
#

is there a way to update a block in a chunk? lets say worldedit pastes a floating grass, and I execute a command to update the coords of the grass, I want the plugin to update it (remove the block basically)

#

idk a good way to explain it

subtle folio
#
private float yawFromLocation(double x, double y, double z) {
        Vector direction = getA().toVector().subtract(new Vector(x, y, z));
        System.out.println(direction.getZ());
        System.out.println(direction.getX());
        float yaw = (float) Math.toDegrees(Math.atan2(-direction.getZ(), direction.getX()));

        return yaw;
    }```

Hey all, I have this code for making the yaw face twoards location A. For some reason this only works with both getZ and getX are both positive or negative, not one or the other. Any ideas?
tender shard
# subtle folio ```java private float yawFromLocation(double x, double y, double z) { Ve...
GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/VectorUtils.java at a1f7e122204b5ec4c45c6c9572272042c826ce03 ยท JEFF-Media-GbR/JeffLib

subtle folio
#

thanks alex

tender shard
#

wth can I not rename modules in IJ lol

#

looks like I gotta manually rename that folder

remote swallow
#

alex back on gradle?!?

tender shard
#

I haven't done anything for 2 days, now checking again whether I get it to work

#

on macOS this time

remote swallow
#

i think i figured out why the jar was always getting bigger

tender shard
#

I remember you told me the issue but I don't remember you having mentioned any fix lol

remote swallow
#

if i download my javadoc jar from my repo for epicspigotlib, the jar includes another javadoc jar, and that one does too

remote swallow
#

i just had an idea

#

who tf pr this dog shite to it

#

that literally just broke the entire javadoc stuff lmfao

slim wigeon
#

Ok, I got a hopper that auto sells. On Roblox, there is machines that you get your earned balances. Now should I do that with my hoppers or add a user uuid to add to player's eco? public void sellInv() { Inventory inv = ((org.bukkit.block.Hopper) this.block.getState()).getInventory(); for(ItemStack item : inv.getContents()) { if( item == null ) { continue; } if( !item.isSimilar(new ItemStack(item.getType())) ) { continue; } if( plugin.shop.manager.hasMaterial(item.getType()) ) { ShopItem shopItem = plugin.shop.manager.get(item.getType()); inv.removeItem(item); } } }

quaint mantle
#

Hi

#

Who speak russia ? And development

remote swallow
#

now the idea i would have used to fix it wont work unless i re-add what "ItzZisker" removed

tender shard
#

i just reverted that PR

#

current version seems to be working fine on macOS

wary topaz
#

` public void updateChunkBlocks(Chunk chunk) {
World world = chunk.getWorld();
int chunkX = chunk.getX() << 4;
int chunkZ = chunk.getZ() << 4;

    for (int x = chunkX; x < chunkX + 16; x++) {
        for (int z = chunkZ; z < chunkZ + 16; z++) {
            for (int y = 0; y < world.getMaxHeight(); y++) {
                Block block = world.getBlockAt(x, y, z);
                block.getState().update();
                if (block.getType() == Material.GRASS) {
                    Block blockBelow = block.getRelative(0, -1, 0);

                    if (blockBelow.getType() == Material.AIR) {
                        block.setType(Material.AIR);
                        world.playEffect(block.getLocation(), Effect.STEP_SOUND, Material.GRASS);

                    }
                }                
            }`

Can somebody rate this ? Like find any thing I should add or smt

tender shard
#

why are you randomly updating the blockstate

#

also, why are you setting the "blockBelow" to AIR if and only if it already is air?

wary topaz
#

?

young knoll
#

They are setting block to air if block below is air

tender shard
#

oh yeah my bad

wary topaz
#

hehe

tender shard
#

but the random blockstate update is pointless

#

or what's the point for doing that

wary topaz
#

its cause of worldedit

slim wigeon
#

Yes, there is a issue with worldedit. I know why he might be updating the blockstates. I was a admin of a server years ago and I had to install a light fixer due to lighting issues. There can be dark areas shown in fully bright room

tender shard
#

ah you just want it to do a physics check, yeah well okay in that case it makes sense

wary topaz
#

ive fixed this
for (int x = chunkX; x < chunkX + 16; x++) { for (int z = chunkZ; z < chunkZ + 16; z++) { for (int y = 0; y < world.getMaxHeight(); y++) { Block block = world.getBlockAt(x, y, z); if (block.getType() == Material.GRASS && block.getRelative(0, -1, 0).getType() == Material.AIR) { block.setType(Material.AIR); world.playEffect(block.getLocation(), Effect.STEP_SOUND, Material.GRASS); } } } }

#

(compacted)

slim wigeon
#

or glitches

wary topaz
#

personally I am making this plugin because of worldedit issues, it will be open source to help beginner coders

young knoll
#

I swear worldedit used to have a command to update everything in the selection

#

Or if they didnโ€™t they really should

slim wigeon
wary topaz
#

what do you think the command was?

remote swallow
tender shard
#

wdym

wet breach
#

the flag worldedit has, is to not do physics

remote swallow
#
:nms:1.19.4:main: Could not resolve com.mojang:authlib:3.18.38.
Required by:
    project :nms:1.19.4 > io.papermc.paper:paper-server:userdev-1.19.4-R0.1-SNAPSHOT

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

:nms:1.19.4:main: Could not resolve com.velocitypowered:velocity-native:3.1.2-SNAPSHOT.
Required by:
    project :nms:1.19.4 > io.papermc.paper:paper-server:userdev-1.19.4-R0.1-SNAPSHOT

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

:nms:1.19.4:main: Could not resolve io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT.
Required by:
    project :nms:1.19.4 > io.papermc.paper:paper-server:userdev-1.19.4-R0.1-SNAPSHOT

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

``` all exists on papers repo or mojangs
wary topaz
tender shard
#

anyone know a better solution than to manually repeat this for all primitive types?

    public static Character[] toComplex(char[] arr) {
        Character[] newArr = new Character[arr.length];
        for(int i = 0; i < arr.length; i++) {
            newArr[i] = arr[i];
        }
        return newArr;
    }
    
    public static char[] toPrimitive(Character[] arr) {
        char[] newArr = new char[arr.length];
        for(int i = 0; i < arr.length; i++) {
            newArr[i] = arr[i];
        }
        return newArr;
    }
slim wigeon
#

Or maybe

wary topaz
remote swallow
tender shard
remote swallow
#

just checked online its my dns

#

gonna jump onto cloudflares

wary topaz
#

`public class ArrayConverter {
public static Character[] toWrapper(char[] arr) {
Character[] newArr = new Character[arr.length];
for (int i = 0; i < arr.length; i++) {
newArr[i] = arr[i];
}
return newArr;
}

public static char[] toPrimitive(Character[] arr) {
    char[] newArr = new char[arr.length];
    for (int i = 0; i < arr.length; i++) {
        newArr[i] = arr[i];
    }
    return newArr;
}

public static void main(String[] args) {
    // Example usage
    char[] primitiveArray = {'a', 'b', 'c'};
    Character[] wrapperArray = ArrayConverter.toWrapper(primitiveArray);
    System.out.println(Arrays.toString(wrapperArray)); // Output: [a, b, c]

    Character[] wrapperArray2 = {'x', 'y', 'z'};
    char[] primitiveArray2 = ArrayConverter.toPrimitive(wrapperArray2);
    System.out.println(Arrays.toString(primitiveArray2)); // Output: [x, y, z]
}

}
` @tender shard

slim wigeon
remote swallow
#

do you even know what gradle is

tender shard
wary topaz
#

not really

remote swallow
#

gradle is a build system like maven, not a minecraft server software

wary topaz
#

it is a custom class for all of the conversion

tender shard
#

where is the difference? you take in a char[] and output a Character[]. It's not generic and only works for char and you manually loop over the contents. I don't see any difference to my code

slim wigeon
wary topaz
#
    Character[] newArr = new Character[arr.length];
    for (int i = 0; i < arr.length; i++) {
        newArr[i] = arr[i];
    }
    return newArr;
}

public static char[] toPrimitive(Character[] arr) {
    char[] newArr = new char[arr.length];
    for (int i = 0; i < arr.length; i++) {
        newArr[i] = arr[i];
    }
    return newArr;
}``` this is the recommended approach
#

it is basically your code

remote swallow
wary topaz
#

gradle is like maven

tender shard
#

yeah just harder to use and slower to setup

#

๐Ÿฅฒ

wary topaz
#

maven ๐Ÿ†

#

gradle ๐Ÿ“•

slim wigeon
remote swallow
#

it isnt a server software

#

its not a server issue

rough ibex
#

huh

#

what is he saying

remote swallow
#

trying to say i should fix my gradle issues by enabling online-mode

wary topaz
#

@slim wigeon ?learnmaven ?learngradle

#

fuck

remote swallow
#

lmfao

wary topaz
#

?learnjava

undone axleBOT
wary topaz
#

?learn code

slim wigeon
wary topaz
#

okay good

#

why do you want to use gradle than

#

I can get chatgpt to explain it to u

#

`Gravel and Maven are both build automation tools commonly used in software development, but they serve different purposes and have distinct features. Here's a comparison of Gravel and Maven:

Gravel:

Gravel is a build tool developed by OpenAI specifically for managing and building Minecraft mods and plugins.
It provides a simplified build system tailored for Minecraft-specific projects, making it easier to set up and manage dependencies.
Gravel focuses on building and packaging Minecraft projects efficiently, with features like automatic dependency management and version conflict resolution.
It uses a configuration file called gravel.toml to specify project settings, dependencies, and build tasks.
Gravel is designed to work seamlessly with OpenAI's ChatGPT and AI Dungeon platforms.
Maven:

Maven is a widely-used build automation tool primarily for Java projects.
It is a powerful and feature-rich build system that manages the entire software development lifecycle, including compilation, testing, packaging, and dependency management.
Maven uses a declarative XML-based configuration called pom.xml (Project Object Model) to define project settings, dependencies, plugins, and build tasks.
It has a vast ecosystem of plugins and extensions that provide additional functionality and integration with various development tools.
Maven follows a convention-over-configuration approach, allowing developers to follow standard directory structures and naming conventions for their projects.
In summary, while Gravel is specifically designed for Minecraft mod and plugin development, Maven is a more general-purpose build tool widely used in Java and other software projects. Gravel simplifies the build process for Minecraft-specific projects, whereas Maven offers a comprehensive build system for a wide range of software development tasks.`

remote swallow
#

gravel and maven

#

whats gravel

wary topaz
#

gravel makes flint in minecraft

remote swallow
#

in 2023 a new build system joins the team

wary topaz
#

GRAVEL

remote swallow
#

looks like a good build system

wary topaz
slim wigeon
#

I don't plan to, I just trying to help with the issue above. The reason I told him to switch to Spigot is because I think there is a issue in the server's source code. Like for a example```import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

import com.mrnategeek.serverShop.ShopItem;```It can be one of these bukkit classes but in his case, paper

wary topaz
#

are you using paper?

#

for your development

slim wigeon
#

Who?

wary topaz
#

u

slim wigeon
#

I talking about EpicEbic

#

I using Spigot-1.19.3

wary topaz
#

ok]

remote swallow
slim wigeon
remote swallow
#

ij

wary topaz
#

?learngradle

RESPONSE

`Gradle is a powerful build automation tool used for managing and building software projects. It provides a flexible and efficient way to automate the build process, including compiling source code, managing dependencies, running tests, and packaging the project.

Here are a few key points about Gradle:

  1. Declarative Configuration: Gradle uses a Groovy or Kotlin-based DSL (Domain Specific Language) for defining the build configuration. It allows you to specify dependencies, tasks, plugins, and other project settings in a concise and readable manner.

  2. Dependency Management: Gradle has a sophisticated dependency management system that simplifies the management of external libraries and project dependencies. It can resolve dependencies from various sources, such as Maven repositories or local files.

  3. Plugin Ecosystem: Gradle has a vast ecosystem of plugins that extend its functionality. These plugins cover a wide range of use cases, such as Java application development, Android app development, web development, and more. You can leverage these plugins to customize your build process and integrate with other tools.

  4. Incremental Builds: Gradle uses an incremental build system that only rebuilds the necessary parts of the project when changes are detected. This can significantly improve build performance, especially for large projects.

  5. Multi-Project Builds: Gradle supports building and managing multiple projects within a single build file. This feature is beneficial when working with complex projects that consist of multiple modules or subprojects.

To get started with Gradle, you can visit the official Gradle website (https://gradle.org/) and explore the comprehensive documentation and guides available there.

Happy learning and happy building with Gradle!`

tender shard
remote swallow
#

parent

tender shard
#

then I am out of ideas

remote swallow
#

im just testing deleting some files in my local repo

wary topaz
remote swallow
#

works for alex my pc is just refusing to redownload the deps

wary topaz
#

this happend to me but my router was blocking outbound connections from non usa so I fixed it

remote swallow
#

the funny thing is it worked a few days ago

wary topaz
#

try a network restart

#

change your public ip

tender shard
wary topaz
slim wigeon
wary topaz
#

damn

tender shard
#

my IP only changes like once in 3 months lol

wary topaz
#

mine changes when I unplug the router for 3 minutes and plug it back in

#

else its perminate

slim wigeon
#

I know this because I had my website hosted on my network before which cannot be done again as I on a hotspot now

wary topaz
#

whats the program where I can sell my services on spigot?

slim wigeon
#

Services?

wary topaz
#

ye

#

like plugin creatuion

slim wigeon
#

I don't know

wary topaz
#

ive seen it in the chat when a player gets told to go to a link and not advertise

remote swallow
#

?services

undone axleBOT
remote swallow
#

real

wary topaz
#

ty

#

lmfao

tender shard
#

oh wrong reply

#

my bad, I sometimes reply to random messages instead of the actual one

remote swallow
#

im just gonna give up on trying to get it to work

#

ill try it again later

#

i should start doing unit tests

tender shard
#

yeah writing tests is a good way to spend time without actually having to add any new features

remote swallow
#

how do i handle nms stuff with mock bukkit and setting a plugin instance

wary topaz
#

lol alg

tender shard
#

mockbukkit only implements API, not NMS ofc

remote swallow
#

well i mean for like getting a server version

wary topaz
#

private final int myCoolness = 100;
if(you.getCoolness() > myCoolness ) throw new ImpossibleException("It's impossible to be cooler than me B)");

tender shard
#

you can just create a MockPlugin MockBukkit.createMockPlugin("RandomName");

tender shard
remote swallow
#

makes sense

small holly
#

Hey so ive been stuck on this forever, I am trying to host a gradle repository (Preferably with something that can link to the github on push) and all I can get is a local nexus repo. I already have webserver hosting if that is needed

tender shard
#

what is that supposed to be

remote swallow
#

a gradle repo is a maven repo

small holly
#

would prefer to avoid any extra fees

remote swallow
#

use something like nexus or reposilite on the webserver

tender shard
#

there's usually 3 ways

  1. nexus
  2. reposilite
  3. plain SFTP/webserver
#

i prefer nexus over reposilite but it doesnt have a builtin javadocs viewer unless you pay for it

#

and usually you wanna host javadocs too ofc so

small holly
remote swallow
#

yeah

#

you just have to run the publish task, or make a github workflow do it

small holly
#

How I tried forever to do it lol all I could find was using some other software from them that required a premium

remote swallow
#

@tender shard much confusion

tender shard
tender shard
remote swallow
#

yeah

#

oh wait

#

im in src/main/test

#

lmao

tender shard
#

ah yeah that explains it

#

src/test/java

remote swallow
#

ye that fixed it

tender shard
#

and don't forget, you gotta annotate your tests with org.junit.jupiter.api.Test

remote swallow
#

i stole it from lunaticlol

tender shard
#

there's another Test annotation that exists but that other one is wrong

#

I'm great in making up long method names lol

remote swallow
#

Caused by: java.lang.NoSuchMethodException: No compatible constructor for xyz.epicebic.simplesuggestions.SimpleSuggestions with parameters [org.bukkit.plugin.java.JavaPluginLoader, org.bukkit.plugin.PluginDescriptionFile, java.io.File, java.io.File]

#

real

#

going great

tender shard
#

it's all explained in mockbukkit's readme

remote swallow
#

i dont see it

tender shard
#

oh wait, it's not lol. yeah anyway, just create a constructor that takes in those args

remote swallow
#

do i have to use them for anything

tender shard
#

not really

remote swallow
#

i have public SimpleSuggestions(JavaPluginLoader loader, PluginDescriptionFile pdf, File a, File b) {} but im getting a
Failed to instantiate plugin
java.lang.RuntimeException: Failed to instantiate plugin

#

just checked the wiki

#

found a fix

tender shard
remote swallow
#

i had to call super() with the params

tender shard
#

aaaah yeah that makes sense

#

if you had sent the full stacktrace, it would have been obvious that this is needed ๐Ÿ˜›

ocean hollow
#

Hi all. How to find out in which direction the player turned his head? Right or Left?

tender shard
#

right or left of what?

remote swallow
#

can mockbukkit not load resource files

tender shard
#

in playermoveevent, if yaw is less than before, it's left than before. otherwise it's right. if it goes from negative to positive or other way around, the opposite is true

tender shard
#

or do some gradle magic if you wanna have the same as in main, but I don't know how to do that in gradle

remote swallow
tender shard
#

hm are you doing JavaPlugin#getResourceAsStream, or what?

ocean hollow
remote swallow
tender shard
remote swallow
#

just realised i pasted the wrong error

tender shard
#

how does your MessageConfig class look like

remote swallow
#

this is the loadResourceFile method

@NotNull
    public static Optional<File> loadResourceFile(Plugin source, String resourceName) {
        File resourceFile = new File(source.getDataFolder(), resourceName);

        // Copy file if needed
        if (!resourceFile.exists() && source.getResource(resourceName) != null && !ServerUtils.isRunningMockBukkit()) {
            source.saveResource(resourceName, false);
        }

        // File still doesn't exist, return empty
        if (!resourceFile.exists()) {
            return Optional.empty();
        }
        return Optional.of(resourceFile);
    }
tender shard
#

why are you checking whether you're running mockbukkit everywhere? IIRC it should work just fine in mockbukkit like on normal spigot, no need to differentiate everywhere

remote swallow
#

im guessing ill need to add an if for mockbukkit and return an option of the resource

remote swallow
remote swallow
#

so it returns an empty optional and then the param isnt set

#

im starting to think unit testing this isnt worth it

ocean hollow
remote swallow
#

what is the math.abs for, there isnt really aneed for that

#

just the if one is bigger/smaller than the other

ocean hollow
#

I have to do this to ignore small camera deviations.

#

So I'm checking

#

Because if I do a rotation like this:

#

It thinks it's a turn up

tender shard
ocean hollow
eternal oxide
#

yaw goes -180 to 0 to +180

ocean hollow
#

how do i solve this?

eternal oxide
#

What are you not understanding about the answers you got?

ocean hollow
#

Oh, sorry, I made such a stupid mistake. Thank you

#

Already everything seems to be working.

eternal oxide
#

until you turn around

#

-180 to +180 flip

#

uh why are you comparing pitch to yaw?

ocean hollow
karmic salmon
#

!whereiam

#

!whereami

#

damn

hazy parrot
#

? Is prefix

karmic salmon
#

oh

#

?whereiam

#

?whereami

karmic salmon
#

lol

desert tinsel
#

so I am using the PlayerFishEvent and want to change the amount of fishes that player gets from fishing, how can I do it?

#

or how I get the type of fished fish?

#

cause event.getCaught().getType() returns DROPPED_ENTITY or smth

tender shard
#

is event.getCaught() not supposed to be an ItemStack?

#

oh wait no, it's indeed an Entity

#

iirc you can just cast the getCaught() entity to an Item (org.bukkit.entity.Item), then you can get the itemstack using getItemStack() on that, change the amount, then do setItemStack back on that item and there you go

agile anvil
#

Check before casting that entity is well an instance of Item

desert tinsel
#

ok and how do I get the type of the caught entity?

tender shard
tender shard
desert tinsel
#

so I dont get the type of item?

tender shard
#

you can get the type from the itemstack, it'll be a normal Material though

#

e.g. it'll be ItemStack.RAW_COD or whatever

#

or a rotten shoe or sth haha

agile anvil
tender shard
#

holy shit, you're right. I totally forgot about that

#

yeah

#

that explains why it returns Entity instead of Item lol

desert tinsel
#

okie, thanks you

quaint mantle
#

so like I would like to do something

#

specific mobs spawn in specific location (inside a given room)

split gull
#

is there a way to check if a method in a class exists with set parameter types?

tardy delta
#

Class#getDeclaredMethod (or #getMethod) and see if no exception gets thrown

split gull
#

kk

halcyon hemlock
#

?whereami

split gull
#

๐Ÿ˜‚ thats funny as hell

bitter dove
#

Ok, trying in the correct channel...
After a world is created with WorldCreator#createWorld()

I got this beautiful message:

java.io.FileNotFoundException: .\arena_Test\data\raids.dat (Systemet finner ikke angitt bane)```
The system can't find the path...

Sure, I can see that the data folder is not there, but why isn't it created?
quaint mantle
split gull
#
        FileConfiguration config = this.getConfig();
        config.addDefault("aaaaa", true);
        saveDefaultConfig();
        config.addDefault("test", true);
        saveConfig();```, this is what i have in my onEnable, without saveConfig() it only copied the config.yml i have in the resources folder, after adding this method nothing is added to the config.yml
#

any ideas?

tardy delta
#

addDefault doesnt write anything to the file

#

it adds defaults in memory

split gull
#

how do i add then

tardy delta
#

manually calling config.set

agile anvil
#

Use #set

halcyon hemlock
split gull
#

kk

quaint mantle
#

Who know make mods?

#

1.16.5

zealous osprey
#

?whereami

scenic onyx
#

how do i get player skulls?

sullen marlin
#

SkullMeta, setOwner or whatever

scenic onyx
scenic onyx
agile anvil
#

?jd-s

undone axleBOT
agile anvil
#

Or

#

?google

undone axleBOT
scenic onyx
remote swallow
#

guess it doesnt exist

#

@worldly ingot pr go

#

you get to use nmsfor it

worldly ingot
#

BlockDataMeta

#
BlockDataMeta meta = item.getItemMeta();
Light light = (Light) meta.getBlockData(Material.LIGHT);
light.setLevel(15);
meta.setBlockData(light);
item.setItemMeta(meta);```
#

Yes

dawn ledge
#

hi, does somebody have an idea on how to store ItemStack, in a file or something else that persist after restarting the server ?
If yes, can you share me how to do it ?

dense falcon
#

There is a way to remove "all" PermissionAttachment from a player?

dawn ledge
#

Thanks a lot !
If you have a snippet can i see it ?

#

ok ty

tardy delta
#

config.set("x", item)

dawn ledge
#

does it work on any type of file or only on yml file ?

tardy delta
#

you need a FileConfiguration object

dawn ledge
#

ok

tardy delta
#

what is this nonsense

nimble hill
#

This is what i call "The hopper issue" This is a long standing issue that Paper, Taco, and spigot have all given a crack at but nobody seems to have a good "FIX" for the awful performance that hoppers have. This is my fix, its a whole breakdown if anyone wants to read it. But i think this TOTALLY fixes the hopper issue, without compromising on the true function of a hopper, and its Redstone implications etc...
(open in web to get a better quality image)

I Forgot who asked, but whoever it was this is my solution to the problem, and ill be implementing it into React. But in case anyone else has this issue, when i comit / test it ill post the source here too :D

flint coyote
#

lmao released a full scientific paper about it

dawn ledge
#

hi I found how to store the Map of an itemstack but I don't know how to restore my ItemStack from the stored Map

remote swallow
#

what map of an itemstack

#

if your calling ItemStack#serialize you shouldnt need to do that

hollow grotto
#

How can I add a Coin emoji on scoreboard, 'cause I've been experiencing where it instead shows an empty emoji box

remote swallow
#

use utf-8 encoding and find a utf emoji for it

dawn ledge
remote swallow
#

yeah you shouldnt do that

#

use yaml and set("path", itemstack) then getItemStack("path")

#

iirc the deserialize is in craftbukkit + package private

dawn ledge
#

Must I use yml file or can I use random type file ?

remote swallow
#

to use the built in bukkit stuff you need to use yaml

tardy delta
#

the file extension doesnt matter, it must be valid yaml syntax inside that file

dawn ledge
#

ho ok ty

tardy delta
#

wdym how

remote swallow
#

if you want to use json you should use gson and write a type adapter, if you want to use a db serialize the item to a byte[] and save it as a blob

tardy delta
#

saving itemstacks to sql ๐Ÿซฅ

storm isle
#

hello i was trying to find a way to activate a listener only if the player is holding a specific item i tried many different things and none seem to work
more specifically im trying to make a listener that removes blocks around the player when holding any type of firework rocket

remote swallow
#

check if Player#getInventory().getItemInMainHand().getType().toString().contains("FIREWORK")

storm isle
#

it only works when changing inventory slots for some reason

#

this is how the listener is now

    public void onPlayerItemHeld(PlayerItemHeldEvent e) {
        Player p = e.getPlayer();
        if (p.getInventory().getItemInMainHand().getType().toString().contains("FIREWORK")) {
            Location pLoc = p.getLocation();
            World world = pLoc.getWorld();
            int radius = 7;
            int radiusSquared = radius * radius;
            for (int x = -radius; x <= radius; x++) {
                for (int y = -radius; y <= radius; y++) {
                    for (int z = -radius; z <= radius; z++) {
                        if (x * x + y * y + z * z <= radiusSquared) {
                            Block block = world.getBlockAt(pLoc.getBlockX() + x, pLoc.getBlockY() + y, pLoc.getBlockZ() + z);
                            block.setType(Material.AIR);
                        }
                    }
                }
            }
        }
    }
}```
echo basalt
#

oh god

#

learn about uh

#

early return

tardy delta
storm isle
#

i see the problem now

#

im kinda new so had heard of early return but hadnt used it

tardy delta
#

kinda sucks that they dont learn that in school

#

not even in college smh

flint coyote
#

Best pratices are often overlooked

#

All you learn is functionality 90% of the time

#

And some theory about SOLID and other principles

#

Definitly not enough to write clean and maintainable code

echo basalt
#

schools don't give a shit about clean code

#

source: am friends with all the programming teachers at this school, they showed me the protocol

#

It's all standardized and like

#

usually outdated

tardy delta
#

my classmates code is awful lol

flint coyote
# echo basalt usually outdated

To be fair it would make teaching those subjects way harder if it wasn't. You'd have to update everything year by year. Meanwhile math doesn't change at all in a decade

echo basalt
#

ehh somewhat

livid dove
#

Been mucking around with simplifying events in terms of scalability and accidentally made a "ClassConsumerMap".

Its a Map<Class<?>, Consumer<?>> so you can cast generalised child classes back to their class if its within the map, and direct em to specific methods within a Class based on the Class key.

Dunno if general Java, or if there is a better way, but my gut be telling me this is hella cool either way ๐Ÿ˜„

livid dove
#

Yeah we are currently designing a library for all our in-house plugins. And ngl it feels hella satisfying

echo basalt
#

used something similar in the event handling for my minigame lib

livid dove
#

I love smile to pieces, but not having to write onClick, onOpen, onClose over and over again is too nice to describe lol

flint coyote
#

Why is EntityType an enum and PotionEffectType is not? D:

fallen pecan
#

Hello, can anyone help me with a problem I have on my server? When I try to spawn any aggressive entity like a zombie it disappears a second later.

flint coyote
#

that's why I'm asking, too. Peaceful and cancelled events won't take a second to remove the mob

echo basalt
#

abstract away his stuff even more

livid dove
#

Oh im way ahead of ya buddy xD

echo basalt
#

this is what I do with my engine

#

and I just have all menus with a common configuration

livid dove
#

Actually going out of my way to integrate redis into the library so you can cache player's inventories in a HashMap<Player,ItemStack[]> to compare before and after the gui is closed or if the player DC's , gets kicked, quits etc) .

echo basalt
#

and it ends up being pretty versatile

#

instead of having slots I have a Selection interface that's just a List<Integer> getSlots and I can apply elements to them

fallen pecan
echo basalt
#

and those elements don't need to be specifically buttons but can also be like multi-element switches for stuff like scrolling left/right

flint coyote
#

Well do you have any plugins or does /difficulty return peaceful?

fallen pecan
livid dove
#

This is where im currently at with mine

#

*it aint perfect, there is a reason u do UML's before u code a library lol :L *

flint coyote
#

I'm way too lazy for that :x

livid dove
#

Im too lazy not to lol

#

I know if I dont do this now, its gonna be 10x the work later

flint coyote
#

Yes but coding > diagrams

livid dove
#

Maybe thats where im different. I actualy find this really fun

#

And I cant describe the utter joy that comes from sitting down with a UML, and getting code bashed out in 1/3 the time as u know exactly what ur doing

flint coyote
#

Yeah in that case it makes sense

echo basalt
#

yeah I don't do UMLs and all that shit

#

I just write

#

and see where it goes

#

and when I'm unhappy I just nuke it all and rewrite

livid dove
echo basalt
#

and then do small scale tests

#

rewrite some more

#

and learn as I go

flint coyote
#

I mean I'm writing an engine for Regional stuff atm and I also spent like 8 hours reworking something that I would have seen with UML before. But whatever lol

livid dove
#

Something very close to my heart. But fun fact, we can't actually remake the SaturnV rocket as the engineers in the 60's literally designed it like most coders such as yourself.

All hte little changes were wrote down on scraps of paper that have since been lost lmao

echo basalt
#

working on a minigame engine atm

eternal oxide
#

We can't make the SaturnV engines because we've lost the skilled engineers who can do the production work.

livid dove
#

because im one of em

echo basalt
eternal oxide
#

Not skilled enough then ๐Ÿ™‚

livid dove
#

xD

#

fuck got me there

fallen pecan
echo basalt
#

I don't like how the team code is not abstracted away ThinkMega

livid dove
#

But yeah @echo basalt it is the next big thing we are gonna do with ours.

Cause our team's called Curiosity Core we are calling each of our library addons a "core".

The Curiosity Core
The Combat Core
The Command Core

#

Need a name for minigames lol

echo basalt
#

The minigame core

flint coyote
#

How would I dynamically instantiate objects that implement Keyed but aren't an enum?

For enums it's easy.

if (type.isEnum()) {
     return Enum.valueOf((Class<Enum>) type, s);
}

But for some reason PotionEffectType is not an Enum. EntityType is

livid dove
#

xD

#

We are holding the most highest regard aspect of coding up....

#

puns

#

xD

#

Such as the latest and greatest add-on to the CoreProtect plugin made by Curiosity Core.

#

MoreProtect xD

#

its a great name i'll die on that hill lmao

echo basalt
#

The Clown Car

eternal oxide
flint coyote
#

Yeah but the Keyed interface doesn't have any useful methods

#

I don't get why PotionEffectType isn't an enum in the first place. Is that some technical debt?

livid dove
#

And then you could slot that into the general "minigame" abstract and then just define as and when needed .

#

Then an interface with defaults for "GroupGames" and "IndividualGames"

echo basalt
#

ehh

#

too much abstraction

#

some games are weird

#

some are not

#

each minigame is unique and categorizing them into those groups is rather limiting

livid dove
#

You are not categorizing them into groups thats the beauty

#

"Participant" is an abstraction of just "person playing the game"

echo basalt
#

you are categorizing them into the group of "group game" or "individual game"

livid dove
#

And you just add more...

echo basalt
#

I don't need a participant class at the moment

livid dove
#

Each to their own ^_^

dawn ledge
#

Hi,
I having this message when loading my yaml file : unacceptable code point ' ' (0x0) special characters are not allowed in "'reader'", position 2
And when I try to extract my ItemStack from the yaml file by using config.getItemStack() i get this error : java.io.StreamCorruptedException: invalid stream header: 6974656D
Can somedy help me ?

flint coyote
#

post your yaml file

dawn ledge
#
  ==: org.bukkit.inventory.ItemStack
  v: 3337
  type: OAK_WOOD
  amount: 12
item2:
  ==: org.bukkit.inventory.ItemStack
  v: 3337
  type: OAK_WOOD
  amount: 12
item3:
  ==: org.bukkit.inventory.ItemStack
  v: 3337
  type: OAK_WOOD
  amount: 12
item4:
  ==: org.bukkit.inventory.ItemStack
  v: 3337
  type: OAK_WOOD
  amount: 12
item5:
  ==: org.bukkit.inventory.ItemStack
  v: 3337
  type: OAK_WOOD
  amount: 16
#

I create it from my code

eternal oxide
#

?paste your actual yaml code

undone axleBOT
nimble hill
#

Was it too much? Lol

flint coyote
#

Nah all good. Just surprised by the effort. I'm just used to people not even being able to communicate their error e.g. "this doesn't work". So that was the hard opposite

eternal oxide
#

you never write anything to file

dawn ledge
#

so why can I see its content change ?

tacit drift
#

๐ŸงŒ

unreal willow
#

how to convert the build above into a plugin running on 1.19.4

hollow grotto
tardy delta
#

\๐Ÿช™

echo basalt
#

think imma write bedwars today

dawn ledge
hollow grotto
tardy delta
#

and if you litteraly do \u1fa99

hollow grotto
#

It's just that it's not working in scoreboard to represent a coin emoji

#

I have tried that before asking the question here

echo basalt
#

โ›€โ›โ›ƒโ›‚

echo basalt
#

just copypaste em

hollow grotto
#

still don't work...

quaint mantle
#

anyone got a ArmorEquipEvent event

#

i need to use

hollow grotto
#

I would have probably done that before going here asking the question not going to lie...

#

I have ran out of options, so had to ask here

quaint mantle
#

Or EquipmentSetEvnt

echo basalt
#

resource pack

echo basalt
#

and shade it

hollow grotto
#

Well, if that's the last point just to get a coin on scoreboard, then oki

quaint mantle
#

ok bud

dawn ledge
quaint mantle
#

why is minecraft such a boring game

#

every server is the same gamemode

#

nothing unique

tardy delta
#

damn i just realized you can use github gists as a free file storage

karmic salmon
#

int numberweneedtochecklol = Integer.parseInt(String.valueOf(readefileofplayerlol.readLine()));

#

this line 306

tardy delta
#

why arent you using the fileconfiguration api to get an int

karmic salmon
#

it should get any int in string of readfileofplayer.lol.readline

karmic salmon
tardy delta
#

gl then

karmic salmon
#

now

#

it say input string: "players-required: 15"

split gull
#

currently using config.options().copyDefaults(true); and i have an issue with it, in the default config i've added an example and i want to make it so the example is only generated if the yaml path that contains it doesn't exist

tardy delta
#

check if config.isSet("path")

#

if not, set it with the default

split gull
#

ohh smart

#

ty

karmic salmon
#

lol

tardy delta
#

thats how my translation stuff does it

split gull
#

actually how do i use it in this case since im working with a list?

#

the example is a list

tardy delta
#

mhh what list, what does it contain

split gull
#

strings

tardy delta
#

ye buth are those paths or what

hazy parrot
karmic salmon
hazy parrot
#

by using same thing fourteenbrush said to you

karmic salmon
#

i thoguht Integer.parseInt do that

karmic salmon
tardy delta
#

reminds me of my expression parser where i had to do the same bs

karmic salmon
#

fileconfiguration api

#

how use fileconfiguration api

#

what is fileconfiguration api

hazy parrot
hazy parrot
#

its not cmd ig

chrome beacon
#

?configs

undone axleBOT
karmic salmon
#

oh

#

let me see

hazy parrot
#

yeah thanks

karmic salmon
#

oh

#

this whole other system

#

i using other system

#

i can't change all the system to file configuration api

#

i just asking for an error

#

not change for whole system ;/

tardy delta
#

github doesnt quite like me pasting 8000 lines of css lol

#

gists kinda lagging

karmic salmon
chrome beacon
#

Split at : then trim and convert second item in the array

tardy delta
#

well have you looked into the docs?

karmic salmon
#

java dosc

karmic salmon
#

or plguin

#

send me docs link >:P