#help-development

1 messages ยท Page 118 of 1

boreal seal
#

i'm really not sure how you got so far

#

tbh

#

nah for real

#

we were impressed from your skills

#

but something is fucky fucky with your server

#

first

#

why it takes

#

more then 2 min

#

connect to a local host

iron glade
#

?di

undone axleBOT
boreal seal
#

oh

#

its because 1 ram

#

dependecy injection is dog shit

torn shuttle
boreal seal
#

static saves all the hard work

#

i take 50 ram

#

for free

rough drift
#

nice

boreal seal
#

ez

#

it scammed me

#

it gived only 14

iron glade
boreal seal
#

everywhere instead

#

works kiss kiss

#

i go to smoke brb

iron glade
#

this guy has issues

eternal night
#

inclined to agree

twilit roost
#

Can I somehow send World files from one spigot server to another?

flint coyote
#

Just skip completely on OOP and Classes/Objects and declare everything static

rough drift
#

that's not what they meant

boreal seal
#

he think he can teach us java

#

he dont know static

iron glade
#

Or maybe explain it to him instead of flaming

rough drift
#

i statically ignore static whenever I can

boreal seal
#

Minesuchti go read what is static

#

if u want plugins go

#

?service

#

fk

#

?

flint coyote
undone axleBOT
boreal seal
#

?services

undone axleBOT
boreal seal
#

go here @iron glade mister dont know static

iron glade
#

who said I don't know static

rough drift
#

static is pretty easy

boreal seal
#

it was a joke okay

#

it tought it would be funny but you take it serious...

rough drift
#

static too much is bad
static too little is bad
static sort of is sort of bad

boreal seal
#

anyway static > di

rough drift
#

Eh

flint coyote
#

๐Ÿ’€

boreal seal
#

it was the joke

rough drift
#

At some point DI has less bugs than static

iron glade
#

the type of guy doing static abuse

rough drift
#

ooooooo

#

it went so over my head you where able to see it

boreal seal
#

who use static look like this

rough drift
# boreal seal

nah, who use static be like "I'll just take some money from the public bank"

boreal seal
#

who use di look like this

#

๐Ÿ’€

twilit roost
odd wedge
eternal night
#

if done correct is the hard part

odd wedge
#

it really isnt that hard

#

Many valid use cases

eternal night
#

Enough people fail at it to make it seem hard

odd wedge
drowsy helm
#

make it a local variable

odd wedge
#

Seems more like a user problem than anything

eternal night
#

Any misused programming pattern is a user problem XD

odd wedge
#

Of course

#

It's not hard to understand when to use the static keyword

#

They just never bother to read about it

timid jetty
#

is there any way to get the damage modifier from an EntityDamageEvent before the final damage is calculated?

odd wedge
#

?jd-s

undone axleBOT
odd wedge
#

If you checked the jd you would've known

#

Check javadocs then google it then ask

odd wedge
flint coyote
worldly ingot
#

That's fine. They can be scared of it until they decide to learn more about it

eternal night
#

^

worldly ingot
#

I'd argue that same principle applies for functional programming

odd wedge
#

Yeah, but they shouldn't be scared in the first case

worldly ingot
#

Don't use a lambda if you have no idea what it means

twilit roost
odd wedge
#

Most people could handle it better

eternal night
#

I mean, you certainly should be scared of static when you first start off because you will slap it onto every Problem

#

Specifically state

#

Where it really has no place

drowsy helm
#

for a OOP lang, its weird that most tutorials get you to use static

agile anvil
eternal night
#

Not using it until you had the time to properly learn it is going to be better than slapping it onto everything and then running into 50 walls

odd wedge
#

People blindly follow tutorials on making plugins when the maker abuses static

odd wedge
drowsy helm
#

biggest problem i realised when learning java; is I was just writing code and not knowing why something did what it did

#

one day everything jsut clicked

odd wedge
#

You did some pasta sauce

eternal night
#

Obviously not but when you just get started with java and coding in general

#

The somewhat ugly issues static can cause are not really benefitial

#

For the upsides that static would bring you

odd wedge
#

Sure, you should wait a bit before using it. But that applies to most stuff

#

You don't just start making a game when you start developing

eternal night
#

But people do XD

#

That's the issue lol

drowsy helm
#

people start making massive plugins without knowing a drop of java

#

people dont want to take the baby steps

odd wedge
#

It's because people are getting more and more lazy everyday that goes

eternal night
#

cannot wait for the GitHub copilot days

#

Where peeps come in here with fully generated code and have no idea what it does

odd wedge
#

lmfao

tall dragon
#

yea thats going to be good fun

odd wedge
#

Super fun

tall dragon
#

we can always just tell em to ask copilot why its not working

drowsy helm
#

Guys, why is my plugin becoming sentient?

visual tide
twilit roost
#

why did this started to occur?

timid jetty
#

Okay so for an EntityDamageEvent, if i do getFinalDamage, can I then after setDamage and finaldamage will update after my listener finishes?

drowsy helm
twilit roost
#

this is the tick method
ik i should use getter for games

tall dragon
drowsy helm
#

static ๐Ÿ˜ฆ

twilit roost
drowsy helm
#

without changing any code?

twilit roost
#

yep

tall dragon
#

hard to believe

odd wedge
#

However it shouldn't be exposed

twilit roost
odd wedge
#

?tias

drowsy helm
#

can you show NWGame class

odd wedge
#

?tryitandsee

odd wedge
twilit roost
undone axleBOT
timid jetty
odd wedge
#

Hey guys, does my entire skyblock core work?

twilit roost
odd wedge
#

I'll paste all the classes gimme a min

tall dragon
odd wedge
#

Oh god

#

His lists

drowsy helm
#

are you initializaing the class beforehand

tardy delta
#

static abuse

odd wedge
tardy delta
#

where are your damn getters

rough drift
tardy delta
#

my god

twilit roost
#

well the first time I use the class in whole cycle is when generating World using WorldCreator and in Tick method

rough drift
#

I do know how to use static and when

odd wedge
#

ik

tardy delta
#

basically everywhere

iron glade
odd wedge
#

Why do you store the games in the gamemode class

#

That's just dumb

#

Make a data class

tall dragon
#

