#help-development

1 messages · Page 224 of 1

undone axleBOT
icy beacon
#

all of us pretty much

buoyant violet
#

build sys?

timber basalt
#

yes

#

ty

mighty pier
#

none of us sorry

peak depot
#

thats litterly the development channel from offical spigot

timber basalt
#

yeah i noticed that

icy beacon
sterile token
#

New build envirolent Graven!

#

The lastest invento around the years for java development

buoyant violet
sterile token
#

Oh please dont use that

peak depot
sterile token
#

Learn a build system

icy beacon
#

yep

buoyant violet
#

how many things do i have to learn

icy beacon
#

for the very beginning you could use the very default compiler

#

but for coding anything good you'll need to learn maven or gradle

#

for now just start with java

kind hatch
buoyant violet
#

well using a default compiler, intellij build system.

#

so... where do i put files that i want to execute?

#

i only have 1 folder

icy beacon
#

alright yall, now for a real question... why is my compiler bitching at a COMMENTED LINE???

mighty pier
#

bad english

#

probably

icy beacon
#

it is a

#

uh

#

compile error

peak depot
#

nah bad english

icy beacon
#

like fr i've been having this error since yesterday

#

i think if i deleted this class it'd still throw an error

peak depot
#

delete comented line and create it again?

buoyant violet
sterile token
#

Default builders from ide will make you suffer a lot because you have to download and manage dependencies manually. In the other hand build envirolent like gradle or maven make that work easier. Because you tell them what dependencies to use (name, version, etc) and they care about download it, etc

icy beacon
#

it throws even when the line is literally empty

#

wtf

sterile token
#

Also using graven is the best option because is 10x fadter than the actual inventions

#

😂😂

mighty pier
kind hatch
icy beacon
#

not exactly in the mood to recreate ~80 files

peak depot
buoyant violet
#

where do i put the files

icy beacon
buoyant violet
#

to code

peak depot
#

src

mighty pier
#

what files

buoyant violet
#

create a class or a file?

kind hatch
peak depot
#

package

icy beacon
#

a class is a java file

icy beacon
kind hatch
#

What's your pom looking like?

icy beacon
#

now that i emptied every method, it errors at a comment, guess it really doesn't like Register:63

peak depot
#

bro got more libaries then I have hair

icy beacon
#

lmao

buoyant violet
#

LETS GOOO i writed my first code in java!

#

package test;

public class myfirstprogram {

 public static void main (String[] args)
 {
     System.out.println("This is my first string of code in java!");
     System.out.println("I hate Roblox");
     System.out.println("Minecraft better lmao");
     System.out.println("Lore FNAF");
 }

}

#

i am following programmingbydoing

chrome beacon
#

|| time to drop the naming conventions link ||

icy beacon
#

yeah...

#

that's gonna be fun

kind hatch
# icy beacon

Hmm, your pom looks fine. Maybe you should purge your com.roughlyunderscore.enchs packages from your local m2 repo. (You would want to quit IJ first)

buoyant violet
#

now i have to write a letter to myself

kind hatch
#

Before you purge

icy beacon
#

also makes sense

#

yeah sure

wet breach
icy beacon
icy beacon
wet breach
#

and didn't quite make it to the packaging install parts 😛

wet breach
icy beacon
#

absolutely nothing

#

like literally nothing

#

