#help-development

1 messages · Page 1572 of 1

opal juniper
#

oh - yeah

#

it just means that everything is hard coded

#

which is not a good thing if u distribute teh plugin

exotic scroll
#

how to tell if an event happened during an interval of time?

vital ridge
maiden briar
#

How can I intercept packets to edit them? For example editing ServerPing in PacketStatusOutServerInfo

quaint mantle
#

Can't I do this in the class I want?

oblique pike
#

You need to access your plugin instance

quaint mantle
#

Hello? any help?

unreal quartz
#

we can't read your mind unfortunately

eternal oxide
vital ridge
#

Whatsu mean same machine?

vital ridge
eternal oxide
#

yes

vital ridge
#

nope

#

n vm

#

it is

eternal oxide
#

then you have a networks issue

vital ridge
#

it is

quaint mantle
eternal oxide
#

ok, are you obtaining a connection each time you make a query? or are you trying to reuse the same one?

unreal quartz
#

then player is null

quaint mantle
vital ridge
#

This is the way I do:

public void createNickTable() {
        try (
                final Connection connection = getConnection();
                final PreparedStatement preparedStatement = connection.prepareStatement("CREATE TABLE IF NOT EXISTS player_info " + "(UUID VARCHAR(36),NAME VARCHAR(100),NICKNAME VARCHAR(100))")
        ) {
            preparedStatement.execute();
        } catch (final SQLException e) {
            e.printStackTrace();
        }
    }
maiden briar
#

What is this class for? EnumProtocolDirection (NMS)

eternal oxide
quaint mantle
# unreal quartz then player is null

How it null?

Player player = (Player) event.getEntity();
            Player killer = player.getKiller();
            DamageCause deathCause = player.getLastDamageCause().getCause();

vital ridge
unreal quartz
#

last damage cause nul lthen

quaint mantle
#

Ok

vital ridge
#

I dont see whats wrong rly

#

like why does it happen

#
config.setMinimumIdle(5);
        config.setMaximumPoolSize(50);
        config.setConnectionTimeout(10000);
        config.setIdleTimeout(600000);
        config.setMaxLifetime(1800000);
#

i added these options

#

hoping they will fix smthing

eternal oxide
#

I've not used Hikari but I believe it has a connection pool. Your issues seems to be that you are being given a stale connection. Or you are trying to retrieve a HUGE amount of data at once.

vital ridge
#

Na it at first works perfectly

eternal oxide
#

I'd not set a lifetime

vital ridge
#

its a nickname plugin

#

but after 10 hours

#

it times out

#

pretty much

unreal quartz
#

50 connections seems like a lot

eternal oxide
#

If you haven't tried it I'd try using everything default.

vital ridge
#

I have honestly no idea what to do

#

before without hikari the error happened after like 2 hours

#

or even less

#

now it happens in 10 hours

unreal quartz
vital ridge
#

You think that will change smthing?>

unreal quartz
#

well by default it is disabled

vital ridge
#

What should be the keepalive time?

#

my goal is just that the server runs as long as it wants and my plugin wont crash

unreal quartz
#

This property controls how frequently HikariCP will attempt to keep a connection alive, in order to prevent it from being timed out by the database or network infrastructure. This value must be less than the maxLifetime value. A "keepalive" will only occur on an idle connection. When the time arrives for a "keepalive" against a given connection, that connection will be removed from the pool, "pinged", and then returned to the pool. The 'ping' is one of either: invocation of the JDBC4 isValid() method, or execution of the connectionTestQuery. Typically, the duration out-of-the-pool should be measured in single digit milliseconds or even sub-millisecond, and therefore should have little or no noticible performance impact. The minimum allowed value is 30000ms (30 seconds), but a value in the range of minutes is most desirable. Default: 0 (disabled)

vital ridge
#

so it like pings the server?

waxen plaza
#

Can I get the inventory of a player pre death in a player respawn event?

chrome beacon
#

No

waxen plaza
#

Ok

rocky glacier
#

any1 know how i make a repeating countdown in a hologram

chrome beacon
#

Use the scheduler

#

?scheduling

undone axleBOT
rocky glacier
#

i mean not how to code one

thorn linden
#

Heyy i wanna dev who can make me a minecraft server pls dm me

rocky glacier
#

more like a finished one

unreal quartz
#

i.e. you want us to write it for you?

rocky glacier
#

no isnt there a some plugins

unreal quartz
#

this channel is for nerds to write plugins

crude hound
#

hey, I want to know : how to import a plugin (NBTAPI for this time) and load it in the server with maven

chrome beacon
#

So you want to shade it

#

NBTAPI is quite large you might want to get people to just install it as a plugin

crude hound
#

it is for a server so I think this is not a problem

waxen plaza
#

I did player.getInventory() but how I can't find a setInventory() method

quaint mantle
#

I wanna Unbreakable item, I use this code

meta.setUnbreakable(true);
#

What should I?

unreal quartz
#

stop using 1.7.9

quaint mantle
#

I try 1.8.8 but not working

unreal quartz
#

read it

quaint mantle
#

What is the unbreakable code for 1.8 or 1.7?

waxen plaza
#

How do I set playerInventory?

dire marsh
#

damn typo's am i right

unreal quartz
#

lol

unreal quartz
#

you update the contents

quaint mantle
waxen plaza
#

Oh ok

dire marsh
#

1.17.1, aah

#

then you can just use ItemMeta#setUnbreakable

quaint mantle
#

There is code for 1.17

unreal quartz
#

simple fix: use 1.17 : )

quaint mantle
#

I need 1.8

dire marsh
#

you don't need it, you want it

unreal quartz
#

then google and 7 year old spigot threads is your friend

dire marsh
#

maybe he meant 1.18

#

sorry that's not out yet

unreal quartz
#

planning for the future i see

dire marsh
#

gotta wait a few more months

quaint mantle
#
ItemStack teleport_bow = new ItemStack(Material.BOW);
ItemStack teleport_arrow = new ItemStack(Material.ARROW);
        
teleport_bow.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);

I wanna just enchantment bow but both enchanted

dire marsh
#

wat

cosmic patrol
#

Having a weird issue, I'm printing the material of an ArmorStand's helmet to the console, but it keeps giving LEGACY_AIR while I'm pretty sure I'm looking at a helmet that ain't LEGACY_AIR.

I use the following code: https://hastebin.com/abinolivan.kotlin

The specific code for this part is:

ArmorStand target = (ArmorStand) e.getRightClicked();
if(target.getEquipment() == null)
  return;

System.out.println("Debug #4 "+target.getHelmet().getType()+" "+target.getEquipment().getHelmet().getType());

I'd say this is quite weird behaviour, I'm using both the deprecated getHelmet() method and it's replacement getEquiment().getHelmet(), but neither gives a valid response. Also tried casting to LivingEntity and then getting the equipment, but that gives the same LEGACY_AIR result
Please ping since chances are high I'll miss it otherwise.

unreal quartz
#

did u specfy api verison

cosmic patrol
#

Good one, I might have forgotten to do that😅

#

Yep forgot, I'mma check if that fixes it

quaint mantle
#

How can I hide enchantments? is there code

cosmic patrol
#

Should be an attribute for that

cosmic patrol
quaint mantle
#

Thanks

magic raptor
#

someone knows how to check if a player has resource pack ( bungee side )?

dense pollen
#

Hi, i have a null error:
for (String s : list) { if (s != null) { if (target.getUniqueId().toString().equals(s)) { list.remove(s); p.sendMessage("§a" + target.getName() + " darf nun nicht mehr auf " + args[1] + " joinen!"); } } }
Error:
[12:07:34] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'serverperms' in plugin Lobby v1.0

