#help-development

1 messages · Page 655 of 1

pseudo hazel
#

okay

#

then use gson

remote swallow
#

how is yaml ugly 💀

pseudo hazel
#

also hashsets in json are just lists

hybrid turret
hybrid turret
remote swallow
#

yeah

#

i prefer to look at yaml than json

hybrid turret
#

It‘s a literal bullet point list

remote swallow
#

doesnt look like it to me

hybrid turret
#

It‘s the same reason I don‘t really like python for example

#

Json is beautifully wrapped in objects

pseudo hazel
#

gson is just json but from google

#

its supposedly a good library for making json files

#

since thats what you want

hybrid turret
#

Ah ic

river oracle
#

It's terrible if you need to do nesting at all It's prone to errors when nesting and it's unreadable

remote swallow
shadow night
#

Gambling-> Yamling

quaint mantle
#

Fuck xml and json

shadow night
#

Xml is shit

#

Json is okay

#

Yaml is weird

#

And what the fuck is toml

pseudo hazel
#

yml is good for when you want users to write stuff in it

#

writing json or xml manually is a pain

river oracle
#

same with json and yaml

pseudo hazel
#

but hey, if the computer generates it it doesnt matter

#

like you aint writing these items by hand I hope

#

I mean I use redhat xml at work too sometimes but its just annoying still

river oracle
# pseudo hazel yeah you can do this is yaml in like 5 lines xD

its way more uggly in yaml imho look

container:
 source: sh.miles.inventory.ContainerResponder
 title: "[Example Title](color=#fff-#000)"
 rows: 3
 columns: 3
 vgroup:
  column: 1
  item:
   item-type: DIAMOND
   name: "[Example Diamond](color=#fff-#666)"
   lore:
    - "[Example Lore Line](color=#111-#222)"
    - "[Example Next Lore Line](color=#333-#444)"  
  item:
   item-type: IRON_SWORD
   click: onSwordClick
   name: "Example Iron Sword"
   enchantments:
    enchantment:
     key: unbreaking
     level: 5
     ignore-level-cap: true
    enchantment:
     key: sharpness
     level: 3
     ignore-level-cap: false
 item:
  item-type: dirt
  row: 1
  column: 2
```\
#

I fucking hated writing this in yaml

#

at first I'm like oh this'll only takea second then I'm counting my spaces like uh where does this go again

remote swallow
#

it would look great with correct formatting

#

discord formatting is shit

pseudo hazel
#

yeah I guess to each their own

river oracle
#

this is what it looks like in my text editor

pseudo hazel
#

this reminds me I still have to make the data driven menu thing I wanted to do

#

instead of creating menus in code all the time

river oracle
#

oh shit I forgot to do the events in this

#

oh lord

remote swallow
#

NERD

pseudo hazel
#

events arent important anyways

river oracle
#

the way I'm doing it they are important

#

look at the xml I bind specific methods to each item in a class

pseudo hazel
#

like open_menu or whatever?

#

only events with predetermined results?

#

or like a crazy scripting thing

river oracle
#

I'll have a ContainerResponder class atleast in this example that will contain all methods mentioned in the xml

#

responder="sh.miles.inventory.ContainerResponder">

#

<item item-type="IRON_SWORD" click="onSwordClick">

remote swallow
#

nerd x2

river oracle
#
@AnnotationMaybe
public class ConatinerResponder implements OrSomeInterfaceMaybe {
  
  @MaybeAnnotationIdfk
  public onSwordClick(InventoryClickEvent event){
   // fancy code here
  }
}
pseudo hazel
#

wait so are those xmls just for you? like who decides what onSwordClick actually does

river oracle
#

its for me as a developer

#

I plan to have links to something like json or yaml that would link elements to a config file

pseudo hazel
#

oh so users can make their own menu with existing settings

remote swallow
#

@Id("onSwordClick")

river oracle
#

then in the xml I might do something as the value like {link} which will retrieve the value from the link

#

probably on an ID based system with JSON keys

pseudo hazel
#

right

#

so that's just for boolean config options I guess

river oracle
#

well if I want to do something in the config I can just port over my config class into my ContainerResponder

#

I plan to just take in a supplier when building the XML file with the resonder

#

I'm going to mock this linking think really quick

river oracle
# pseudo hazel so that's just for boolean config options I guess

maybe something like this I think

<?xml version="1.0" encoding="UTF-8"?>
<container title="[Example Title](color=#fff-#000)" rows="3" columns="3"
           responder="sh.miles.inventory.ContainerResponder" link="test-menu.json">

    <item id='element1' row="1" column="1"/>

</container>```

