#help-development

1 messages ยท Page 805 of 1

eternal oxide
#

that creates a Bukkit Entity so it will trigger events you can listen to

serene sigil
eternal oxide
#

did you run buildtools --remapped?

serene sigil
#

ye

#

i followed mfnalexes turoial

#

?nms

serene sigil
#

this one

eternal oxide
#

did you run the buildtools command it says to run?

serene sigil
#

yes

eternal oxide
#

are you building against 1.18.2?

serene sigil
#

no 1.19, but i replaced the version in the command

eternal oxide
#

your error says you still have 1.18,2 in your pom specialsource entry

serene sigil
#

alright ill try running bt again

eternal oxide
#

no0

#

fix your pom

serene sigil
#

wait ill show my pom

#

?paste

undone axleBOT
serene sigil
eternal oxide
#

yeah you didn;t update teh version in specialsource

#

which is why I use mine so I only have to change the version in the properties entry

serene sigil
#

so i should change the special source version to yours?

eternal oxide
#

yes

#

and add the line in properties

serene sigil
#

wdym

#

it givesme now this errpor

#

@eternal oxide

twin venture
#

cannot access com.sk89q.worldedit.world.registry.WorldData
class file for com.sk89q.worldedit.world.registry.WorldData not found

how i can fix this?

#

trying to build my plugin

chrome beacon
#

Add the WorldEdit dependency to your project

twin venture
#

already do

#

iam adding worldguard just to make sure its not from it

serene sigil
twin venture
#

and my java version is 17

chrome beacon
#

Pick one

#

also don't use System Path dependencies

twin venture
#

i use both

chrome beacon
twin venture
#

should support new mc version and old mc versions

#

that's why iam using both .

chrome beacon
#

To prevent conflicts use two different modules

twin venture
#

hmm

serene sigil
minor junco
#

?mappings

undone axleBOT
chrome beacon
#

define your variable correctly

#

if you need help with that show us your pom

#

?paste

undone axleBOT
serene sigil
chrome beacon
#

You aren't defining the spigot version variable anywhere

#

so ofc it won't find it??

serene sigil
#

oh

chrome beacon
#

ElgarL showed you

serene sigil
#

@chrome beacon now it says

Unsupported class file major version 63

chrome beacon
#

Don't use Java 19

#

Use Java 17

serene sigil
#

ok

serene sigil
eternal oxide
#
        <maven.compiler.target>19</maven.compiler.target>```
#

change to 17

#

you now only have to change the version in one place

twin venture
#

hi uhhh

#

Unsupported class file major version 61

upper hazel
#

why location is not null but location.getWorld can be null? why intelji think so

twin venture
#

trying to build a plugin with worldedit

#

the java version is set to 17

shadow zinc
#

?paste

undone axleBOT
shadow zinc
#
org.bukkit.plugin.InvalidPluginException: java.lang.RuntimeException: Error resolving libraries
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.2.jar:git-Paper-260]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.2.jar:git-Paper-260]
        at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.2.jar:git-Paper-260]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.20.2.jar:git-Paper-260]
        at net.lenni0451.spm.storage.SingularRuntimePluginProviderStorage.enter(SingularRuntimePluginProviderStorage.java:54) ~[PluginManager.jar:?]
        at io.papermc.paper.plug......```
#

Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact com.github.retrooper.packetevents:spigot:jar:2.0.2 in central (https://repo.maven.apache.org/maven2)

#

even tho i did this

#
        LibraryLoader libraryLoader = new LibraryLoader(new RemoteRepository.Builder("codemc-releases", "default", "https://repo.codemc.io/repository/maven-releases/").build());
#

im confused why it isn't using the repository i specified

eternal oxide
#

You should ask in Paper about the paper loader

shadow zinc
#

im using paper to test it, it has nothing to do with paper

#

code is in my plugin

#

not relying on paper

#

screw paper

eternal oxide
#

LibraryLoader is not spigot

shadow zinc
#

correct

#

its in my plugin

#

i copied the code

#

and put it in my plugin

#

as legally as possible

#

regardless

#

why is it using a different repositiory

#

curious behaviour

#

updated code

slender elbow
#

why are you reading the plugin.yml from the plugin's config folder ๐Ÿ’€

lost matrix
#

What is the reasoning behind

FileConfiguration config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "plugin.yml"));

After having the PluginDescriptionFile already?

serene sigil
#

Guys help @eternal oxide @chrome beacon

slender elbow
#

yeah so you're trying to use 1.19 internals in 1.20

shadow zinc
#

so i gotta pull up my sleeves and do it myself

orchid trout
#

sleeves

shadow zinc
#

no one asked

serene sigil
orchid trout
shadow zinc
#

in game

slender elbow
#

either run 1.19 server or compile against 1.20 internals in your project

serene sigil
#

ok

slender elbow
#

see the package name, it contains v1_19, 1.20 will contain v1_20 instead

eternal oxide
#

you are using NMS so you have to build against teh exact version your server is going to run

shadow zinc
#

elgar, i remember you

#

the teh guy

eternal oxide
#

thats me!

shadow zinc
#

i respect the consistency

#

teh*

#

i've changed the code a bit

lost matrix
shadow zinc
shadow zinc
#

and im running it like this