what the heck is dis xD

        spawnpointLL.setX((spawnpointLL.getBlockX()>=minX&&spawnpointLL.getBlockX()<=maxX)?spawnpointLL.getBlockX():((spawnpointLL.getX()-maxX<spawnpointLL.getX()-minX)?maxX:minX));
        spawnpointLL.setZ((spawnpointLL.getBlockZ()>=minZ&&spawnpointLL.getBlockZ()<=maxZ)?spawnpointLL.getBlockZ():((spawnpointLL.getZ()-maxZ<spawnpointLL.getZ()-minZ)?maxZ:minZ));

        spawnpointLR.setX((spawnpointLR.getBlockX()>=minX&&spawnpointLR.getBlockX()<=maxX)?spawnpointLR.getBlockX():((spawnpointLR.getX()-maxX<spawnpointLR.getX()-minX)?maxX:minX));
        spawnpointLR.setZ((spawnpointLR.getBlockZ()>=minZ&&spawnpointLR.getBlockZ()<=maxZ)?spawnpointLR.getBlockZ():((spawnpointLR.getZ()-maxZ<spawnpointLR.getZ()-minZ)?maxZ:minZ));

        spawnpointUR.setX((spawnpointUR.getBlockX()>=minX&&spawnpointUR.getBlockX()<=maxX)?spawnpointUR.getBlockX():((spawnpointUR.getX()-maxX<spawnpointUR.getX()-minX)?maxX:minX));
        spawnpointUR.setZ((spawnpointUR.getBlockZ()>=minZ&&spawnpointUR.getBlockZ()<=maxZ)?spawnpointUR.getBlockZ():((spawnpointUR.getZ()-maxZ<spawnpointUR.getZ()-minZ)?maxZ:minZ));

        spawnpointUL.setX((spawnpointUL.getBlockX()>=minX&&spawnpointUL.getBlockX()<=maxX)?spawnpointUL.getBlockX():((spawnpointUL.getX()-maxX<spawnpointUL.getX()-minX)?maxX:minX));
        spawnpointUL.setZ((spawnpointUL.getBlockZ()>=minZ&&spawnpointUL.getBlockZ()<=maxZ)?spawnpointUL.getBlockZ():((spawnpointUL.getZ()-maxZ<spawnpointUL.getZ()-minZ)?maxZ:minZ));

how can you even know whats going on this point

twilit roost
twilit roost
quaint mantle
#

Hey guys,,,, Can I ask bout github again...?

iron glade
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

odd wedge
#

You're not allowed to ask anything

twilit roost
odd wedge
quaint mantle
twilit roost
odd wedge
#
    public static ArrayList<NWGame> games = new ArrayList<>();
iron glade
#

pls call this GAMES

odd wedge
#

And make it private

#

and have getters and setters

twilit roost
odd wedge
#

Well wtf is that class

twilit roost
#

its the class I sent here??

odd wedge
#

WHAT DOES IT DO?

#

what's the logic behind it

#

What should it do

#

holy fuck

twilit roost
#

manage current game, setup world, check team events

iron glade
#

You store the class that contains that arraylist inside that arraylist?

odd wedge
#

So you store every game inside that class

#

Lol

#

That shouldn't be handled there

#

Make a data class

twilit roost
#

yet I didn't ask 'bout this
I wasn't worried about my trash code
Just for server not wanting to accept the jar anymore

tardy delta
#

lmfao

odd wedge
#

Maybe listen to what I say

iron glade
#

anything in the console?

twilit roost
#

I apreciate your help
but I don't care about those problems rn

odd wedge
#

Yes you can

twilit roost
iron glade
#

show the stacktrace

twilit roost
iron glade
#

what's line 50?

twilit roost
thin delta
#

How do I export a jar in eclipse using maven and I include a library it is dependent on?

odd wedge
#

Did you exclude the class

twilit roost
odd wedge
#

Well it couldn't find the class

thin delta
twilit roost
#

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

tall dragon
#

to make sure its in there

twilit roost
#

imma check

odd wedge
# twilit roost
private static List<NGame> GAMES= new Arraylist<>();

public List<NWGame> getGame() {
return this.GAMES;
}
#

Try this

twilit roost
#

but can't do anything rn
not near pc

twilit roost
#

due to exploits? or potentional bugs

bold copper
#

Hi, please tell me how can I forbid the skeleton NoAI(true) to turn its head?

heady spruce
#

How can I let the player take only half the damage he took?

odd wedge
#

?jd-s

undone axleBOT
twilit roost
#

EntityDamageEvent
and just get Damage amnt /2 and set it to damage dealt

bold copper
echo basalt
#

wipes AI but not gravity

bold copper
# echo basalt setAware(false)

you don't quite understand me.
I inherited a class EntitySkeleton and
disabled calling tick, passengerTick, movementTick
And the monster stops moving, exactly as I wanted.

However, this skeleton is sitting in the boat, and if I leave the boat during the turn,
the skeleton's head will turn ,,by inertia,,s

echo basalt
#

oh you're doing that stuff

#

you might need to lock the yaw or change it back every tick

#

maybe just stop yaw packets from sending

bold copper
echo basalt
#

IIRC

#

setting lastYaw = yaw

#

should fix it?

#

As the datawatcher won't detect it as "dirty"

#

basically each datawatcher is checked for modifications

#

if it's modified, it sends the new packet

#

oddly specific

bold copper
#

Hmm.. This gave me 1 thought. Thanks

vital sandal
#

is there any better way to do this ?

quaint mantle
chrome beacon
#

^^

#

Don't read the lore for stats

#

?pdc

vital sandal
#

tks i should have known this sooner

green prism
#

Hello there! I wondered how I could create fake player in tab through ProtocolLib, and maybe even assign them a skin that you see in the mini-square

#

Can you help me guys?

sacred mountain
#

it's a private one sorry, but you can get a limited feature one that's kinda outdated but still works. I got the idea from it, just the code may not be similar

#

it's called something like fakeplayers

golden turret
#

How can I send to the client a huge block change? Something like updating 300000 blocks. I have seen the PacketPlayOutMultiBlockChange but I dont know what is each parameter

hasty prawn
#

You should probably use Mojang maps if you're gonna be messing with packets btw

hushed spindle
#

i got a method that parses a string math expression into a double value, only issue is that java doubles occasionally format themselves in the scientific notations so it starts producing errors saying it doesn't understand "E"

#

for such cases i'd need to use bigdecimal right so doubles aren't formatted like that

torpid sapphire
#

is there a way to use InventoryClickEvent#setCursors functionality in a non deprecated way?

ebon ether
#

You cant upload pictures... ๐Ÿ˜