magic raptor
#

in what line?

dense pollen
#

The line i pasted in

#

The loop

unreal quartz
#

if i am not mistaken

#

what i see is multiple lines

dense pollen
#

Wait

#

The Error:

cosmic patrol
#

You can't loop through a list and modify it at the same time

cosmic patrol
#

You can use iterators for this or add them to a second list then remove that from the list you looped through

blazing scarab
chrome beacon
#

A packet will be sent if the client accept the server resourcepack

#

If that's what he's wondering

dense pollen
#

It fixed it

fickle helm
#

what is the most reliable way to check if the server is running spigot and not a fork such as paper?

#

I ran Bukkit.getServer().getVersion() and it showed 3178-Spigot-eac3cd9-a6292cc (MC: 1.17.1), so I could check if -Spigot- is in there, but not sure if all versions used this format

unreal quartz
fickle helm
#

thanks

quiet ice
#

just note that a few servers do not adhere to this

#

I recall the maker of bstats complaining about it

void cedar
#

Hi, I coded a plugin on intellj idea, how can I upload it to spigotmc?

quiet ice
#

build tool?

void cedar
#

Uh?

quiet ice
#

from that answer I guess it isn't maven or gradle. In that case I cannot help you

void cedar
#

Is ok

#

Anyway

#

How can I get the private message from spigotmc?

unreal quartz
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

void cedar
#

Ik....

#

I do !verify Belven123

#

It say sent private message to my account

unreal quartz
#

thennnn

#

wait

void cedar
#

???

unreal quartz
#

wait for the message

void cedar
#

Kk

#

Do u know how to public my plugin on spigot MC?

unreal quartz
ivory sleet
#

You first need a plugin

void cedar
#

I already coded it on intellj idea...

unreal quartz
#

do u know how to build it

void cedar
#

Wait I'm confused..

unreal quartz
#

have you managed to produce a .jar file

void cedar
#

Is ok

#

I get it

#

Yes produced a .jar file :)

#

Thanks for ur help :)

unreal quartz
#

ok

void cedar
#

:)

fickle helm
#

is there a way to write to the console as a error or warn stream? I'm aware I can use the bukkit logger but if I do that then I can't use chat colors.
I'm using this method but only shows up as info

Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.YELLOW + "this is a test");```
unreal quartz
#

use your plugins logger

eternal oxide
#

Using colours in console is annoying as heck

rocky glacier
#

Plugin Development Request: (PM if you can do this for me)

I need a plugin wich has the following features:

  • A "cmd" generator bound to a mc block (i can place any command wich it will execute in time stamps)
  • A placeholder with a value (value depends on generator tier) wich adds up to a total and that total i can display as a placeholder
  • A config file where i can add generators by my self, choose cmd, choose a delay and the name of the generator
  • a gui wich shows up when a player clicks on his generator
eternal oxide
#

?services

undone axleBOT
rocky glacier
#

i need 20 posts 😦

crude charm
#

my brain is much right now. It's 12am and i've been working on this for the last 8 hours

fickle helm
unreal quartz
#

ah. not sure then

stone sinew
crude charm
#

and it didnt work

#

1 sec

#

and then when I make it final

#

it errors more

unreal quartz
#

move it within the runnable

stone sinew
unreal quartz
#

or change it to a field

#

either way you cant have it local

crude charm
unreal quartz
#

needs 4 args

#

delay and period

crude charm
#

ugh

#

im so dumb

stone sinew
# crude charm
Bukkit.getScheduler {
    int timeRemaining = 
    public void run() {

    }
}
crude charm
#

lol

crude charm
#

just dumb

#

Do you want to know what it was

#

oh no

#

lmfao

#

I literally made a constructor

#

lmfao

#

but didnt change it

tidal dust
#

Hello, how would I get the PotionEffectType of a potion itemstack, rather than the PotionType? I have been looking at the docs for a while now and it seems that I can only get PotionType, not PotionEffectType. I need to be able to apply an effect to a player based on a potion itemstack.

opal juniper
#

Soooooo, this is not spigot, but i think there will be some1 around that can help.

I have this class as a demo:

public class HelloWorld {
    public HelloWorld() {
        System.out.println("Hello world from constructor");
    }
}

And i am trying to compile and then run it, even if it is not inside the jar file. so the class above is placed in a random folder and i managed to compile it:

JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
// Compiling the code
compiler.run(null, null, null,
        "A:\\java\\test\\HelloWorld.java");
``` which does spit out a .class. but how do i then instanciate the class?
#
URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File("A:\\java\\test").toURI().toURL() });
Class.forName("A:\\java\\test\\HelloWorld.class", true, classLoader).newInstance();

the second line was just an attempt to get it to work - and it doesn't 😄

quiet ice
#

not having it inside a jar file complicated a few things since I do not think that the URLClassloader can be used

opal juniper
quiet ice
#

I think you could define your own classloader and just load in the bytes manually. At least that would be my approach

#

Then just invoke ClassLoader#defineClass(String, byte[], int, int)

opal juniper
#

ill give it a shot

quaint mantle
#

Hello

#

dm me if you are looking for plugins to make, I need a dungeons plugin. Will not pay (might pay)

opal juniper
#

?services

undone axleBOT
opal juniper
#

i get this:
Incompatible magic value 1885430635 in class file com/jeff/java/HelloWorld

#

(ignore the sysouts)

quiet ice
#

Are you sure that this is the class file?

opal juniper
#

it isn't

#

thanks

#

it works now

#

i put .java lmao

#

not .class

quiet ice
#

I saw, which I why I asked

opal juniper
#

😄

#

thanks

vital ridge
#

Basically all the plugin works

#

just the error spits in console

#

When I remove an usertag

#

it successfully gets removed from the gui

#

And then when I reopen the gui, its not there anymore but im getting the error

opal juniper
# quiet ice I saw, which I why I asked

Another potentially dumb question inbound - suppose the class was an event listener, is it possible to register it? It returns a class so my ide has a hissy fit

eternal oxide
#

If its loaded through your own class loader, then no

opal juniper
#

Hmm, is there any way to get around this

#

I guess “get the class loader to load it”

quiet ice
#

I guess reflections would be one way, but I think that is no longer allowed in newer java

eternal oxide
#

Yep, blocked in 1.16

opal juniper
eternal oxide
#

iConomy used to inject teh h2 jar using reflection so spigot could access it but thats not available anymore

opal juniper
#

What do they use instead, the libraries thing in the plugin.yml?

eternal oxide
#

yep

#

I updated it a few weeks back

opal juniper
#

yeah i mean that is like the usecase for it

quiet ice
opal juniper
#

shame you cant speak english to the jvm

#

"listen here, pretty please load this"

eternal oxide
#

I did ask about making the method public in there so we could inject, but it wasn;t needed for my case as we got libraries

quiet ice
#

But spigot does use ASM, so how does it work here?

quaint mantle
#

Im getting a null when getting a variable from another class however when i get the same variable but use a command class instead it doesn't throw a NPE, is there a thing which events find nulls different?

eternal oxide
#

Anything spigot loads its using its own class loader so has full security access.

eternal oxide
quaint mantle
#

I know its a null, but i grab the variable the same in the command class and the event class so not sure why the event is null when its fired after the command

eternal oxide
#

a Null means something is null, there is no other explanation.

#

You can;t be accessing it the same way

quaint mantle
#
    GUIManager guiManager = new GUIManager();

Both times im making a instance

eternal oxide
#

I'd guess yoru class instance is null and not the field