#
        LibraryLoader libraryLoader = new LibraryLoader(
                new RemoteRepository.Builder("codemc-releases", "default", "https://repo.codemc.io/repository/maven-releases/").build(),
                new RemoteRepository.Builder( "central", "default", "https://repo.maven.apache.org/maven2" ).build());
        libraryLoader.createLoader(this);```
#

but its ignoring my repositories

lost matrix
#

Is your repo public or does it need authentication?

shadow zinc
#

public

#

works normally in my pom

eternal oxide
#

check your builder actually applies the provided repository

shadow zinc
#

yeah thats the problem

echo basalt
#

goofy ahh builder pattern

shadow zinc
#

it should apply it

#

you can see how they add the maven repository

serene sigil
#

does anyone know how to override the /summon command

rotund ravine
#

Define it in ur plugin yaml

young knoll
#

And if that doesn't work listen for the command event

#

But yeah plugin commands should take priority

slender elbow
#

remove summon from the default spigot.yml config

young knoll
#

plz no

slender elbow
#

man that is so stupid

young knoll
#

If you are going to override a vanilla command at least leave /minecraft:<command>

rotund ravine
slender elbow
#

the default settings for command replacement in spigot.yml

#

commands.replace-commands or smth

serene sigil
#

basically I want the /summon minecart command to summon a special nms minecart

#

and not the default one

shadow zinc
#

im actually joe biden

#

gotta use a different flag

#

problem fixed

#

lmao

#

finally a human being with a sense of humour

serene sigil
#

lol

slender elbow
young knoll
#

lol

#

Good ol days

slender elbow
#

silly defaults, but yeah you'll want to remove those from the spigot.yml if you want to have /summon be for your plugin

#

ofc /minecraft:summon will still be accessible

young knoll
#

What should the defaults be

slender elbow
#

well certainly not commands that don't exist

young knoll
#

:p

#

I am happy to update it if people let me know what should be replaced by default

worldly ingot
#

As a wise man once said...

#

"PR or shut up >:("

young knoll
#

Deez nuts

#

oh

worldly ingot
#

Well that too

rotund ravine
#

My nuts yeah

slender elbow
#

yeah idk about the "wise" part if that was the case

worldly ingot
young knoll
#

Ugh don't get me started

#

I love worse versions of /tp and /kill

shadow zinc
#

why isn't this getting my plugin.yml? ```java
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "plugin.yml"));

#