the error is ```

wet breach
#

delete the line and retype it

#

most likely there is a hidden character in there

wet breach
#

either delete and retype the line or just shift the line down

icy beacon
#

the content of the line does not matter

#

i shifted the line multiple times

#

in the message that i linked above, it was a completely different line

#

it just errors at 63

#

and if there were to be a hidden char, it'd probably say that in the error or in the ide itself

wet breach
#

try removing .

icy beacon
wet breach
#

at the end of the comment

icy beacon
#

alright, so

#

a funny thing

#

i just cleared the shit out of Register.java for it to have 55 lines

sterile token
icy beacon
#

now it errors at my main class' line 63

#

it really does not seem to be a code problem

sterile token
#

Hmn

wet breach
kind hatch
#

Eh, maven errors are weird sometimes. What does it say now?

icy beacon
#

nooooo

#

it's just an empty error

sterile token
#

I would recommend learning about reading ide and stracktraces

icy beacon
sterile token
#

Hmn maven doesnt thru empty errors

kind hatch
wet breach
icy beacon
#

it just throws errors at whatever-class-it-finds-funny:63

wet breach
#

or corrupted class files

icy beacon
#

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

wet breach
#

that changes the encoding during compile time

#

doesn't change the encoding the file started as

kind hatch
# icy beacon

If you click on "Some problems were encountered" or "COMPILATION WARNING", does it say anything there?

icy beacon
#

for Register:
Some input files use or override a deprecated API.
Recompile with -Xlint:deprecation for details.
for EntityConditionParser:
uses preview features of Java SE 19.
Recompile with -Xlint:preview for details.

#

this is the first warning:

'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 24, column 21
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
#

it does, in fact, throw that error even when the version tag is present

wet breach
#

version should be in there

#

and its quite possible there isn't a maven version for 19?

icy beacon
#

alright, i've recompiled with version

#

nothing changed

icy beacon
#

nope

#

same thing

kind hatch
#

Did you refresh your pom after you removed it?

icy beacon
#

yeah

kind hatch
wet breach
#

but you have preview features being enabled

#

not entirely sure how much that changes in how the compiler works

kind hatch
#

Well, let me see what happens if I remove it.

#

Still able to compile.

wet breach
#

but is it giving the same errors?

kind hatch
#

I'm not getting errors though. 😛

buoyant violet
#

package test;

public class math {

public static void main(String[] args)
{
    System.out.println("Doing Math, I will count my votes");
    System.out.println(" (6 + 5 + 3) / 3 ");
    System.out.println("yooo what a good/bad grade man...");
}

}

why doesnt do the math

#

its like

icy beacon
#

you encapsulated your math expression in a string

kind hatch
icy beacon
#

you shouldn't

buoyant violet
#

oh ty

#

not it works

#

now

kind hatch
buoyant violet
#

it works

icy beacon
#

frostalf, do you see anything peculiar?

#

i'll take some time off, will be back in half an hour maybe

wet breach
honest badge
#

is there any possible way to play the totem popping animation to a player without them holding a totem in their hand?

mighty pier
#

probably

honest badge
#

any idea how?

wet breach
mighty pier
#

put totem in hand

#

damage player

#

put the old item back

honest badge
#

hm

mighty pier
#

and put the old health back

honest badge
#

im so dumb

#

ok

peak depot
#

world.spawnParticle(Particle.TOTEM, sender.p.location, 1)

#

thats the proper way

honest badge
#

ah

#

ok

peak depot
#

or this

#

p.playEffect(EntityEffect.TOTEM_RESURRECT);

wet breach
#

what I suggest is to set in the IDE to turn all tabs to spaces

#

and then have the IDE reformat your class file

#

also enable viewing hidden characters too

kind hatch
#

You can reformat your files by selecting the one you want to modify and then using the spaces button in the bottom left.

wet breach
#

having the IDE reformat the class file should remove those hidden characters

#

hopefully lol

#

not sure why your IDE is adding those in there or how they got there

buoyant violet
#

what is a double var?

ivory sleet
#

you mean this?

double variable = 1.3d;
buoyant violet
#

no

#

what is a double

peak depot
#

a number with a decimal

buoyant violet
#

oh

#

ty

#

cause i need to write a program that uses int, double and string

fringe hemlock
#

What’s the difference between a double and float

peak depot
#

they are the 32bit version of double

wet breach
#

@icy beacon @kind hatch can see the hidden characters on the left

#

the arrows are tabs

kind hatch
#

I swear, tabs were a mistake.

wet breach
#

but you can see there is a . before and after the asterisk

kind hatch
#

Are you sure that's not the notation for a space? Some editors use . indicating a space. I also copied the code from the repo and it looks like a space to me.

kind hatch
icy beacon
#

but why the 63 line every time?

kind hatch
#

It has them between the words.

wet breach
#

yeah I see it now, only other thing I can think of is tabs

icy beacon
wet breach
kind hatch
icy beacon
kind hatch
#

Did you changes the tabs to spaces?

icy beacon
#

not yet, looking for a way

kind hatch
icy beacon
#

yeah, found it in Edit -> Convert Indents

kind hatch
#

My personal settings. Use 4 if you want.

icy beacon
#

so I converted my main class and Register

#

nothing changed, same error

wary wren
#

Hey, I need a bit of advice, I got a problem with allays. I'm spawning one with noai and i'm open a inventory in interact and cancel the event. If the player doesn't have a item in hand, the inventory is "glitched" otherwise it's normal. I mean with normal that my listeners cancel the inventory click events etc.

kind hatch
#

Show your code.

wet breach
#

it is the only way I have ever been able to resolve such issues

kind hatch
wet breach
#

since I don't have their project files I can't really look

icy beacon
#

ah, this is going to be a pain in the ass

#

i've committed the new Register file, take a look

wary wren
#
spawning:
            entity.setSilent(true);
            entity.setAI(false);
            entity.setCanDuplicate(false);
            entity.setCollidable(false);
            entity.setCanPickupItems(false);
            entity.setInvulnerable(true);

@EventHandler
  public void handle(PlayerInteractEntityEvent event) {
    if (this.isNonTask(event.getRightClicked())) {
      return;
    }

    event.setCancelled(true);

    // open here a inventory with player.openInventory.
  }
icy beacon
#

maybe something is there again

wary wren
#

I'm also canceling the PlayerInteractAtEntityEvent.

kind hatch
undone axleBOT
kind hatch
#

There could be more issues than what you are showing.

wary wren
#

yea i'm creating a minimal example mom

icy beacon
#

like all the files that have changed since the last edit

kind hatch
# wary wren yea i'm creating a minimal example mom

Well, you know, if you only show part of the problem instead of explaining the whole thing, then don't be surprised when the advice people give you doesn't work because they didn't have the full picture.

kind hatch
icy beacon
#

well, there are still 36 uncommitted files

kind hatch
wet breach
#

I wonder if its the switch blocks causing issues

#

like mixing up switch expressions with switch statements

kind hatch
#

Maybe, but I think there are checks in place for newer styles used with older sdks. I got an IDE warning and a compile warning for that before.

icy beacon
#

do you still think it's a code problem? 😄

wet breach
#

at this point really hard to tell because no error output

icy beacon
#

i'm certain it's not, otherwise it would at least be a different line when i removed that line

wet breach
#

well nothing really useful being outputted anyways

kind hatch
#

It could literally be anything. lol

icy beacon
#

if you have any ideas, i can check them myself

wet breach
#

it could be the annotation processor

kind hatch
#

I was going to mention that, but I figured it was fine.

wet breach
#

have you tried removing the annotations?

icy beacon
#

do you think lombok could be the bitch?

#

i'll try, sure

kind hatch
#

Hey, can you push your changes? I'd like to see if I can compile it on my system.

#

I think the latest one is missing a couple classes.

icy beacon
#

yeah, sure, let me just finish the no-annotation attempt

#

wait, that seemed to be a good call

#

i removed the annotations from Register and now it throws an error at main

#

it'd be really unfortunate if annotations are the case, because I do not want to create a thousand getters-setters-constructors

kind hatch
#

Yea, I don't know what's up with the code that's currently on the repo, but it's missing classes and has messed up imports.

icy beacon
#

yeah, it's because I only updated the Register class

#

it has 36 uncommitted changes

#

i'll try to remove all the annotations in my main class, if it fails, i'll commit the changes

kind hatch
#

Lmfao, what a variable name.

icy beacon
#

🙂

#

It was Lombok!

#

now just gotta figure this, shouldn't be harder than a google query, unless?..

kind hatch
#

Check your IDE project level.

icy beacon
#

hm, pretty sure it's set to 19 everywhere

#

could it be one of the libraries?

kind hatch
#

It shouldn't be.

icy beacon
#

alright, it was an outdated shade plugin

#

and it FINALLY compiled

#

ok, wow, so lombok was causing errors in 2 classes, no more no less

#

oh, I got an idea, i'll readd the annotations one-by-one

kind hatch
#

You may also want to check if lombok has an update.

#

However, it may not be lombok itself, but how you implemented it. I have a feeling the compile on my end would have been fine if I had the original Register class.

#

Hard to say though. My setup is a little different.

icy beacon
#
<dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
            <scope>provided</scope>
        </dependency>
tender shard
#

people who like lombok >

icy beacon
#

😛

#

so it seems that @SneakyThrows is at fault

#

I've readded the other annotations and it compiled just fine

#

at least as for the main class

#

haven't done the register class yet

steady hinge
#

Hi! So, I'm trying to compile a plugin on 1.19 which was abandoned in 1.18. It's giving me an error though when it tries to compile PlayOutSpawnEntity, why is that? https://pastebin.com/dKxELuku

kind hatch
#

Because that is a 1.18 specific packet. You'll have to update the packets to use the 1.19 equivalent.

steady hinge
#

ah so it was removed in 1.19?

kind hatch
#

Possibly. It may just be the wrong import, but it's likely that it could have been renamed to something different.

wary wren
#

@kind hatch sorry for the late response. I found out that both events PlayerInteractEntityEvent and PlayerInteractAtEntityEvent are getting called twice for allays. I that a spigot related issue?

#

I tested it out with a minimal setup also and confirm it like so

wary wren
#

yea okay

steady hinge
#

I'm sorry if this is obvious, but is there a list of available packets?

wary wren
#

then sorry for pinging you shadow master.

icy beacon
#

but also not sure if it's an "issue", looks like "intended behavior" because it's been out for a while

kind hatch
wary wren
#

idk is that right?

#

when yes its kinda dumb

wary wren
kind hatch
icy beacon
#

Ok, I have just checked, @SneakyThrows is 100% at fault. It's also present in those two classes only so it kinda makes sense. Not sure what is going on though.

wary wren
#

so it lead to a race condition

kind hatch
#

Do you need both events though? I'm betting no.

flint coyote
#

@wary wren are they called twice for each hand? or once for each hand?

wary wren
#

no the events just was for testing. I was only using one event. The other one was just get canceld too

flint coyote
#

that's correct then

kind hatch
#

Oh right, the hands.

wary wren
#

i can just check that slot

#

so better read the docs i guess

kind hatch
#
if (event.getHand() != EquipmentSlot.HAND) {
  return;
}
wary wren
#

yea ik

#

but thanks!

kind hatch
#

Are you still getting a bugged inventory then?

wary wren
#

nop that fixed it

kind hatch
#

Cause it seems like you shouldn't if you are listening for one event and have that check.

#

Ah, good deal then.

steady hinge
#

🙏

tender shard
#

haha I just realize

wet breach
tender shard
#

the blog post I sent and wrote is EXACTLY about the packet you mentioned lmao

icy beacon
# wet breach you are welcome

I've also opened an issue on github. thanks ShadowMaster and frostalf for helping me solve this unreasonably non-trivial problem 😛

tender shard
#

you suck, plugg

#

sorry but I had to write this because it rhymes

icy beacon
#

i was trying to make a joke about how you know my real name

#

lol

#

but then i realized

#

you forgot the third g.

tender shard
#

I know everyone

#

oh sorry

icy beacon
#

not sure if a sin of such scale may be forgiven

tender shard
icy beacon
#

😶

eternal night
tender shard
#

exactly

kind hatch
#

Who's Michael?

tender shard
#

md_5

icy beacon
#

blackmailing is bad

tender shard
#

this is michael lol

icy beacon
#

LMAO

tender shard
#

yeah anyway

#

wtf is this, and why does it show up when you google "md_5 spigot" lmao

icy beacon
#

sctr

tender shard
#

sctr?

echo basalt
icy beacon
echo basalt
#

cap

icy beacon
#

that should be enough proof

tender shard
#

true, that's actually choco

icy beacon
#

this ain't canada, why is it green outside and not white

wet breach
#

lol

viscid lotus
#
try {
  Connection connection = DriverManager.getConnection(getDB().getPath());
} catch (SQLException e) {
  throw new RuntimeException(e);
}
public File getDB(){
  return new File(getDataFolder().getPath()+"/locks.db");
}

i get this error

#

java.sql.SQLException: No suitable driver found for plugins\SignLock\locks.db

wet breach
#

need to load the appropriate driver

#

in this case sqlite

summer agate
#
            Class.forName("org.sqlite.JDBC");
            connection = DriverManager.getConnection("jdbc:sqlite:" + dataFolder);```