quaint mantle
#

The class instance isn't null but the variable itself is, when its set. Not sure whats going on ill have a look

quiet ice
#

Perhaps you are not using J15+ and actually there is something else being null

eternal oxide
#

if you are using new GUIManager() in separate classes you are creating two instances of it

quiet ice
#

new <clazz>(); is guaranteed to be never null

eternal oxide
#

then you are accessing different fields.

#

so you are initialising a field in one instance but not the other.

quaint mantle
#

Right i see

tidal dust
opal juniper
#

This little “protected” is gonna cause a lot of issues ….

#

Making it impossible level of issues

vital ridge
#

I added this to my code:

#
while (rs.next()) {

                        final String userTag = rs.getString("USERTAG");

                        final String permission = rs.getString("PERMISSION").toLowerCase();

                        if (p.hasPermission("cubicxpchat." + permission)) {

                            final ItemStack item = new ItemStack(Config.getTagItem());
                            final ItemMeta im = item.getItemMeta();
                            im.setDisplayName(Config.getTagDisplayName(userTag));

                            item.setItemMeta(im);

                            allItems.add(item);

                        }

                    }

it fixed the error but now my usertags aint showing up at all

eternal oxide
tidal dust
eternal oxide
#

Nope, I also tried that and replacing the default loader

quiet ice
#

nvm, that class is final

opal juniper
#

So @eternal oxide I don’t mean to bother you but you are pretty certain there is no way to load the class?

coarse stream
#

hello

#

im using towny

#

i cant figure out how the raiding works

eternal oxide
#

There is one, but you have to enable it with a command line switch when you start spigot. However that option is also going away very soon

quiet ice
#

what is the rationale behind that?

sharp bough
#

whats the point on making a variable final if you simply dont assing it to something new?

quaint mantle
#

Quick question, when I register a listener in a new class and that class is no longer used/done with, should I just unregister the class with
HandlerList.unregisterAll(className);
Because I'm afraid it could rack up memory, this is for when a player is opening a gui, it creates a new instance of a class named "MenuView" and that registers listeners inside of it and then it could end up registering thousands of them classes, even when the listeners inside the class aren't used anymore.

sharp bough
coarse stream
#

i didnt find a right discord for it

quiet ice
eternal oxide
coarse stream
#

nothing was helpful

sharp bough
#

let me see if i can find something

#

send me the link of your plugin

coarse stream
#

okay!

quiet ice
#

For non-local variables (fields) however the final access modifier does matter as JIT will optimise things

coarse stream
#

here ya go!

sharp bough
opal juniper
quiet ice
opal juniper
#

On the bottom

eternal oxide
quiet ice
#

I recommend grepping for "discord" or something

quaint mantle
#

Ok thank you @eternal oxide ❤️

coarse stream
#

wait

#

where

sharp bough
#

bro you fr?

quiet ice
#

I sent you a link already

coarse stream
#

kk

#

thanks

quaint mantle
#

So like I said, would it rack up quite a bit of memory quite fast or what would happen if not unregistered? @eternal oxide

eternal oxide
bitter dove
#

I noticed when a generic command need a playername as argument, it doesn't care about casesensitivity. what is the best way to implement it to my plugin? Bukkit.getServer().getPlayer("string") seems casesensitive...?

eternal oxide
#

You only need one class to handle all the UI and players

quaint mantle
#

Right

quiet ice
#

Bukkit.getTargets or whatever it is called might do it, idk

#

never bothered with such details

bitter dove
#

@quiet ice when I made a new server I added player to whitelist, and didn't need to think about the upper- or lowercase of playernames, even though they never had been online here. it was corrected the case at the server siden upon adding them

#

like it checked the database to Microsoft/Mojang

quiet ice
#

Bukkit.getTargets is the only thing that I could think of might do it - but I highly doubt it

#

Case matters in minecraft, so idk why this happened.

#

Actually perhaps we two should read the docs more throughout

static Player
getPlayerExact​(String name)
Gets the player with the exact given name, case insensitive.
ivory sleet
#

@opal juniper for future references avoid sending links in the discord, dm them instead

quaint mantle
#

Im comparing getInventory to current inventory open, however its not running the code, when i print out the inventories their the same ID, should be noted that 2 different prints are coming to the same result, so why isnt the if statement working?