because i do this and it says its empty ```java
List<String> libraries = config.getStringList("dependencies");

eternal oxide
#

your plugin.yml is in your jar not the plugins data folder

shadow zinc
#

how might i get it?

#

wait

#

steal the spigot code

#

genius

eternal oxide
#

why not just use the description file as its API

shadow zinc
#

the spigot code is good to copy and stuff right?

#

im using 1.8

#

and it doesn't have getLibraries

worldly ingot
#

Sure but you can still get the contents of the YAML file via code

eternal oxide
#

it still has description

worldly ingot
#

plugin.getDescription().getDependencies() should yield you a List<String>

eternal oxide
#

orjava YamlConfiguration description = YamlConfiguration.loadConfiguration(new UnicodeReader(plugin.getResource("plugin.yml"))); List<?> libraries = description.getList("libraries");

worldly ingot
#

Also works

shadow zinc
#

i made it up for my library

eternal oxide
#

so add them

worldly ingot
#

You're telling me that in the 1.8 API, plugins had no concept of dependencies?

#

That seems hard to believe

shadow zinc
#

im saying plugin.getDescription().getDependencies() isn't a function

eternal oxide
#

its literally a text file.

worldly ingot
#

Oh, right, depends vs dependencies

shadow zinc
#

yeah

slender elbow
#

spigotmc contributor

worldly ingot
#

LISTEN

shadow zinc
#

i can't use libraries because 1.8

worldly ingot
shadow zinc
#

and i need additionally repositiories

worldly ingot
#

Gotcha

shadow zinc
#

anyways

rotund ravine
#

Shading

shadow zinc
#

no

eternal oxide
#

use the code I just gave you

shadow zinc
#

its gonna be thiccer than those pound girls on my tv

young knoll
#

Can't you just do

slender elbow
#

sounds like brazil

young knoll
#

YamlConfiguration.loadConfiguration(getResource("plugin.yml"))

#

Or does getResource not work for plugin.yml

worldly ingot
#

Can it take an InputStream?

#

If so then yes

young knoll
#

I think there is one that can

chrome beacon
#

Do keep the license in mind since you're using Spigot code

young knoll
#

Ah nope

#

Only reader or file

shadow zinc
#

im only selling it for 5 bucks

#

jk

young knoll
#

Clearly we need YamlConfiguration.loadConfiguration(nio Path)

worldly ingot
#

I honestly did consider potentially exposing some NIO stuff, like a FileSystem for your plugin directory

glossy venture
#

you can just create an InputStreamReader to read the config from a resource

shadow zinc
#

oh wait

#

i have a util that reads the plugin.yml

#

forgot about that

#

i guess i could use that

#

ffs i gotta shade maven resolver

slender elbow
#

yes

eternal oxide
#

why?

shadow zinc
#

idk

#

i think the error code says that

#

something about java.lang.IllegalStateException: The super POM /org/apache/maven/model/pom-4.0.0.xml was not found, please verify the integrity of your Maven installation

#

wait maven resolver is in spigot isn't it?

slender elbow
#

since 1.16

eternal oxide
#

I do it all myself in pre 1.16 versions

shadow zinc
#

ah

#

the server is running 1.20 so its not caused by that

shadow zinc
#

idk what java.lang.IllegalStateException: The super POM /org/apache/maven/model/pom-4.0.0.xml was not found, please verify the integrity of your Maven installation means

quiet ice
#

While building or wha?

#

Well soon enough my custom maven resolver will release. It should only be in embargo for 5-10 more months

shadow zinc
#

god?

#

i fixed it

#

just restarted the server ๐Ÿคฆโ€โ™‚๏ธ

proud badge
#

would having a long array (an array containing the banned players) cause issues? It wouldnt be permament just for stuff like whenever someone gets banned on my server it shows a count of how many bans there are, so I would put them in an array and get the array length then

ivory sleet
#

Sounds a bit scarce, I mean you probably want to save and load it somewhere (like to a database or a flatfile), then also it may not be nice if you plan on having a large amount of players

lost matrix
ivory sleet
#

Like it scales relatively poorly

proud badge
#

because rn our ban system is in skript ๐Ÿ’€

lost matrix
#

So your plugin fetches this data from skript somehow?

#

Or do you mean an array in skript?

shadow night
ivory sleet
proud badge
#

nope

proud badge
#

Im slowly migrating my entire server from skript to java

lost matrix
#

Sounds reasonable

ivory sleet
#

Sounds like an amazing must do plan

shadow night
#

I wonder how much of a performance difference there would be

ivory sleet
#

Not only about raw performance

proud badge
lost matrix
shadow night
#

What if all skripts got their own thread

vast ledge
#

Might improve performance

#

but still

#

skript will stay skript

shadow night
#

Does skript count as an interpreted language

vast ledge
#

I mean

#

techincally

#

it is

proud badge
#

but sadly theres some stuff I cant move

#

like player sethomes, or warnings

vast ledge
#

You can

#

theres plenty of /home plugins

proud badge
#

How could I move my sethome variables to java?

#

No I mean like I have 500 unique players

#

How could I migrate their skript variables?

vast ledge
#

Save them in a db or a local file

#

Oh

#

you have the locations

#

and wnat to move them

proud badge
#

I mean like, the player's sethomes are currently stores in the variables.csv file of Skript. and if I remove skript completely players wont have access to their /sethome anymore

vast ledge
#

A csv file

#

gotta check what it looks like

#

Ye csv is fine

#

you can look online

#

Or

#

hm

#

you can have java use some api to read the csv to a different method of saving

#

If you wanna use a db like mongo, you can just import the file

proud badge
#

home::00000000-0000-0000-0009-01f2f10a4d99, location, 8605776F726C6480FF0000000181046E616D65208005686565736501780940942E5A1CAC08310179094051000000000000017A094080C8EBB98C7E2805706974636808419198280379617708C2AE7673
heres an example of a player's sethome in variables.csv file

vast ledge
#

wth is the jamble of garbage behind location,

shadow night
#

Probably some bytes or something

vast ledge
#

base64?

shadow night
#

Base64 looked different last time I seen it

#

Can't know for sure tho

proud badge
#

Its the sethome location

#

but in some sort of encoding

#

h::00000000-0000-0000-0009-01f139125f95, long, 0000000000000003 for example this variable represents how many hours a player has played

shadow night
vast ledge
#

hex

#

ew

#

why tho

#

im not gna question

shadow night
#

Weird shit

vast ledge
#

Then you have to decode the hex and then insert into a database

#

ig

#

or

#

you can insert into db

#

then pull via java, decode, and insert decoded

proud badge
vast ledge
#

๐Ÿ”ฎ

proud badge
#

can I make a database without making a database? I dont want to pay for a seperate database outside of my server? Like can I run a database inside of my own server somehow?

torn shuttle
#

I've done some custom hitbox detections before but is there any known solution to be particularly highly efficient at scale to detect if players have hit an arbitrary hitbox (e.g. not a hitbox that exists in-game insofar as minecraft is concerned)

lost matrix
proud badge
#

epic

proud badge
#

or int bans = server.getBanList(); or something

vast ledge
#

why would it be an int

shadow night
#

Why would the banList be an int

vast ledge
#

it would be a hashmap

shadow night
#

Or atleast a list

proud badge
#

Cause

#

For example 50 players are banned

#

The int would be 50

vast ledge
#

server.getBanList().size()

shadow night
#

That's a Count then, not a list

vast ledge
#

or .length()

proud badge
#

ah ok

vast ledge
#

I have to renew my domain ๐Ÿ˜ข

lost matrix
#
int profileBans = Bukkit.getBanList(BanList.Type.PROFILE).getEntries().size();
#

Or for all types of bans

    int bans = 0;
    for(BanList.Type type : BanList.Type.values()) {
      bans += Bukkit.getBanList(type).getEntries().size();
    }

Not sure how duplicates are handled

vast ledge
#

I dont think it allows them

#

DOes it return a hashmap

#

or a list

#

cus hashmap doesnt allow dupe keys right?

lost matrix
#

I mean IP ban + profile ban with the same ip

vast ledge
#

ah

#

Not sure maybe it returns a ban type

lost matrix
#

Are you Bettanation?

shadow night
#

Is it about minecraft Beta

vast ledge
shadow night
lost matrix
#

Someone else with a pinguin profile pic. He always creates new accounts because his previous persona wasnt cool enough or sth.

vast ledge
#

Ive had the same acc for a while

#

You can check my github

lost matrix
#

Yeah you talk a bit too much sense for being him i noticed

vast ledge
#

xD

slate tinsel
#

Is this kind of a particle or how do you spawn them?

vast ledge
#

Texture pack

torn shuttle
#

left clicks can be detected via PlayerInteractEvent right

vast ledge
#

If ur talking abt the rgb

vast ledge
#

or

#

no

#

it was rightlick

#

that sometimes

#

dies

lost matrix
vast ledge
slate tinsel
lost matrix
#

Meh, for the server its nothing

vast ledge
#

Ye

lost matrix
vast ledge
#

that has nametage

#

background

#

def nametag

slender elbow
#

if you're lagging with 30 text displays, stop running on a raspberry pi

lost matrix
#

ESP32

vast ledge
#

Im not lagging, but if you want to optimize (everything)

eternal night
#

I run it on my ipad thanks

vast ledge
#

I run it on my toaster

#

Anybody got any ideas
for anythign i could add?

slender elbow
#

free vbucks

lost matrix
torn shuttle
#

your ssn

#

anyone know off the top of their heads what the melee attack range is?

#

3 blocks?

river oracle
#

Ur gonna get haxed

torn shuttle
weak adder
#

I'm trying to make a edit mode thing for my plugin to select a region using a wand.
This is what i've got so far and the code works perfectly fine but in the isInEditMode method for some reason it is not detecting the player is in edit mode or the player is not getting added to the Map

My EditModeManager class - https://pastebin.com/MVjJ6bFk
My CreateCommand class - https://pastebin.com/yTLSNUxd

shadow zinc
#

how can i shade spigot into my plugin?

river oracle
#

You don't god don't

shadow zinc
#

and will i need to shade java into it as well?

river oracle
#

What the fuck

shadow zinc
#

how do i shade windows 10 into my jar file?

river oracle
cobalt solstice
shadow zinc
#

๐Ÿง 

orchid trout
shadow zinc
#

how to shade government classified documents

slender elbow
#

step one is to become an employee

#

in which case, you have my condolences

shadow zinc
#

oh no i don't want joey to nuzzle me

orchid trout
#

how do i get pregenant

shadow zinc
slender elbow
#

step one is to go to an underdeveloped country

vast ledge
orchid trout
#

what if someone raps me

vast ledge
#

What ever

#

am i gna do

river oracle
shadow zinc
cobalt solstice
#

I mean, I don't care about your text.
But there will be people who literally will be unable to read it

vast ledge
#

Just dont be color blind

cobalt solstice
#

kay

#

whatever dude

eternal oxide
#

wrong channel, sorry

vast ledge
#

was abt to say

river oracle
#

#Unknown

slate tinsel
#

don't know how much of a "spigot" question this is but is there "Google Sheets API" for maven?

river oracle
#

the gradle dependencies can be adapted to maven fairly simply

slate tinsel
#

Just checked there, but it's only gradle

river oracle
#

gradle dependencies can be adapted to maven

slate tinsel
#

how? ๐Ÿ™‚

river oracle
#
<dependency>
  <groupdId>com.google.api-client</groupId>
  <artifactId>google-api-client</artifactId>
  <version>2.0.0</version>
</dependency>
#

here is example on the first one

#

too break it down

#

implementation 'com.google.api-client:google-api-client:2.0.0'
com.google.api-client -> Group ID
google-api-client -> Artifact Id
2.0.0 version

slate tinsel
#

" Provides transitive vulnerable dependency maven:commons-codec:commons-codec:1.11 Cxeb68d52e-5509 3.7 Exposure of Sensitive Information to an Unauthorized Actor vulnerability Results powered by Checkmarx(c) "

river oracle
#

ignore that or upgrade

#

the version if one exists

#

its letting you know of a vulnrability

slate tinsel
#

like this?

        <dependency>
            <groupId>com.google.api-client</groupId>
            <artifactId>google-api-client</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.oauth-client</groupId>
            <artifactId>google-oauth-client-jetty</artifactId>
            <version>1.34.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.apis</groupId>
            <artifactId>google-api-services-sheets</artifactId>
            <version>v4-rev20220927-2.0.0</version>
        </dependency>
river oracle
#

๐Ÿคทโ€โ™‚๏ธ idk does it work properly?

slate tinsel
#

no error message at least from intellij, maybe try with some code ig

river oracle
#

did you refresh maven

slate tinsel
#

yes

valid burrow
#

what are mob effects and how does one use them

river oracle
#

MobEffects rae just Potion Effects iirc

dull mango
river oracle
#

final makes sense here

#

you can still insert entries into an empty collection

dull mango
river oracle
#

collection fields in most cases should just be final. Especially in manager classes

dull mango
#

yes

river oracle
#

yes it is

#
        if(player.hasPermission("afkarea.commands.create") || player.hasPermission("afkarea.commands.*")) {
            if(args.length <= 1) {
                player.sendMessage(utils.s(player, utils.getConfig().getString("messages.no_args_provided")));
            } else {
                if(utils.getConfig().contains("afk-areas." + args[1])) {
                    player.sendMessage(utils.s(player, utils.getConfig().getString("messages.area_already_exists")));
                } else {
                    editModeManager.startEditMode(player, args[1]);
#

my guess is one of these else statements aren't reached

summer scroll
river oracle
summer scroll
river oracle
#

I'm assuming Executor#sync is the thing that delays the action 1 tick

summer scroll
#

Correct, delaying the action by 1 tick.

river oracle
#

try delaying it for 2 ticks

summer scroll
#

Yeah I was thinking the same thing however I haven't tried that but I'm gonna try it now.

river oracle
#

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

#

the 2 tick delay might help

summer scroll
# river oracle the 2 tick delay might help

It still doesn't work. I'm thinking about setting the BlockState again but I forgot on how to do that. I'm not sure if it's a thing but I kinda forgot and remember that I need to do something about that.

#

Okay I fixed it, apparently updating the BlockState will remove the items from the inventory.

valid burrow
#

how can i make this return the entity i spawned so i can further do stuff with it

minor junco
#

Well you allocate the creature (entity I assume?) that you add to the world. Just declare a local with your entity that you pass as the argument no?

shadow night
#

or are you

#

nvm

#

I'm blind, sorry lmao

grim hound
#

the PlayerInfo packet is sent to others after the PlayerJoinEvent, right?

weak adder
slate tinsel
# river oracle did you refresh maven

I managed to read from the spreadsheet document but when entering the data I get this error:

{
  "code": 403,
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.ErrorInfo",
      "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
    }
  ],
  "errors": [
    {
      "domain": "global",
      "message": "Insufficient Permission",
      "reason": "insufficientPermissions"
    }
  ],
  "message": "Request had insufficient authentication scopes.",
  "status": "PERMISSION_DENIED"
}```