#
        if(args.length >= 1){
            if(args[0].equalsIgnoreCase("start")){
                if(sender.hasPermission("kts.start")){
                    if(kts.started){
                        sender.sendMessage(ChatColor.RED + "The game has already started.");
                    }else{
                        if(Bukkit.getOnlinePlayers().size() >= 2){
                            Random random = new Random();
                            kts.sheep = Bukkit.getPlayer(Bukkit.getOnlinePlayers().toArray()[random.nextInt(Bukkit.getOnlinePlayers().size() - 1)].toString());
                            Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-" + ChatColor.AQUA + "Lusion's Kill The Sheep" + ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-");
                            Bukkit.broadcastMessage(ChatColor.GREEN + "Kill The Sheep has started! Go to /warp events to play!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "The sheep must be hit 2,000 times!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "You win by getting the most hits!");
                            Bukkit.broadcastMessage(ChatColor.GOLD + "The sheep is " + kts.sheep.getDisplayName() + ".");
                            kts.started = true;```
#

How can I format that

#

so its readable?

hushed spindle
#

do this ```java instead of just ```

boreal python
#

How do I iterate through event.getInventory().getContents() to find if a slot has red wool, and then replace it with a diamond_block?

ebon ether
#
        if(args.length >= 1){
            if(args[0].equalsIgnoreCase("start")){
                if(sender.hasPermission("kts.start")){
                    if(kts.started){
                        sender.sendMessage(ChatColor.RED + "The game has already started.");
                    }else{
                        if(Bukkit.getOnlinePlayers().size() >= 2){
                            Random random = new Random();
                            kts.sheep = Bukkit.getPlayer(Bukkit.getOnlinePlayers().toArray()[random.nextInt(Bukkit.getOnlinePlayers().size() - 1)].toString());
                            Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-" + ChatColor.AQUA + "Lusion's Kill The Sheep" + ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-");
                            Bukkit.broadcastMessage(ChatColor.GREEN + "Kill The Sheep has started! Go to /warp events to play!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "The sheep must be hit 2,000 times!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "You win by getting the most hits!");
                            Bukkit.broadcastMessage(ChatColor.GOLD + "The sheep is " + kts.sheep.getDisplayName() + ".");
                            kts.started = true;
#

tat?

iron glade
#

not at all

fluid river
ebon ether
#
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(args.length >= 1){
            if(args[0].equalsIgnoreCase("start")){
                if(sender.hasPermission("kts.start")){
                    if(kts.started){
                        sender.sendMessage(ChatColor.RED + "The game has already started.");
                    }else{
                        if(Bukkit.getOnlinePlayers().size() >= 2){
                            Random random = new Random();
                            kts.sheep = Bukkit.getPlayer(Bukkit.getOnlinePlayers().toArray()[random.nextInt(Bukkit.getOnlinePlayers().size() - 1)].toString());
                            Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-" + ChatColor.AQUA + "Lusion's Kill The Sheep" + ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-");
                            Bukkit.broadcastMessage(ChatColor.GREEN + "Kill The Sheep has started! Go to /warp events to play!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "The sheep must be hit 2,000 times!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "You win by getting the most hits!");
                            Bukkit.broadcastMessage(ChatColor.GOLD + "The sheep is " + kts.sheep.getDisplayName() + ".");
                            kts.started = true;
fluid river
#
if (args.length < 1) return true;
if(!args[0].equalsIgnoreCase("start")) return true;
if(!sender.hasPermission("kts.start")) return true;
ebon ether
#

where you see kts. the "kts" is red

iron glade
#

is there a reason ur checking args.length >= 1?

fluid river
#

and so on

iron glade
#

like /kts start blabla would also start this

fluid river
#

boolean onCommand

#

not a void

iron glade
#

ik

#

why false

fluid river
#

cuz why not

iron glade
#

who wants that ugly message to be printed

fluid river
#

i don't know what the guy wants

iron glade
#

np but personally I never return false in onCommand

ebon ether
fluid river
#

changed

#

problems?

iron glade
ebon ether
#

for example - if(kts.started) { ... }

#

"kts" is red

#

and kts.sheep

#

kts is red

iron glade
# fluid river problems?

no was just wondering, you can return false if you want but most people don't want that message to be sent

undone axleBOT
fluid river
#

used it a lot

iron glade
#

rly?

fluid river
#

yeah

#

try it

ebon ether
#

it says "can't resolve symbol 'kts' "

iron glade
fluid river
#

you don't have kts varible in your class/method

ebon ether
#

ahh

fluid river
fervent siren
#

idk why but my worldguard spawn pvp protection wont work at all it says "Hey Sorry but you cant pvp here!" but it does damage to people

iron glade
#

idk why I always added it tbh

fluid river
#

I first found it out like half year ago

iron glade
#

something I've done when I started making plugins and just kept doing

fluid river
#

with coding experience from like 1.5.2)

timid jetty
#

BrewingStands have getBottles to get the contents of the bottle area, but how would you get the item that is put in to brew with?

ebon ether
fluid river
#

Idk lol

#

Is that even your code

iron glade
#

what is kts?

#

if even you don't know how we supposed to know

fluid river
#

If you wrote it you should know what it is

If it's not your code just make own plugin

ebon ether
# fluid river Is that even your code

no. im seeing how much this AI can do in terms of making a minecraft plugin so seeing if it can make a minigame. I can't do much in Java, only plugins i've made are simple little things.

Cause if this AI can do all this shit for me.. im not going to learn Java anymore.

fluid river
#

Bro

ebon ether
#

It's made everything so far

fluid river
#

You will have to learn java anyways

odd wedge
#

lol

iron glade
#

programs AI to code java plugins so he doesn't have to

fluid river
#

Cuz Base64, ByteStreams, Desktop, and System/Runtime

#

You will have to write it with your own hands

torn shuttle
#

just make a bot that does that

fluid river
#

Cuz it's using string parameters

#

Bro what is this ai

#

send a link

#

I'm gonna write ProtocolLib player lie-fly animation

ebon ether
#

this is what I did...

package com.lusionmc.killthesheep;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class ktsCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        return false;
    }
}

I gave it that code - and then said "create the command: /kts start"

then it gave me that. And it seems perfect so far

#

other than what I can't figure out

#

why that shit is giving an error

fluid river
#

What's the idea

#

of your plugin

#

what are you even trying to implement

ebon ether
#

KIll the sheep plugin so a sheep spawns & players gotta hit it 2k times

#

and player w most hits wins

#

and gets reward

#

and this is the start command

fluid river
#

There should be a class

ebon ether
#
    @Overrid
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(args.length < 1){
            if(args[0].equalsIgnoreCase("start")){
                if(sender.hasPermission("kts.start")){
                    Object kts;
                    if(kts.started){
                        sender.sendMessage(ChatColor.RED + "The game has already started.");
                    }else{
                        if(Bukkit.getOnlinePlayers().size() >= 2){
                            Random random = new Random();
                            kts.sheep = Bukkit.getPlayer(Bukkit.getOnlinePlayers().toArray()[random.nextInt(Bukkit.getOnlinePlayers().size() - 1)].toString());
                            Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-" + ChatColor.AQUA + "Lusion's Kill The Sheep" + ChatColor.DARK_GRAY + "-~-~-~-~-~-~-~-~-~-~-");
                            Bukkit.broadcastMessage(ChatColor.GREEN + "Kill The Sheep has started! Go to /warp events to play!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "The sheep must be hit 2,000 times!");
                            Bukkit.broadcastMessage(ChatColor.WHITE + "You win by getting the most hits!");
                            Bukkit.broadcastMessage(ChatColor.GOLD + "The sheep is " + kts.sheep.getDisplayName() + ".");
                            kts.started = true;
                        }else{
                            sender.sendMessage(ChatColor.RED + "There are not enough players online.");
                        }
                    }
                }else{
                    sender.sendMessage(ChatColor.RED + "You don't have permission to use that command.");
                }
            }else{
                sender.sendMessage(ChatColor.RED + "Usage: /kts start");
            }
        }else{
            sender.sendMessage(ChatColor.RED + "Usage: /kts start");
        }
        return true;
    }
}```
#

there is a class

fluid river
#

with fields "sheep" and "started"

golden turret
#

How to resend the chunk to the player?

torn shuttle
#

how is there a typo on override

ebon ether
fluid river
#

And you have to make a variable called kts and initialize it with a new Kts object

ebon ether
fluid river
#

Well if you didn't know

iron glade
#

that's not gonna work

fluid river
#

You can just remove the annotation completely

#

And never use it again

timid jetty
#

does this mean the player using the brewing stand?

fluid river
#

In your code

iron glade
#

you'd have to return after args.length < 1

fluid river
timid jetty
#

ah okay ty

torn shuttle
#

this looks like a pretty dumb ai

fluid river
#

try getView() if exists in class @timid jetty

fluid river
#

and remove all if brackets

fluid river
molten hearth
#

how you gonna teach an Ai to write java without knowing java

fluid river
#

If he knows C++ then easily)))

#

Well except arrays and ->

#

and #include

molten hearth
#
#include org.bukkit.plugin.java.JavaPlugin;


public static int minigame extends &JavaPlugin {
}```
timid jetty
#

anyways related to the past questions, anyone have an efficient way of implementing custom brews before I try figuring it out myself

fluid river
#

you guys know how to create normal cpp array with size specified with keyboard

#

that's

#
int size;
cin >> size;
int* array = (int*) malloc(size * sizeof(int));
lone herald
#

is that a question

#

because if it is

#

i'd say doing it like this is a VERY bad idea

#

it will work though

reef lagoon
#

nvm wait that whole thing is wrong

tardy delta
#

there is no extends in c++ and extending a reference hmm

#

that would be kinda fun

lone herald
lone herald
#

ye
but you need to free() array

lone herald
#

and it basically does all the things that array does

fluid river
fluid river
#

only talking about creation here

mighty pier
#
      
      try {
         Class.forName("org.sqlite.JDBC");
         c = DriverManager.getConnection("jdbc:sqlite:test.db");
      } catch ( Exception e ) {
         System.err.println( e.getClass().getName() + ": " + e.getMessage() );
         System.exit(0);
      }``` i found this in a sqlite tutorial, do i have to replace the jdbc:sqlite:test.db with something else?
tardy delta
#

with the path to ya db

#

and please dont do a System.exit

mighty pier
#

what that do

#

stop plugin?

tardy delta
#

shuts the jvm down

mighty pier
tardy delta
#

im doing like

#

where that utils thing is just to make sure the file exists

mighty pier
#

mm\

tardy delta
#

thats my own code lol

quiet ice
#

Make sure to make the onDisable block handle errors in the onEnable block correctly

tardy delta
#

just create a file and make sure it exists and add the absolute path to the connection string

quiet ice
tardy delta
#

i only get a few npes when my onEnable fails and onDisable is called lol

#

like calling userManager.saveAll() but usermanager doesnt exist

quiet ice
#

There is a danger that you could overwrite the full thing if you are not careful enough

near crypt
#

why is createInventory crossed out?

mighty pier
#

deprecated

fluid river
#

go to javadocs and find why

ornate mantle
#

[Server thread/INFO]: Named entity EntityZombieHusk['[Lv1] Husk 7/20:hearts:'/886, l='ServerLevel[world]', x=-19.61, y=128.00, z=-122.22] died: [Lv1] Husk 7/20:hearts: was slain by TheGiorno how do i stop these notifications from appearing?

golden turret
#

How can I send to the client a huge block change? Something like updating 300000 blocks. What would be the best method?

ornate mantle
golden turret
#

I want to use fake blocks

ornate mantle
#

what

golden turret
#

I want to use fake blocks

ornate mantle
#

not really cuz if i dont use my nms plugin it doesnt show up

ornate mantle
golden turret
#

How

ornate mantle
#

packets

golden turret
#

How

ornate mantle
#

what exactly are you trying to accomplish

golden turret
#

Send to the client a huge block change

quiet ice
#

Just resend the chunks with your alterations

golden turret
#

How to change the chunk then

eternal night
#

Or review chocos pr for multiblockchange

#

So it gets merged

ornate mantle
#

@golden turret

#

use nms

#

watch a tutorial or something

golden turret
quiet ice
#

Or well it can, but not to a large degree

ornate mantle
#

its been fucking me over for weeks

#

wait

#

why cant it be used for a large degree

quiet ice
#

I have never used NMS at all, but at least I know how bukkit works and thus can infer how the protocol works based on the documentation

ornate mantle
#

it does acknowledge changes right

quiet ice
#

Yes

ornate mantle
#

why not to a large degree?

#

say i have max render distance

quiet ice
#

What do you not understand in acknowledge?

ornate mantle
#

the client realises that a block change has occured

#

like place/remove

#

am i getting this correctly

quiet ice
#

Acknowledge block change is clientbound

ornate mantle
#

yeah

#

isnt that what they wanted to do all along

#

"fake blocks"

quiet ice
#

As such it will confirm SERVERBOUND block changes, not the other way around

reef lagoon
#

what the fuck is event.getWhoClicked() why can't it just be event.getPlayer(), can a mob click a gui?

quiet ice
quiet ice
#

?jd-s

undone axleBOT
reef lagoon
quiet ice
#

Yeah, no clue

quiet ice
# reef lagoon more* it's just annoying

to be fair if you have decent autocompletion (which should be the case if you are using eclipse), you won't have to try to find out what method you are looking for

reef lagoon
#

I'm using intellij

round finch
#

autocompletion algorithm / ai
nice

reef lagoon
#

Just changing event.getPlayer() to event.getWhoClicked() is annoying
I mean, it doesn't change much but like why have it in the first place xd

ornate mantle
#

i love copilot

gray merlin
#

@lost matrix @smoky oak I was just eating and I thought of a better solution to ItemStack[] compression algorithm. I'd watched the addItem function do the compression on my testing before, and it clicked on me just now.

O(n), too, though this one is limited by the maximum inventory site of 54, as a pose to the prior algorithm that could work on all sizes

public static List<ItemStack> compress2(List<ItemStack> items) {

        Inventory compressor = Bukkit.createInventory(null, 54);
        items.stream().filter(item -> item != null && item.getType() != Material.AIR).forEach(compressor::addItem);

        return Arrays.asList(compressor.getContents());
    }```
near crypt
mighty pier
#

undeprecate it

ornate mantle
#

you were born to do this

near crypt
round finch
mighty pier
#

idk why its deprecated

torn shuttle
#

uh can you correctly run an #equals() to evaluate two array lists of strings?

near crypt
#

does anyone know why createInventory is deprecated?

mighty pier
#

what version?

near crypt
#

paper

near crypt
smoky oak
#

how much does that slow it down?

gray merlin
#

Doesn't seem to slow it down in any way

#

If anything, it's a little faster

smoky oak
#

ah

smoky oak
#

i was a bit worried it might slow it down

#

because a smaller O(n) isnt necessarily a fasater algorithm if the overhead makes it slower overall

#

it's just how it scales

gray merlin
#

Yeah that's alright. Also I forgot to mention that after testing, I had to filter out the null objects from the array to list conversion, so to add to the method...

near crypt
#

XDDD

#

and how is the method in paper called? @last temple

golden turret
gray merlin
#
public static List<ItemStack> compress2(List<ItemStack> items) {

        Inventory compressor = Bukkit.createInventory(null, 54);
        items.stream().filter(item -> item != null && item.getType() != Material.AIR).forEach(compressor::addItem);

        return Arrays.stream(compressor.getContents()).filter(Objects::nonNull).collect(Collectors.toList());
    }```
#

Not sure if the return is all correct since I'm writing this on my phone

#

But yeah.

vocal cloud
#

How would determine the correct slot of each item?

smoky oak
#

thats not really the goal here

reef lagoon
#

is there a way to stop this from existing

smoky oak
#

dont have double files

#

usually you should replace it with the file last edited

#

you could use a script to force copy it

reef lagoon
#

isn't there something in settings to disable that pop up

ebon ether
smoky oak
#

no, but what you can do is a 'verify replace' copy via shell:```sh
copy /b/v/y origin_path target_path

ebon ether
#

that*

ebon ether
#

and it seems correct?

reef lagoon
#

what's the /b/v/y

gray merlin
smoky oak
#

iirc its bytewise verify yes

vocal cloud
#

Thonk I don't understand but okay

reef lagoon
#

Windows powershell right?

smoky oak
#

just command line

#

put it in a file and name it something.bat

reef lagoon
#

alr ty

lost matrix
smoky oak
#

he fixed it further down smile

lost matrix
#

Ah ok

smoky oak
waxen vapor
#

If i want to create a bossbar that shows the health of a specific person in the game, how do i do that? Im trying to make a person a "Boss" so i want his health shown in a boss bar

#

How would i do that?

#

I tried with the /bossbar command but shit aint working

#

so can i somehow make a plugin that does it?

smoky oak
#

scheduler that updates the boss bar with their health, onkill check that removes it from existence

lost matrix
#

Create a BossBar, when the targets health changes you change the BossBar

#

Scheduling would be a bit expensive because EntityDamageEvent and EntityRegainHealthEvent exist.

smoky oak
#

ah

#

i wasnt aware the latter existed

#

thats why i said scheduler

lost matrix
#

I guess it wouldnt be too bad because it just calls a bunch of getters. So either is fine.

reef lagoon
smoky oak
#

you can just reference the file directly

waxen vapor
#

Also, can i somehow change the values of a item the player is holding? Like if the name of the sword is test i can change the damage it gives, or if armor is named test i can change the resistance

smoky oak
#

the PATH for me ends in target/Shards-v1.0.jar and plugins/Shards-v1.0.jar

reef lagoon
#

ah so add the plugin's name too?

smoky oak
golden turret
#

smile, do you understand the PacketPlayOutMultiBlockChange?

smoky oak
golden turret
#

I want to send a huge block update to the client

#

fake blocks

smoky oak
#

so path/target/BuiltFile.jar to server/plugins/BuiltFile.jar

#

copy /b/v/y C:\Users\me\IdeaProjects\Minecraft\Shards\target\Shard-1.0-SNAPSHOT.jar D:\Creation\Minecraft\plugins\Shard-1.0-SNAPSHOT.jar

#

thats how mine looks

waxen vapor
quiet ice
#

Although I myself do not like this

smoky oak
#

three plugin files isnt a great idea

#

especially if they start insulting you

#

'no such method: L()'

smoky oak
waxen vapor
#

player.getInventory().getItemInMainHand().getItemMeta().getDisplayName()

#

would this work

#

to get the display name of the current itemi n the hand?

smoky oak
#

looks like it would

#

im working on something else rn so i cant check

waxen vapor
#

what event do i put it in? PlayerItemHeldEvent?

smoky oak
#

your best bet is probably to either change the damage value of the sword once it's held, or to modify the damage it deals in an EntityDamageByEntity event

waxen vapor
#

How do i get the player from that?

#

is there like a event.getattacker

smoky oak
#

i dont know the method but yes you can get the entity that inflicts damage

#

check if its a player

#

if yes cast it to a player and proceed from there

#

or you could follow mnfalex suggestion and do if(!(entity instanceof Player player)) return;

prisma palm
#

Can anyone help me with PersistantDataContainers. I have one plugin that makes an item and gives it a "canDismantle" tag. When i try to test for that tag in another plugin, it doesnt detect it, even though returning the PersistantDataContainer keys shows it is in the item.

if (meta.getPersistentDataContainer().has(new NamespacedKey(LitcraftBasicUtilities.getPlugin(), "canDismantle"), PersistentDataType.STRING)) {

chainsawMeta.getPersistentDataContainer().set(new NamespacedKey(LitcraftItemUtilities.getPlugin(), "canDismantle"), PersistentDataType.STRING, "true");

I dont know if i need an instance of the other plugin to test for it or not. if i did do something wrong and stupid pls correct me.

and yes the metas are the same. It is just getting the same meta from the same item in another plugin.

The image is the keys of the item i am holding.

#

oh wait u cant add images

#

hold up

smoky oak
tardy delta
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

vocal cloud
#

You need to use the same plugin. PDC is written to prevent you from messing with other plugins PDC by accident.

smoky oak
#

@prisma palm alternatively make a api plugin that handles the pdc you want shared between plugins

#

did you just change ur name

#

why

prisma palm
#

i verified

long zephyr
#

guys someone knows how can i set the hight of the name tag?

chrome beacon
#

You can't

#

You can shift text though but might look a bit odd

smoky oak
#

u can stack name tags tho

#

hypixel scoreboards are a good example

long zephyr
#

how could i do that ? i know change the name tag with packets and scoreboard. My problem is, i'm teleporting an armostand to the player with custom name and it has the same high of name tag, and i need to move the name tag (no the armorstand)

chrome beacon
#

Move the armor stand

long zephyr
chrome beacon
#

Time to make a mod then

long zephyr
#

i cant send photos here

#

x.x

chrome beacon
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

#

This account is already verified!

long zephyr
echo basalt
#

Hey, how do I go around changing a player's skin for itself?

#

Using 1.18.2

#

My code looks like this so far, running the command doesn't do anything

#

I might need to set the property name to "textures" honestly

#

no clue to what that is

long zephyr
torn shuttle
#

is there a way to convert an inputstream to a File object without actually saving a file to the OS?

echo basalt
#

that's not what I'm looking for

long zephyr
echo basalt
eternal night
#

A file does not hold its data

#

its just a ref to the file

torn shuttle
#

oh wait

#

you're right

#

I want a fileconfiguration actually

#

uh

#

that's worse

eternal night
#

a file configuration ?

#

like a spigot YamlConfiguration ?

#

that would actually be a lot more doable lol

torn shuttle
#

yeah

eternal night
#

like, a lot lot more doable

torn shuttle
#

I have a yml in my jar

#

in the resources

echo basalt
#

get it as an inputstream

torn shuttle
#

that's where I was at

eternal night
#

there is loadFromReader

#

on the YamlConfiguration

echo basalt
#

YamlConfiguration.loadConfiguration(new InputStreamReader(stream))

torn shuttle
#

ah

#

now taht sounds dank

eternal night
#

pls close the reader once you are done

#

or well

#

the stream in general

echo basalt
#

try with resources

eternal night
#

^

odd wedge
#

What about a byte array

echo basalt
#

ByteArrayInputStream

eternal night
#

if the byte array is just your string

torn shuttle
#

input stream reader not input stream right

eternal night
#

you can also just, loadFromString

echo basalt
#

update: the skin changes once I die, any way how I can make the player die and respawn or something?

#

I wonder if Player#spigot#respawn does it

eternal night
#

Wouldn't it be best to just

#

look at paper's API for this xD

#

credit the patch

echo basalt
#

ehhhhhhhhhhhhhhhh

torn shuttle
#

premadeTranslationsConfiguration = YamlConfiguration.loadConfiguration(new InputStreamReader(MetadataHandler.PLUGIN.getResource("translations/" + parsedFilename)));
that's hot, that's hot

eternal night
#

be and good

echo basalt
#

I use paper's api but why do that when I can be an idiot

eternal night
#

oh

eternal night
torn shuttle
#

getting a specific fileconfiguration entry for one of the languages prepackaged in my plugin

echo basalt
#

pov: you're international

torn shuttle
#

without actually making it a file outside of the resources inside of the plugin for reasons

torn shuttle
#

no, from the plugin resources

#

best part is now I get to write it very slowly lol

trim creek
#

I am absolutely lost. What is wrong with this code? ;-;

PreparedStatement ps2 = connection().prepareStatement("INSERT IGNORE INTO `cuud` (NAME, UUID, RANK, GEMS, XP, KILLS, DEATHS, GEMBOOSTER, XPBOOSTER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
#

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RANK, GEMS, XP, KILLS, DEATHS, GEMBOOSTER, XPBOOSTER) VALUES ('NeonOwlGery', 'bd' at line 1 - console

odd wedge
eternal oxide
# torn shuttle getting a specific fileconfiguration entry for one of the languages prepackaged ...
    public static boolean checkDependencies(Plugin plugin) {

        if (Supported.hasLibraries())
            return true;

        AtomicBoolean isLoaded = new AtomicBoolean(true);

        Consumer<Exception> error = ((ex) -> { // This consumer runs if an error occurs while loading the dependency
            plugin.getLogger().info(ex.getMessage());
            ex.printStackTrace();
            isLoaded.set(false);
        });

        Consumer<String> loaded = ((name) -> { // This consumer runs on a successful load.
            plugin.getLogger().info(name + " loaded!");
        });

        // Read all libraries from the plugin.yml and manually load them (pre 1.16.5).
        
        YamlConfiguration description = YamlConfiguration.loadConfiguration(new UnicodeReader(plugin.getResource("plugin.yml")));
        List<?> libraries = description.getList("libraries");

        if (libraries != null) {
            libraries.forEach(lib -> {

                String[] split = lib.toString().split(":");
                if (split.length == 3) {
                    new MavenCentralDependency(plugin, split[0], split[1], split[2]).load(loaded, error);
                }
            });
        }

        return isLoaded.get();
    }```This is reading the plugin.yml contents.
torn shuttle
#

all of this to make a safe translation autoupdater that doesn't overwrite custom values...

waxen vapor
#

Where can i find the TNT texture in a texture pack?

#

I cant seem to find it anywhere

#

in the json file for tnt it says the location is in texture/block/tnt_top,tnt/side,tnt/bottom

#

but i cant find it

#

anywhere

#

i searched the whole texturepack folder

#

its not there

torn shuttle
#

yeah it worked

#

man this is a cursed workflow

#

I do think I got it as simple as possible though

waxen vapor
#

please <3

trim creek
#

i dont think its development related

echo basalt
waxen vapor
#

so kinda development related ig?

trim creek
#

datapack afaik

mellow pebble
#

can someone help me

#

i have code that writes to file

#

but it writes to another file too

#

and i really dont see where im making mistake

#

?paste

undone axleBOT
haughty idol
#

how would i do backstabs?

#
                double angle = ((vector.getX() + vector.getZ()/2));

                if (angle <= 45) {
                    damaged.getWorld().spawnParticle(Particle.SMOKE_LARGE, damaged.getLocation(), 10);
                    damaged.damage(e.getFinalDamage());``` this is my current code
mellow pebble
#

here is 3 classes

#

when i run /mute

#

it writes to ban file and mute file

#

but when i do /ban it writes to mute too

wispy hedge
#

Is there any API to download bought premium plugins from spigotmc.org to build an auto updater:)?

trim creek
haughty idol
#

uh

#

i just want to do backstabs

trim creek
#

'k I can't get it

#

I might be the one who is tired

#

but

trim creek
mellow pebble
echo basalt
#

you mean spawn a particle behind the target entity?

#

raytrace, get hit position, negate it, add to entity location, spawn particle

haughty idol
#

aa i got it

echo basalt
#

rename it to id

trim creek
#

๐Ÿค”

#

Strange

#

Every other plugin supports it

#

and the console doesn't even shows it as an error ๐Ÿค”

echo basalt
#

It's not suitable for a column name

#

imo

trim creek
#

humm

#

Yet thats still strange

#

others of my plugins supported it

#

what the heck is wrong with me?

torn shuttle
#

place your bets, will I get this automatic translation update system working in my first try

hasty prawn
#

I thought stuff working first try was a myth

torn shuttle
#

yep messed up lol

hasty prawn
round finch
#

how can that be possible?

torn shuttle
#

oh boy this is actually a bad one too

#

you love to see it

hasty prawn
#

Pretty sure it's not possible

round finch
#

it most be reviewed many times

trim creek
# echo basalt imo

The column is actually created, the system just cannot put the data inside the database for that reason that is written down in the idkwhatwecallthatlol.

#

so, I clearly don't get what's wrong

#

before it was saying its a f*cking NullPointerException

haughty idol
#

how do i check if player is on the ground

trim creek
#

player.isOnGround()

haughty idol
#

it's deprecated

trim creek
#

should work afaik

eternal oxide
#

because it can be faked

#

The client tells the server if the client is on the ground.

trim creek
#

humm

eternal oxide
#

Its fine so long as you don;t need it for cheats

trim creek
#

checking if the block below the player is not air... is not the most correct idea, right? ๐Ÿค”

eternal oxide
#

no, you can shift and hang off a ledge

trim creek
#

c###

eternal night
#

Well either you go with what the client tells you or you perform the calculation on your own which a) more expensive and b) might not be correct

trim creek
#

I might be a bit too tired I guess

eternal night
#

pick your poison

trim creek
#

but kinda feeling weird

hasty prawn
#

I mean as long as you're not doing cheat detection, if the client lies about it then the only thing that can happen is very funny things probably

trim creek
remote swallow
#

Anyone know how i would be able to get the killer from PlayerDeathEvent

eternal oxide
#

getLastDamageCause()

#

check instanceof EntityDamageByEntityEvent, cast and getKiller()

#

or getDamager()

remote swallow
#

thanks

tender shard
#

or just do event.getPlayer().getKiller()

#

isnt this also a thing?

eternal oxide
#

it is, if its a player

tender shard
#

oh yeah, if it's another entity then one need to do what you sent

odd wedge
brave goblet
odd wedge
brave goblet
#

Ik

eternal night
#

would also advertise for that method if you need a player killer

#

stuff like "what zombie murdered this poor soul" become harder

#

and you'd have to go along the elgar described last damage event route

brave goblet
torn shuttle
#

sometimes my genius frightens me

#

especially when it's 3 am 2 years later and I'm reading my old code

eternal night
torn shuttle
#

what the hell why did my french file get chinese characters

#

oh come on

#

just can't catch a break, it's japanese now

eternal oxide
#

saved as utf8 and read as utf16 or something like

torn shuttle
#

yeah

#

and unicode reader gives me a malformed input, this is lots of fun

#

aight

#

just forced a charset on the stream, we good now... probably

quaint mantle
#

block animations and falling blocks are something completely different

#

you can spawn falling blocks with spigot

#

after they have landed?

#

ofc

#

well pretty much anything is possible

#

if you want them to do damage when they hit an entity I think you'd need to check every falling block to see if they are touching anything

#

and damage and then delete the block

long zephyr
#

someone knows how to do that empty space? D:

torn oyster
#

why is this not working

#
            p.getInventory().clear();
            for (int i = 0; i < oldInventories.get(p).getSize(); i++) {
                ItemStack item = oldInventories.get(p).getItem(i);
                if (item != null) {
                    p.getInventory().setItem(i, item);
                }
            }
            oldInventories.remove(p);```
#

i save their inventories into a HashMap<Player, PlayerInventory> but it doesn't work

eternal night
#

the inventory instances are not re-created

#

e.g. the one of the player remains the same

agile anvil
eternal night
#

just saving a reference to it into your oldInventories map won't clone it

long zephyr
dusk flicker
#

use another plugin and use the api of said plugin

torn oyster
#

so i should save the ItemStack[] contents?

long zephyr
#

like in the plugin

fluid river
#

Store copy of inventory

gray merlin
#

I have made a deep copy of a player's inventory, so as to save the inventory before anything happens in a GUI. However, for some reason, when I get the variable value, it returns the current inventory of the player. I have no idea what's going on.

fluid river
#

or store ItemStack[]

#

As a copy of inventory contents

gray merlin
#

Accessing

#

There's literally nothing inbetween that changes the field

#
  • the field is final
eternal night
#

contents should already be a copy

gray merlin
#

Yeah, I thought so too at first, but they just sync up for some reason, instead of backing up

#

it's annoying

eternal night
#

the items inside are potentially craft item stacks

#

which directly map to the minecraft stack

gray merlin
#

Oh, yeah they are.

#

I'll have to make a new array mapping the craft item stacks to Itemstacks then

#

Thank you

quaint mantle
#

Also forgot to say, but everything worked! Thank you so much :D

torn oyster
#

why whenever i teleport someone after they take void damge

#

damage

#

does it cause them to be stuck

#

i make it so if someone takes damage in the void, the event is cancelled and they get teleported to spawn

#

but they get stuck there and can't move for what seems to be forever

rough drift
#

I am having some trouble working on chat pings, so say I have @IkeVoodoo @IkeVoodoo2, my result would be @IkeVoodoo ยงeยงe@IkeVoodooยงr2ยงr

for (Player player : server.getOnlinePlayers().stream().sorted((plrA, plrB) -> Integer.compare(plrB.getName().length(), plrA.getName().length())).toList()) {
    if (message.contains(PING_PREFIX + player.getName())) {
        message = message.replace(PING_PREFIX + player.getName(), PING_COLOR + PING_PREFIX + player.getName() + PING_RESET);
    }
}
```That's my code (Sorting is done so the longer names come first, an attempt to try and fix the issue)
#

How could I go about fixing that?

eternal night
#

Write a proper regex to match these ?

#

either ending in a space or in line end

echo basalt
#

something like that

#

handles @ @one

#

@Hey @There would make group1 There

snow lava
#

why this code that detect if there is a custom item in the result slot and delete the incridients doesn't delete the ingridients if it's shiftClick?

code: https://paste.md-5.net/watuwoqeda.cs

dawn plover
#

how do i add values to my scoreboard. player.getScoreboard().registerNewObjective("Name", Criteria.DUMMY, "objectName" );
i came so far to make a score objective. but thats about it

#

and it exist in game, so that works as intended

fluid river
#

well basically you just put some placeholder and each scoreboard update replace it with actual values?

dawn plover
#

but likke, how do i add the placeholder XD

#

i have been trying to find some kind of way to just type an interger, and make it show up in minecraft

#

like, i know it wont be as simple as that, but at least something where i can add a score would already help

#

but the only thing i can find are getters

hazy parrot
#

Placeholder to what

#

Placeholder api?

dusk flicker
#

theres probably hundreds of tutorials on scoreboards

sterile token
#

Something like Assamble

#

Let me look something for you

#

1m please

#

There you have their github

#

At the end of the readme they have some examples

#

Let find another tuto because that doesnt explain match what you want

#

Im not really sure

#

I dont use HikariCP

#

I just know its a pool manager

hazy parrot
#

Its like any other sql library/ whatever, its just different implementation to interfaces

#

also making connection is a bit different

sterile token
hazy parrot
#

but its pretty much same

sterile token
#

I mean they use static things

#

Not really okay doing that, but atleast you can understand how it works

#

Hmn i dont think its just like normal Mysql driver

#

But designed better i think

#

Read the tuto

#

it will help you a lot

ornate patio
#

whats the difference between armor defense points and armor toughness

worldly ingot
#

HikariCP doesn't run queries. It pools connections

#

You get a connection from HikariCP, then you do queries like you would normally

ebon ether
#

can you have a space in plugin name?

#

I forgot if you could or not

#

ive always done it without a space

young knoll
#

No

ebon ether
#

ok

worldly ingot
#

You used to be able to, but modern versions explicitly disallow it

#

I want to say 1.13+?

ebon ether
#

alright, its no problem

#

just wondering

#

doesnt bother me

#

should I use cammel case for plugin name

#

or it really doesnt matter lol

#

ive j done caps for every word

#

including first

hazy parrot
#

I mean it will look weird if your plugin is called for example chestCrates

#

Imo

worldly ingot
#

Standard naming conventions is PascalCase for plugin names, yeah

iron glade
#

never seen anyone use camelCase for plugin name wtf

ebon ether
#

๐Ÿ™

quaint mantle
#

what's the best way to make prison enchants?

#

looping blocks?

#

or

desert frigate
#
public static boolean isLocationInArea(Location location, Location location1, Location location2) {
        if((location.getBlockX() > location1.getBlockX()) && (location.getBlockX() < location2.getBlockX())){
            if((location.getBlockY() > location1.getBlockY()) && (location.getBlockY() < location2.getBlockY())){
                if((location.getBlockZ() > location1.getBlockZ()) && (location.getBlockZ() < location2.getBlockZ())){
                    return true;
                }
            }
        }
        return false;
    }```
#

idk whats wrong with this code at this point

#

it keeps returning false

waxen plinth
#

Are you sure that location1 is the minimum corner and location2 is the maximum corner?

#

And are you sure that you want it to be exclusive on both ends?

quaint mantle
#

i hate jitpasck

#

why

waxen plinth
#

same

quaint mantle
#

buoo

#

you know anything about jitpack

waxen plinth
#

yes

quaint mantle
#

because its giving me a stupid error

waxen plinth
#

which is

quaint mantle
#

class file has wrong version 60.0, should be 52.0

drowsy helm
#

What error

quaint mantle
#

i've tried to change the java version so many times

#

still didn't work

drowsy helm
#

Itโ€™s expecting java 8?

waxen plinth
#

it's set to use java 8

drowsy helm
#

Strange

quaint mantle
#

i've tried to set it to java 16

#

since 1.17

waxen plinth
#

Add this file to your project

#

And make sure you have this in your build

desert frigate
waxen plinth
#

Or if you're using maven I don't think it's needed

quaint mantle
#

that's gradle doe

#

im using maven

waxen plinth
#

The jitpack.yml is still needed though

#

Try that

desert frigate
quaint mantle
#

okay so

#

i've tried changing my java version to 1.17

#

but keeps getting this error

#

and i've asked this channel

#

and they couldn't fix it

#

Unsupported class file major version 61

#

everything is set to java 17

#

so idfk

#

maven gay ngl

desert frigate
kind hatch
quaint mantle
kind hatch
#

Check your project settings.

quaint mantle
#

its java 17

#

like i asid

#

everything is java 17

kind hatch
#

How's your pom setup?

quaint mantle
kind hatch
#

Try this instead.

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
</properties>
quaint mantle
#

that breaks it

#

but i'll try

#

and give error

#

which it is 17

#

like bruh

kind hatch
#

Well, I have seen some people having issues with Java 17. Not sure why. My best guess is that it's still not finished, but do you need Java 17 for anything specific? Why not just use java 16?

quaint mantle
#

i dont think i can

#

or i can change my paper version ig

#

but

#

i can change it to 1.13

#

instead

#

shouldn't break anything

desert frigate
#

still false

kind hatch
# quaint mantle i dont think i can

I mean, that shouldn't affect your plugin would it? Unless paper now requires Java 17? I don't use it so I wouldn't know, but I have Java 17.0.1 installed and I just write Java 8/16 code.

quaint mantle
#

well isn't version 52.0

#

8?

#

jitpack being gay

kind hatch
#

Yes, Java 8 is version 52.

quaint mantle
#

which is weird

kind hatch
quaint mantle
#

yeah

worldly ingot
#

Paper bumps Bukkit's Java version to 17

#

For some reason?

quaint mantle
#

well how do i fix this stupid error

#

i just want my jitpack to work

worldly ingot
#

Jitpack only builds properly with Java 8. You can change it with a .jitpack file iirc.

#

Can't remember the specific details of that file though

desert frigate
#

maybe i need to convert to whole number?

worldly ingot
#

Yeah. You can make a jitpack.yml file

jdk:
  - openjdk9
before_install:
   - ./custom_setup.sh
install:
   - echo "Running a custom install command"
   - ./gradlew clean install -xtest
env:
   MYVAR: "custom environment variable"```
#

(obviously you would only need the jdk part though)

quaint mantle
#

okay

quaint mantle
#

so would i change it to openjdk-17.0.1?

worldly ingot
#

Not sure because it's not called openjdk anymore. It's temurin. Lemme see if I can find supported versions

quaint mantle
#

like, i've tried to fix this issue but never could

#

should i use spigot for this

#

instead of paper?

worldly ingot
#
before_install:
   - sdk install java 17.0.4.1-tem
   - sdk use java 17.0.4.1-tem
#

Just using that should work in a jitpack.yml file in the root of your repository

quaint mantle
#

and the jdk?

#

17.0.4.1?

worldly ingot
#

Yeah, that's Temurin 17

#

sdk is just the name of the SDKMAN command