#
        System.out.println(guiManager.rankInventory);
        System.out.println(event.getInventory());

        if (guiManager.rankInventory != null) {
            if (event.getInventory() == guiManager.rankInventory) {
#

I wouldn't compare objects using ==, so use .equals

opal juniper
#

well, it is fairly difficult to actually compare inventories

#

that is the issue

#

not that they are using ==

#

You should be using an inventory holder

eternal night
#

or a WeakHashMap<Inventory, YourDataType>

quiet ice
#

If the identity hashcode is the same but they fail the identity comparison, there is something wrong

#

I guess you code afterwards is just wrong

rigid otter
#

What difference between scheduleSyncRepeatingTask and runTaskTimer?

sharp bough
#

or Inventory Framework

quiet ice
#

before suggesting random libraries, I suggest to look at the code

opal juniper
#

but nothing gets deprecated 🙃

#

well, removed

rigid otter
#

What?

opal juniper
#

they are the same essentially

quiet ice
#

just use whatever you like

eternal oxide
#

See not confusing at all...
scheduleSyncRepeatingTask
scheduleAsyncRepeatingTask

unreal quartz
#

and return type

#

runTask returns BukkitTask rather than just the id

rigid otter
#

Yes but are they the same and just difference func name?

unreal quartz
#

essentially

eternal oxide
#

yes

rigid otter
#

Ahh

quiet ice
#

well, not the same same, but for the regular dev yes

#

The distinction only becomes vital if you want to do more cursed things

rigid otter
#

One another question, a class(interface) like Server, Player, BukkitScheduler and so many more if they are just interface how can I see its code?

unreal quartz
#

interfaces don't have implementations

#

that' sthe point of them

#

you can see the classes which implement them on the spigot stash

rigid otter
#

I sometimes want to know how do they work, how they are defined, but I can't

eternal oxide
#

If you ran BuildTools you can look in teh sources there

rigid otter
unreal quartz
#

craftbukkit implements bukkit

#

e.g there is a CraftPlayer implementing Player

quiet ice
#

Usually it is Craft + Bukkit's interface name

rigid otter
#

Ahh I see it!

#

Thank you!

#

But why don't they do in purely Player instead of CraftPlayer?

unreal quartz
#

abstraction

eternal oxide
#

Because Bukkit is the API and nothign else

unreal quartz
#

the api is meant to be abstract, such that it is there independent of whatever implements it

eternal oxide
#

CraftBukkit is the implementation

quiet ice
#

Which is why things such as Glowstone can exist

rigid otter
#

But then the server run CraftBukkit instead of Bukkit?

unreal quartz
#

ye

#

/version will say something like Spigot or CraftBukkit implemting Bukkit API

rigid otter
#

Does it exist in spigot.jar?

unreal quartz
#

the output of buildtools is everything

quiet ice
#

Spigot is a fork of cb

unreal quartz
#

spigot is a series of patches on top of craftbukkit

eternal oxide
#

spigot is both API and implementation

quiet ice
#

there is spigot-api

rigid otter
#

Ohh yeah, I see it

#

But we can get maven repo only spigot-api, can't get its implementation(?)😕

eternal oxide
#

no

rigid otter
#

I need to use external lib to(use spigot.jar) to get its library

unreal quartz
#

you shouldnt need the nms classes letalone craftbukkit

eternal oxide
#

if you run BuildTools you install spigot into yoru local repository so then you can use spigot over spigot-api, if you need

rigid otter
#

Ohh

#

Yeah, I might try it

#

So, thank you!

quiet ice
#

The issue is that Cb is based on mojang minecraft, which cannot be distributed freely

#

bukkit had some degree of immunity from this which is why the downloads from the pre-1.8 era were distributed in a raw manner

rigid otter
#

Btw, is spigot legal or illegal?

quiet ice
#

Grey area

unreal quartz
#

spigot is in complicated limbo which nobody knows the legality of until some court case happens which will never happen

quaint mantle
#

mojang hasn't said anything

rigid otter
#

Yeah

quiet ice
#

Mojang isn't too much of an issue as they tolerate them

#

And given that they bought bukkit (the project, not the codebase), it is likely that they are supportive of spigot

rigid otter
#

Yeah, I think so too

quaint mantle
#

At the end of the day spigot brings so many talented minds to minecraft and recently took on a member of the forge community to develop, and they partener with servers who use spigot api..

rigid otter
#

I wonder if spigot team has extremely knowledge on this, why don't they develop a brand new server software instead of panic using Bukkit? Also can't much modify it.

unreal quartz
#

spigot maintain bukkit

lusty cipher
#

There's other server software being developed. However the Spigot team continues to maintain Spigot/Bukkit as many developers are used to it and there exists such a large amount of plugings and a big community for Spigot.

rigid otter
#

But I think if they don't have well enough permission to modify Bukkit, they shouldn't stay even it is a large community, but seem the potential of being greater and greater is less, they can't update the old.

unreal quartz
#

they maintain bukkit

rigid otter
#

idk, if so

quaint mantle
quiet ice
#

Bukkit is GPL, modifing it is not an issue

#

Forking now would result in giving paper the upper hand. not a valid move

opal juniper
#

stupid spigot classloading shenanignans smh day ruined

quiet ice
#

Spigot classloading is strange if you have no idea what it does, agreed

eternal oxide
#

Silly question, but why do you want to load a separate class in manually?

opal juniper
#

better skript

somber hull
#

If i have a list being created like this

    public void loadEvents() {
        angryBeeEvent = new AngryBeeEvent();
        events.add(angryBeeEvent);
        summonCreeperEvent = new SummonCreeperEvent();
        events.add(summonCreeperEvent);
        loopTntEvent = new LoopTntEvent(this);
        events.add(loopTntEvent);
        giveDiamondGearEvent = new GiveDiamondItemsEvent();
        events.add(giveDiamondGearEvent);
        giveDiamondEvent = new GiveDiamondEvent();
        events.add(giveDiamondEvent);
        loopSheepEvent = new LoopSheepEvent(this);
        events.add(loopSheepEvent);
        lightningSpawnEvent = new LightningSpawnEvent();
        events.add(lightningSpawnEvent);
        giveAppleEvent = new GiveAppleEvent();
        events.add(giveAppleEvent);
        
        
    }

I want to do event.getEnabled(); wich just returns true or false, and then if its true put it in the list, if false. dont.
Whats the best way of doing that, would i have to create a new List?
Loop through everything in List1 check if its enabled, if true add it to List2?

opal juniper
#

and i was just curious

#

jheez

#

that came from nowhere

somber hull
#

yes

#

I was asking last night and everyone ignored me lol

blissful folio
#

How can I add fake ServerPlayers in 1.17?

sand rune
#

Guys should i learn java before spigot api ?

opal juniper
#

Yuhuh

somber hull
#

I mean

opal juniper
#

here is some info

somber hull
#

i didnt

opal juniper
#

?learnjava

somber hull
#

but YES

undone axleBOT
somber hull
whole stag
#

If you don't learn java first you will probably find yourself in a developing/debugging cargo cult

opal juniper
sand rune
#

im learning java now from codeacdemy i completed 20%

opal juniper
#

nice!

somber hull
#

jeff

opal juniper
#

yeah

whole stag
#

Very good start, codecademy is nice

somber hull
#

should i make a second list?

opal juniper
#

lemme read it

whole stag
#

Make sure you at least get a solid few lessons in on classes, once you understand those you should mostly be good to go

opal juniper
#

i dont really know what you are trying to do. once you make all these events you add them to a list which i assume is a Set. what is the purpose of the lists?

somber hull
#

i just do event.start(Player)

#

thats all working, i just wan to be able to enable or disable them without manually adding an if statement per event

opal juniper
#

im so confused

#

so

#

what is event

opal juniper
somber hull
#

Its a interface i made

opal juniper
#

ok

somber hull
#

called ChaosEvent

#

Inside them is getEnabled() wich returns true or false

opal juniper
#

so what, you are getting a random choice from the list and then call that one on the player?

somber hull
#

Yea, and that works fine

#

But i need to be able to enable or disable certain ones

#

Should i Loop through everything in List1 check if its enabled, if true add it to List2?

opal juniper
#

so just remove them from the list to disable, and add then back to enable

#

no need to have two lists?

somber hull
#

But then i would have to add an if statement for every event

#

right?

opal juniper
#

umm

#

why

somber hull
#

to check if its enabled

quaint mantle
#

Is there a method to set a inventory display name as i couldn't see it in the docs

opal juniper
#

oh

#

well i guess if u really want u could have a set of enabled and a set of disabled

#

that would work

#

idk i feel like there is a better way

somber hull
#

Here

#

let me type it out

#

and not suedocode

real spear
#

I am trying to create a system where I can add prefixes to my players based on permissions they have. Why won't this work???
@EventHandler public static void onPlayerJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); if (player.hasPermission("owener.minecraft")) { player.setDisplayName(ChatColor.RED + "[OWNER] " + player.getName()); player.setPlayerListName(ChatColor.RED + "[OWNER] " + player.getName()); player.setCustomName(ChatColor.RED + "[OWNER] " + player.getName()); } else if (player.hasPermission("admin.minecraft")) { player.setDisplayName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); player.setPlayerListName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); player.setCustomName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); } }

somber hull
#
    public void refreshEvents(){
        List<ChaosEvent> newList = new ArrayList<>();
        for(ChaosEvent event : events){
            if(getConfig().getBoolean("chaos.events." + event.getName() + ".enabled")){
                newList.add(event);
            }
        }
        events = newList;
    }

@opal juniper

opal juniper
#

Should work

#

Make sure you add to disabled

real spear
burnt current
#

Hey! Quick question: I'm trying to work with JDBC in my plugin and am in the process of creating methods for it. I got the recommendation to use datasources. Unfortunately, I don't quite understand how to create and use them. Can anyone help me with this?

somber hull
#

gith

#

right

#

thank you

#

wait

#

no because the newList doesnt contain any of the disabled ones

real spear
#

Is there a way to change chat capsule? I.e. reg minecraft: <[username]> [msg] what I want: [username]: [msg]

hasty prawn
#

AsyncPlayerChatEvent#setFormat

real spear
#

ty

fleet falcon
#

method above works
method below doesn't works.

unreal quartz
#

sah dude

fleet falcon
#

sorry what

hasty prawn
#

What are you trying to do

fleet falcon
#

when i drop an item

#

only sends "sa"

#

never sends "1"

hasty prawn
#

ItemSpawnEvent doesn't fire when items are dropped I don't think

fleet falcon
#

when i break a chest

hasty prawn
#

Only when you use something like World#dropItem maybe?

fleet falcon
#

doesn't triggers again

hasty prawn
#

Honestly I'm not really sure what it considers "Spawning an Item"

fleet falcon
#

actually items doesn't drops

#

its spawns

crude hound
#