```json
{
  "element1": {
    "item-type": "IRON_INGOT",
    "name": "item name"
  }
}
#

I'm still theorizing how I'm going to do the entire file system, but I want to beable to do everything, but the events in files

#

some internal some user editing

pseudo hazel
#

do the entire file system, what do you mean

river oracle
#

basically want to iron out how the files will work before I code anything

#

I want to set out a strict set of rules for the way the files can work before even writing any code

pseudo hazel
#

right

#

if your input keeps changing you need to keep changing the program

river oracle
#

then I'm going to write the API, then implement it

ivory sleet
river oracle
ivory sleet
#

well you know how xml, json, yaml, toml etc all have scalar values, list values and map values

river oracle
#

yes

ivory sleet
#

just define the format/structure in terms of how one structures the relations between them

#

and then u choose the file format

#

if that makes sense

river oracle
#

kind of, but not really I'd probably wanna see a code example if you have a link to any

ivory sleet
#

well I just meant like,

lets say I wanna have this config:

{
  "items":[
    {
      "name": "SomeItem",
      "count": 3
    }
  ]
}

this can be well written in terms of yaml, xml, toml, hocon or other file formats

#

the abstract tree here is just the items pointing to a list of maps right?

river oracle
#

yeah

storm raven
#

hey, I have a problème, my eclypse not see a spingot bibliothèque

river oracle
#

what

eternal oxide
#

which version?

ivory sleet
storm raven
#

1.20.1

ivory sleet
#

and not worry about the file format too much, just rather getting the tree itself structured in ur preferred way

eternal oxide
river oracle
storm raven
#

on superclass, I not see JavaPlugin

eternal oxide
#

using Maven?

storm raven
#

eclipse

eternal oxide
#

or manual import jar?

ivory sleet
#

basically, get ur tree planned out, then u can start worrying about how it looks in xml

gleaming brook
#

how i can remove my old resource from spigotmc?

river oracle
eternal oxide
ivory sleet
#

think of the data in terms of java classes

#

then just "orm" it

river oracle
gleaming brook
ivory sleet
#

object relational mapping :,)

river oracle
ivory sleet
#

:)

river oracle
# ivory sleet :)

okay I'm going to see if I get this right I should have something kinda like this

**ContainerData**
String title
int row
int column
String responderClassPath
List<VGroupData>
List<HGroupData>
List<ItemData>

**VGroupData**
int column
List<ItemData>

**HGroupData**
int row
List<ItemData>

**ItemData**
int row;
int column;
... Item Attributes
#

I'm breaking my data down into what I want to see in their respective types

#

then I could easily write a parser and express this because each VGroupData is parsed the same each HGroupData is parsed the same and each ItemData is parsed the same

torn shuttle
#

is there a catch-all event that would detect when a player fires a projectile?

ivory sleet
#

like listening to Event and all of its subclasses?

torn shuttle
#

catching bows, crossbows, tridents, snowballs and so on?

ivory sleet
#

perhaps?

torn shuttle
#

I should be able to, right?

ivory sleet
#

getEntity().getShooter() i think right?

torn shuttle
#

yeah

#

I've got this annoying thing where I need a custom data object for projectiles so I can tell what they were fired from

#

because people are bypassing some stuff I made by putting crossbows in offhand

toxic sorrel
#

Is there a way to cancel sculk sensors from activating? I'm not finding an event for it

proven jay
#

Does anyone know an alternative to ChatColor.of in PaperSpigot 1.20 as it's deprecated?

#

I have a gradient hex color codes system, but it seems as if it's not working because of this problem in it

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

proven jay
#

Do you know the answer to it or not?

eternal oxide
#

thats just an answer

remote swallow
#

ask paper

#

not spigot

torn shuttle
#

does projectilehitevent do all arrow collisions?

#

including entity and block?

inner mulch
#

how do i get the material value of event.getcaught from playerfishevent

restive current
#

Can I report leaker if I know NONCE_ID of the purchase?

chrome beacon
#

From javadoc

inner mulch
#

thank you for trying to help, but i found the way item.getitemstack.gettype

chrome beacon
#

I mean that's basically what I told you to do

#

You cast to item and then get the itemstack and type from it

proven jay
#

Can someone tell me why this isn't working?

            // Original gradient color codes - gradientColor.getColorCodeOne().getRed(), etc are all integers (I've debugged this to make sure of it) 
            // This doesn't work 
            ColorSet<Integer, Integer, Integer> colorSetOneTemporary = new ColorSet<>(gradientColor.getColorCodeOne().getRed(), gradientColor.getColorCodeOne().getGreen(), gradientColor.getColorCodeOne().getBlue());
            ColorSet<Integer, Integer, Integer> colorSetTwoTemporary = new ColorSet<>(gradientColor.getColorCodeTwo().getRed(), gradientColor.getColorCodeTwo().getGreen(), gradientColor.getColorCodeTwo().getBlue());
            // These are my debug values to see if the system works or not and it does 
            // This works 
            ColorSet<Integer, Integer, Integer> colorSetOne1 = new ColorSet<>(119, 255, 51);
            ColorSet<Integer, Integer, Integer> colorSetTwo2 = new ColorSet<>(51, 66, 255);```
upper hazel
#

who know what the best event for check nicth or day now

#

nith

#

night

lilac dagger
#

pretty sure you can check this in the World class

#

unless you wanna cancel it

upper hazel
#

i want optimize option

#

i not wanna use if not need task

lilac dagger
#

a task is not as expensive if the checks are reduced to a minimum

#

and you need the least amount of instances

upper hazel
#

i was find WorldTimeEvent but this event works every tick apparently

lilac dagger
#

then a task is better for you

#

do it every second instead

#

or even less depending on what you wanna achieve

remote swallow
#

im pretty sure normally it doesnt go day to night that quick

pseudo hazel
remote swallow
pseudo hazel
#

oh is that how that works?

upper hazel
pseudo hazel
#

the more you know I guess

remote swallow
pseudo hazel
#

right

#

nice

remote swallow
#

the main reason i refuse to use paper api

pseudo hazel
#

does paper have alternatives for those?

remote swallow
#

adventure components

lilac dagger
#

i'll keep using md's components

pseudo hazel
#

oh

lilac dagger
#

they're amazing

#

if paper wanna remove those they'll lose any plugin making use of them

#

so it's up to them

timid hedge
#

Why dont i get a potion effect?

        Player victimPlayer = (Player) victim;
        Player attackerPlayer = (Player) attacker;

        if (attackerPlayer.getItemInHand().getType() == Material.STICK){
            victimPlayer.sendTitle("Hello!", "This is a test.");
            victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(5, 5));
        }
remote swallow
#

paper plan to break comapt

#

compat

eternal night
#

Truely BaseComponent[] is superiour to Component

quiet ice
lilac dagger
#

there might be some small nuisances like how to make a hover event but tbh it's alright

quiet ice
#

They are very active in the vineflower discord

eternal night
#

thank you jasmine

quiet ice
#

The hard fork can't be far away

eternal night
#

*soft spoon

lilac dagger
#

and i looked through adventure, it's not that fancy

quiet ice
#

It's okay I guess. But does what you'd expect and that counts

#

As in there are no truly arbitrary limitations

pseudo hazel
#

yes I will take code that does the job well over code that looks complicated

eternal night
#

beyond that

timid hedge
#

Isnt it seconds?

eternal night
#

no

#

its in ticks

pseudo hazel
#

durations for anything are usually in ticks

lost matrix
#

Giving the player the hint of a potion effect

quiet ice
#

Isn't getItemInHand deprecated?

lost matrix
#

yes

pseudo hazel
#

this is like gaslighting them with a potion effect

lost matrix
#

It should be finally removed. Deprecated for a few years now

remote swallow
#

(that would break compat)

eternal night
#

((you can never break compat))

#

(((HOW WILL MY 1.8 PLUGIN RUN ON 1.20.2)))

quiet ice
#

Meh, it's quite a dangerous method

timid hedge
#

If i am setting it to 100 i am still not getting a potion effect

remote swallow
#

did you change the right one

quiet ice
#

Like yes, implicitly that means the main hand but eh

lost matrix
eternal night
#

is the victim getting the title ?

timid hedge
#

Here is the class:

public class PlayerDamageListener implements Listener {

    @EventHandler
    public void onPlayerDamage(EntityDamageByEntityEvent e) {
        Entity victim = e.getEntity();
        Entity attacker = e.getDamager();

        if(!(victim instanceof Player && attacker != null)) return;

        Player victimPlayer = (Player) victim;
        Player attackerPlayer = (Player) attacker;

        if (attackerPlayer.getItemInHand().getType() == Material.STICK){
            victimPlayer.sendTitle("Hello!", "This is a test.");
            victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 5));
        }
    }
}
lost matrix
#

Is it registered?

eternal night
#

that if is cursed

timid hedge
lost matrix
#

if (attackerPlayer.getItemInHand().getType() == Material.STICK){

eternal night
#

blind cast all the wayy

remote swallow
#

cant wait for something to be attacked by a zombioe

flint coyote
#

Or hit by an arrow

gleaming grove
#

I'm using protocol buffer. Why generated classes from generated-sources folder can't be found be Intelji ?

lost matrix
# timid hedge Here is the class: ``` public class PlayerDamageListener implements Listener { ...
    @EventHandler
    public void onPlayerDamage(EntityDamageByEntityEvent event) {
        Entity victim = event.getEntity();
        Entity attacker = event.getDamager();

        if(!(attacker instanceof Player)) {
          return;
        }

        if(!(victim instanceof Player)) {
          return;
        }

        Player victimPlayer = (Player) victim;
        Player attackerPlayer = (Player) attacker;

        ItemStack attackerWeapon = attackerPlayer.getInventory().getItemInMainHand();
        Material weaponType = attackerWeapon.getType();

        if(weaponType != Material.STICK) {
          return;
        }

        victimPlayer.sendTitle("Hello!", "This is a test.");
        victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 5));
    }