My code:

```java
        ValueRange appendBody = new ValueRange()
                .setValues(Collections.singletonList(
                        Arrays.asList("This", "was", "added", "from", "code!")
                ));
        try {
            AppendValuesResponse appendResult = sheetsService.spreadsheets().values()
                    .append(SPREADSHEET_ID, "congress", appendBody)
                    .setValueInputOption("USER_ENTERED")
                    .setInsertDataOption("INSERT_ROWS")
                    .setIncludeValuesInResponse(true)
                    .execute();
        } catch (IOException e) {
            throw new RuntimeException(e);

        }```
upper hazel
#

how can you install logs on the code in the plugin so that it is not so tedious

#

and do not check whether the log is enabled or not

#

or without it itโ€™s not like

#

and what are the standards for logs and what is the best way to log everything that happens in code

#

I don't want to reinvent the wheel

slate tinsel
river oracle
twin venture
#

while using worldedit to load a schematic into the world i get this problem :
stopTiming called async for anti-xray - obfuscate

#

is this from how i handle it , or is it like that?

kindred sentinel
#

I have subcommands like /pl a or /pl b. Every subcommand needs it's permission, but i want player with op have all permissions, how to do this? Now it works if i use luckperms or add permissions manually to player, but by default player with op don't have permissions

sterile token
river oracle
#