hey, I have a little question : why my plugin work without importing anything (BossBarStorageData for this time)

hardy swan
#

is BossBarStorageData of the same package

#

if so, that's why

crude hound
#

actually not

hardy swan
#

inner class

#

?

crude hound
#

no a simple class

#

I have no idea what is he doing

hasty prawn
#

Can you send your project hierarchy?

wide coyote
#

when you break a chest, drops the items in it

fleet falcon
#

that not works too

fleet falcon
crude hound
#

I moved him for a little test

fleet falcon
#

exactly

hasty prawn
#

@fleet falcon what are you trying to do?

fleet falcon
#

i wanna use ItemSpawnEvent

#

but does not triggering

hasty prawn
#

Yes but why do you want to use it

crude hound
#

wait, I have a compile error

hasty prawn
#

Might be another way to do it

crude hound
#

that's confusing

hardy swan
fleet falcon
#

i making a auto-collector in a nutshell

#

for example cactus farms

regal lake
crude hound
#

uhh, he inverted an icon, I think it's better for me to re-install eclipse

regal lake
#
 /home/false/git/Builder-s-Wand/Spigot_Plugin/src/main/java/de/False/BuildersWand/utilities/ParticleUtil.java:[5,37] package de.False.BuildersWand.version does not exist
#

(just a few times, always package does not exists)

granite stirrup
#

it means the package doesnt exist?

regal lake
#

Yea but as i described in the spigot thread, the package is part of the Builders_Wand_abstraction module which is added as dependency

<dependency>
            <groupId>de.False</groupId>
            <artifactId>Builders_Wand_abstraction</artifactId>
            <version>3.0.0-SNAPSHOT</version>
            <scope>compile</scope>
</dependency>
granite stirrup
#

but why are you doing package ?? why not import it

regal lake
#

I need modules, because if i don't use module (which is currently the case) the plugin ALWAYS needs Java 16.

granite stirrup
#

you can import modules?

regal lake
#

Hm ?

sharp bough
#

is there a way to make X and Y just go to the next possible possition when using paginated pages in IF ?

granite stirrup
#

import de.False.BuildersWand.version.*;?

regal lake
#

Yea i do that 😄

hasty prawn
# fleet falcon

Interesting, I tried this myself and it seems to be working fine.

granite stirrup
sharp bough
fleet falcon
hasty prawn
#

On 1.16.4 right now.

north ridge
hasty prawn
#

Try not canceling PlayerDropItemEvent? 🤔 Item isn't gonna spawn if you cancel that

ivory sleet
#

Yugi!

granite stirrup
hasty prawn
#

It does

regal lake
opal juniper
#

Do what u we’re doing

granite stirrup
#

yeah i have no idea whats wrong

north ridge
#

You dont seem to be using the maven shade plugin

regal lake
#

Let me try that.

granite stirrup
north ridge
#

Yes

granite stirrup
#

im pretty sure i did a multi module thing before and im pretty sure i didnt use it

#

and it worked fine

north ridge
#

Afaik you do need the shade plugin to copy the compiled files from the different modules into the same jar

#

Maybe you didn't notice?

granite stirrup
#

¯_(ツ)_/¯

#

pretty sure the <scope>compile<scope> doesnt use the shade plugin

north ridge
#

I havent used maven in about an year now so not particularly sure, gradle does require you to use shadow tho, so most likely you do need shade.

north ridge
regal lake
granite stirrup
#

let me check

#

lol i do have it i guess i just didnt notice it

north ridge
#

ah

regal lake
#

Could you share how you implemented it ?
It don't work for me with the shade plugin 😅

granite stirrup
#

?paste

undone axleBOT
granite stirrup
#

thats what i have

#

lol

#

for the shade plugin

regal lake
#

Within the main pom or in the module pom ?

granite stirrup
#

i think i did it in the module