lost matrix
gleaming grove
#

No I'm doing this stuff for the first time. What should be added in pom?

lost matrix
#

The dependency

gleaming grove
#

like I have dependecy to Protocol buffer plugin if you are asking about it

lost matrix
#

And you defined your protocol?

woeful valve
#

@spare hazel you joined my discord server

gleaming grove
#

Those classes are already generated but can not be found be Intelji. IdeaProjects\TEST\Client\target\generated-sources\protobuf\java\io\github\jwdeveloper\generated\EmoteDetails.java

timid hedge
remote swallow
#

calling 1.8

timid hedge
#

Yeah

zealous osprey
#

Got a quick question about maven compiling:
Is there a way to tell the compiler to replace a certain string with some value/string?

So for example I want "%%url_param_id%%" to be replaced with "id".
I have some JS files and some java files and I want to make sure both have the same value for it.

gleaming grove
zealous osprey
# zealous osprey Got a quick question about maven compiling: Is there a way to tell the compiler ...
timid hedge
smoky oak
#

if the server restarts/reloads, what happens to scheduled tasks?

upper hazel
#

!paste

#

?paste

undone axleBOT
upper hazel
gleaming grove
smoky oak
#

sync

ivory sleet
#

Cancelled

upper hazel
#

how math need sec for check your recomindation?

lost matrix
#

*If you dont want to solve any integrals

upper hazel
#

2?

#

2 tick?

next stratus
#

I can't work out if I'm doing something real dumb but I've managed to create a custom command system but I can't work out how to make the server detect when the plugin is ran and if it's ran how to execute the method

undone spindle
#

does someone know how to load multiple yml files on the initialization of the plugin so just like the config.yml i want to use a rounds.yml to be able to controll the amount of mobs spawning in each round. With the way that i tried it i got newPosition < 0: (-1 < 0)

hybrid ledge
#

Hi, is it still true that bungee has no method to simply create config.yml from file in Resources?

hazy parrot
#

It should be simple enough to do yourself if it doesn't exist

#

Get Inputstream and write it to fileoutputstream

hybrid ledge
#

Yes it is simple

#

I'm new in Bungee. If I throw exception in onEnable() method for any reason, will plugin disable please? Or just show exception in logger? Or does it depend on whether the exception is checked/unchecked?
Thanks!

#