I just moved it into my main lib

sterile token
quaint mantle
#

question im using papiapi and i want to add this placeholder %ultimateautorestart_seconds% whats the command to add it again i forgot

sterile token
#

yes thosens of them, just moved out from latest version to 1 version old

#

and everythign fixed

sterile token
river oracle
#

yes

sterile token
quaint mantle
#

no s

sterile token
#

They are really nicefull to help you and its more appropiated for help

quaint mantle
#

no so i have a plugin with comes with extensions i need to download using papi im asking how do i download them

sterile token
quaint mantle
#

oh

sterile token
#

this is programming help

quaint mantle
#

right my bad didnt know which one

sterile token
#

na its okay

#

i was too much confused sorry if soudn rude

quaint mantle
#

no you didnt at all

sterile token
#

right, i hope you find how to fix your isssue

quaint mantle
#

me too

#
    @EventHandler
    public void onPlayerPlace(PlayerMoveEvent e) {
        if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.PAPER) {

            Block block = e.getPlayer().getTargetBlockExact(5);
            if (block == null) return;
            Location loc = block.getLocation();
            for (int i = 0; i < 5; i++) {
                Location currentLocation = loc.clone().add(i, 1, 0);
                e.getPlayer().sendBlockChange(currentLocation, Material.GLASS.createBlockData());
                for (int j = 0  ; j < 5; j++) {
                    Location upperLocation = currentLocation.clone().add(0, 0, j);
                    e.getPlayer().sendBlockChange(upperLocation, Material.GLASS.createBlockData());
                }
            }
        }
    }```
#

i made this and how do i edit offset ?

chrome beacon
#

Just offset loc

quaint mantle
quaint mantle
chrome beacon
#

also you don\t need to manually clone each time

quaint mantle
#

and how do i add offset to the location? that was my real question, sorry.

chrome beacon
#

Just use the add the method?

quaint mantle
#

i'm not very familiar with the spigot library

chrome beacon
#

?

quaint mantle
#

oh sorry, i fell victim to google translation

sterile token
grim hound
#

Damn

#

String#trim no longer removes spaces

#

damn

sterile token
#

what does now?

grim hound
#

cuz look at this

grim hound
chrome beacon
grim hound
grim hound
#

what the f-

chrome beacon
grim hound
#

what

scenic onyx
#

because dont set the ServerFolder? (MultoverseCore API)

chrome beacon
grim hound
chrome beacon
#

yes

grim hound
#

uh

chrome beacon
#

That's what it's always done

grim hound
#

Well guess am a fool

icy beacon
#

It trims the string

#

Just like the name says xD

young knoll
#

If you want to remove all spaces use .replace

icy beacon
#

Yeah

#

Removing something in the middle of something is not trimming

#

It's violating

shadow night
grim hound
#

I've been living for years

#

thinking it removes all spaces

#

and never once until now discovering the truth

sterile token
#

i learnt that String#trim() removes starting and ending spaces, they changed what it does so?

hazy parrot
#

It does same as it did since first versions of java

sterile token
icy beacon
chrome beacon
chrome beacon
#

what about it

scenic onyx
kindred sentinel
#

How to add all permissions to people that have OP

eternal oxide
#

set it to op in your plugin.yml

kindred sentinel
#

how...

worldly ingot
#

If you have a permissions plugin then ideally you're not using op at all

kindred sentinel
#

oh..

river oracle
#

yes

worldly ingot
#

I mean yeah. You would have some sort of owner group or something that either has all permissions or all that is required

#

* if you really want

young knoll
#

Better to do only what is needed to limit damage if someone gets compromised

#

But yeah

worldly ingot
#

That's more what I was hinting at

#

Or to avoid stupidity like with me when I used to run /stop out of habit after testing something, and then me literally doing that on my production server at the time

#

:p

young knoll
#

I remember when I did /reload instead of /somepluginreload

#

That was fun

river oracle
#

๐Ÿ’€ everything

#

RIP

young knoll
#

I suppose this is why [redacted] has a confirm arg

river oracle
#

confirm arg?

near mason
#

./reload confirm

river oracle
#

oh I know what you mean now

#

yeah

#

๐Ÿงป

scenic onyx
#

why?

#

this error?

#

the server is 1.8.8

river oracle
#

Phantom doesn't exist in 1.8

#

lmao

young knoll
#

Phantoms don't exist in 1.8

weak meteor
#

Help, my clicks are getting cancelled and the only event i have isnt cancelling it

scenic onyx
#

MultiverseCore is ๐Ÿ™‚

#

how i can resolve?

river oracle
#

must not support 1.8 anymore

weak meteor
#

ye i need help

#

so

#

this method is for my GKit inventory:

#

and its only called when i click the GKit Inventory

#

and idk why

#

inventoryclickevent is cancelled

#

even when the onClick() method i showed doesnt execute

#

this is the main listener

#

delegates to:

#

oh nvm i think i found the error

#

yeah i just found the error

#

but now, when i transfer a item from my inventory to the gkit inventory, how do i identify that?

clever lantern
#

anyone had this error?

in "'reader'", position 0``` , nulls being saved to my config lol, just changed the directory of configs from defualt to .\customconfig
torn shuttle
#

is there a quick and easy way of calculating how much damage a player would deal to an entity? I want to fake a hit to an entity while simulating the right amount of damage

#

and the only way I know how to do that is, uh, laborious

#

I do have the specific entity they would damage

young knoll
#

You can make one attack the other via the api

solemn willow
#

sooo how can i add an 200 whiter skeleton limit to the nether?
my code is:

package me.uwunugget.uwunugget_plugin;


import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.block.Block;

public class Uwunugget_plugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {

        getServer().getPluginManager().registerEvents(this, this);
    }


    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Block block = event.getBlock();
        World world = block.getWorld();





        if (block.getType() == Material.NETHER_BRICKS && world.getEnvironment() == World.Environment.NETHER) {
            org.bukkit.scheduler.BukkitTask task = new org.bukkit.scheduler.BukkitRunnable() {

                @Override
                public void run() {
                    if (block.getType() == Material.NETHER_BRICKS) {
                        world.spawnEntity(block.getLocation().add(0, 1, 0), EntityType.WITHER_SKELETON);
                    } else {
                        this.cancel();
                        return;
                    }
                }
            }.runTaskTimer(this, 200l, 1600l);

        }
    }
}
chrome beacon
#

Why do you need the time that the player got whitelisted?

#

Then just save the time yourself

#

That wouldn't get you the time whitelisted

molten hearth
#

Is there any performance impact to using infinity over a real number

serene sigil
#

hi is there a way to store a velocity vector in a persistentdatacontainer?

drowsy helm
torn shuttle
#

I'm real happy

#

I think I might be able to release my custom model animation plugin today

serene sigil
molten hearth
quaint mantle
#

anyone know a good builder generator

#

I need one that works with records

#

cause im not typing all that out

rotund ravine
#

Oh my

#

Does lomboks thingy work with?

quaint mantle
#

im not using lombok

glossy venture
#

why not

rotund ravine
#

Then get bing to write ur builder i guess if ur too lazy

quaint mantle
#

oh ya u right

#

ima use gpt

#

wtf it worked so well

rotund ravine
#

Usually works fine sometimes

drowsy helm
#

IF itโ€™s an int itโ€™s functionally the same as MAX_VALUE

slate tinsel
#

What is the easiest way to make it look like a player is sitting down on an entity without an entity should I just make the entity invisible then?

rotund ravine
#

Sure

river oracle
#

can't you ride display entities

#

that would be the absolute best if you can

slate tinsel
#

okey ๐Ÿ™‚

minor junco
slate tinsel
#

Can the distance between the player and display entity be increased?

molten hearth
#

is there a builtin bukkit function to check if an itemstack can harvest something's drop

#

as in air should be able to get a drop from a log for example

grim hound
#

how the fuck

#

do you remove a log4j filter

young knoll
#

Never thought about getDrops

#

Sadly it's not perfect

#

For example, tall grass can be harvested by anything

#

But iirc getDrops respects chances, so it may still return an empty list since seeds aren't a 100% drop

#

Even then some stuff just doesn't have drops regardless of what tool you use

molten hearth
#

hmm okay odd

rotund ravine
wet breach
#

you basically don't, you just change it to what you want it to be

molten hearth
#

i dont actually care about the drops i just needed it to know if the item could produce some drops from the block

young knoll
#

rip budding amethyst

molten hearth
#

what is wrong with budding amethyst

#

nvm something is off with budding amethyst

#

shit

#

nvm something is off with small_amethyst_bud

young knoll
#

It drops nothing

molten hearth
#

nvm my shi broke again ong

#

oh shit

#

goddamn it

silent topaz
#

how would I get the proxiedplayer obj from connection im listening ot the proxydefinecommandsevent

slate tinsel
#

Can I move a display entity with a passenger using setVelocity

young knoll
#

display entities ignore velocity

orchid gazelle
#

You can move displayentities with interpolation

slate tinsel
storm crystal
#

do I have to empty my cache HashMap everytime I disable server?

#

or just save that map into database?

orchid gazelle
hazy parrot
storm crystal
#

im asking if I should clear it on server disable

#

or just not care about it

hazy parrot
#

Just don't care about it lol

rotund ravine
#

Donโ€™t need to care

storm crystal
#

alright

meager wolf
#

when u put the cursor on an inventory slot, and hit a number to get the item in that hotbar number to the slot ur hovering on, what event is triggered in that case ?

rotund ravine
#

Click event prolly

#

Maybe some swap event

storm crystal
#

okay thats... way easier than I thought it would be

storm crystal
#

is it an okay way to check for invalid arguments in command?

young knoll
#

Seems alright

storm crystal
#

would Float.parseFloat(something) change the type to float (if possible)?

#

as in

#

would it do it permamently to that thing or just once?

young knoll
#

what?

quiet ice
#

Does anyone have major experiences with CI/CD and knows whether are tools for deploying libraries (using maven or gradle) that are developed in a rolling-release form? I don't want to deploy like spigot does, as it should still be possible to address individual versions

gleaming grove
quiet ice
#

Atm I have been working with Jenkins but given that I've just started setting everything up I am still rather free

gleaming grove
#

Imo github actions are nice and easy for start

quiet ice
#

Oh, and stuff will be self-hosted if that is the question

#

Well not self-self-hosted but run on a VPS that is owned by me

gleaming grove
#

What about artifacts, you wanna to store them on private machine or send to Maven center?

quiet ice
#

While sending them to OSSRH is an option given that I have the keys I'll likely only do that for "stable"/final builds. The other builds are likely going to be dumped into a bog-standard http fileserver, at least that is the idea atm

paper viper
#

I don't understand what you mean by permanantly or just once

storm crystal
#

I was asking if it could change this datatype permamently

#

into float

#

well im not using float rn but the thing is that I made this line of code

quiet ice
#

Uh, do you know how objects and variables in java work?

storm crystal
#

to check if provided arguments are numbers

#

turned out I needed integers but thats just semantics

quiet ice
#

Then I don't comprehend what you are asking for

storm crystal
#

I was asking how it works

paper viper
#

or wait

#

i mean

#

i guess that works

#

if you want argument checking

quiet ice
#

Without using wrapper objects such as AtomicReference you cannot change the type of vars and objects without redefining them

storm crystal
#

I just did that later

#

after the check was passed

gleaming grove
paper viper
#

it unboxes into int

storm crystal
#

command works fine

#

basically adding enemy to database

young knoll
#

Technically that's a really janky way to check if a string is a number

#

However java doesn't provide nice ways to do so