north ridge
granite stirrup
#
            <groupId>somegroup.id</groupId>
            <artifactId>ArtifactID</artifactId>
            <version>1.0</version>
            <scope>compile</scope>
        </dependency>``` i just added my other modules like this xd
regal lake
#

Don't work for me in the Spigot_Pluigin module, same errors.

north ridge
#

Could you send the error you are getting?

regal lake
north ridge
#

Thats a compilation error

regal lake
#

Yea i know.. but he should find the package :/

north ridge
#

You have unresolved classes in your dependencies

#

Go through each of the mentioned classes

regal lake
#

No, the ide also can resolve them 😄

north ridge
#

Your IDE should let you know what's missing

chrome beacon
#

Run mvn install

regal lake
#

I did Olivo 😄

chrome beacon
#

oh

#

Anyway I recommend you use a module setup with maven

regal lake
north ridge
#

What ide are you using?

regal lake
#

IntelliJ

north ridge
#

Ok, open the "maven" tab on the right toolbar and hit the refresh button

regal lake
#

I did almost a thousand times 😄

north ridge
#

Your issue looks like a missing import

regal lake
#

Yea i know how it looks, but i don't understand why 😅

#

As you can see on Github the import is there.

#

There are only errors for the Class NMS, the other Classes (for each Version) can be used it seems..
But i imported it on the same way..

north ridge
#

Remove the 1.16 nms import in your abstractions module

#

That will override other version dependencies you specify in modules that depend on that

#

oh wait nvm

regal lake
#

😄

north ridge
#

change it to spigot-api

#

the artifact

regal lake
#

done and now ?

north ridge
#

Try building again

regal lake
#

Okay, let me refresh maven (will took some minutes :D)

north ridge
#

Alright

quaint mantle
#

PDCs is settable for spawners?

#

i can't or to set, or to get value

#

or that's so big

#

idk

north ridge
#

You dont get data containers for blocks afaik. Only entities, and items(maybe)

regal lake
#

Okay, still the same errors 😅

north ridge
#

Oh it is? Then you should be able to I assume

quaint mantle
#

i saving items(contents of inventory) in PDC with YamlConfiguration serializer

regal lake
#

Do you have any other ideas ?

north ridge
#

Try running clean and then install

regal lake
#

I did, but i always run mvn clean install

untold gazelle
#

How do I create particles that are displayed to the player for a certain amount of time? I'm using 1.8.8 so I don't have access to spawnParticle()

regal lake
untold gazelle
#

Right I probably should've specified

#

I want it to display for a certain amount of time

#

Like instead of showing the particles for a second and then disappearing I should be able to make a line of crit particles for example

regal lake
#

Im sure it is not possible, so you have to use timers/schedulers and respawn them for the time.

unreal quartz
#

your parent pom should have its plugins defined in <pluginManagement> for submodules to inherit it

regal lake
#

Yugi already told it to me, but it still not working.
Let me push the newest version.

#

Check now, the shade plugin is now on github too..
I almost have the same structure and modules as https://github.com/WesJD/AnvilGUI (execpt of the javadoc stuff, which i don't need).

unreal quartz
#

your project also doesnt have the default location for source files

regal lake
#

What do you mean ?

unreal quartz
#

the abstraction module doesn't have its code within src/main/java, and you havnet configured maven to accoutn for this

quiet hearth
#

Im creating a plugin that give the users item a random enchant. However it wont add the Enchant to the users item. Everything else works. https://hastebin.com/lokerazoru.csharp
If someone could help me, i'd appreciate it

unreal quartz
#

apply the item meta again

#

get itemmeta returns a copy

quiet hearth
#

ok ill try that

regal lake
lusty cipher
#

Does any library included with the spigot jar include something like a Either or Pair implementation?

unreal quartz
#

i suppose the same issue is true for th rest of your modules

regal lake
#

i guess, yes

lusty cipher
#

is that included?

unreal quartz
#

yes

regal lake
#

Thank you, in german i would say "Manchmal sieht man den Wald vor lauter Bäumen nicht" -> "Sometimes we cant see the forest because of the trees" 😬

wicked swan
#

Is there anyway to make PersistentDataContainers on Projectiles persist through Projectile Firing Events such as an Arrow Shooting out of a Bow?
Every time I shoot an arrow, the PersistentData is cleared.

unreal quartz
#

no problem

lusty cipher
#

i'll trust you, cause spigot-api doesnt include any other libs 👍

unreal quartz
wicked swan
#

I figured, but how do I go about getting the "Ammo" used that triggered the event?

eternal night
wicked swan
#

Would it have to be nested events, like set the Data on a Launch event, then read the Data on the Hit Event?

#

That works! Thanks! 😄

eternal night
#

And yes, you would need an event listening to shoot bow -> check for PDC on the consumed item -> apply to arrow entity -> check its PDC on hit

wicked swan
#

Sounds good

lusty cipher
#

Oh no sorry, that is actually a paperclip issue it seems

umbral pagoda
#

free

regal lake
#

Start with youtube videos

hasty prawn
#

?learnjava

umbral pagoda
undone axleBOT
regal lake
#

The errors of my modules are gone, but now i get

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project Spigot_Plugin: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x5b6b5888) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x5b6b5888 -> [Help 1]

But i don't understand what that means...
I don't use LombokProcessor (what ever that is) and also all my modules are named.

crude hound
#

hello, can you help me to cast an real offline player to a player because when I read the javadoc they say : "Represents a player, connected or not" so how can I cast an offline player to a player (I tryed the OfflinePlayer#getPlayer but I only return a player if he is connected)

quiet ice
#

Though that is provided by the JVM

quaint mantle
#

I'm trying to make a virtual anvil with a item already in it, however the item doesn't seem to spawn, Is there something im missing?


Inventory userNameInventory;

        userNameInventory = Bukkit.createInventory(player, InventoryType.ANVIL);
        userNameInventory.setItem(0, createItem(Material.PAPER, "#c4c4c4", "Input Username", "uInput"));
        player.openInventory(userNameInventory);
blissful folio
#

How can I move armor stands with passengers on them in 1.17?

robust crypt
#
Error occurred while enabling DrDukyGud v1.17 (Is it up to date?)
java.lang.IllegalArgumentException: Plugin already initialized!

what does this mean

blissful folio
eternal oxide
#

or whatever your main class is

quaint mantle
eternal oxide
#

perhaps all three of the above 🙂

robust crypt
#

...

quaint mantle
#

Theres rarely 1 reason for a error

#

Theres many things it can mean xD

burnt current
#

Hey! Does anyone know about JDBC and can help me with it? I would like to use it in my plugin. I had actually already built something like this into my plugin, but then I got the tip to work with datasources and that has now somehow completely confused me. Does anyone know how I can connect MySQL to my plugin for Minecraft version 1.16.5 by using datasources? I would be very grateful

robust crypt
#

this game is trash

robust crypt
#

i only have 1 plugin

quaint mantle
eternal oxide
#

then you are attempting to call new Main()

robust crypt
#

i did not write new main()

crude hound
#

if you do a new Main() use an instance

quaint mantle
#

Show the code 🙂

eternal oxide
blissful folio
#

How can I move armor stands with passengers on them in 1.17? They wont budge with passengers, but they would if they have nothing on them

robust crypt
#
package drdukygud.me.cringe;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.ScoreboardManager;


public class jxlCringe extends JavaPlugin {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective obj = board.registerNewObjective("test","dummy", "§cEwen_Is_Fat_XD§r");
        obj.setDisplaySlot(DisplaySlot.BELOW_NAME);

        Player player = (Player) sender;
        player.setPlayerListName("§cEwen_Is_Fat_XD§r");
        player.setDisplayName("§cEwen_Is_Fat_XD§r");
        player.setCustomName("§cEwen_Is_Fat_XD§r");
    return true;
    }

}
crude hound
#

the full error can help also

quaint mantle
#

§ try to avoid these

#

Use ChatColor instead

robust crypt
# eternal oxide is that the whole plugin?

package drdukygud.me.cringe;

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        getLogger().info("wtf");
        getLogger().info("wtf hein??");
        getCommand("nick").setExecutor(new jxlCringe());
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}

main class

quaint mantle
crude hound
#

uhhh wait

quaint mantle
#

Oh wait

robust crypt
#

?

crude hound
#

why do you use a javaPlugin

eternal oxide
#

You can;t have two classes extend JavaPlugin

quaint mantle
#

OnCommand needs to implement CommandExecutor

crude hound
#

or TabExecutor if you want to use tabs

robust crypt
#

for real idk

quaint mantle
#

^ fair

eternal oxide
#

so @quaint mantle was correct. You have two plugins in teh same jar

burnt current
robust crypt
#

i hate my life >:(

quaint mantle
eternal oxide
fluid cypress
#

i want to use permissions but i dont quite understand how it works, how they work exactly? are they something a minecraft server thing that various plugins handle more easily? are they something from bukkit/spigot? does each permission manager plugin have its own implementation? does each player have an individual permission list, or does each permission group have a list of players? any guide on this?

quaint mantle
#

But If the user is opped they pass that check

eternal oxide
burnt current
quaint mantle
#

@eternal oxide You ever worked with anvils xD

eternal oxide
fluid cypress
#

mmm, but i want to give permissions to individual players, like, sell permissions ie, how do i add the permission to an individual player? where is that stored?

crude hound
#

yes but the player is actually offline

eternal oxide
eternal oxide
unreal quartz
eternal oxide
#

an OfflinePlayer only has an OfflinePlayer object

crude hound
unreal quartz
#

the player may disconnect, but the object will still exist if there is a reference to it

quiet ice
#

because an offline player can be connected as well as not connected

eternal oxide
deft raft
#

hey, does <version>1.17-R0.1-SNAPSHOT</version> mean 1.17.1?

quiet ice
#

The OfflinePlayer object is not dependent on the online state

hasty prawn
#

1.17.1-R0.1-SNAPSHOT is 1.17.1

crude hound
#

I think now I will re-dev my entire functions

#

or I delete this part of my code and I have no problem

deft raft
eternal oxide
burnt current
#

i use MySQL

deft raft
eternal oxide
#

a datasource could be flat file, MySQL, SQLite, progress etc

quaint mantle
hasty prawn
#

The R0.1 changes sometimes. I think all the versions are on the BuildTools page

deft raft
reef wind
#

@quaint mantle Furry cringe

burnt current
quaint mantle
reef wind
eternal oxide
deft raft
#

That's odd

quaint mantle
#

restart intellij

deft raft
quaint mantle
#

yes

#

do that

deft raft
#

ok

deft raft
robust crypt
#

abcd

burnt current
fluid cypress
#

SuperPerms still exists? if so, why doesnt it exist in my intellij? isnt it supposed to be part of bukkit? isnt that the core stuff of all permissions?

lost wraith
#

How are you able to define a spawners type?

quaint mantle
lost wraith
#

Type can't be used on spawners, can be used on spawn eggs tho.

quaint mantle
eternal oxide
lost wraith
#

Is there not another way beside NBT?

burnt current
#

and how do I have to set it up?

eternal oxide
#

That github page you linked looked to be fairly comprehensive

robust crypt
#
public class jxlCringe implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective obj = board.registerNewObjective("test","dummy", "§cEwen_Is_Fat_XD§r");
        obj.setDisplaySlot(DisplaySlot.BELOW_NAME);

does this thing work cause i can't see by myself

#

or do i need to add something else

quaint mantle
#

Aslong as you've defined a command yeah thatll work

robust crypt
#

k

burnt current
eternal oxide
#

What part are you having trouble understanding?

burnt current
#

So
I have the following classes to connect the plugin to the database:


import com.mysql.cj.jdbc.MysqlConnectionPoolDataSource;
import com.mysql.cj.jdbc.MysqlDataSource;
import org.bukkit.Bukkit;

import java.sql.*;

public class MySQL {



    public static String host;
    public static String port;
    public static String database;
    public static String username;
    public static String password ;
    public static Connection con;

    public static void connect() {
        if(!isConnected()) {
            try {
                con = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
                Bukkit.getConsoleSender().sendMessage("§aDatabase connected!");
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

    public static void disconnect() {
        if(isConnected()){
            try {
                con.close();
                Bukkit.getConsoleSender().sendMessage("§cDatabase disconnected!");
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

    public static boolean isConnected() {
        return (con == null ? false : true);
    }
    public static Connection getConnection() {
        return con;
    }

    public static void update(String qry) {
        if(isConnected()) {
            try {
                con.createStatement().executeUpdate(qry);
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

    public static ResultSet getResult(String qry) {
        if(isConnected()) {
            try {
                return con.createStatement().executeQuery(qry);
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}
#

and

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import java.io.File;
import java.io.IOException;

public class MySQLFile {
    public void setStandard() {
        FileConfiguration cfg = getFileConfiguration();

        cfg.options().copyDefaults(true);

        cfg.addDefault("host", "localhost");
        cfg.addDefault("port", "3306");
        cfg.addDefault("database", "straussfalkeplugins");
        cfg.addDefault("username", "root");
        cfg.addDefault("password", "");

        try {
            cfg.save(getFile());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private File getFile() {
        return new File("D:/Programmierung/Plugins/SfAdminTools", "mysql.yml");
    }

    private FileConfiguration getFileConfiguration() {
        return YamlConfiguration.loadConfiguration(getFile());
    }

    public void readData(){
        FileConfiguration cfg = getFileConfiguration();

        MySQL.host = cfg.getString("host");
        MySQL.port = cfg.getString("port");
        MySQL.database = cfg.getString("database");
        MySQL.username = cfg.getString("username");
        MySQL.password = cfg.getString("password");
    }
}
#

and I don't understand how to include MysqlDataSource dataSource = new MysqlConnectionPoolDataSource (); in full correctly

eternal oxide
burnt current
#

ok

regal lake
eternal oxide
#

Lombok is used in Bungee and I believe spigot

unreal quartz
#

i assume one of your dependencies has lombok

burnt current
regal lake
eternal oxide
regal lake
eternal oxide
#

look before the error, what was maven doign last?

unreal quartz
#

try compiling with a different java version for now

#

i assume that is brought on because of the changes in java16

burnt current
#

Ok. Then thank you for your help

regal lake
eternal oxide
#

?paste

undone axleBOT
regal lake
eternal oxide
#

and bintray

regal lake
#

I have multiple repositories for some dependencies

burnt current
#

@eternal oxide Sorry, I have another quick question: In the class there are the following imports:

import io.airlift.discovery.client.ServiceSelector;```