I have this for example, dunno if it is the best way
viscid lotus
#

i'll try it thanks.

summer agate
wet breach
#

which gives a couple of examples in loading it

icy beacon
#
if (condition.length == 1) {
  String temp = condition[0];
  condition = new String[2];
  condition[0] = temp;
}

i've written this code snippet a very long time ago, let's try to figure out what the fuck it does
condition example: ["damage", ">", "5"]

steady hinge
#

um... any idea why it's giving me a Cannot resolve symbol 'ClientboundRemoveEntitiesPacket' error when I try to import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket;? :c

icy beacon
#

are you sure you have the correct NMS version?

wet breach
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

untold patio
#

Hello guys, a question, anybody knows why the variable message ain't changing it's value? I mean, it's always "Your saved homes are: " but it's not reaching the "You don't have any homes"

steady hinge
#

so I should do something like dependencies { compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT-shaded' implementation project(':NMS') } in the build.gradle then?

ivory sleet
untold patio
ivory sleet
#

Well, you’re not mutating the contents of the array anyway?

#

Not there at least

#

if (homes.length ==0){
sendAbsentMessage();
return;
}
StringBuilder message = new StringBuilder(…);
for (var home : homes){
message.append(…);
}
sendMessage(message.toString());

Or sth? You know, case by case working the logic out.

#

The code is just a pseudo

#

But you get the point

untold patio
#

I mean I can't use the (homes.lenght = 0)

ivory sleet
#

well is it an array or a collection?

tardy delta
#

IsEmpty()

ivory sleet
#

^

tardy delta
#

Im literally braindead

#

3 hours the same lesson without pause

ivory sleet
#

Is that in an event?

tardy delta
#

You wanna know what, my teacher programming doesnt want to let me use break and continue

#

Even when the code looks better

ivory sleet
#

what do they advocate instead?

untold patio
#

And that array has different players homes

tardy delta
#

We should use nested ifs 💀

#

Also using while with a bool finished

ivory sleet
untold patio
#

So wouldn't make sense if I say if homes.lenght == 0 send the message, because welp, it's not gonna be empty

tardy delta
#

Im starting to hate that teacher

ivory sleet
untold patio
#

The point is to send the message if once the arraylist gets iterated, no home with the player sender uuid is found

ivory sleet
#

What event r u using?

undone axleBOT
tardy delta
#

Cuz of the runnable ig

ivory sleet
#

So the bukkit runnable runs unexpectedly much?

viscid lotus
#
stat.executeQuery("select * from "+tableName);

guys i want to get all values of that but it only gives me one of the values

hazy parrot
#

Select from table with definetly show all entries from table

viscid lotus
#

while(results.next())

river oracle
#

Genius

viscid lotus
tardy delta
#

my teacher programming forces me to do this;

boolean found = false
while (it.hasNext() && !found) {
  if (/**/) {
    it.remove();
    found = true
  }
}```
river oracle
#

💀

tardy delta
#

we cant use break lol

river oracle
#

Why not

#

That's so fucked

tardy delta
#

cuz shes a bitch probably

river oracle
#

Is she to dumb to understand break keyword

tardy delta
#

shes also taking points if we dont use the required loop for her

river oracle
#

What a shitty professor

#

She's probably cranky she ended up as a professor cuz she wasn't good enough to get a job anywhere else

tardy delta
#

ig

#

wondering wth she is doing with jjava in her free time

river oracle
#

Committing atrocities

#

My prof does the forbidden
void method()
{

}

viscid lotus
tardy delta
#

what we had to code todayy

#

she didnt really gavve an explenation lol

river oracle
#

Your prof would hate me lol I love using final and breaks etc etc

#

I use finals everywhere where something doesn't need to be changed

tardy delta
#

if you use final for variables i hate you too

#

then altleast use C++ with const

#

where it has its usecase

river oracle
#

C++ more like trash

#

It has a ua
secase in Java too

hybrid spoke
river oracle
#

Took his dignity

zinc wolf
#

Hello guys i am making boxpvp server. There is problem with plugin MRL. I write /mrl create (name) and theres ,,An internal error occurred while attempting to perform this command,,
What is wrong?

opal juniper
tardy delta
#

?paste the whole error

undone axleBOT
tardy delta
#

you might contact the plugins owner if thats not your plugin

vivid skiff
#

How is called the fern and the large fern in legacy?

summer agate
#

English > Dutch when it comes to coding

summer agate
hybrid spoke
tardy delta
summer agate
frail gale
#

what's the best way to extract a folder from your Plugin Resource folder to the Plugin Data/Config folder?

tardy delta
#

plugin.saveResource("file.yml", false)

frail gale
tardy delta
#

oh uh not sure about that, probably not

#

either way check the impl and do the same thing for folders

hazy parrot
#

Getting folder content from resources is fucked up

#

You probably just want to save all file names and iterate over them

tardy delta
#

me coming to the idea of writing a bytecode interpreter in java itself 💀

#

interpreterr is probably not the word

#

anyways, how would i go about including a connection string to a mongodb cluster server in a plugin?

#

dont want to expose password and dont even know if its safe to expose the string itself

frail gale
hazy parrot
frail gale
#

so best way is to iterate over them

hazy parrot
#

just save names in set or something and saveresource

hazy parrot
frail gale
#

alright thanks brother!

summer agate
naive bolt
#

im storing BlockData in a hashmap with a vector. is their a replacement of BlockData that also stores the metadata of the block?

tardy delta
#

hmmm

naive bolt
#

is their a Bukkit.createBlock(data); sorta thing?

eternal oxide
#

yes under Material

naive bolt
#

thats create block data

eternal oxide
#

oh no such thing as createBlock

#

each location refers to an Instance of a Block. there is never more than one Instance of each Block

sick ermine
#

When starting a spigot project, I can't decide which classes, which model classes I need. What is your suggestion for me?

tardy delta
#

what are you making lol

winged anvil
#

yo am i tweaking or does Server#recipeIterator() not have all the recipes

#

i’m tryna cache shaped recipes in a custom way for a custom craft menu

rough drift
mortal hare
#

do we have any people here who understand the concept of dynamic programming?

#

I have a few questions regarding the algorithm it specifies that i couldnt find on google

#

And no. dynamic programming is not particularly finding something at runtime (That what I initially thought before uni lecture today)

river oracle
#

wtf is dynamic programming i feel stupid

mortal hare
#

its an optimising algorithm for problems that you cant easily solve, for example in problems which involve combinations

#

mostly for the problems that can be solved recursively

#

lets say you have a 2XN block board

#

and you have two tiles, an "L" one (blue), and 1x1 (purple) one,

#

you need to construct a function which give you result how many combinations can 2XN board have

#

for 1X2 board you only can use two 2 1x1 tiles, so you have only one way to tile it

#

for 2x2 you have 5 ways, since you can use "L" tile and rotate it by 90 degrees like in tetris, and you can use 4 1x1 purple times, so 4+1=5 ways

sullen marlin
#

Also some are complex

#

Both are returned by the iterator however

mortal hare
#

and by analysing more and more combinations you can spot on a pattern of how the sum of combinations can be expressed algebraically

cedar oyster
#

Hey, I'm trying to limit the amount of certain item a user can have in their inventory. I have already handled it for when the player picks up an item from the ground, but I'm having a hard time finding the correct event to handle for when the player moves an item from one inventory to his inventory. Does anyone know which event I should use

sonic goblet
#

Isn’t it called InventoryMoveEvent?

cedar oyster
#

I tried that one, but it didn't work

eternal oxide
#

drag

cedar oyster
cedar oyster
#

ok, its sort of working, its behaving really weird though

#

I'll just play around with it

granite burrow
#

How can I change the priority of an event by changing something in console?
Example:
Chat Event Priority: HIGHEST
Movement Event Priority: LOWEST

woeful crescent
#

does isDead() work for checking if a firework has exploded?

drowsy helm
granite burrow
#

ah, okay... I dont think ima do that then

worldly ingot
#

Yeah, the alternative is to just have 5 listeners of varying priority and swap between them lol

#

Which is a bit ugly, but definitely the better approach

granite burrow
#

yeah I might do that one, but not sure if its a necessity for my chat plugin. Just thought it would add more compatibility.

Im not 100% sure how I would switch between the different priorities however.

EDIT:
I guess I could just have checks that will enable or disable based on what it is

#

Is it possible to create a fake user to be sent a message?

It seems like EssentialsXDiscord requires there to be someone in the AsyncPlayerChatEvent#getRecipients() section of the event to determine that there is a message being sent. The messages that I send cannot be used in conjunction with normal chat messages, (I'm sending hover able messages), so I have to clear the recipients before sending the message to ensure only 1 message is sent

woeful crescent
#

is there any way to get the spot immediately to the left of a player?

#

I know .getDirection() can give you right in front of the player (where they're looking) but what about other directions?

ripe urchin
#

a spigot plugin can set a playerlist name, but i can only see a display name on bungee (for proxiedPlayer). Is there a way to change the playerlist name from a bungee plugin?

#

I guess i'll have to set it from the bungee part of the plugin since there i have access to Player which has setPlayerListName()

humble tulip
#

Or 90 degrees anticlockwise

olive ice
#

Say I'm writing an addon for an existing plugin.
If I want to make changes to what the plugin does in one of its methods, what options have I got?
Can I inherit from this plugins class, overwrite that method and somehow tell it to use my "edited" child class instead?

humble tulip
#

If you can extend the class and then figure how to orovide the plugin with instances of your custom class, that can work

#

May be difficult tho

#

It might be easier to get the src

olive ice
#

figure how to orovide the plugin with instances of your custom class
Any idea how this would work?

humble tulip
#

It depends on the type of changes you're trying to make

#

Let's say you're trying to change a manager class that the plugin has an instance of in its main class, you cld use reflection

hybrid spoke
#

so you literally want to inject your own instance to somewhere it probably doesnt belong

humble tulip
olive ice
# humble tulip It depends on the type of changes you're trying to make

The class in question doesn't need instances, it basically contains a number of static methods to some of which I want to make small changes to.
I know building my own version of the plugin would be easier, but I want my plugin to act as an optional addon that depends on the main plugin, not as its own standalone thing.

#

Can't really overwrite static methods, what do you think would be the best approach for this scenario?

hybrid spoke
tight knot
#

Hi everyone, I'm trying to modify the explosion resistance of some blocks. What's the best way to do that? I've tried using NMS but unfortunately the explosion resistance fields are final.

humble tulip
#

that's if there isnt a securitymanager stopping you from doig so

tight knot
#

Thanks for answering! I did try, unfortunately final modifier has to be removed from the field which is not possible as far as I know on java 12+

tight knot
#

I'm currently trying to do that actually. Do you mind pointing me in the right direction? I see references online for modifying static members of a class but not object instances.

humble tulip
tight knot
#

Would it look like this (kotlin):

val unsafe = Unsafe.getUnsafe()

val blockBaseER: Field = BlockBase::class.java.getDeclaredField("aH")
unsafe.putFloat(Blocks.eG, unsafe.objectFieldOffset(blockBaseER), 100f)
humble tulip
#

ohh

#

i thought that those would be static final

#

ok one sec

naive loom
#

Anyone know why this doesn't work?

past stream
#

What's the proper way to run some code only once when the server starts?
I can't use onEnable() because that is called when I run the /reload command.

river oracle
#

you can't afaik onEnable is the entry point

#

if server owners use reload its their fault your plugin will break

#

tell them to cope

past stream
#

I guess I could save some data to a file. Read that in onEnable to see if the server is already running.

#

Basically, I want to make server start/stop messages for my discord webhook.

#

I don't want it to say "Shutting down", "Starting server" every time I /reload

tight knot
dry forum
#

whats the best way to add support for spigot & bungee for my plugin?

humble tulip
tight knot
#

Oh really? Sounds interesting

humble tulip
#
    public static void main(String[] args) throws Exception {
        //this is standard
        final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
        unsafeField.setAccessible(true);
        final Unsafe unsafe = (Unsafe) unsafeField.get(null);

        //field that you want to modify
        final Field ourField = Example.class.getDeclaredField("amount");
        ourField.setAccessible(true);

        //instance of the object you wanna modify
        Example example = new Example();

        //let us get the value of that field via unsafe and print it (1222)
        System.out.println(unsafe.getInt(example, unsafe.objectFieldOffset(ourField)));

        //let us set the value of the field to 100
        unsafe.putInt(example, unsafe.objectFieldOffset(ourField), 100);

        //let us print the value of the field via a method (1222)
        System.out.println(example.getAmount());
        
        //let us print the value via reading directly from the variable(100)
        System.out.println(unsafe.getInt(example, unsafe.objectFieldOffset(ourField)));
    }
river oracle
#

if you need to do anything hard restart

humble tulip
#

when you modify the variable via unsafe, the getter is not garanteed to return the updated value

river oracle
#

reloading can tend to cause memory leaks and other problems

tight knot
#

It's final, right?

humble tulip
#

yep

#

so it depends on how the final variable is declared

tight knot
#

Reason is the compiler sees the variable has a constant value defined at compile time and inlines it in the getter

humble tulip
#

when declared like this though

#

it works

tight knot
#

If you read the int from stdin or smth and set it at runtime that wouldn't happen

trim lake
#

How can I make clickable only part of message? I tried this but is not working. I want 2 clickable messages in one line. TextComponent confirm = new TextComponent("Potvrdiť"); confirm.setColor(ChatColor.GREEN); confirm.setUnderlined(true); confirm.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/char done")); confirm.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Vytvor si postavu.").color(ChatColor.GRAY).italic(true).create())); player.spigot().sendMessage(confirm + "text");

drowsy helm
#

sendMEssage can take an array of TextComponents

#

so just split each bit into a separate TextComponent

#

you cant append a string to text component

twilit garden
#

how do i convert setDisplayName() and setLore() to paper?

#

they are deprecated

#

and requires compoents

river oracle
#

they have their own server

twilit garden
#

oh

#

XP

untold patio
#

:c

#

Guys can please any one help me :c, everytime a player executes this command (even if they don't have any homes) it's not reaching the variable reasignment message "YOu don't own any homes"

winged anvil
#

why not just store a home name to a list of locations in a map

honest badge
#

is there any way i can add to the already existing "loot table" for librarian villager trades, so that even ones created by the player have a chance to get the trade?

untold patio
winged anvil
#

tbh i couldnt tell you

#

id just try to use a map

remote swallow
winged anvil
#

?paste

undone axleBOT
winged anvil
sullen marlin
#

There's at least 500 recipes in the iterator last I checked

#

What's your video

winged anvil
#

hmm

sullen marlin
#

Code

winged anvil
#

does it matter when im trying to access them because rn im printing these onEnable()

sullen marlin
#

Plugin startup normal?

winged anvil
#

i believe so

#

it does say it loaded 7 recipes

#

which is weird cause im getting more than 7 but

sullen marlin
#

Datapack?

#

Recipes disabled in spigot.yml?

winged anvil
#

after creating a new spigot server, im getting different recipes being printed

#

but not anywhere near 500

blazing basin
#

yo where can i hire a dev i need somone with experience to make a server for me and add plugins if u looking for a mini job HMU

idle loom
#

Is it possible to open a GUI to a proxyplayer in a bungee plugin? and like- How?

tender shard
#

With packets, yes

#

But usually you‘d want to do it from the actual server

#

The proxy doesnt keep track of any inventories

undone axleBOT
tender shard
tender shard
#

hm I dont think so

#

I was not able to DM you

blazing basin
#

let me open em

tender shard
#

just friend request me

blazing basin
#

O)O

idle loom
tender shard
#

?messaging

#

hm

#

?channels

#

what's the command again

#

?messages

#

?pluginmessages

#

fuck this

#

1 sec

#

this however only works if the backend server has at least one player online. if you also want it to work without any players, you should rather look into pub/sub systems, e.g. redis

#

@idle loom

#

redis is the "de facto standard" for stuff like this

winged anvil
#

yeah fuck the plugin messaging shits wack

tender shard
#

agreed, lol

#

plugin messaging channel is very weird

winged anvil
#

it would be better if it didnt require someone on the server

tender shard
#

yep

#

that's why everyone uses redis instead

winged anvil
#

yo alex, some reason im not getting all the recipes when i use recipeIterator(), you got any experience with this?

tender shard
#

ughm it should include everything

#

you do use spigot as your .jar ?

#

or do you use a weird forge/fabric hybrid thing?

#

because in those cases, I can confirm that it doesnt include everything

#

however, there's of course also a chance that your plugin gets enabled before all recipes are registered - what happens if you check the iterator after waiting one tick?

#
public void onEnable() {
  Bukkit.getScheduler().runTaskLater(myPlugin /*this */, () -> {
    for(...) // Now print out all recipes, whatever
  , 1L, 1L);
}
remote swallow
#

whats the 2nd 1l for

#

this is just a delay not a repeat

tender shard
winged anvil
tender shard
#

that's for a repeating task

#

I just wrote it by hand

remote swallow
#

smh

winged anvil
#

but its weird cause the recipes rotate, its different recipes after every restart

tender shard
#

looks okay, what does it print?

winged anvil
#

hold lol

tender shard
#

damn now you removed the msg lol

winged anvil
#

                case "recipes" -> {
                    getPlugin().getServer().recipeIterator().forEachRemaining((recipe -> {
                        System.out.println(recipe.getResult().getType());
                    }));
                }
#

same thing

#

lemme get a paste

#

?paste

undone axleBOT
winged anvil
tender shard
#

is that everything?!

winged anvil
#

and yes

sullen marlin
#

What /version

winged anvil
#

just got a new build

remote swallow
#

who runs craftbukkit anymore

tender shard
#

pls send screenshots directly instead of using gyazo or whatever 😛

winged anvil
#

it doesnt popup as embed?

tender shard
remote swallow
#

why they put craftbukkit on there then

tender shard
#

well even if it would be craftbukkit, it should work

#

do you run spigot.jar or craftbukkit.jar @winged anvil ?

sullen marlin
#

Spigot, it says

#

Anyway maybe someone else should test this

tender shard
#

I'll test it, gimme a minute

sullen marlin
#

But I doubt there's a non deterministic bug lol

remote swallow
#

but it says craftbukkit version something-spigot-something shouldnt it say spigot version something

tender shard
#

well that's just how it is lol

sullen marlin
#

Don't think it be like that but it do

remote swallow
#

jank

winged anvil
#

hmm

tender shard
#

okay let's see

winged anvil
#

i hope it also breaks for you so i dont look crazy

tender shard
#

I'll just run this and see how many lines it prints

#

it prints 1089 lines for me

winged anvil
#

bruh

tender shard
winged anvil
#

ok

tender shard
#

I'm using 3607-Spigot-6198b5a-e7aab54 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT)

#

(latest)

winged anvil
#

yeah same as well

tender shard
#

do you have any datapacks in your world's folder or similar?

winged anvil
#

does your server say "loaded 7 recipes" in console when it first starts up

tender shard
#

I'll check

winged anvil
#

i mean i have the bukkit/pack.mcmeta but i think that just comes with no?

tender shard
#

have you tried to move your spigot.jar to a whole new directory, then see what it does with only your plugin installed?

#

e.g. new world, no other plugins, etc?

winged anvil
#

mmm i recreated the server by deleting everything in the folder, but not a new folder name

#

i can try a new folder

tender shard
#

well that should be a problem, but please try it anyway lol

#

should NOT* be a problem

#

sorry I'm quite drunk

#

can you send your whole latest.log?

#

?paste

undone axleBOT
winged anvil
#

yes

#

actually wait lemme test something

tender shard
#

oki

winged anvil
#

heres the log from the old server, not the new one im making rn

#

here i do use /reload so im gonna try wout that

tender shard
#

the log you sent has all the recipes

winged anvil
#

yk what

#

thats really interesting

#

all of the recipes do not show in the console

tender shard
#

brb, going for a smoke

winged anvil
#

well, problem solved

tender shard
#

maybe that's the problem

winged anvil
#

it is localhost

tender shard
#

hmmm then I have no clue

#

anyway, the log you sent has all the recipes

winged anvil
#

yes, issue has been resolved

tender shard
#

Do you know what the problem was?

winged anvil
#

well i feel dumb, is it bad to trust a print to the console ?

tender shard
#

Normally, yes

#

Unless you use paper lol

winged anvil
#

ig the console just didn’t print all the things

tender shard
#

The console, if you run plain spigot, will always show every System.println

#

On paper, iirc they supress repeated messages or limit them somehow

#

But im not 100% sure and im banned on papers discord lol

winged anvil
#

lmaoo for what

tender shard
#

A soundcloud link lol

#

But lets not go into that here

#

I sent a song that violated their rules

winged anvil
#

ok

#

well

#

lmaooo this ur song?

tender shard
#

yes lol

#

it's about my ex gf

delicate lynx
#

interesting they banned you for that

tender shard
#

people on paper's discord are quite easily triggered

#

I talk about sex and stuff here all the time and nobody cares lol

#

that's why I love this discord

wet breach
#

Lets not forget your temp removal lmao

timber basalt
#

?services

undone axleBOT
glossy venture
#

bro remember the your mom joke streak we went on in the paper dc

frozen dune
#

how do i make my localhost server not count my accounts as 127.0.0.1 for ip? cant test my ip thing with it being 127.0.0.1 all the time

sullen marlin
#

Join the server using 127.0.0.2 or any other 127 address

#

Might work

frozen dune
remote swallow
#

might work -md5

#

creator of spigot

frozen dune
#

lmao

frozen dune
#

"yeah yeah that addition might work"

frozen dune
white root
#

Just Google "what's my ip"

remote swallow
#

ip leaked confirmed

white root
#

Have fun, I live next to the taco bell 😉

remote swallow
#

takes too much effort to find where they are

white root
#

:lol:

remote swallow
#

also i cannot be bothered to type an ipv6 ip

white root
#

Mood tbh

white root
frozen dune
#

(not sponsored)

white root
#

Shockbyte is actually just terrible

remote swallow
#

shockbyte is terrible

#

use aternos for free server

white root
#

Nah, use oracle cloud free tier

remote swallow
#

no credit card

#

but yes

#

that is better

vocal cloud
#

Buy a $5 a month digital ocean node. You control everything from the OS to the java version.

remote swallow
#

how do you expect any of us to have money

white root
#

Or bloom.host or pufferfish.host if you need a host
Those are the least shit of the mc hosts

remote swallow
#

bloom is the best imo

#

but then i havent used pufferfish

white root
#

Puffer is better I think, mostly cause of pufferfish+

remote swallow
#

whats pufferfish+

frozen dune
remote swallow
#

did you pay like 200million for 12mb of ram

#

and 0.02 of a core

remote swallow
#

SCAM

white root
#

Not really tbh

vocal cloud
frozen dune
remote swallow
white root
#

you cant use puffer+ without a key

#

or without using their hosting

remote swallow
#

dont care

#

ill find a way

white root
vocal cloud
#

$5 a month nets you a gig.

round plinth
remote swallow
#

^^ thats their discord

round plinth
#

yeah i tried to app nobody answered 😦

quaint mantle
#

hey,
how would i apply an tab complete list to my custom command?

for example when i have an command time with 4 options morning, noon, evening and midnight.
is there spigot method to do this or do i have to code this from scratch somehow?

remote swallow
#
@Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        switch (args.length) {
            case 1 -> {
              return StringUtil.copyPartialMatches(args[0], Arrays.asList("option1", "option2", "option3", "option4", new ArrayList<>());
            }
        }
    }
tardy delta
#

Return switch

mighty pier
#

i want to make an item that you can upgrade in a shop and cannot remove from your inventory and i dont know how to make the item upgradeable

#

i was thinking of making a hashmap with key int, value itemstack

#

any better way of doing it?

vocal cloud
#

You want an upgradeable item you have two common options.

  1. If the item follows an algorithmic upgrade system where each state is based on a % increase of a base version then you only need to store the base version and the formula.
  2. Use a HashMap and store each upgraded state as an individual item.
mighty pier
#

its gonna have many different enchants

#

and material types

#

wai tactually

#

ill put it in a sorted list

#

because the player will select each tier of the item

#

or maybe not

#

i just keep going in loops

#

i dont know what to do

summer agate
#

You can also try storing a class or something that defines the operation on upgrade rather than the exact item. That way you won't need to override the old items (vanilla enchants, dyed leather armour for one)

sterile token
remote swallow
#

its not spam

#

its directing the person to the right place for help

sterile token
#

Sorry its the cellphone thing

echo basalt
#

providing a direct solution to someone's problem is not spam, it's help

sterile token
#

I thought he was lo king to his own private servers

remote swallow
#

why would i do that

#

also whats the point

sterile token
#

Idk just for spam reason 😂🤣

quaint mantle
#

again a little question, when i set a player custom weather with player#setPlayerWeather()
will this reset after an rejoin or is this permanently until i reset it?

eternal oxide
#

its reset on a re-log

quaint mantle
#

okay, good :) thanks

olive ice
#

Is there an equivalent to player.chat() that lets me select the recipients? Or would I have to use player.chat() and then intercept its AsyncPlayerChatEvent?

fierce whale
#

is there anyway to play custom sound in resource pack?

rough drift
#

If I have Material.STONE.createBlockData(); can I just store the result and re-use it? Or will that cause issues?

humble tulip
#

Alternatively you can just send the msg to the ppl that need it

olive ice
humble tulip
#

Yes

olive ice
#

I'll stick to AsyncPlayerChatEvent then, thanks :)

teal mulch
#

Hello, is there some API for yaml you guys recommend? Thanks!

remote swallow
#

spigots yaml is good enough

ivory sleet
teal mulch
teal mulch
#

Thanks. ✅

sterile token
#

I also have my own FileHandler which is an impl of spigot one but is well used compared with spigot default one which is really abstract in terms of usage

tardy delta
#

👀

teal mulch
#

Cool. I am finding a solution to create files much faster.

charred blaze
#

why is legacy book and quill deprecated in 1.16.5?

tardy delta
#

wdym by creating files much faster.

dim palm
teal mulch
sterile token
#

This is help programming

echo basalt
sterile token
#

Adoman I also looking for a solution for working over diff flat file formats by using the same way

trim creek
#
File file;
FileConfiguration config;

public void setup() {
  file = new File("path/file.filetype");
  if (!file.exists()) {
    try {
        file.createNewFile();
        // config = YamlConfiguration.LoadConfiguration(file);
    catch (IOException e) {
      e.printStackTrace();
    }
  }
  config = YamlConfiguration.LoadConfiguration(file);
}

here

#

idk if it is the correct one

echo basalt
#

yaml ew

sterile token
#

Yeah is not bad

echo basalt
#

I'd just make an enum and a parser

#

type deal

tardy delta
#

makes me remember to work on my expression parser

teal mulch
echo basalt
#
public enum FileType {
  YML,
  JSON,
  PROPRIETARY;
}
#

type deal

#

and make a handler for each

#

then link em together

sterile token
#

? 3?&?

#

3(_64()?

echo basalt
#

So the end result would look a bit like worldedit's clipboardformat class

trim creek
#

I don't really use WorldEdit

#

lamo

trim creek
#

uhh

echo basalt
#

wtf are you on

sterile token
#

Ahh shit fucked discord

trim creek
#

VERAN are you ok?

#

bruh

sterile token
#

Cellphone discord is trash

trim creek
#

shit fucked Discord

echo basalt
#

yeah that

#

but add more types

#

MYSQL being the only remote database type is shameful

#

add MongoDB, Cassandra and S3 <3

tardy delta
#

then i only had to do this

#

smh it was more like a personal plugin which just was on gh

echo basalt
#

my database abstraction system is a bit more aggressive

trim creek
#

aslo

#

is there any difference between the four?

echo basalt
#

yes

#

MySQL uses queries and is a relational database

sterile token
echo basalt
#

MongoDB works via documents

#

the other 2 work with buckets

echo basalt
tardy delta
#

oh god

#

rn i only have mongo

trim creek
#

anyway gonna make the game

eternal night
#

Might need more databases

trim creek
#

see ya

echo basalt
#

this should cover everything

#

caching & messaging are both covered with redis

vale ember
sterile token
echo basalt
#

but I can use RabbitMQ for messaging if I want

tardy delta
echo basalt
#

It ties into my packet system and allows me to send packets containing info to specific instances

#

useful when sharding

sterile token
#

How does your message work

echo basalt
#

you make a packet

sterile token
#

Query to De database every x time?

echo basalt
#

redis pubsub

#

like

sterile token
#

Oh bruh

echo basalt
#

all the messaging databases have a pubsub system

sterile token
#

I thought you were using db mthru Messaging

echo basalt
#

binary pubsub

tardy delta
echo basalt
#

caching

#

fetching

#

type adapter is for funky types but it should handle it automatically

#

graphing is for making graphs

sterile token
#

Wipe?

echo basalt
#

wipe yes

#

it wipes the entire database

sterile token
#

Hmn

#

Wipes

echo basalt
#

very useful when you fuck up the entire schema

sterile token
#

I dont understand meaning hahaha

echo basalt
#

it deletes everything

#

on mysql it's like dropping all tables

#

on mongo it just deletes and recreates the collection

#

for proprietary formats, it just deletes the file

#

or empties the bucket for bucket-based databases

tardy delta
#

kinda like essentials 2.0

sterile token
#

Does your database interface contains the credentials, open and close methods right?

echo basalt
#

yeah

sterile token
#

I like how you code imlussio.

hardy pollen
#
  PlayerUUID: e69dee42-3a33-359c-802c-eb5dd278a5d7
  DiscordUUID: '925303002867310592'
cd62:
  PlayerUUID: e69dee42-3a33-359c-802c-eb5dd278a5d7
  DiscordUUID: '925303002867310592'

Help please how can i delete cd61 out the config file?

echo basalt
#

it comes with experience, verano

sterile token
#

I take your impl coding ideas and apply to my own resources

hardy pollen
echo basalt
#

setting it to null should remove it

sterile token
#

Mainly skidding your way of implenting the things

echo basalt
#

watch me add licensing to all my code samples

#

so you have to give me 5$ every time you steal my ideas

sterile token
#

Rude

echo basalt
#

desperate times need desperate measures

hardy pollen
echo basalt
#

haven't been paid in 2 weeks, only got like 30$ to my name rn

sterile token
#

Why?

#

I thought you have a stvle work were they paid you montly x amount of dollars

echo basalt
#

yeah but they decided like

#

until the alpha is done

#

all payments are being held

sterile token
#

Held?

echo basalt
#

like

#

on hold

sterile token
#

Lmao shity englibs

echo basalt
#

paused

#

whatever

sterile token
#

I hate fkng english

echo basalt
#

and then once alpha was ready

#

we'd all get paid all the hours

sterile token
#

Oh now úes I understand

echo basalt
#

now, I have like 1k$ unpaid

sterile token
#

Lol

echo basalt
#

and bills to pay in 2 weeks

sterile token
#

Are u sure the goig to pa?

echo basalt
#

yes

sterile token
#

Because they can still your work tho

echo basalt
#

not only am I getting paid, I'm also getting a raise once alpha is done

sterile token
#

But for you doesnt care cuz you can make usage of Dm A

echo basalt
#

I can just sell their code and make 5 grand lmao

sterile token
#

Im cae you are not member of Dmca you are fucked up because they can sirelly now pay u

sterile token