storm crystal
paper viper
#

It's better to use a regex or Ints.tryParse

quiet ice
# gleaming grove Ok, I've never been using Jenkins however if you would have aby questions about ...

The setup I have in mind right now and with whom I'll probably go with if there isn't an already-made solution is to have the Jenkins instance start a custom-made daemon. Make jenkins run maven or gradle which publishes to the daemon. Then have Jenkins send a command to the daemon that will commit all changes to the http fileserver (renaming the versions accordingly, creating index files, etc.) and kill the daemon.

paper viper
gleaming grove
quiet ice
#

I have no clue, I might look into that beforehand I guess

young knoll
#

Ooh Iโ€™ve never heard of tryParse

#

Sounds interesting

paper viper
storm crystal
slender elbow
storm crystal
paper viper
#

No

storm crystal
#

goes straight into last line and throws NPE

paper viper
#

You don't understand how it works

#

Ints.tryParse doesnt throw an exception

#

it returns null if parse failed

#

Integer tryParse = Ints.tryParse(args[index]);

young knoll
#

I wonder if it internally uses parseInt

paper viper
#

then check if null

paper viper
young knoll
#

Yeah exceptions are kinda slow

#

Tis the main issue

paper viper
#

and also it kinda doesnt really follow the general idea of an exception

#

like it doesnt make sense

young knoll
#

Sadly we donโ€™t have like

#

A String#isNumeric

gleaming grove
young knoll
#

Although even that isnโ€™t ideal as you would need something separate for floating point vs integer values

paper viper
#

In the future Guava will change the result of Ints.parseInt to OptionalInt

#

but not for a long time lol

young knoll
#

Ehhh

#

Optional is also kinda wack

paper viper
#

that's true, it's kinda like a bandage

storm crystal
#

okay works now thanks

#

anything I could do about it?

paper viper
#

and then just use it later on

young knoll
#

C# is kinda nice with their out keyword

#

Idk how other languages handle it

slender elbow
#

structured bindings ๐Ÿฅบ

young knoll
#

Can I get that in not big brain computer science terms

#

Iโ€™m special

slender elbow
#

var [a, b, c] = someFunctionThatReturnsATupleOrSomething()

young knoll
#

Ah

paper viper
#

๐Ÿคฏ

young knoll
#

int, boolean parseInt

hazy parrot
#

ook lol

paper viper
#

soooooo

#

maybe we're good ๐Ÿ˜‚

young knoll
#

Pretty sure java is still jank

#

Integer.parseInt can only produce NFE but Double.parseDouble can also produce NPE

young knoll
storm crystal
#

would this work?

paper viper
#

you are unboxing so if its null it will produce an error

storm crystal
#

well thats why I used try and catch?

slender elbow
paper viper
#

No that's not the point

storm crystal
#

you told me to reassign it to something

#

so I did

paper viper
#

is this assuming all the arguments are valid numbers?

young knoll
#

Yes but you are forcing it to be unboxed

paper viper
#

or are you still checking?

storm crystal
#

thats the check

paper viper
#

then you still need to check if its null

storm crystal
#

if it gets NPE it stops

#

wouldnt it count as check?

paper viper
#
Integer num = Ints.tryParse(args[index]);
if (num == null) {
  sender.sendMessage(ChatColor... blah blah);
}
#

That's the whole point of Ints.tryParse

#

to avoid catching the exception

#

Also uh, check your indexes in your array too

#

they look kinda weird

#

Oh wait

#

nvm they're fine I can't see subtraction lol

storm crystal
#

like that?

hazy parrot
#

!=

paper viper
#

Yeah but you will get bullied

#

if u do !(num == null)

#

Do !=

storm crystal
#

idc tautology works

paper viper
#

I used to do that but i stopped cause it was kinda weird

storm crystal
#

well im mathematician

#

so it makes more sense to me

young knoll
#

!(x != nullnโ€™t)

storm crystal
#