Do you know where I can get these classes?
eternal oxide
#

ignore those, you don;t need them

#

its just the MySQL stuff you want

burnt current
#

Oh wait I only need the method that is in example 5?

eternal oxide
regal lake
#

Oh.. let me try if that is the issue.

timid kestrel
#

Yo, quick question about the aids that is BuildTools and the Minecraft eula, do we know how to import the Spigot-Server dependencies with Gradle? As I'm running into this error: https://bpa.st/N6MQ

burnt current
# eternal oxide its just the MySQL stuff you want

I now have created the following class

import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;

import javax.sql.PooledConnection;
import java.sql.SQLException;


public class MySQLDataSource {

    protected PooledConnection createConnectionInternal() throws SQLException {
        SQLException lastException=null;
        if (dataSource != null) {
            try {
                return dataSource.getPooledConnection();
            }
            catch (    SQLException e) {
                lastException=e;
            }
        }
        dataSource=null;
        for (  ServiceDescriptor serviceDescriptor : serviceSelector.selectAllServices()) {
            if (serviceDescriptor.getId().equals(currentServer)) {
                continue;
            }
            String jdbcUrl=serviceDescriptor.getProperties().get("jdbc");
            if (jdbcUrl == null) {
                continue;
            }
            try {
                MysqlConnectionPoolDataSource dataSource=new MysqlConnectionPoolDataSource();
                dataSource.setUrl(jdbcUrl);
                dataSource.setConnectTimeout(getMaxConnectionWaitMillis());
                dataSource.setInitialTimeout(getMaxConnectionWaitMillis());
                dataSource.setDefaultFetchSize(defaultFetchSize);
                PooledConnection connection=dataSource.getPooledConnection();
                this.dataSource=dataSource;
                this.currentServer=serviceDescriptor.getId();
                return connection;
            }
            catch (    SQLException e) {
                lastException=e;
            }
        }
        currentServer=null;
        if (lastException != null) {
            throw lastException;
        }
        throw new SQLException(String.format("No mysql servers of type '%s' available in pool '%s'",serviceSelector.getType(),serviceSelector.getPool()));
    }

}

and some things are marked as errors there.