(I'm asking because there is no disablePlugin in PluginsManager)

rotund ravine
#

There is

#

Oh in bungee

#

I see

timid hedge
#

Does anyone know how ticks work? 1000 ticks is somehow 12 seconds?

eternal oxide
#

not in spigot its not

#

well

#

the best it can be is 50, worst is minutes

pseudo hazel
#

ideally a second is 20 ticks

eternal oxide
#

nope, his 1000 ticks doing 12 seconds is faster than any server can run

#

his math is bad or his code is bad. Or his watch is broken

rare rover
#

hmm, shouldn't this be detecting if the falling block landed?

@EventHandler
    public void changeEvent(EntityChangeBlockEvent e) {
        Bukkit.broadcastMessage("Something");
        if (e.getEntity() instanceof FallingBlock fallingBlock) {
            Bukkit.broadcastMessage("Falling block");

            Block block = e.getBlock();
            block.setType(fallingBlock.getBlockData().getMaterial());
        }
    }```
#

kinda weird

hybrid ledge
#

Or he uses some kind of fork with functionality to catch-up missed ticks

rare rover
#

i've seen multiple spigot resources and this is how they do it

#

i've also tried e.getEntityType() == EntityType.FALLING_BLOCK

timid hedge
#

How do i do so the time of the potion effect dosent stack? its becuase you get 3 seconds blindess every time you get hit and i dont want so you can hit a person 10 times so its 30 seconds i just want so it dosent stack

shadow night
#

Uh that's a thing?

upper hazel
#

who know were i can gat this api

proven jay
#

Is there a way to bold, underline, etc a message which has been formatted by using hex color codes?

upper hazel
muted trout
#
Failed to create log file: BuildTools.log.txt
Loading BuildTools version: git-BuildTools-2836244-160 (#160)
Java Version: Java 17
Current Path: C:\Users\Niklas\Desktop\Build-Tools\.
*** Using downloaded git PortableGit-2.30.0-64-bit\PortableGit ***
*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
git version 2.30.0.windows.1
Niklas326
root@niklas326.de
Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
java version "17.0.7" 2023-04-18 LTS
Java(TM) SE Runtime Environment (build 17.0.7+8-LTS-224)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.7+8-LTS-224, mixed mode, sharing)
Attempting to build version: 'latest' use --rev <version> to override
Found version
{
        "name": "3844",
        "description": "Jenkins build 3844",
        "refs": {
                "BuildData": "faff587dcbe915bc565bf01f2d54c6af86039414",
                "Bukkit": "f83c8df43a0d48d0743834730abee046c1fa1d3a",
                "CraftBukkit": "c335a555fb8cf6efda5b99d89bda26393199fa92",
                "Spigot": "b41c46db51ec4aca746def5ac9080ec319c4abdb"
        },
        "toolsVersion": 148,
        "javaVersions": [61, 64]
}

Starting clone of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git to CraftBukkit
Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file CraftBukkit\._LGPL.txt10782082938263398985.tmp to CraftBukkit\LGPL.txt
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:215)
        at org.spigotmc.builder.Builder.clone(Builder.java:1140)
        at org.spigotmc.builder.Builder.main(Builder.java:365)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: java.io.IOException: Could not rename file CraftBukkit\._LGPL.txt10782082938263398985.tmp to CraftBukkit\LGPL.txt
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1516)
        at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:563)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:467)
        at org.eclipse.jgit.api.CloneCommand.checkout(CloneCommand.java:385)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:212)
        ... 3 more
Caused by: java.io.IOException: Could not rename file C:\Users\Niklas\Desktop\Build-Tools\CraftBukkit\._LGPL.txt10782082938263398985.tmp to C:\Users\Niklas\Desktop\Build-Tools\CraftBukkit\LGPL.txt
        at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:323)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1514)
        ... 7 more

C:\Users\Niklas\Desktop\Build-Tools>```
#

help.

north nova
#

probably permissions problem

muted trout
#

I have started CMD in Admin mode

north nova
#

check the folder itself

#

lol

eternal oxide
#

move it off your desktop

#

onedrive breaks it

muted trout
#

okay

#

i hate onedrive

cedar marlin
#

d

#
public void setMoneyValue() {
        OfflinePlayer[] players = Bukkit.getOfflinePlayers();
        YamlConfiguration cfg = YamlConfiguration.loadConfiguration(getMoneyStats());
        for (int i = 0; i < players.length; i++) {
            cfg.set("money." + players[i].getName(), RecklessGD.getInstance()
                                                        .getPlayerHandler()
                                                        .getCurrency(players[i].getPlayer(), PlayerHandler.Stats.MONEY));
        }
        try {
            cfg.save(getMoneyStats());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
}```

Why do I get a NUllPointerException
#

getCurrency return me an Integer of the Players Balance, it is safed in an another Config

eternal oxide
#

which line is giving npe?

cedar marlin
#

[19:36:20 WARN]: Unexpected exception while parsing console command "money"
org.bukkit.command.CommandException: Unhandled exception executing command 'money' in plugin recklessgd v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1003) ~[paper-1.20.1.jar:git-Paper-60]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:966) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:501) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:448) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-60] at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "player" is null
at us.recklessgd.handler.PlayerHandler.getCurrency(PlayerHandler.java:69) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at us.recklessgd.handler.FileHandler.setMoneyValue(FileHandler.java:74) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at us.recklessgd.commands.ReloadMoneyConfig.onCommand(ReloadMoneyConfig.java:15) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 9 more

#

soo.. uhh

eternal oxide
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "player" is null

kind hatch
#

Is that player online?

cedar marlin
#

no

#

they are all offline

kind hatch
#

Then there's your issue.

#

Use OfflinePlayer instead.

cedar marlin
#

instead of normal Player?

eternal oxide
#

Players are only for those online

cedar marlin
#

ahhhh

kind hatch
#

Hence the distinction.

cedar marlin
#

and OfflinePlayer for both?

kind hatch
#

Yes

eternal oxide
#

yes

cedar marlin
#

ah okay

#

thank yoU!

#

LESS GOOO PLUGIN WORKS!!!

muted trout
#

Then which jar do I need to take at build tools so that I have the following imports: org.bukkit.craftbukkit, net.minecraft.network

kind hatch
eternal oxide
#

?nms

cedar marlin
#

or use gradle

#

👍

cedar marlin
#

:(

river oracle
#

Use maven if you're using spigot

cedar marlin
#

but it works (so spigot does)

muted trout
#

I use gradle and have now run java -jar BuildTools.jar --rev latest --remapped, what do I need to use now?

cedar marlin
#

what

muted trout
#

which jar

north nova
river oracle
#

He's using mapping buddy

river oracle
cedar marlin
#

ah okay

north nova
#

¯_(ツ)_/¯

#

need nms, use paperweight

cedar marlin
#

what is mapping?

river oracle
#

Notice how I specifically said spigot and not paper

cedar marlin
#

like what its jobs

river oracle
#

Their apis are different

eternal oxide
#

This is spigot, stop recomending gradle/paperweight

kind hatch
north nova
#

so if i use spigot i should not use gradle ok

#

sorry

#

ill move back to maven mb

cedar marlin
kind hatch
#

I feel this is appropriate.

#

?whereami

river oracle
#

Just saying paperweight isn't compatible with spigot easily

cedar marlin
river oracle
#

Than go to paper discord

#

And recieve help from there

north nova
#

wait im confused

#

paperweight isn't compatible with spigot easily?

#

w/e

#

wrong server i guess 😄

cedar marlin
#

I use SPigot PLugins but server is running with Paper

eternal oxide
#

It doesn't matter what server you run. If you build for Spigot use Maven

cedar marlin
#

what are the advantages of maven?

eternal oxide
#

Spigot is designed to use Maven for building/mapping

cedar marlin
#

ohhh.. thats why it is good to use Maven.

kind hatch
#

Right tools for the right job.

eternal oxide
#

It doesn;t support Gradle for NMS

north nova
#

bro what are u saying 🤣 🤣

eternal oxide
#

the truth, why are you grinning?

kind hatch
#

Idk how much simpler it can get.
Spigot = Maven
Paper = Gradle

Paperweight = Paper = NOT OFFICIAL/UNRELATED TO SPIGOT

north nova
#

👍

rough drift
#

MyPlugin.getInstance().doSomething()

or

MyPlugin.doSomething()

public static MyPlugin getInstance() {
  return JavaPlugin.getPlugin(MyPlugin.class);
}

Discussing with my friend about this (I am pro-getInstance for APIs)

eternal oxide
#

as a plugin you shoudl use getInstance

rough drift
#

ye

#

I am making an API for work stuff and he just prefers static stuff

eternal oxide
#

If it's not a plugin and you have full control over instancing you are fine without getInstance

hybrid spoke
#

then dont go over the main class

#

if its an api you should have another access point which is NOT your entry point

rough drift
#

Fair enough

#

Though I still need a plugin class to register some listeners which are required

hybrid spoke
#

yeah but that should not be the access point for the enduser

rough drift
#

Yeah

thick mica
#

Hey guys do somenone knows a prophunt (hide and seek) plugin with some taunts on 1.8.9 pls or higher but I prefer 1.8.9

undone axleBOT
thick mica
#

Sry

near mason
#

is there a way to auto complete chat like command arguments?

chrome beacon
#

chat like?

sage patio
#

How I can sort a Map<String, Double> by the values from high to low and return the top 10 Strings in a List?

eternal oxide
#

use a TreeMap and pass a Comparitor Map.Entry.comparingByValue()

sterile breach
#

hi, let's say I have a plugin that displays the number of broken blocks on my server. On a bungee proxy, how can I make it display the same number on the 2 servers?

hazy parrot
sterile breach
gleaming grove
#

What do you think, with this change there will be possibility register custom packets in spigot?

hazy parrot
#

I would connect all those plugins to same database

#

To keep count synchronized

sterile breach
#

ah yes, but then I can't do any more caching

hazy parrot
#

I mean you can sure make a system that will send message to proxy on every event via some messaging service(redis, plugin messaging channel etc)

#

But idk how performant will it be

#

I wouldnt say its best idea

sterile breach
#

ah yes so the best is to go through the db

rare rover
#

nvm

onyx fjord
warm mesa
#

Hi, Im trying to do something similar of this thing

#

But the thing is that I need code that the player have 2 options, proceed or gets disconnected from the server

worthy moat
#

Hey I want to build a nick plugin...Is there a DB where I can get Skins and Names of players?

warm mesa
#

But I just can do that:

#

I don't need the option No because is forced

#

Can somebody help me?

lilac dagger
#

i wonder how he did this

sage patio
#

is getConfigurationSection("test").getKeys(false).isEmpty() true while configuration file looks like this:

test:
pseudo hazel
#

yes

#

test has no keys

#

or should be true atleast

sage patio
#

so why this happens:

[01:05:26 ERROR]: Error occurred while enabling NLGangs v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
pseudo hazel
#

oh

#

well thats because there is nothing in test

sage patio
#

yes

pseudo hazel
#

its like saying test: null

carmine mica
#

how does YAML know that's a section, its just a key, so yeah its null

pseudo hazel
#

well it just looks for another key presumably

sage patio
#

how how i can do something when its not empty?

#

to prevent this error

whole portal
#

I am currently making a spawn plugin. When you type /spawn, you have to stop for 3 seconds, but I don't know how exactly to do that? At least I don't know what to use, I think it's called a boolean. On the screenshot you can see more exactly what I mean. Can someone help me or at least tell me how I can solve this?

sage patio
pseudo hazel
sage patio
pseudo hazel
#

wdym

#

how does intellij know

sage patio
#

thats why i didn't did that

#

lemme show u

vagrant stratus
#

Lets play a game called getting an old driver to work on a modern pc

(Coded in C)

pseudo hazel
#

yes

#

likely because getKeys returns a collection

#

and if there are no keys, it will be an empty collection, not null

#

intellij doesnt say anything about getConfigurationSection I guess

vagrant stratus
warm mesa
#

How can I get a skin for a NPC in 1.8 with NMS?

sage patio
# pseudo hazel intellij doesnt say anything about getConfigurationSection I guess
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null

while i'm checking for null:

if (data.getConfigurationSection("test").getKeys(false) != null) { ... }
whole portal
pseudo hazel
#

are you not listening?

#

I said check if getConfigurationSection is null

#

null.getKeys() does not exist

sage patio
#

ow, thanks

pseudo hazel
whole portal
#

i think so 😄

pseudo hazel
#

okay, then listen for the player move event

#

have some kind of hashmap with player ids and something like the time they went to spawn or whatever

#

I mean this isnt a very basic thing

whole portal
pseudo hazel
#

youll need to write code in a few places

#

yes thats possible

hazy parrot
#

Why not have HashMap<Uuid, bukkittask>, task would be repeating task on every 20 ticks for 3 seconds, listen to Player move event, if move get task and cancel it

whole portal
#

import the file and then?

pseudo hazel
#

this is where you need to learn about object oriented programming I guess

#

you could just listen for it in the command, but thats not a very common way to do it

#

but in short, you should have some way to access the hashmap of players

#

like maybe i your plugin class

#

then you can reach it from both the command and the this event listener

random wedge
#

Trying to get the craftbukkit project loaded up in IntelliJ and it's for some reason having trouble resolving the bukkit api dependency. Did I miss a step along the line somewhere? nevermind just needed to mvn install the Bukkit project

#

I have run BuildTools and have appliedPatches pointing to the correct working directory

calm robin
#

would having protocollib stuff screw with my vanish plugin?

#

im not using it to vanish players but im starting to think that it may be responsible for my vanished players becoming visible when they click things

quaint mantle
#

how do i put hex colors on ItemMeta.setDisplayName()? Im currently getting the string from the config but its not parsing that hex

undone axleBOT
calm robin
#

my b

pseudo hazel
#

ChatColor.of("#aabbcc") + "your name"

#

yes

whole portal
pseudo hazel
#

well I told you a general approach

#

for any specifics that would just be java stuff mostly

#

but in this server its assumed you atleast know basic java

#

which includes oop

warm mesa
#

Yessir

#

it is because in 1.8 we don't have access to mojang skins

whole portal
rare rover
#

how would one set the block display type?

#

using packets

#

because i need it client sided

#

using this rn:

#

which isn't working

#

then the method:

young knoll
#

Are you sending the meta packet

rare rover
#

ClientboundSetEntityDataPacket dis one right?

#

im using mojang mappings

young knoll
#

I assume so

quaint mantle
#

My event isnt firing

young knoll
rare rover
#

well im using a builder class

#

but here

young knoll
#

Also please don’t identify items by lore

#

?pdc

rare rover
#

would i have to create the meta packet class in the build method?

young knoll
#

Yes

#

You should create the meta packet after all the meta changing is done

rare rover
#

👍

#

hmm

#

still doesn't show the block type

#

the entity does spawn

#

i can see it in my F3 menu

#

just cant see it

#

which is why i think its display.setBlockState(getBlockState(blockData));

#

nvm

#

okay i have another issue now, it is setting the state

#

but how do i spawn it at a location?

#

how am i supposed to spawn it at an itemstack

young knoll
#

setPos

rare rover
#

ayyy

#

ty

#

hmm

#

transformation doesn't seem to be working

#

i've also tried to set it when i send the packets

#

that refers back to

#

which seems correct

#

then setting it:

young knoll
#

Iirc there’s a setTransformation

rare rover
#

ye

#

still doesn't work tho, i've tried to set it in the constructor of the builder class

#

and then the .build method

#

neither of them work

young knoll
#

What are you setting it to

rare rover
#

transformation itself is this:

private Transformation transformation = Transformation.identity();```
young knoll
#

Yes but what values are you using

rare rover
young knoll
#

No idea

#

Try constructing a new transformation instead of editing the old one

rare rover
#

alr

rare rover
#

tried doing this: java private Transformation transformation = new Transformation(new Vector3f(), new Quaternionf(), new Vector3f(), new Quaternionf());

#

which completely broke it

young knoll
#

Default is probably 0,0,0

#

So you set the scale to 0

rare rover
#

no, but i set it to 0.5

vagrant stratus
young knoll
#

I meant try constructing a new transformation when you want to edit it

wet breach
vagrant stratus
#

Well, fuck

#

I need to get the Linux driver working on modern versions

wet breach
#

probably just needs to be added to modprob

vagrant stratus
#

No, it has specific compile instructions

#

Those are the errors I get currently

#

Can't add it if it doesn't compile kekw

wet breach
vagrant stratus
#

They're all code related issues

#

If I can get it and the PCs nic working @wet breach then it would allow me to have a PC dedicated to just cyber security, and make it worth at least slightly improving

#

Could give it a slightly better CPU (maxes out easily currently) throw ssh & ftp on it, and make it an ok-ish home lab until I can buy a laptop

quasi berry
#

Is someone able to explain why this is happening? I am using this code to write my HashMap<String, Syndicate> (Syndicate is a custom data type) to yaml and it's all working properly except for the !!com.playharth.syndicates.Syndicate after the String:

        for (Map.Entry<String, Syndicate> entry : syndicateList.entrySet()) {
            syndicateData.getConfig().set("data." + entry.getKey(), entry.getValue());
            syndicateData.save();
        }```
drowsy helm
quasi berry
#

Alright

#

I've heard so many conflicting things on the player uuid thing

#

Oh alright

#

So I do actually have to

#

alright

#

mhm

#

would it be easier to load this back to memory as is or should I just manually parse it?

#

well yeah that's a given

drowsy helm
#

What conflicting things have you heard about player serialization?

quasi berry
drowsy helm
#

It’s pretty cut and dry

quasi berry
#

yeah I realize that now

drowsy helm
#

So that post it technically right but if you keep the reference in the collection gc wont pick it up and it will cause a mem leak

#

And knowing most new devs wont manage their memory it will become an issue

#

But yes if you properly manage memory it will be fine

#

Not in config though thats a different story

slender elbow
#

a List object with five million elements occupies the same space as an Integer because they're both references, not the values themselves

#

the underlying values occupy the bulk in memory

#

zzz

flint coyote
slender elbow
#

no

#

it only stores the reference to the array

#

assuming ArrayList ofc

flint coyote
#

Of course. The array holds 5 million references though

slender elbow
#

sure, but the list doesn't hold 5 million elements

#

only 1 reference

flint coyote
#

Probably 1. and 2. go together. It is the same space until the players logs out. Because then you keep a player instance alive - that one has more fields than a UUID instance

slender elbow
#

My point is that saying that is disingenuous, it's why the 1st point is bullshit because the ServerPlayer has more fields than UUID, so they don't take the same amount of memory just because they're references

flint coyote
#

The opionion about saving player instances differ

#

I personally don't mind as long as you clear them on PlayerQuit

#

Other state that Players are Entities and can get unloaded and loaded again (therefore having a different reference) in the future. That they are constantly loaded is an exception among entities

#

Oh I didn't read the second paragraph and therefore misunderstood you - I was kinda distracted.
However the ServerPlayer Object is also just an Object that holds other references that then gets carried on as a single reference which therefore needs the same space

simple schooner
#

Is it better to make 1 plugin with all the features like making holograms making crates, etc, or make separate plugins for each thing?

young knoll
#

Make separate plugins

#

It’ll be easier to maintain

simple schooner
#

okay

young knoll
#

You can have a core plugin that handles common things better them

simple schooner
#

would that make it more lightweight?

slender elbow
#

do you see why i say it's disingenuous to say that?

quasi berry
#

Is my only option to manually parse it or is there something else I can do?

slender elbow
#

yes it is

wet breach
#

no

slender elbow
#

yes

wet breach
#

well I don't acknowledge you as an expert in regards to the JVM

slender elbow
#

okay and?

wet breach
#

what you are saying is incorrect in regards to the JVM

slender elbow
#

List<Object> l
l.add(ArrayList.asList(new Object[5000000]))
l.add(Integer.valueOf(1))

shallowly, l is just as wide as the Integer which is just as wide as Arrays$ArrayList

#

that's what the thread is trying to say

quasi berry
#

"not true"
"yes it is"
"no"
"yes"
lmao

wet breach
slender elbow
#

the reference itself does, yes

#

it's just an Object reference at the end of the day

#

rather, what makes you disagree?

wet breach
#

Because an Object needs to exist somewhere, the primary one

#

its not just imaginary

compact haven
#

the reference is the same size, yes

#

but the literal allocation for the object is definitely larger

slender elbow
wet breach
#

the object itself is not

slender elbow
#

sigh

wet breach
#

I don't care about references and they are pointless to compare with

slender elbow
#

this is exaclty the point

#

that is exactly why i say it's disingenuous to claim this

#

that is exactly why i say the thread is silly

wet breach
#

claim what? that the objects actually differ?

slender elbow
#

claim that the references itself inside the list are the same width

#

not the real data in memory

#

but the reference that points to said data

wet breach
#

depends how the list is filled

pale hazel
#

I thought this was a thread to help with Spigot Development questions? Why are we arguing about references and objects?

slender elbow
#

tf

#

no

#

how does it depend

compact haven
#

and that thread makes complete sense

#

not sure how this argument started

slender elbow
#

the first claim in that thread is stupid

compact haven
#

"stupid" why

#

what "first claim" are you talking about

slender elbow
#

the one that literally reads "first"

wet breach
eternal oxide
#

The thread you linked starts out stating a false premise

compact haven
#

It's a pretty common misconception that
You should store UUIDs instead of Player objects because UUIDs occupy "less space"

eternal oxide
#

Thats not the reason at all to use UUID

slender elbow
#

explicitly talking about references

wet breach
#

but I assumed you read the jvm spec

compact haven
#

I'm not saying he is right, I'm saying that the anti claim makes sense. The point of Map<UUID, V> vs. Map<Player, V> is NOT because it occupies less space, because it occupies equivalent space

wet breach
#

I must have been mistaken

slender elbow
#

you assumed right

#

again, explicitly talking about references

#

"except for this thing that has nothing to do with what you are saying"

wet breach
#

then don't make remarks as if you don't know if you did in fact read the jvm spec

compact haven
#

this entire conversation is dumb

#

if you want to argue, argue in the spigot thread

#

because none of these claims are logical

slender elbow
#

what the thread is claiming is that both elements inside the list occupy the same memory because "they're both references"

#

which is what i am saying is silly

compact haven
#

literally the truth:
Map<UUID, V> and Map<Player, V> use the same amount of memory because Player AND UUID is already allocated BEFORE the map is created, and the references are equivalent in usage regardless of type.

slender elbow
#

sure the actual reference is nothing but a pointer so they have the same width but there is more data than just that, the one frostalf rightfully said "needs to exist somewhere, the primary one"

eternal oxide
#

The ONLY reason we alwasy say to use UUID and not Player has nothing to do with Object size, gc or any stated in that thread. It's mainly because Player objects are transient while UUIDs are not.

pale hazel
#

Lmao

#

Lets just continue to argue about it

slender elbow
#

typical frostalf conversation

young knoll
#

This is why I make sure to deep copy my players

#

That way I can make sure I use more memory

compact haven
slender elbow
#

too late xx

eternal oxide
#

Unless there is a dev question in here to answer, discussions like these are permitted

compact haven
#

not to mention, transient status literally means nothing unless you're using a serializer that uses it, or for whatever reason using that map in a DTO

#

so I will actually break my own advice and say that doesn't make sense (not to me, yet)

#

but I digress

eternal oxide
#

You are talking about Java transient not object transient

compact haven
#

"The ONLY reason we alwasy say to use UUID and not Player has nothing to do with Object size, gc or any stated in that thread. It's mainly because Player objects are transient while UUIDs are not."
what are we talking about here

#

someone explain this logic to me, because I've only ever heard of the 2 claims inside that spigot thread

eternal oxide
#

Transient lasting only for a short time; impermanent.

compact haven
#

ah

eternal oxide
#

The Player obejct is not reused when a player relogs. A new object is created

wet breach
#

and the reference will then point to nothing

#

where as the UUID will always be valid

compact haven
#

Yes but the only reason people store Map<Player, V> is when they remove it with a PlayerQuitEvent

#

same with a Map<UUID, V>

young knoll
#

That’s not true

compact haven
#

I've never seen a map with player keys expected to persist past object deallocation or player logout

eternal oxide
young knoll
#

Remember this is spigot developers we are talking about

compact haven
#

this is true

#

I have seen very popular plugins do very disgusting things

eternal oxide
#

We see devs in here storing Players with no cleanup all teh time. Which is why we teach to use UUID

compact haven
#

to be fair there, that's a problem on its own

eternal oxide
#

agreed

compact haven
#

because those entries won't magically disappear after the player logouts

wet breach
eternal oxide
#

unless its a weak ref

wet breach
#

where as the player object reference will

young knoll
#

It’s still a memory leak

#

But at least it won’t grow due to the player relogging a bunch

stuck imp
#

Hey, I have a question. Do you know how a Minecraft plugin communicates with a website? If it's a client request, or a server request?

lavish hemlock
#

Well it depends on the plugin/site in particular.

chilly hearth
#

umm

lavish hemlock
#

A common setup is for the plugin to send requests to an API.

chilly hearth
#

bro i cant get e.getclickedinventory().gettitle

#

it deoest show me the gettitle option

eternal oxide
#

title is no longer a component of teh inventory

#

its under the view now

chilly hearth
#

then how do

#

i

#

do it ;-;

lavish hemlock
chilly hearth
#

OH

lavish hemlock
#

I'm just assuming you're asking because you want to implement your own system. If so, use cryptographically-signed tokens to prevent forging, i.e. HMAC. A good format for this is JWT.

lavish hemlock
#

Look into how cryptography works. The main principle behind cryptographic signatures is that you have two keys. The private key is used to sign the token, the public key is used to verify that the token was signed with that specific private key. The private key should remain private (i.e. only your API server should have access to it), the public key can be provided to anything (like your plugin).

#

If you find that too confusing, don't try and code it yourself, just look online.

#

If you don't need your API to be protected (i.e. it's meant to be public), no need to prevent people from forging API tokens, so no need for tokens in the first place.

stuck imp
#

Alright, thanks for the info 🙂

lavish hemlock
#

You're welcome.

simple schooner
chilly hearth
#

got it thx

#

also btwe there is a problem

#

when iam coding ofc i need to replace plugins 1m times

#

but when ever i try to delete it it says running in java IDK

#

so i have to stop server remove it and restart it :/

simple schooner
#

well that sucks

#

it also takes me 20 minutes to test my plugins because my pc is soo bad

#

it can even barely run google and intellij at the same time

lavish hemlock
#

Create a symlink of your plugin in your server plugins dir. That way you don't need to replace the file. You will still need to restart the server every time you make changes though.

simple schooner
sterile breach
#

hello, let's imagine I want to make a tablist pluign for bungee. I'd have to make a proxy plugin and another spigot plugin that I'd put in the servers and make them communicate with the proxy plugin?

torn shuttle
#

the mc support experience

stuck imp
#

Hello I had a question, can a Minecraft server send a "POST" request to an HTTP server?

lavish hemlock
#

Yes, provided you have an HTTP client.

stuck imp
#

I would like to query my API to obtain information from an SQL database, I tried with Postman (everything works), except with my Minecraft server which shows me in the debug log "error 404"

lavish hemlock
#

I'm not sure why that would be the case.

stuck imp
#

so i don't understand ...

tender shard
#

?paste your code

undone axleBOT
stuck imp
tender shard
#

that is a stacktrace and not your code

stuck imp
#

?paste

undone axleBOT
stuck imp
stuck imp
#

So ?

quaint mantle
#
  • am i need jpa and hibernate for spigot plugins ?
hazy parrot
#

It really depends on you, there is no correct answer

#

But personally I find myself more confident to write queries then use hibernate for example

onyx fjord
#

It always gives you more safety

#

From things like SQL injection

#

Generally all kinds of human error

quaint mantle
#

well understood

#

btw

#

what is this ?

onyx fjord
#

Update your java

remote swallow
#

you have a too new version of hikari cp

quaint mantle
#

well im using tlauncher and i need upload old java version

#

minecraft servers has a problem for our country

#

i will delete and try

remote swallow
onyx fjord
#

@remote swallow tlauncher is not just offline launcher

quaint mantle
onyx fjord
#

It supports both

remote swallow
#

it does?

onyx fjord
#

Yes

#

Ofc

quaint mantle
#

i have 3 account

remote swallow
#

til

onyx fjord
#

Launchers with offline are really useful for debugging

#

I'm not paying for more mc accounts

quaint mantle
#

u guys can join minecraft ?

onyx fjord
#

@quaint mantle launchers like polymc let you change java version independently of instance

lilac dagger
#

just use my bot creator @onyx fjord

onyx fjord
#

Bots arent useful

#

I just need 2 mc instances

#

For example when I was making a claim plugin

buoyant viper
#

big craft doesnt want u to know this but u can get offline mode with the vanilla minecraft launcher

quaint mantle
quaint mantle
#

we can't login to the launcher in any way

#

it even makes me launch the game as a demo

#

microsoft confirmed this they are going to fix it today

buoyant viper
#

oh im talking like custom name offline :P

quaint mantle
#

ah mb

onyx fjord
#

instancing is shit

#

and its slow

#

and the worst part

#

its absolutely proprietary

#

and peterix works on it

quaint mantle
onyx fjord
#

polymc 😎

quaint mantle
#

oh

#

wait

#

not for launcher for my plugin

#

😄

onyx fjord
#

ah

quaint mantle
#

mb

#

well

onyx fjord
#

wdym idea

#

what are you looking for

quaint mantle
#

for save database

#

now

#

im doing friend plugin

#

and i wanna get friends from player

#

and i think this how do i save friends to database ?

#

am i create primary key with player uuid and create colums like
friend1 friend2 friend3

#

or i do only like this

#

friend1 and friend2
they will be friends if they are in the same column as each other

#

I told you a little strange

#

if u can't understand i will show with pictures

onyx fjord
#

honestly ive never worked with dbs

#

other than flat files

quaint mantle
#

well np

#

ty

hazy parrot
#

Don't create different column for every friend

#

You want to learn about database normalisation

#

And relations

#

You basically want table called friends or something where columns would be UUID | FRIEND_UUID and make it composite primary key

#

That way you can have multiple friends for same uuid (I just notices I haven't considered that friendship is mutual, according to that, design may be slightly different to avoid useless memory consummation)

north nova
#

why not use mongo

#

instead of a relational db

drowsy helm
#

migrating dbs for such a non issue seems inconvenient lol

quaint mantle
#
  • Can I see what server you're playing in bungeecord?
  • Can I send a message to a player in bungeecord?
    with craftbukkit?
drowsy helm
#

i believe so

#

is this for your own server or a public plugin?

#

if its for your own network just chuck a plugin on the proxy and make your life easier

quaint mantle
#

and i will do this

#

ty

drowsy helm
#

and use redis if you can

ocean hollow
#

DELETE FROM blocks WHERE x = ? AND y = ? AND z = ? AND world = ? How do I formulate a command for mySQL??

pseudo hazel
#

what do you mean by formulate

#

this looks like it can work

ocean hollow
#

I checked it doesn't work.

#

it only adds

chrome beacon
#

Well how do you add it

ocean hollow
hazy parrot
#

Check return value of execute Update

placid moss
#

are you sure the locations are the same

#

the add might add with a double location

#

which doesnt match the delete

wary harness
#

delete or insert

pseudo hazel
#

assuming the query starts with DELETE

#

I think they want to delete the block not insert it

ocean hollow
#

maybe the problem is here

pseudo hazel
#

if you get the block position, why use doubles

hazy parrot
#

I would not query db synchronous on every block place/break

ocean hollow
hazy parrot
#

Also check return value of executeUpdate, if it's 0, smth is wrong with your query

#

After that try to select values with same x y z and world

#

If 0 rows are returned check what value doesn't add up

#

It's called debugging

spare hazel
#

How can i create a bukkitrunnable as a class and then create an instance of the bukkitrunnable whenever i need?

pseudo hazel
#

yes but getx and getblockx are different

remote swallow
spare hazel
#

Ok thanks

#

No need of .runTaskTimer?

remote swallow
#

new MyRunnable().runTaskTimer

spare hazel
#

Ok

remote swallow
#

this is a class impl not annon impl

rigid otter
#

What is the reason of requiring at least one player to send a plugin message?

ocean hollow
eternal night
#

plugin messages hijack the player connection

spare hazel
#

How can i get a list of all the players?

eternal night
#

so you need a player connected in order to send one

rigid otter
#

What doesn't BungeeCord create a connection by itself?

pseudo hazel
#

bukkit.getOnlinePlayers() is a thing right?

rigid otter
#

Yes?

pseudo hazel
#

okay, then thats how @spare hazel should do it

#

sorry I wasnt answering you, I know nothing about bungee except they have a cool chatcolor class

rigid otter
#

OK I see, I was just confused.

hazy parrot
#

You don't need getServer

remote swallow
#

^^

pseudo hazel
#

yeah Bukkit is the real static abuser here

shadow night
#

Lol yes

split slate
#

Hey ! I'm currently developping a Plugin that involves villager trades (I'm on 1.8.8)
However, I can't shift click my materials into the Villager trade menu, so I tried to make it but artifically

Heres my code so far :

public void onClickEvent(InventoryClickEvent event){
        Inventory inventory = event.getInventory();
        if (!event.isShiftClick()) return;
        if (!inventory.getType().equals(InventoryType.MERCHANT)) return;
        ItemStack cursorItem = event.getCurrentItem();
        inventory.setItem(0,cursorItem);
 
    }

However, the item isn't moved in the specified location (here, slot 0, the villager trade slot)
Any clue on how to do that ?

grim ice
#

Does anyone actually think, java is better than C#?

grim ice
grim ice
#

try 36 instead of 0

gleaming grove
split slate
#

i have an error

split slate
#
[12:47:05 ERROR]: Could not pass event InventoryClickEvent to rushplugin v0.1
org.bukkit.event.EventException: null
 at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
(i shortened the error to make it fit in a message)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 36
        at com.hkrush.rushplugin.listeners.ClickEvent.onClickEvent(ClickEvent.java:44) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_382]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_382]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_382]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_382]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        ... 15 more

Any idea ? 🤔

#

It seems like the slot 36 isn't the right slot , idk

grim ice
#

hm

split slate
#

I tried logging the slots by using System.out.println(event.getSlot()); on the InventoryClickEvent
However when i click on the villager trade slot i get "0", and when I click on my hotbar first slot I also get "0", so i'm kinda lost 😅

hazy parrot
grim ice
#

pointers

#

properties

#

those are just 3 off the top of my head

gleaming grove
#

Extensions methods, null operator, string interpolator, parial class, file scope class, (properties)getters and setters, dynamic objects and more

hazy parrot
#

Imagine using pointers in c#

#

Also dynamic lol

grim ice
#

@split slate my bad

#

try 35

#

36 doesnt exist

hazy parrot
grim ice
#

c# is objectively a bit better than java

hazy parrot
#

However it's just syntax sugar

eternal night
#

objectively KEKW

gleaming grove
reef flower
#

Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw

hazy parrot
#

If u are using dynamic and pointer in c# you are doing smth wrong, hence I can't really count those as features

grim ice
eternal night
#

anyone claiming any programming language is "objectively" better is pretty delusional

#

you have your usecases

#

for some usecases your pgoramming language might make more sense

eternal night
#

for others, not so much

grim ice
#

okay then

grim ice
#

which one is better to make mc plugins with

#

pascal or java?

hazy parrot
#

You just considered usecase

grim ice
#

When I said objectively, I meant for the same use case, one is better than the other

#

C# has more features

hazy parrot
#

So c# is better then java in making mc plugins

grim ice
#

and ur likely to use

grim ice
#

for c#

#

and minecraft itself is made in java

eternal night
#

I mean, java ecosystem is a whole different beast to c#

reef flower
#

Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw

eternal night
#

given the amount of third party libraries etc

grim ice
#

java is much larger than c# in terms of libraries

#

but we're talking about features here

eternal night
#

well but you aren't

#

if you call a language objectively better

#

you talk about the entirety of the language

#

I mean, haskall can do a lot of cool things java cannot

#

is it now the objectively better language ?

grim ice
#

"cool things"

smoky oak
#

to be fair you can do almost anything in every language. the difference is how many hoops you need to jump through to archive it

grim ice
#

arent useful in most code bases

hazy parrot
#

I also can't find what features are you talking about xd. Only real benefit is no runtime clearing of generics

split slate
eternal night
#

Yea, so realistically you like some C# syntax and langauge features over java

#

GG

#

I like some kotlin features over java

reef flower
#

Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw

ocean hollow
#

when does this event run? I activate the piston and nothing happens

gleaming grove
#

The disadvantage in C# I see is application compilation because it needs 10000000 dlls to run. Simple self executable C# console app has about 90mb

grim ice
#

being clicked on

#

is yours

#

or the trader

grim ice
#

this whole debate is honestly pointless

eternal night
#

yes

grim ice
#

each language has its own use case, as u said

reef flower
#

Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw

eternal night
#

?google

undone axleBOT
split slate
# grim ice try to check if the inventory

Its the trader, i'm checking this with the if (!inventory.getType().equals(InventoryType.MERCHANT)) return; condition
I tried with raw slot as @smoky oak suggested, and I still get 0 for the villager trade menu
However, I get 30 for the hotbar first slot, so it means the slot i'm looking for seems to actually be 0 ?

smoky oak
#

thats cuz raw slots are counted differently

reef flower
eternal night
#

bro if you are asking for help with something as basic as shading

#

the only thing anyone here would be doing is just, linking a google result

split slate
eternal night
#

or rewording it

#

shading in maven isn#t some terribly complex thing, it is well documented online

smoky oak
#

wellll

#

slot 0 in the player inventory is the crafting output

reef flower
eternal night
#

bro

smoky oak
#

the raw slot applies to the inventory of the trader and the player inventory differently

#

you might want to post your relevant code

eternal night
#

especially as a non senior java developer you should learn that googling things on your own is a major part of development

#

if the only way you learn things is by relying on other people to spoon feed it to you

#

you are not going to get better

split slate
# smoky oak you might want to post your relevant code

I did, but here is the code again

public void onClickEvent(InventoryClickEvent event){
        System.out.println("A click event pccured. Here is the raw slot :");
        System.out.println(event.getRawSlot());
        Inventory inventory = event.getInventory();
        System.out.println(inventory);
        if (!event.isShiftClick()) return;
        if (!inventory.getType().equals(InventoryType.MERCHANT)) return;
        ItemStack cursorItem = event.getCurrentItem();
        inventory.setItem(0,cursorItem);
 
    }
split slate
#

the inventory.setItem(0,curstorItem) does nothing