~(something = something') rather than something ~= something'

paper viper
#

But do you understand why your original code would throw an exception

#

It's cause you are esssentially converting the Integer back to int so if the original Integer was null to begin with, it will throw an exception

#

The point of Ints.parseInt is so you don't have to catch an exception, and you just perform a null check

#

Catching exceptions are expensive and also in this case, not rlly appropriate because it doesn't rlly make sense from a design standpoint

inner mulch
#

why does player#getClientBrandName return null?

paper viper
#

According to documentation

Returns player's client brand name. If the client didn't send this information, the brand name will be null.
For the Notchian client this name defaults to vanilla. Some modified clients report other names such as forge.
compact haven
#

because the client didn't tell the server

paper viper
#

So ig sometimes it doesnt tell the server yeah

storm crystal
#

i got a question about my custom damage plugin logic

#

should I manage enemy healthbar and their actual health separately?

#

or should I make separate method for calculating damage and then apply this damage to a method that would damage entity and update their healthbar at the same time?

paper viper
storm crystal
#

Id like to also make indicator of damage dealt

#

so I was thinking about latter

#

so I could get how much damage I'd deal without actually dealing it

paper viper
#

Yep

storm crystal
#

okay im getting a bit better at making plugins now

#

I only need to add weapon database and I can push further with it

#

I can then just remove config managers

minor junco
#

But yh it adds cost ofc but idk if that's that costly

paper viper
#

Yeah sorry that's what i meant

minor junco
#

I agree tho that it's a design flaw when parsing numbers

#

But you shouldn't prematurely not use a specific thing if it adds minor cost when there's no realistic bottleneck to be made through this

#

Especially when it comes to something that requires only 20 ticks per sexond

quaint mantle
#

We encountered certain modifications during the endeavor to generate a config.yml from the plugin resources. This occurred subsequent to an upgrade from version 1.20 to 1.20.1. Would anyone happen to possess information regarding alterations in this regard?

minor junco
sullen marlin
#

can you provide more information

#

I doubt the version upgrade has anything to do with configs

paper viper
#

I think honestly I'd just prefer Ints because it looks cleaner and design stuff yeah

young knoll
#

To quote an old stackoverflow post on it

minor junco
#

Honestly just use NumberConversions from Bukkit

young knoll
#

You can use parseInt if you want to troll the people that do your code review

minor junco
#

NumberConversions.toInt is better integrated since it's using Integer.parseInt under the hood

#

@paper viper

paper viper
#

Ints.tryParse doesn't use Integer.parseInt tho, it has it's own process which returns null if it doesn't work

hazy parrot
#

point of conversation is not to use parseInt xd

minor junco
#

Ah okay

#

So you want null to be returned if the operation fails I see

paper viper
#

Yeah

young knoll
#

Speed doesnโ€™t really matter much here since itโ€™s a command

#

However who wants to benchmark it :p

slender magnet
# sullen marlin I doubt the version upgrade has anything to do with configs

Hi, the problematic Code is from me so i can provide more Information. We try to load a .yml file from the Plugin resources via plugin.saveResource and plugin.loadResource. After that we save the file itself, so user can edit it. The Problem is now, that we get an empty .yml file although our file in the resource folder isnt empty. I assume that the problem is something with the save or loadresource Method on the Plugin object.

paper viper
#

Omg 20 nanoseconds faster ๐Ÿ˜Ž

minor junco
#

Again tbf micro speed shouldn't matter too much when you have 50ms between ticks

young knoll
#

Hey

sullen marlin
#

I'm sure the method is fine

#

?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.

young knoll
#

50ms isnโ€™t a lot

minor junco
#

It is tho if you worked in other games

hazy parrot
#

if you type that commands 100000 times its 0.002 seconds faster

#

i mean, its ok ๐Ÿคก

young knoll
#

Plus what if I want to run my server at 100tps in 1.20.3

#

Then itโ€™s only 10ms!

minor junco
#

Wtf

paper viper
#

what if everyone on my server used a chat macro and typed the command 100 times per second and i had a 1000 players

slender magnet
paper viper
#

and i wanted to run my server at 100 tps

young knoll
#

Lol commands are bound to the tick loop

minor junco
#

What if a meteor decides to destroy one of my servers

paper viper
#

what if the server building burns down

young knoll
#

Actually

paper viper
#

๐Ÿ‘ฟ

#

OVH

young knoll
#

Maybe you can send multiple commands in the same tick, idk

minor junco
#

These are questions that should be asked at enterprise level when high availability is requested but not for anything else

young knoll
#

Trust me

paper viper
#

dam โ˜ ๏ธ

young knoll
#

Your config loading code isnโ€™t revolutionary

minor junco
#

Bruh just destroyed my bro ๐Ÿ’€๐Ÿ’€

#

Publicly

fallow dragon
slender magnet
paper viper
#

man we are too deep into this lmao

#

it aint that deep XD

slender magnet
#

its the decompiled code, dont complain about naming and shit pls xD

sullen marlin
#
        if (isInitialLoad) {```
#

for starters I dont think that does what you think it does

#

?jd

undone axleBOT
young knoll
#

Yeah getResource will return the same thing on every load

minor junco
young knoll
#

Unless you change the jar contents

paper viper
minor junco
#

Yeah definitely just go with one solution that fits your needs and move on ๐Ÿ˜†

fallow dragon
#

It would actually be cool if spigot support command argments similar to how python does with the typer CLI library because it's such a common use case

young knoll
#

Did someone say ACF

#

Or cloud

minor junco
#

That's the thing with premature optimization and shit you could start arguing without any end, and at the end you change the compilers behaviour yk

sullen marlin
#

I mean you can have a library to do it however you want

young knoll
#

Brigadier

river oracle
#

Or you just do it easy asf using a map and bukkits api like I do xD

slender magnet
paper viper
#

nah i prefer brigad

sullen marlin
#

your code says if file not found in jar then save file in jar

#

obviously that doesn't work

young knoll
#

You gotta check if the destination file exists

minor junco
#

Or you use my library that enables you to create configs off of plain old java objects

#

ยฏ_(ใƒ„)_/ยฏ

young knoll
#

Not the internal one

paper viper
river oracle
#

Nms required be like

paper viper
#

?

#

what

#

It's included in libraries u just set to compile only and use it

#

U dont need NMS

river oracle
#

Bukkit doesn't wrap the types

paper viper
#

i can show my shitty example lmao

#

hold on

slender magnet
# sullen marlin obviously that doesn't work

okay ur right, but could this be the problem? when i open the jar file with z-zip the .yml file exists. So the getResource wont be null... that means the saveResource gets skipped am i right?

paper viper
#

I mean u do need a bit of setup

#

but it isn't that hard

river oracle
#

But then you don't get to leverage what makes brig cool and stuff

#

The beautiful colored arguments and such

river oracle
#

Oh commodore handles the nms for thst?

paper viper
#

Yes

slender magnet
sullen marlin
#

brigadier is like the worst way to make a command library ever

young knoll
#

Commodore, not to be confused with commodore

slender magnet
#

copy paste

#

changed version

#

worked

river oracle
#

People really like their weird ahhh builders

paper viper
#

u dont need the builders

#

well

#

it doesnt have to be messy

#

thats what i meant

#

Divide the separate literals into its own classes

#

not just one fat builder

sullen marlin
#

subcommands.get(arg[0]).execute(..)

paper viper
#

hey man, people do it differently

#

ยฏ_(ใƒ„)_/ยฏ

river oracle
#

Commands aren't trees change my mind

sullen marlin
#

ye they're flowers

river oracle
#

Factz

echo basalt
#

reminds me of my command builder

slender magnet
#

okay well then i go try to fix my issue by my self xd

drowsy helm
#

Acf on top

weak meteor
#

Can someone help me debug my Cooldown Manager?

#

i got some trouble

#

i start by getting my CooldownLoader (its a abstraction class for a Map of <Kit, CooldownManager)

#

i give the cooldown

#

but the user does not have cooldown

storm crystal
rough drift
#

A builder?