regal lake
eternal oxide
#
[WARNING] 'dependencies.dependency.systemPath' for com.residence:residence:jar should not point at files within the project directory, ${project.basedir}/external/Residence.jar will be unresolvable by dependent projects @ line 182, column 25```
regal lake
#

Yes im already searching if there is an replacement for ${project.basedir} just for the module dir 😄

fluid cypress
#

is there an event for when someone finishes writing a sign? to then perform an action such as creating a store for example

#

or when someone presses a button, that would be better i think

fluid cypress
#

what about the button

regal lake
eternal oxide
#

the last is the long list at the end where it can;t find those dependencies

tardy delta
#

why does pressing tab in chat while entering a command sometimes gives a player list and sometimes it doesnt?

regal lake
dense python
#

I dont know if this is meant for this channel but i dont know how to fix my server it keeps on crashing it says 'Exception in server tick loop'

eternal oxide
#

try running the build with a -e switch

dense python
#

I dont know if this is meant for this channel but i dont know how to fix my server it keeps on crashing it says 'Exception in server tick loop'

regal lake
dense python
regal lake
#

That is no reason to spam it...
I guess your Server don't have enough ram (i quickly search the error on google)

dense python
#

how would i fix it

regal lake
#

Search what RAM means, then increase the RAM 😅
You can't throw questions, without do some research...

smoky oak
#
ItemStack cost = new ItemStack(Material.AMETHYST_SHARD);
cost.setAmount(1);
Inventory i = player.getInventory();
boolean containing = i.contains(cost);

This returns containing=false if I have not a stack of EXACTLY 1 Amethyst Shard in my inventory.
How can i make it return true even if i have for example 24 shards?

dense python
#

i have

regal lake
#

I don't think so...

eternal oxide
#

looks like some plugin is using an out of date lombok

dense python
#

i have researched it i have watched some videos and i try what they say

regal lake
#

Okay, then you know what RAM is, right ?

dense python
#

yes

smoky oak
#

I'll try thanks

regal lake
silver robin
#

lets say, for the sake of simplicity, i have an item which, when the player holds, displays his location (x y and z coords) in his action bar. I obviously have to listen to PlayerItemHeldEvents but what is the best way to implement that?

I am thinking of having a List or Array of Players and loop though it every (let's go with 50) ticks and send action bar updates, but is there a better approach?

dense python
#

i know what ram is i just dont know how to find how much ram it uses and how to change it

#

i really thought this would help me but obviously not

regal lake
dense python
#

but i dont know where to look in the files of my server

eternal oxide
#

@regal lake what version of maven are you using?

regal lake
#

3.8.1

regal lake
dense python
#

im not the best at coding ok and i want to make a minecraft server for me and my friends

eternal oxide
regal lake
#

That is don't even coding..
If you don't know how to adjust that simple thing you maybe should buy/rent a minecraft server instead of hosting it yourself.

dense python
#

i want to make the server myself

regal lake
#

Then you have to learn the basic stuff yourself..

#

@eternal oxide seems working, thank you very much 👍 .
Now i can check if the compiled jar is working:-)

burnt current
sand rune
#

I setuped up a bungee cord and it tells me

Can't connect to the server

tight jolt
#

can someone help me with player.openworkbench?

#

._.

lusty cipher
#

Does Plugin#getResource get the resource from the data folder or the JAR?

eternal oxide
#

jar

lusty cipher
#

So should I do Plugin#saveResource if it is found?

eternal oxide
quiet hearth
#

I am trying to make an item that when it is in the inventory and the player is moving then it will automatically consume food. To start i am just using steak (Cooked_Beef). https://hastebin.com/uvuzawosaw.java
I am trying to loop through the players inventory to see where the food is located but can't seem to get it to work.

novel lodge
#

Is there a way I can set a block's damage?

burnt current
fluid cypress
#

if i modify the public property of an object which is stored inside a map, the object inside the map will also changes without having to put it back, right?

#

new MyObject() returns a pointer, like in the majority of languages, right? so its a reference

robust crypt
#

dont judge the skin pls

#

?

left tangle
#

Hi, can somebody help, i dont know what to write there.

slow oyster
#

Does anyone use an 'error tracker' or similar in there plugins at all? Something like Sentry.io? I'm wondering how useful/possible it would be

robust crypt
#

ignored.........

silver robin
#

lets say, for the sake of simplicity, i have an item which, when the player holds, displays his location (x y and z coords) in his action bar. I obviously have to listen to PlayerItemHeldEvents but what is the best way to implement that?

I am thinking of having a List or Array of Players and loop though it every (let's go with 50) ticks and send action bar updates, but is there a better approach?

versed ferry
slow oyster
versed ferry
blissful saffron
#

how do I set a blocks breaking power

wary harness
#

any idea how would I check if pumpkin is naturaly grown ?

#

or placed by player

ivory sleet
#

Not a reference

#

You will get a variable if you store it in one and a field if it happens to be an instance variable

shy wolf
#

hi guys i need help!
how i add custom item to mincraft but
not overtake micnraft item
exep:

candid galleon
#

use a resource pack

shy wolf
#

but what with the module

#

like in the code or something

#

item#setcustommudle?

young knoll
#

You can't not have it show as a vanilla item

#

If you don't want to see that, F3 + H

quiet ice
#

hide the imperfections

shy wolf
#

how?

quiet ice
#

just do not look at it

shy wolf
#

ok

fluid cypress
#

how can i know the facing of a sign block or a button?

fluid cypress
#

so i check the material of the block, and if its a directional block, i just cast to Directional instead of block, and then getFacing

#

?

#

or better cast to Ladder or Button i guess

quiet ice
#

MaterialData is scheduled for removal

wary harness
#

maybe soem one has some easy idea to check if pumpkin is connected to steam ?

rocky rampart
#

Yep, I forgot about that, sorry. BlockData API is the replacement.

fluid cypress
#

so ((Attachable)block.getBlockData()).isAttached()?

quiet ice
#

So it would be something like

if (block.getBlockData() instanceof Directional directional) {
    directional.setFacing(BlockFacing.SOUTH);
    block.setBlockData(directional);
}

I think

fluid cypress
#

and then, if it is, cast to directional?

#

mm ok thanks

#

is that instanceof check necessary if im listening to SignChangeEvent?

#

i guess not

ivory sleet
#

I smell ClassCastException

#

Only WallSign extend Directional

fluid cypress
#

mm, well yea, i forgot about normal signs, but i just want to listen to wallsign

#

so, i have to check that in the event

#

mmm why does Location have a getBlock method but no setBlock?

eternal oxide
#

Block#setType

fluid cypress
#

a Block object has a location inside?

#

i thought it was independent of its position

chrome beacon
#

Well a block is a block in the world so yeah it has a location

fluid cypress
#

makes sense

ivory sleet
#

Olivo hitting the logics

fluid cypress
#

then, if im replacing a sign with a button, maybe i dont even have to know the location and direction?

#

just check if its a wall sign?

indigo iron
#

?paste

undone axleBOT
indigo iron
eternal oxide
#

SummerCrate.java:30

dusty sphinx
#

How do I use the modules system? Is it documented?

#

(BungeeCord)

eternal oxide
lunar wedge
#

I'm so confused. Working with vault, making an economy plugin. The issue is, other plugins will not interact with it. If I take the SAME economy code, and put it into a different project, the other plugins have no issues. But in my main project, they just won't interact. It will interact with its self with economy commands, and is hooking into vault it seems.....

So I'm at a loss. Any thoughts?

eternal oxide
#

but you do need to check that crate is not null before you attempt to use it

indigo iron
eternal oxide
#

yes you can return if crate is null

hexed hatch
#

Does anyone know of a way to add bukkit recipes to the vanilla recipe book?

#

I’ve seen it done before

indigo iron
eternal oxide
#

?paste your class

undone axleBOT
eternal oxide
#

you are not exiting if crate is null

#

and remove (Block) (Player) and (Action)

#

You also need to move this test up so it happens before you try to access item if(item == null) return;

eternal oxide
eternal oxide
indigo iron
dreamy anvil
#

why in gods name does this change the value of cornerLocation

#
                testLocation.setX((cornerLocation.getX()));
                testLocation.setZ((cornerLocation.getZ()));
                testLocation.setX(testLocation.getX() - 1);
                testLocation.setZ(testLocation.getZ());
                logColored("After processing: My location is "+cornerLocation+" and im testing at"+testLocation);```
#

i CANNOT get cornerLocation to stay the same

#
[15:24:06 INFO]: [FactionsX] Before proccessing: My location is Location{world=CraftWorld{name=world},x=3584.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0} and im testing atLocation{world=CraftWorld{name=world},x=3584.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0}
[15:24:06 INFO]: [FactionsX] After processing: My location is Location{world=CraftWorld{name=world},x=3583.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0} and im testing atLocation{world=CraftWorld{name=world},x=3583.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0```
eternal oxide
granite stirrup
#

im learning lwjgl

#

what i have rn

eternal oxide
granite stirrup
#

a game in 18 lines of code ```package me.gstudiosx.game;

import me.gstudiosx.secret.BasicGame;

public class TestGame extends BasicGame
{
public void update() {

}

public void render() {

}

public static void main(String[] args) {
    new TestGame().setTitle("Test Game!");
}

}```

#

it does nothing rn

#

xd

#

btw me.gstudiosx.secret.BasicGame is in another module so technically its 1 file 18 lines of code

ivory sleet
#

With ur logic minecraft with one line of code would be possible

granite stirrup
#

lol

granite stirrup
#

anyway i fucked up some how with modules and i cant compile it to a jar rn

#

so im running it with intellij

#

xd

#

it keeps trying to search my module in the fucking repo full of all stuff like lwjgl and more