#development

1 messages Β· Page 131 of 1

lyric gyro
#

yeah hold up, does it compile?

queen plank
#

Ok

#

Uhh

#

Yeah

#

Eclipse is just messing with me

#

Apparently

lyric gyro
queen plank
#

:>

#

Thanks any ways tho

lyric gyro
#

May I suggest our lord and savior IntelliJ IDEA by JetBrains

queen plank
#

I mean, I've tried, a few times. But I can't be be bothered learn a new IDE and fix a theme and those things again.

tight junco
#

its easier in the long run though

queen plank
#

It took me 15 mins to figure out how to export a .jar. And I didn't succeed lol

tight junco
#

a short term struggle to fix all pontential issues in the long run

lyric gyro
queen plank
#

I mean, I wish I would have gone with it from the get go. But, yeah, I can't really be bothered xD It works good, except for when it does these kinds of things to me

#

Might give it another try

#

But we'll see

lyric gyro
pearl topaz
#

how does the package structure work? do you have

src/
 main/
  java/
   org.myapp/
    loggers/
    utils/
 test/
  java/
   org.myapp/
    misctests/
#

and what about in src/main/resources and src/test/resources?

spiral prairie
#

Just the org.myapp being nested folders too

pearl topaz
spiral prairie
#

Wat

broken elbow
#

they're asking if they can have the same package in test as in main

pearl topaz
#

as in i couldnt have src/main/java/org.myapp/utils and src/test/java/org.myapp/utils

broken elbow
#

so for example
src/main/java/org/myapp/loggers
and
src/test/java/org/myapp/loggers

#

or that

pearl topaz
#

as they would both resolve to org.myapp.utils

broken elbow
#

you can have the same package tho

#

just not files I think

pearl topaz
#

should i not make a tests package inside src/test/java/org.myapp

pearl topaz
kind granite
#

yes you can

pearl topaz
#

yes but say i want src/test/java/org.myapp/utils to be testing src/main/java/org.myapp/utils

kind granite
#

you just cant define the same class twice, as if they were the same codebase

#

src/test/java

broken elbow
#

or was that not for me

#

?

pearl topaz
broken elbow
#

usually the test is under src. not under main

#

that's all

pearl topaz
#

ah i wrote it wrong

broken elbow
#
src -> main -> java -> some -> package
    -> test -> java -> some -> package

``` this is possible. I know for sure. what I don't know if its possible to have the same classes in those packages tho
icy shadow
#

It's usually 1 : 1

#

main/java/myapp.package.classes.ClassName
test/java/myapp.package.classes.ClassNameTest

broken elbow
#

yeah but you can't have the exact same class right? That's what I'm saying

#

I know for test classes you usually want to append Test at the end

#

but I'm just asking

#

bcz I'm curious

#

and can't test rn

icy shadow
#

Yeah no they can't have the same fully qualified name

formal crane
#

So i am trying to delete a row in sql with the following code:

public void removeReward(String reward, String playerUUID, String table) {
        try {
            PreparedStatement ps2 = plugin.SQL.getConnection().prepareStatement("DELETE REWARD FROM " + table + " WHERE UUID=?");
            ps2.setString(1, reward);
            ps2.setString(2, playerUUID);
            ps2.executeUpdate();
            return;
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }```
But when i try this i get this error: https://paste.helpch.at/upocagames.md

The layout of the table is the following:
#

Anyone that has an idea how to fix it?

kind granite
#

bruh

icy shadow
#

No need to shout.

kind granite
#

delete from not delete reward from

formal crane
#

same error

kind granite
#

also you seem to be both concatenating the sql string (yikes) and using a prepared statement

#

do the latter for both

formal crane
#

wait what

dense drift
#

You only have one ? and you set the uuid as 2nd argument

#

Currently you are looking for an entry with UUID = reward, not playerUUID

hoary citrus
#

How can I set a stairs facing direction?

#

in 1.8.8?

#

apparently

loc.getWorld().getBlockAt((int) x, (int) (y + 4), (int) z).setType(Material.QUARTZ_STAIRS);
        Block stairs = loc.getWorld().getBlockAt((int) x, (int) (y + 4), (int) z);
        Directional d = (Directional) stairs.getState().getData();
        d.setFacingDirection(BlockFace.SOUTH);
        stairs.getState().setData((MaterialData) d);``` doesnt work
lyric gyro
#

getState returns a new snapshot of the block data each time you call it

#

you need to put it in a variable, modify it and then call BlockState#update() when you're done

formal crane
hoary citrus
#
loc.getWorld().getBlockAt((int) x, (int) (y + 4), (int) z).setType(Material.QUARTZ_STAIRS);
        Block stairs = loc.getWorld().getBlockAt((int) x, (int) (y + 4), (int) z);
        Directional d = (Directional) stairs.getState().getData();
        d.setFacingDirection(BlockFace.WEST);
        BlockState bs = stairs.getState();
        bs.setData((MaterialData) d);
        bs.update();``` @lyric gyro so this?
lyric gyro
#

that looks about right yes

#

it can be tidied up a bit but that's the idea

patent zephyr
lyric gyro
#

api-version only takes into account major.minor versions, so you would use "1.18" instead of "1.18.2"

hoary citrus
#

now I gotta figure out how slabs work

#

and how to get them on the lower half of a block :)

lyric gyro
#

enjoy 1.8 OMEGALUL

dense drift
formal crane
#

ty

pearl topaz
#

any idea why i could be getting
Caused by: java.net.UnknownHostException: "127.0.0.1"

#

trying to connect to redis via jedis in java

#

redis.clients.jedis.exceptions.JedisConnectionException: Failed to create socket.

#
return new JedisPool(jedisPoolConfig,
                    redisData.get("address").toString(),
                    redisData.get("port").asInt(),
                    2000,
                    redisData.get("password").toString());
round sail
#

Anyone know if you can color a button in rich presence with a discord bot?

idle agate
#

how hard would It be to make a plugin that allows a person to put multiple commands into a command block

#

i would also have to learn java for this as i only know c#

dusky harness
#

i think

idle agate
#

thats interesting

#

what is the scope of what a plugin can do then

dusky harness
#

so

#

a plugin can modify pretty much everything server-side

#

but it can also use CustomModelData to also use resource packs

idle agate
#

i was thinking simpler than that where you can just separate them by &&

dusky harness
#

ah ic

#

oh then u can use a plugin

#

not sure how easy it'd be to move to java, but I know c# and java are very similar

idle agate
#

thats what ive heard

#

wheres a good place to get started learning how to make plugins?

dusky harness
idle agate
#

Nice

#

Thanks for the help!

dusky harness
# idle agate Nice

prob something like ```java
public class CommandListener extends Listener {
// [EventHandler]
@EventHandler // tells spigot that this is a listener method
private void onCommand(ServerCommandEvent event) {
if (!(event.getSender() instanceof BlockCommandSender)) {
// aka event.getSender().GetType() == typeOf(BlockCommandSender)
return;
}
List<String> commands = new ArrayList<String>();
// below: foreach (string command in event.getCommand().Split("&&"))
for (String command : event.getCommand().split("&&")) {
// loops through the command split by "&&"
commands.add(command.trim()); // remove any spaces around the command
}
if (commands.size < 2) {
return; // if there's only 1 command, just let it run normally
}
event.setCommand(commands.remove(0)); // set the command to the first command on the list
for (String command : commands) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command); // to the rest of the commands, run them in console
}
}
}

#

something like that

#

hopefully it's similar enough that you can understand

#

added c# versions in comments

lyric gyro
#

hey dkim

dusky harness
#

hi emily

lyric gyro
#

wanna see something really funny?

#

like really

dusky harness
#

uhhh sure πŸ‘€

lyric gyro
dusky harness
#

oh-

lyric gyro
#

hilarious right?

#

holy shit

#

that was amazing

#

okay

#

you hate me

dusky harness
#

no i dont

#

im just

lyric gyro
#

yes

dusky harness
#

i dont know

#

wait

#

why

lyric gyro
#

indeed

#

Not configuration help

dusky harness
#

that is correct

#

but what are we developing

#

πŸ€–

#

help

#

im confused now πŸ˜–

lyric gyro
dusky harness
#

oh

lyric gyro
#

not configuration, right?

dusky harness
#

nonono

#

not configuration

#

i hope

lyric gyro
#

okay good

dusky harness
#

I didn't know what we were developing and so now I don't need help πŸ˜ƒ

#

πŸŽ‰

#

πŸ₯³

#

πŸͺ…

lyric gyro
#

:Warning: :Warning: :Warning: :Warning: :Warning:

#

:Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning:

dusky harness
#

Uh

#

do you need help

dusky harness
lyric gyro
#

How does one fix a 406 error code for a GET request

#

406 Not Acceptable: " "

leaden sinew
#

Remove the space

lyric gyro
#

from where lol

leaden sinew
#

I have no clue

#

Can you post your code?

lyric gyro
#
    private inline fun <reified T> makeRequest(url: String, t: T?): T? {
        val headers = org.springframework.http.HttpHeaders()

        headers.contentType = MediaType.APPLICATION_JSON
        headers.accept = Collections.singletonList(MediaType.APPLICATION_JSON)

        headers.setBasicAuth("a", ACCESS_KEY)
        val entity = HttpEntity<T>(headers)

        return restTemplate.exchange("$BASE_URL/$url", HttpMethod.GET, entity, T::class.java).body
    }```
#

thats making the request and then I call it with

#
 val party = makeRequest("parties/$sisId".trim(), JobReadyParty(-1, "-1")) ?: return LocalDate.MIN```
leaden sinew
#

Does the request contain a " "?

lyric gyro
#

dont think so....

leaden sinew
#

Can you use a debugger to see the exact request or sout?

idle agate
#

Thanks

turbid plank
#

Can you recommend me some command manager library/framework ?

surreal lynx
#

?mf

neat pierBOT
turbid plank
#

Thank you!

idle agate
#

do you need a specific java jdk for different minecraft versions or does the latest always work?

inner jolt
#

although i think paper requires java 11

grim oasis
#

^

idle agate
#

hmmm

grim oasis
#

different plugins will also need newer java versions

idle agate
#

my server runs on magma forge

grim oasis
#

deluxemenus also needs java 11 I believe

idle agate
#

do those require 11 minimum or strictly 11

grim oasis
#

minimum

idle agate
#

oh alright ill just use 18

#

thank you

inner jolt
#

πŸ‘

idle agate
#
@Override
    public void onEnable()
    {
        
    }
``` would this still be called a method in java
#

also ```
@Override

#

i get its an annotation but what does it do

#

alright i read about it and im still confused lmao

inner jolt
inner jolt
idle agate
#

lmao

#

simple enough

#

thanks

inner jolt
#

yeah i'm not sure how much detail you wanted

#

feel free to do more research on it, there are probably a ton of people that can explain it better than i can

idle agate
#

no thats what I was looking for just a simple explanation and if i get confused with it later ill be able to ask a more specific question

inner jolt
#

Alright πŸ‘

idle agate
#
[23:56:48 ERROR]: Could not load 'plugins\Multi Commands.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/JohnZ/Multi/Command/MultiCommand has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:318) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:222) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:616) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]
Caused by: java.lang.UnsupportedClassVersionError: com/JohnZ/Multi/Command/MultiCommand has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 52.0
``` It seems theres some version incompatibility here
inner jolt
#

You compiled your plugin in a higher java version than your server runs, so your server can't run the code

idle agate
#

ahh damn

#

i fixed it thank you

inner jolt
#

awesome!

#

i'd recommend looking up your error messages on something like the spigot forums before taking them to this server because someone's probably had the same issue before

idle agate
#

ya lmao but discord is just so easy

#

ill try to keep them off here though

#

but i do have a good question

#
public class CommandListener implements Listener {
    @EventHandler
    private void onCommand(ServerCommandEvent event) {
        getServer().getConsoleSender().sendMessage(ChatColor.BLUE + "command is sent");

    }
}
#

this code should send a message in the console every time a non player sends a command

#

but its not

#

what am i doing wrong here

inner jolt
#

did you register it in the config.yml

#

are you setting the command executor in the main class

#

are you sure that the plugin is enabled on your server

#

there are a lot of things that could be going wrong

idle agate
#

ya i just realized that

#

im just gonna watch a video lmao

inner jolt
#

alright, soujnds good

idle agate
#

and boom

#

I did it!

#

multiple commands can go into a command block now

#

and I learned the basics of plugin development

inner jolt
#

Awesome!!!

#

good luck on your journey

idle agate
#

alright so there is an issue with my plugin

#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
#

i use this code

#

to run all the commands after the commandblock executes the first command

#

but the problem is that line sends the command through the console and I need both commands to be sent through the command block

#

because both the commands I need depend on locations

#

one is a setblock command

#

the other gives currency to the player closest to the command block

warm steppe
#

Is it possible to change how org.bukkit.command.Command#testPermission() works?

#

Using a plugin*

sterile hinge
#

sounds like an xy problem to me

fiery pollen
#
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot</artifactId>
  <version>1.18.1-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>```
I am using this in maven to get acces to nms but whenever when i reload maven i get the error ``Cannot resolve org.spigotmc:spigot:1.18.1-R0.1-snapshot``
prisma briar
#

Oh, you're trying to use NMS?

fiery pollen
#

yeah

prisma briar
#

Have you run the build tools?

fiery pollen
#

Oh, not yet. I forgot

#

thank you

prisma briar
#

np

patent zephyr
#

So, I would like to use an API of a plugin, but the repository and dependency is there only for Gradle. I tried to translate it to the maven, unfortunetly doesnt work. Can someone give me some advice about this topic please?

neon wren
pulsar ferry
#

Just split the dependency by : first is group id, then artifact id, then version

pulsar ferry
idle agate
#

I am wondering if there a way to get the coordinates of where the command block executed the command from bc that might solve the issue

#

Also if there is a way to find the closest player to where the command was executed from

#

I could solve my issue with one of these

#

If I can find the coords I could also calculate the closest player

prisma briar
#

You need to define the location yourself.

patent zephyr
patent zephyr
void orchid
# idle agate I am wondering if there a way to get the coordinates of where the command block ...

You can cast the sender to BlockCommandSender if you're certain that the command was sent from a command block. You can ensure that it's sent by a command block by utilizing the instanceof feature, like this:

  // if the sender was not a command block, don't continue
  if (!(sender instanceof BlockCommandSender)) {
      return;
  }

  final BlockCommandSender commandBlockSender = (BlockCommandSender) sender;
  // do your thing here...
pearl topaz
#

if I have an interface where I specify a variable like

interface MyLogger {
    val redisPool: JedisPool
    val loggerName: String
    fun serialise(): String
    fun updateRedis() {
        redisPool.platform.use {
            redis -> redis.set(loggerName, serialise())
        }
    }
}

and then in my class that implements my interface I do

public class BooleanLogger(override val loggerName, override val redisPool): MyLogger {
    // ...
}```
#

however, when I pull an object from a Map<String, MyLogger> and try use the redisPool, I get null returned on the getter generated

#

despite initialising this logger with a non null value

#

I'm wondering if it's something to do with the override, or like it's still trying to get it from the interface or something

#

maybe it's because the method inside the interface is using it, but it's not declared until it's inside the class. is there a way around that?

leaden sinew
round sail
lyric gyro
warm steppe
#

replace default permission message?

lyric gyro
#

There's a config for that in paper.yml :P

#
  no-permission: '&cI''m sorry, but you do not have permission to perform this command.
    Please contact the server administrators if you believe that this is in error.'
#

Should be at the veeeeeery top

ocean raptor
reef belfry
#

Hey can anyone help me with this, I am trying to run the "restart" command. But this kinda defeats the purpose of a restart command

https://imgur.com/Mi2MMAG

proud pebble
#

or atleast i think thats the right place

reef belfry
#

Okay

somber gale
#

@kind granite The expansion has a few - at least for me - questionable design choices.

First: Optionals (Ewwwww). Really don't see a benefit over a simple if (something == null) check.
Second: the split.length >= 2 can be replaces with either split.length > 1 or split.length = 2 because your usage of params.split("_", 2) guarantees that the array won't be larger than 2.

Not sure how much better it would be in terms of performance, but maybe have the LocalExpansionManager instance cached or smth?

Like smth such as

private LocalExpansionManagarer expansionManager = null;

// All the other stuff

public String onRequest(final OfflinePlayer player, @NotNull String params) {
    if (expansionManager == null) {
        expansionManager = PlaceholderAPIPlugin.getInstance().getLocalExpansionManager();
    }

    // Check again for null? Idk for sure...

    return // stuff
}
#

Also, I would return null when split is 1

#

Because PAPI doesn't allow %identifier% placeholders

#

Maybe like this? Idk... Just trying around a bit

lyric gyro
#

why is using optional a questionable design choice? πŸ€”

somber gale
#

Many people say it's a bad option performance wise

lyric gyro
#

lol it's really not

somber gale
#

Even Sponge devs had a huge debate about if they should remove it or not

#

JDA devs also mention it's bad

lyric gyro
#

I don't think it should be used everywhere but it definitely does have its place

somber gale
#

And they know their java

lyric gyro
#

JDA is hot garbage

#

it allows for more expressive code instead of "oh I have to stop here and check for null" every two lines

#

and unless you're running some really hot code all the time, the performance impact is truly negligible anyway

#

like.. 99% of what one does in java already

leaden sinew
#

Optional can be pretty nice in some places, other places not so much

lyric gyro
#

Kotlin's null safety is one of the things they really nailed it well

#

It's not as intrusive as an Optional can be sometimes but it's also far from being as disgusting as null can be sometimes too

leaden sinew
#

I honestly don’t mind nulls as long as methods are annotated properly

onyx kayak
#

null safety chaining in kotlin is really nice

#

i've only really used optionals when its cleaner to chain with it and then fallback on a default

lyric gyro
#

thing is that j.u.Opt is really.... poor, and is not really used in the jdk so there isn't even an incentive to use it

#

Scala's Option is embraced in the stdlib (and any other scala lib, lol) and it's feature packed (+ the way you can do some stuff in Scala makes it much pleasant to use than in java)

idle agate
wintry grove
lyric gyro
#

Do you use paperweight or md5's broken maven plugin?

dusky harness
#

Does java.io.Serializable need to be implemented in classes that are as a variable in another class that implements Serializable?

ex java public class Data implements Serializable { private OtherData other; }would OtherData have to also implement Serializable?

leaden sinew
#

Why are you using Serializable?

dusky harness
#

helping someone else with data files and don't want to introduce importing a library and stuff

lyric gyro
#

yes

dusky harness
#

and so spigot tutorial says to use Serializable :))

#

should i just use gson

lyric gyro
#

"it depends"

lyric gyro
dusky harness
#

but ill wait for you emily πŸ‘€

#

oh

dusky harness
lyric gyro
#

skull

dusky harness
#

😭

#

idk how i didn't notice that

lyric gyro
# lyric gyro "it depends"

Serializable is a good simple example (without libraries (besides the jdk)) that you can make data out of an object and the other way around, but a) it's not human readable data (it's just an array of bytes) and b) it's not a really good method for large things (that's why it's good for simple examples showing "hey you can do this" (though it also has its use cases but it's quite niche))

dusky harness
#

hm

lyric gyro
#

But like then you can just throw gson and do the same thing anyway

dusky harness
#

true

and it'd be human readable
and without implementing serializable

lyric gyro
#

throw the object into the serializer and it'll give you the thing

wintry grove
#

sorry for late

atomic trail
#

What would be the best way to set up a folder called something like "classes" that contains an basically unlimited amount of yaml files, one file for every class

graceful hedge
#

Define/specify best πŸ˜…

#

It’s to some extent quite subjective

atomic trail
#

Is there some way of updating specific parts of a GUI using TriupmhGUI instead of clearing it and updating it all every time? It seems a bit bad performance-wise

#

Kinda confused why this would store the GUI every time I close it. Because when I reopen it, it says shows the lore one more time if that makes sense https://paste.helpch.at/itukadufin.cs

tight junco
#

to update an item in the gui

#

iirc

#

you have to do gui#setItem and then gui#update

#

but just make sure you're not setting the same values every time

atomic trail
#

I suppose I could use updateItem? Just found it

dusty frost
#

might be worth looking into what updateItem does

#

as if you're doing bulk updates, it might update every single time, when in reality you could do all the setItems and then do one update

atomic trail
#

Hmm not sure what it does tbh, it seems like it keeps track of the guiItems for some reason?

dusty frost
#

looks like it has a copy of the gui and the actual inventory

#

this would be a good question for @pulsar ferry, whether doing a bunch of setItems then one update is better, or a bunch of updateItems. Possibly could be quite similar in terms of performance

atomic trail
#

I think just storing the GUI and then using gui.update() in the end would fix the issues, but yeah not sure about performance then

#

It still loads everything multiple times for some reason

dusty frost
#

that is quite weird

atomic trail
dusty frost
#

are you modifying the GuiItem?

atomic trail
#

I use this but that's really all ```java
public static void setItem(Gui gui, ItemStack item, int slot, GuiAction<InventoryClickEvent> action) {
GuiItem guiItem = ItemBuilder.from(item).asGuiItem(action);
gui.setItem(slot, guiItem);
}

dusty frost
#

are you making a new ItemStack every time?

#

as it should override with a completely new one, unless you're like appending to the lore or something

atomic trail
#

I get it from another class, then append the lore, which is probably the issue

                ItemStack item = kit.getUnlockedItem().getA();
                ItemMeta meta = item.getItemMeta();
                List<Component> lore = meta.lore();

                lore.add(Component.text("Current tier: " + tier.toString()));
                lore.add(Component.text("Next tier: " + nextTier.toString()));
                lore.add(Component.text("Left click to select - Right click to upgrade"));

                meta.lore(lore);
                meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                item.lore(lore);
dusty frost
#

yeah it's absolutely the issue

atomic trail
#

So I need to clear the lore firstly

dusty frost
#

just wipe hte lore

#

yes

#

πŸ‘€

atomic trail
#

lol

#

No idea why I used this List<Component> lore = meta.lore();

slow folio
#

I am having a problem trying to get CraftBukkit on 1.18.1, I tried to use build tools but it doesn't make a craft bukkit jar. Is there a solution to use NMS in 1.18.1 I need to use packets for block breaking play stage.

somber cloak
#

Hello, each time i try to get my main class to read the Listener class i get this error 'Listener' is abstract and cannot be instantiated.
My listener class is named Creeperexplode.

slow folio
#

Show your project

#

Folder

dusty frost
#

and you're doing new CreeperExplode?

slow folio
#

And both registering line

#

and listener class

dusty frost
#

and it's in a file named CreeperExplode?

somber cloak
slow folio
#

@hoary scarab

#

can I post in a pastebin

#

It's too bigf

#

big

hoary scarab
#

DM me and discord wil .txt it

slow folio
#

There if you trust it

#

oh yeah okay

hoary scarab
#

Does spigot have a method, list or other of blocks (materials) that have physics? Don't want to make a list if one already exists.

sterile hinge
#

all blocks can be falling, therefore it wouldn't make much sense to have a list of blocks that are falling by default

hoary scarab
hoary scarab
#

Kinda vague description but I'll see if it includes all the materials I need.

#

Thank you.

lyric gyro
#

hmm it would be cool if Mojang made that a tagstar_thonk

hoary scarab
#
for(Material mat : Material.values())
    if(mat.hasGravity() && mat.isBlock()) ConsoleOutput.debug(mat.name());
hoary scarab
#
[DEBUG] SAND
[DEBUG] RED_SAND
[DEBUG] GRAVEL
[DEBUG] DRAGON_EGG
[DEBUG] ANVIL
[DEBUG] CHIPPED_ANVIL
[DEBUG] DAMAGED_ANVIL
[DEBUG] WHITE_CONCRETE_POWDER
[DEBUG] ORANGE_CONCRETE_POWDER
[DEBUG] MAGENTA_CONCRETE_POWDER
[DEBUG] LIGHT_BLUE_CONCRETE_POWDER
[DEBUG] YELLOW_CONCRETE_POWDER
[DEBUG] LIME_CONCRETE_POWDER
[DEBUG] PINK_CONCRETE_POWDER
[DEBUG] GRAY_CONCRETE_POWDER
[DEBUG] LIGHT_GRAY_CONCRETE_POWDER
[DEBUG] CYAN_CONCRETE_POWDER
[DEBUG] PURPLE_CONCRETE_POWDER
[DEBUG] BLUE_CONCRETE_POWDER
[DEBUG] BROWN_CONCRETE_POWDER
[DEBUG] GREEN_CONCRETE_POWDER
[DEBUG] RED_CONCRETE_POWDER
[DEBUG] BLACK_CONCRETE_POWDER
[DEBUG] BlockList >> Size: 23
lyric gyro
#

yeah well those are blocks that have gravity

#

as the name of the function suggests lol

hoary scarab
#

I know. I'm telling MasterOfTheFish its not what I need.

lyric gyro
#

so what you need is to know if a block type requires a "support" block, is that what you mean?

hoary scarab
#

basically

lyric gyro
#

hmm I vaguely remember seeing a function that tells you that... might be internals

hoary scarab
#

Yeah not finding anything other then making my own list.

barren ore
#

I have a plugin with custom drops from stone and from what i've searched online the only way to block the drop of cobblestone is to cancel the event and set the block to air, however doing this cancels the sound of the block being broken for other players around you. Anyone know a way around this so people around you can still hear you breaking the block?

dusty frost
#

Not sure what version you're on, but on 1.18 you can do BlockBreakEvent#setDropItems(false) to stop it from dropping the default items

somber cloak
#

So im tryna make it so that all zombies have sharp 5 netherite swords but i don't know which enchantment it is, is it DAMAGE_ALL?

worn jasper
#

does this seem like a good structure?

high edge
#

Friend
Friends

#

Why tho

#

data.friends.friends

worn jasper
#

The idea behind Friend and Friends is that Friends returns a list of Friends and is also used to modify that list.

#

while Friend contains one single person and their permissions

#

unsure if that even makes sense xD

icy shadow
#

Friends return a list of Friends
The fact that this sentence is ambiguous already shows that you have a problem with naming

#

Friend & FriendList, problem solved

worn jasper
#

fair

#

besides naming, does it make any sense? lol

icy shadow
#

i mean i have no idea if the actual code makes sense

#

but sure i guess

#

not a massive fan of the {something}s naming scheme tbh

#

feels like it could be improved

worn jasper
#

Ye me neither, I was just stupidly dumb and didn't think about FriendList

icy shadow
#

same with Upgrades

#

and maybe Permissions

#

it's not entirely obvious what the classes are doing

worn jasper
#

should probably name them like FriendPermissions and GenUpgradeList

#

would that sound better?

#

"sound" I meant be better lol

icy shadow
#

much better

worn jasper
#

This is a list of the constructors of all of them:

Friend(UUID friend, FriendPerms perms)
FriendPerms(boolean upgrade, boolean sell, boolean addFriends, boolean place, boolean remove) {
Generator(String type, Location location, UUID owner, GenUpgradeList upgrades, FriendList friends)
GenUpgradeList(int speed, int dropQuantity, double sellMultiplier)
#

hopefully it gives you a bit of the idea behind it

icy shadow
#

see that doesnt seem like it's an UpgradeList

#

wheres the List part?

worn jasper
#

I mean, true, it's meant to be all the upgrade levels a generator has

#

so list would probably be a bad naming too

#

GenUpgradeLevels?

icy shadow
#

seems more accurate

#

honestly just be as specific as possible

#

that's generally a good rule

worn jasper
#

makes sense

#

uh also is the logic behind the whole system a good way of doing it?

#

(Asking mainly because it's actually the first time I am trying to go for a more organized environment using different classes instead of having everything above in one single class)

high edge
#

Scuze me

worn jasper
#

I feel bad about it too cat_cry

lyric gyro
#

ok

worn jasper
fiery pollen
#

I'm trying to get a BiomeSettingsGeneration var but when i try to get it i am getting some issues:
BiomeSettingsGeneration.a gen = (new BiomeSettingsGeneration.a()).a();
Its saying "Cannot resolve symbol 'a' (the first a after BiomeSettingsGeneration).
When i look in the decompiled class from nms it obviously shows a static class, am i doing something wrong?

worn jasper
#

did you try removing that .a? (honestly don't know, lol let me do some research)

fiery pollen
#

I'll show the class

#

I need the static a class from BiomeSettingsGeneration

worn jasper
#

what are you trying to use this for?

#

I suppose create a custom biome or so?

fiery pollen
#

Updating a plugin for custom fog in a biome

worn jasper
#

this might help?

#

fixed link

fiery pollen
#

Hmm, i'll take a look at it

#

Yeah, that was in the code before

#

But i am updating it to 1.18

worn jasper
#

oh ok

fiery pollen
#

And WorldGenSurfaceComposites doesn't exist anymore

worn jasper
#

I legit can't find anything about BiomeSettingsGeneration in 1.18

fiery pollen
worn jasper
#

Can't even find it in the javadocs

fiery pollen
#

Are there javadocs for nms?

worn jasper
#

oh wait ye

#

forgot that

fiery pollen
#

xD

worn jasper
#

TBH no idea, I know that IrisDimensions has custom color skies, etc. Maybe contact the devs and ask them? Or just wait until someone here has an answer, sadly can't help

ocean raptor
worn jasper
lyric gyro
#

It sure does

#

you just gotta pick the right mappings

worn jasper
fiery pollen
worn jasper
worn jasper
#

any way to hide this?

slow folio
#

Does anyone one know how to work with Protocol Lib?

#

I have a question about some packets.

dense drift
worn jasper
#

oh ye I am stupid, thx

dense drift
#

Ask away @slow folio

lyric gyro
#

please help me and ping me after

kind granite
#

your config is wrong

#

@lyric gyro

lyric gyro
kind granite
#

oh yeah that too

lyric gyro
#

whats wrong

#

the channel you asked in

icy shadow
#

yeah no favourite IDE arguments please

#

come on guys

dense drift
dusky harness
icy shadow
#

shut it

#

please

kind granite
#

favo**U**rite

dusky harness
#

yes sir

icy shadow
#

good

dusty frost
dusky harness
#

ah i remember

#

when i tried netbeans

#

😌

icy shadow
dusky harness
#

so

dusty frost
#

make sure to tell me one one line

dusky harness
#

i stopped

dusty frost
#

can't see more than one at a time

icy shadow
#

ed sheeran

dusky harness
#

hello

icy shadow
#

what do you mean ed sheeran?

#

why are you confused

dense drift
icy shadow
#

yes why is he asking a question

#

it is not a good question to ask

#

i dont know what he is asking

#

elaborate NOW dkim

dusky harness
#

can I delete my message

icy shadow
#

no you can not

dusky harness
#

can I edit my message

dusty frost
#

pisses me off

icy shadow
#

you can elaborate on your question

icy shadow
dusty frost
#

😠

icy shadow
#

come on dkim i dont have all day

dusky harness
#

uh

#

I think

#

you should work on your computer science coursework πŸ˜ƒ

icy shadow
#

yes thats a good idea

dusky harness
#

good luck on it

icy shadow
#

maybe you should stop distracting me by asking about random things like ed sheeran

#

thanks

dusky harness
#

sorry

#

ill stop talking now

#

cya

icy shadow
#

yeah youd better be sorry

kind granite
#

ed sheeran

#

more like ed sheeran my ears off

sleek walrus
#

Does someone know... Is there a way where i can allow Players only to break their own placed blocks ?

dusky harness
#

or are you trying to code one

sleek walrus
#

Do you know one ?

#

No im just starting developing but i need one

dusky harness
#

if you're trying to look for an existing one, I'd suggest #general-plugins since this channel is for coding help

sleek walrus
#

Oh thanks and sry

dusky harness
#

and np

slow folio
#

I have a basic system setup so far

#
prisonCore.getProtocolManager().addPacketListener(new PacketAdapter(prisonCore, ListenerPriority.NORMAL, PacketType.Play.Client.BLOCK_DIG) {
                @Override
                public void onPacketReceiving(PacketEvent event) {
                    PacketContainer packet = event.getPacket();
                    EnumWrappers.PlayerDigType digType = packet.getPlayerDigTypes().getValues().get(0);

                    if(digType == EnumWrappers.PlayerDigType.START_DESTROY_BLOCK){
                        //Start task, call begin event,
                    } else if(digType == EnumWrappers.PlayerDigType.ABORT_DESTROY_BLOCK){
                        //Cancel task, save block break state.
                    } else if(digType == EnumWrappers.PlayerDigType.STOP_DESTROY_BLOCK){
                        //Cancel task, Remove block break state from map, call end event.
                    }

                    System.out.println("DigType: " + digType.name());
                }
            });
#

Which I am still thinking about in my head and may work, would be to simulate the whole breaking process if they are using a tool with a persistent variable (using PersistentDataContainer). The process would be able to be run on a timer, where I can decide the time intervals between each break animation progression. This way, I could calculate the time (in ticks) from a few variables: the amount of time the vanilla item we are modifying takes to break the block (for diamond pickaxe on stone it would be 0.3 seconds), and the multiplier that I want to add onto that time (an example could be 1, this would add 1 * 0.3 to the original, 0.3 resulting in 0.6, doubling the speed the item breaks blocks). I would send a block animation packet every tick (so when people right click it the breaking texture doesn't go away) in which the player is actively trying to break the block. Of course, I would kill the runnable when the player stops breaking the block in any way shape or form.

slow folio
#

Any clue?

#

testBreakTask1 is null

#

Oh I know what it is

snow siren
wintry grove
dusky harness
wintry grove
#

a sec let me check

#

no I dont

#

do I add it?

dusky harness
wintry grove
#

oh but I'm using groovy DSL, will that be ok or will I have to do something else?

dusky harness
#

maybe like tasks.reobfJar

#

idk

wintry grove
#

> Could not get unknown property 'reObfJar' for task ':assemble' of type org.gradle.api.DefaultTask. well

dusky harness
dusty frost
#

not the groovy

#

πŸ’€

wintry grove
#

wait how exactly

#

nvm it was because its reobfJar

#

not reObfJar

dusty frost
#

classic

#

that's cause reobfuscate is one word

wintry grove
#

the error

#

this is how I did the task thing:

tasks.assemble {
    dependsOn(reobfJar)
}
#

probs wrong

lyric gyro
#

how are you building the plugin? what are you doing exactly?

dusky harness
#

u need to remove compileOnly spigot

#

and u need to compileOnly ProtocolLib

lyric gyro
#

πŸ₯΄

dusky harness
#

also thats 3 different dependency formats right there πŸ₯²

dusky harness
#

or does groovy need something different (in this one it's paperweightDevelopmentBundle)?

lyric gyro
dusky harness
#

ah

wintry grove
#

you mean paper? lmao

dusky harness
#

mb

#

lol

wintry grove
#

lmao

#

alright

#

it didnt work

#

same fucking error

#

I'll just rework the NPC code

#

that was what was causing the error

lyric gyro
#

@wintry grove can you answer my question lmao

wintry grove
#

sorry

#

using the included build task

lyric gyro
#

yes, don't do that

wintry grove
#

oh

lyric gyro
#

run reobfJar only and use the non -dev jar

wintry grove
#

alright

#
Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_18_R1/entity/CraftPlayer
        at com.starl0stgaming.lostworlds.commands.SpawnNPCCommand.onCommand(SpawnNPCCommand.java:29) ~[lostworlds-0.0.1-ALPHA.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        ... 21 more
#

crap

#

and it also included protocollib on the .jar lmao

wintry grove
#

Β―_(ツ)_/Β―

lyric gyro
#

that looks okay

wintry grove
#

not so okay

lyric gyro
#

can you show your new build script?

wintry grove
#

sure

lyric gyro
#

hm

#

have you tried doing a clean build?

wintry grove
lyric gyro
#

first run clean, then reobfJar again

snow siren
wintry grove
#

but havent tested the npc code

slow folio
#

Hello

#

Does anyone know anything about protocol lib?

west socket
#

Anyone have an idea on why this might be happening?

LivingEntity shooter = ((LivingEntity) npc.getEntity());
                        shooter.launchProjectile(Arrow.class);```

Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.entity.CraftArrow cannot be cast to org.bukkit.entity.LivingEntity```

#

Very strange

slow folio
#

bruh

#

it’s not very strange

#

the arrow isn’t a living entity

#

it’s a entity

#

but not a living one

west socket
#

Im not casting it

#

Im casting npc

#

And its saying I

#

m trying to cast the arrow

slow folio
#

that’s not what you get from that

#

you get the projectile

west socket
#

From NPC?

slow folio
#

Look at what the values return in the event

#

or npc

#

doesn’t matter

west socket
#

That would be super odd if npc was returning an arrow

slow folio
#

npc is nms made

west socket
#

no

slow folio
#

meaning it’s not a living entity

#

it’s a client side packet

west socket
#

Its a CitizensAPI npc

slow folio
#

it’s still bums

#

nms*

#

auto correct

west socket
#

I still fail to see how this means its returning an arrow

slow folio
#

Not sure either

#

Show the npc class

west socket
#

Ill show you the constructor

#
public class ZombieBoss extends PitBoss {
    public NPC npc;
    public Player entity;
    public Player target;
    public String name = "&c&lZombie Boss";
    SubLevel subLevel = SubLevel.ZOMBIE_CAVE;

    public ZombieBoss(Player target) throws Exception {
        super(target);
        this.target = target;

        npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, name);
        entity = (Player) npc.getEntity();


        CitizensNavigator navigator = (CitizensNavigator) npc.getNavigator();
        navigator.getDefaultParameters()
                .attackDelayTicks(10)
                .attackRange(10)
                .updatePathRate(5)
                .speed(2);

        npc.setProtected(false);

        skin("zombie");
        spawn();
        BossManager.bosses.put(npc, this);
    }```
slow folio
#

what’s the npc class type

#

ZombieBoss?

west socket
#

Well thats just a class I make it in

slow folio
#

oh

#

what’s the npc class

#

like what’s it’s values

west socket
#

Its still NPC type, extends Player though

slow folio
#

just show the npc class

#

just show what it’s values are

west socket
#

You mean the CitizensAPI NPC class?

slow folio
#

yes

west socket
#

1s

slow folio
#

okay

west socket
#

The only thing I can possibly think of is that when I launch a projectile from the NPC, the entity object temporarily is replaced with the arrow (???), since the arrow still actually fires with no issues

#

Nope, its not

#

Ill probably just end up suppressing the error

slow folio
#

it returns a entity

#

why do you need the living entity

#

cant you just use entity

crystal otter
#

how do i compile a jr from a zip file

#

jar

slow folio
#

watch a tutorial

#

I want to change the mining speed so the intervals between the stages in the block break stages and break the block when it hits 10 ( resets ). But I want to save the block break stage to that block for 30 seconds if they stop mining it and that deletes by itself so we don’t need to handle that. so i made a hash map that has a block and block break data class i made, this block data class just contains the entity id, the block type ( I change it to stone once they hit the 10th stage ( reset ). the task that’s ran for the block stages ( it counts by ticks and the stages go by ticks which i’ll make a formula to determine that number of ticks per stage. )

#

This is all done using the ItemHeldEvent

#

With a few packets inside from protocol lib

#

such as

#

Block break packet

#

Player Dig packet

sand ermine
#

question, what event in bungee is called when a player connects

pulsar ferry
#

Maybe ServerConnectEvent

flat anchor
#

U will need interact with nms code, so ye

slow folio
#

That won't work

#

Because I need to alter the block state after they mine it

#

And if they stop mining it

worn jasper
#

could I use pdc on a player to store data instead of storing things in a file?

#

like serialize stuff, turn it into base64 and store it with pdc in a player

worn jasper
prisma briar
#

Of course it's good

restive isle
#
package com.test;

import com.mojang.authlib.GameProfile;
import javafx.beans.property.Property;
import net.minecraft.server.v1_16_R3.EntityPlayer;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;

import java.util.UUID;

public class corpseentity {
    public static void execute(Player player){
        EntityPlayer craftplayer = ((CraftPlayer)player).getHandle();

        Property textures = (Property) craftplayer.getProfile().getProperties().get("textures").toArray()[0];
        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), player.getName());
        gameProfile.getProperties().put("textures", new com.mojang.authlib.properties.Property("textures", textures.getValue(), textures.**getSignature**));
    }
}

why doesnt getSignature not work here? (markt with stars to make more clear)

lyric gyro
#

import javafx.beans.property.Property;
uhm are you sure this is the correct type of Property class?

restive isle
lyric gyro
#

authlib one

restive isle
#

ty

restive isle
lyric gyro
#

it's literally right there lol

restive isle
#

oh lol

#

still doesnt work though

#

oh nvm

#

forgot caps lol

bitter lark
restive isle
#

shut

#
EntityPlayer corpse = new EntityPlayer(
             ((CraftServer) Bukkit.getServer()).getServer(),
             ((CraftWorld)player.getWorld()).getHandle(),
             gameProfile);

imports:
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.minecraft.server.v1_16_R3.EntityPlayer;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_16_R3.CraftServer;
import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;

error =
'EntityPlayer(net.minecraft.server.v1_16_R3.MinecraftServer, net.minecraft.server.v1_16_R3.WorldServer, com.mojang.authlib.GameProfile, net.minecraft.server.v1_16_R3.PlayerInteractManager)' in 'net.minecraft.server.v1_16_R3.EntityPlayer' cannot be applied to '(net.minecraft.server.v1_16_R3.DedicatedServer, net.minecraft.server.v1_16_R3.WorldServer, com.mojang.authlib.GameProfile)'

what did i do wrong?

night ice
# restive isle shut

There is a 4th parameter PlayerInteractManager that need to be passed to the EntityPlayer Constructor, thats what the error means…

warm steppe
#

also the error literally shows the problem

lyric gyro
#

yo
i have a bug on my server
where even if keep inventroy is set to false
players are keeping their inventories when they die
any plugin you think overrides this?

keen quarry
#

Yoo! I changed from Eclipse to IntelliJ IDEA and when i imported my project to it i get a lot of "might be null" and "null check" warnings... Anyone know how i can get rid of them without changing a lot of code. Or should i just leave the warnings?

lyric gyro
#

I mean the warnings are there for a reason

#

"this may fail", take caution then

keen quarry
#

I know... So you say that i should check if everything is null?

lyric gyro
#

myes

#

Unless like you are 100% certain it won't be null

#

then you can slap a @SupressWarnings on the method, but generally you should consider those kinds of warnings

keen quarry
#

Yeah alright

#

I also get this: Condition 'sender instanceof Player' is redundant and can be replaced with a null check
What should i do about this

#

Don't really understand it

lyric gyro
#

it means that it already knows it's a Player if sender is not null (null is not an instance of anything) so you can replace that with a null-check instead (I don't know the exact context of that warning so I can't really say anything else on how you'd go about doing that exactly without seeing contextual code)

keen quarry
#

Because i have always used if(sender instanceof Player) in eclipse

leaden sinew
keen quarry
#

Ohh yeah, that got rid of the warning

#

Thanks for the help!

leaden sinew
#

No problem

west socket
#

Sorry to bother you guys, but does anyone have an idea as to why these potion effects arent being added?

public static void moveWither(Player player) {
        Wither wither = withers.get(player);
        wither.setCustomName(ChatColor.translateAlternateColorCodes('&', messages.get(player)));
        double health = wither.getMaxHealth() * progress.get(player);
        wither.setHealth(health);

        wither.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20 * 60, 1, true, false));
        wither.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 20 * 60, 1, true, false));
        Location location = player.getTargetBlock((HashSet<Byte>) null, 5).getLocation();
        wither.teleport(location.add(0, 3, 0));
        Bukkit.broadcastMessage(wither.getActivePotionEffects() + "");
    }```
#

I run this every 5 ticks, and the broadcast always returns empty

dusty frost
#

probably have to like apply it or something

#

ah, addPotionEffect returns a boolean indicating whether the effect could be added

west socket
#

Ah

#

Let me check that

#

Hmm?

#

Its returning true

#

But the Effect isn't being applied

#

No errors either

#

I think the issue is that there are somehow 2 PotionEffect classes under the same package

#

One with a sixth boolean variable, and one without

#

The issue though is I can't choose that one since they literally have the same package

#

Idk how thats even possible

latent pier
west socket
#

That looks like a resource pack issue

latent pier
#

you mean that the resource pack is deciding that all the heads should looks like the first img instead of the normal player_heads right?

west socket
#

Yeah

sand ermine
#

[02:25:11 WARN]: Error dispatching event ServerConnectEvent(player=SquareWings928, target=BungeeServerInfo(name=Hub-01, socketAddress=/136.243.134.184:25566, restricted=false), reason=JOIN_PROXY, request=net.md_5.bungee.api.ServerConnectRequest@7d9dadb5, cancelled=false) to listener me.squarecodes.events.ServerEvents@28a9494b
java.lang.NullPointerException: Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null

#

Line 43.

player.sendMessage(new TextComponent("Β§c[S] Β§4" + p.getName() + " Β§7has joined Β§c" + p.getServer().getInfo().getName()));
#

Whole event (

    @EventHandler
    public void onProxyJoin(ServerConnectEvent e) {
        if (e.getReason().equals(ServerConnectEvent.Reason.JOIN_PROXY)) {
            ProxiedPlayer p = e.getPlayer();
            if (e.getPlayer().hasPermission("bungeeutils.staff")) {
                for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
                    if (player.hasPermission("bungeeutils.staff")) {

                        player.sendMessage(new TextComponent("Β§c[S] Β§4" + p.getName() + " Β§7has joined Β§c" + p.getServer().getInfo().getName()));
                    }
                }
            }


        } else {
            return;
        }

    }
```)
#

Should i instead do

#

ServerInfo server = e.getTarget();

#

and then server.getName()

#

Yeah okay answered my own question

lyric gyro
#

can wither bosses even have potion effects?

leaden sinew
leaden sinew
#

I would probably use packets for it if possible, or you can use the adventure API I think

west socket
#

Yeah

#

I cba to debug packet args for 2 hours

leaden sinew
#

But if you want to do it this way, you could use LivingEntity#setInvisible and cancel entity damage for it

west socket
#

And adventure API is buggy

lyric gyro
#

adventure isn't buggy lmao

leaden sinew
#

Yeah I haven't heard of it being buggy

west socket
#

The Boss bar was for me

leaden sinew
#

MiniMessage with its breaking changes on the other hand...

lyric gyro
#

it's used by literally hundreds of developers across hundreds of hundreds of projects

west socket
#

Must have had an old version then

#

Either way I don't believe that method exists

leaden sinew
#

What method?

west socket
#

No, the setInvisible method is not available for the version I'm using

#

I'm just trying to figure out why I cannot set a PotionEffect

leaden sinew
#

Oh, try setVisible

west socket
#

Nope.

west socket
#

Oh Interesting

#

Hmm

west socket
#

Trying to think how else I would do this

#

1.8.8

leaden sinew
#

Oh

#

Well

lyric gyro
#

man just use adventure

west socket
#

I think I actually was using it at one point

#

The repo died or something though

lyric gyro
#

it's in maven central so it most definitely didn't lol

leaden sinew
#

Either use Adventure or packets

west socket
#

Must have been using some other fork then lol

leaden sinew
#

Or use a newer version

west socket
#

Yeah I'll give adventure another shot

#

Thanks for the help

leaden sinew
#

No problem

nova sparrow
#

Anyone knows how to create a placeholder that can be clicked via chat using javascript?

#

I'm creating a placeholder which then being called whenever a command is being executed. However, I need to create pages which calls another command to be executed upon clicking.

edgy wedge
winged pebble
patent zephyr
#

is there any way, of using my custom itemstack rather than material?

edgy wedge
winged pebble
patent zephyr
winged pebble
#

You'd have to setup a listener and all that to test for the recipe yourself

patent zephyr
#

ok

pure crater
#

You could use ExactChoice if you just want to match itemstack but not amount

#

iirc

winged pebble
#

Yeah that's correct

#

Because the logic uses isSimilar()

nova sparrow
keen quarry
#

How can i check if a string is null? Because after i switched to intellij from eclipse i got alot of Argument 'Main.getPlugin().langManager.getConfig().getString("prefix")' might be null warnings

#

The quick fix for it is to do Objects.requireNonNull() but i don't know if i should do that or not

leaden sinew
#

if (string == null)

leaden sinew
keen quarry
#

Uhh okay

#

If i do this i still get the warning ```java
if (!(Main.getPlugin().langManager.getConfig().getString("prefix") == null)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&'
, Main.getPlugin().langManager.getConfig().getString("prefix")));
}

#

Or do i need to this first String noCommand = Main.getPlugin().langManager.getConfig().getString("noCommand");

#

and then this ```java
if (!(noCommand == null)) sender.sendMessage(ChatColor.translateAlternateColorCodes('&', noCommand));

leaden sinew
#

Yeah do that

#

Except

#

if (noCommand != null)

keen quarry
#

Ohh yeah

#

But to get a string to be null. Does it need to be like stringHere: ""

leaden sinew
#

You can do stringHere = null

keen quarry
#

Okay

keen quarry
#

Do i need the toString() in Player targetPlayer = Bukkit.getPlayer(args[0].toString());?

broken elbow
#

ugh. what is the args? if its an array of string then no

keen quarry
#

Yeah okay, It is an array of string

pulsar ferry
#

Which IDE are you using? IntelliJ should tell you that you didn't need the toString()

high edge
#

Even eclipse tells you that no?

broken elbow
#

maybe

#

we don't know. we have forgotten the old ways

keen quarry
#

Yeah, i switched to intellij yesterday from eclipse and i got A LOT of warnings

broken elbow
#

:))

pulsar ferry
keen quarry
#

Is it possible to use an API that needs to be installed into the plugin folder without putting it into the plugins folder. But instead somehow put it in the java/maven project? I think i read something about that last week

pulsar ferry
#

Like, you want to shade a library?

#

Like put it inside your own jar so it's not needed to be present as a separate plugin?

keen quarry
#

Uhh i dont really know...

pulsar ferry
#

It depends on the library, you don't want to do that with things like PAPI, ProtocolLib, etc
But most others you'd shade it

keen quarry
#

Hmm okay, why should you not do it?

pulsar ferry
#

Because they are already provided as separate plugins

#

They aren't much of libraries but access points for you to hook into the plugin that already is there

keen quarry
#

Yeah okay

#

Well, if i ask this instead... Do i need some kind of API to be able to open up a "remote" anvil and crafting table? Because i have only found stuff about opening chest inventories

pulsar ferry
#

You can definitely do it without any library, but it's much easier if you use one, those should definitely be shaded into the plugin

keen quarry
#

Alright

haughty sapphire
#

When my plugin turn on I get this warn:
[21:18:18 WARN]: Nag author(s): '' of '' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
I know this isn't an error but how can I fix it anyways?

pulsar ferry
#

Yes, don't use println for logging, use the Plugin's logger

haughty sapphire
#

any examples?

pulsar ferry
#

plugin.getLogger().info("Hello!") or if colors are important you'd use the console sender

haughty sapphire
#

ok fine thanks

hazy nimbus
pulsar ferry
#

Only on Paper servers iirc

hoary scarab
lyric gyro
#

You mean that… terminals that can't render colors… can't render colors?

broken elbow
#

no

#

I mean it

pulsar ferry
#

Shocked

dusty frost
#

πŸ₯΄

hoary scarab
#

I feel like you're reading the message wrong lol. Matt implied colors only worked on paper. I said color only works on consoles (terminals) that support colored text.

dense drift
#

iirc windows cmd shows colors on some paper versions but not on 1.8 spigot for instance

hoary scarab
#

I thought paper only recently started adding colorcodes to their logger?

lyric gyro
#

From what I know paper has supported ANSI formatting for longer than Spigot

hoary scarab
#

I mean like to the text itsself not additional.

#

Like for example you can use color codes in logger but spigot defaults its text to white.(Of the default of the system font)

lyric gyro
#

what

broken elbow
#

yesssss

slate crater
#

Hello yes I am trying to access new discord servers but I run into a verification problem where it tells me an existing account is already using my phone number.

neat pierBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

lyric gyro
#

Sir this is Wendy's

slate crater
#

wtf this is a minecraft discord

dense drift
#

on spigot colors are displayed as [3;something or what the format is

#

or at least they used to

lyric gyro
#

the fucking log files

#

full of that shit lmao

dense drift
#

πŸ₯²

hoary scarab
# lyric gyro what

Like for example if you start a spigot server all text will be white (or default color) with paper only the logs will be white but everything else will have color. Info has yellow warning has red etc... (Not talking about messages added by plugins)

lyric gyro
#

oh that uh I thought spigot handled that to?

hoary scarab
spiral prairie
#

wtf is this shit? i have a library bundling all that, i dont need repositories for that when the lib is bundling it either way, do I?

sand ermine
#

How would be the best way to ban a player from a bungee plug-in? Is there anyway i can dispatch a spigot command?

neon wren
#

Get a Bungee based ban plugin, where it'd be universal if that's what you need.

#

Use the built-in ban commands for a individual server, or get a plugin to manage your bans.

wintry grove
lyric gyro
#

KannaSip try refreshing your project dependencies i guess cuz internals are on R2 (gradlew dependencies --refresh-dependencies will do)

wintry grove
#

alright

lyric gyro
#

or depending on the actual version you're using

#

you're trying to run on 1.18.2, i don't know if you're depending on 1.18.1 or .2

wintry grove
#

oh that explains it

lyric gyro
#

mhm that would do it

wintry grove
#

> Could not find io.papermc.paper:dev-bundle:1.18.2-R0.1.

#

hmmm

#

oh nvm its working

slim vortex
#

Is there a good efficient way to serialize an inventory, send it over redis, and deserialize it back into its exact place on the same player that switched servers?

dusty frost
#

I would use that for inspiration if you intend to make your own

#

JSON or binary serialization is probably your best bet

slim vortex
#

Thanks

nova sparrow
#

Hi, anyone encountered the chats being shown as [[playername]] everytime they use the command /reply, /r, /whisper, and /w ? It's some sort of a spy. Already disabled most of the permissions but still showing on OP players.

terse kelp
#

Hello, when I compile the code I get this weird error and don't really understand what I'm doing wrong. Help!

broken elbow
#

typical maven

shell moon
#

Event called when block is exploded by explosion (tnt or creeper)?

terse kelp
#

I fixed it

restive isle
#

Im working on SignGUI over 10 hours and everything i find is outdated or doesnt work. I basicly want to make it so you have a shop and you can set the title of that shop by clicking on a button and a sign will pop up where you can type something in and then make it so the title will be what the players shop name will; be what he typed in the sign. Does annyone have any expiriences with this or wants to help me with this? you can dm me.

fathom kestrel
#

Hello, my code here isn't working, I have reviewed a lot of resources and can't figure out why it doesn't work.

        plugin = this;
        NamespacedKey glowkey = (new NamespacedKey(this, "glow"));

        this.getServer().getPluginManager().registerEvents(glow, this );
        ItemStack glowitem = new ItemStack(Material.BOOK, 1);
        ItemMeta glowmeta = glowitem.getItemMeta();
        PersistentDataContainer glowdata = glowmeta.getPersistentDataContainer();
        glowmeta.setDisplayName("Β§d");
        glowdata.set(glowkey, PersistentDataType.STRING, "glow");
        glowitem.setItemMeta(glowmeta);
        NamespacedKey glowrecipekey = new NamespacedKey(this, "glowrecipekey");
        ShapedRecipe glowrecipe = new ShapedRecipe(glowrecipekey, glowitem);
        glowrecipe.shape("EEE", "ECE", "EEE");
        glowrecipe.setIngredient('E', Material.GOLD_BLOCK);
        glowrecipe.setIngredient('W', Material.GLOW_BERRIES);
        glowrecipe.setIngredient('G', Material.GOLDEN_CARROT);
        glowrecipe.setIngredient('C', Material.BOOK);
        Bukkit.addRecipe(glowrecipe);
high edge
#

And what exactly doesn't work?

fathom kestrel
#

I put the items into that pattern in the crafting table and nothing is the output

lyric gyro
#

/papi ecloud download Player doesnt work for me
pls help me I need it
Am running 1.16.5
PaperMC

modest tiger
#

Hi, I'm looking for a developer for a paid Java Spigot 1.18 plugin development job

hushed badge
modest tiger
#

Thanks

molten wagon
#

Is it a method to get cooking time for x item (or is it same for every item)? for example coal ore.
And also for exp is it method to get default exp? I only find #result()

slim vortex
#

Has anybody experimented with dynamic memory class loading from a web server instead of transpiling to a jar? it’s usually used to prevent cracking a plugin

sterile hinge
#

it means the data is still transferred to the user at some point. If someone wants to "crack" it, they'll still do so

slim vortex
#

Yeah it doesn’t actually stop it

#

It just makes it a lot harder

#

Requires dumping the contents of memory which isn’t hard if you know what you’re doing but a larger number of people don’t know how

lyric gyro
#

EntityExplodeEvent?

shell moon
#

waht about BlockExplodeEvent, also?

lyric gyro
#

that is for when blocks themselves explode

#

like beds in nether/end or the respawn anchor

shell moon
lyric gyro
#

what

tight junco
#

Anyone able to explain why the fuck the display on a tipped arrow is fucky wucky

lyric gyro
#

"the display"?

tight junco
#

hold

icy shadow
#

"arrow"?

tight junco
#

the arrow has speed 2 for 5s but on the item itself it shows as 0?

lyric gyro
#

because bukkit sucks ass

tight junco
#

spigot bug?

#

nope minecraft bug

#

minecraft:tipped_arrow{CustomPotionEffects:[{Id:1,Duration:100,Amplifier:1}]}

broken elbow
#

what's the bug

lyric gyro
#

is that even how you apply effects to tipped arrows..?

dense drift
#

Looks like it is

tight junco
#

The effects are active

#

like if you shoot something with the arrow, they will get the effect

icy shadow
#

why does it say uncraftable

tight junco
#

i believe that's the base name for tipped arrows

dense drift
#

Probably if the effect doesnt have the vanilla values it will say that

lyric gyro
#

if the nbt tag.Potion is unset

The default value is "minecraft:empty", which gives it the "Uncraftable" name.

fathom kestrel
#

so I'm getting this error ```
java.lang.NullPointerException: Cannot read field "glowkey" because "me.nrgking.imbuements.ImbuementsMain.glow" is null
at me.nrgking.imbuements.Imbuements.Glow.<init>(Glow.java:25) ~[?:?]
at me.nrgking.imbuements.ImbuementsMain.onEnable(ImbuementsMain.java:27) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:517) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:431) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:612) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:414) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:263) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1007) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3468-Spigot-ffceeae-d53c4fb]
at java.lang.Thread.run(Thread.java:833) [?:?]


my main class is
#

    private static ImbuementsMain plugin;

    public static Glow glow;

    @Override
    public void onEnable() {
        plugin = this;
        NamespacedKey glowkey = (new NamespacedKey(this, "glow"));

        this.getServer().getPluginManager().registerEvents(new Glow(), this );
        ItemStack glowitem = new ItemStack(Material.BOOK, 1);
        ItemMeta glowmeta = glowitem.getItemMeta();
        PersistentDataContainer glowdata = glowmeta.getPersistentDataContainer();
        glowmeta.setDisplayName("Β§dGlowing Spellbook");
        glowdata.set(glowkey, PersistentDataType.STRING, "glow");
        glowitem.setItemMeta(glowmeta);
        NamespacedKey glowrecipekey = new NamespacedKey(this, "glowrecipekey");
        ShapedRecipe glowrecipe = new ShapedRecipe(glowrecipekey, glowitem);
        glowrecipe.shape("EEE", "ECE", "EEE");
        glowrecipe.setIngredient('E', Material.GOLD_BLOCK);
        glowrecipe.setIngredient('W', Material.GLOW_BERRIES);
        glowrecipe.setIngredient('G', Material.GOLDEN_CARROT);
        glowrecipe.setIngredient('C', Material.BOOK);
        Bukkit.addRecipe(glowrecipe);


    }

    public static ImbuementsMain getPlugin(){
        return plugin;
    }
#

my other class is ```java
NamespacedKey glowkey = ImbuementsMain.glow.glowkey;

@EventHandler
public void GlowHit(EntityDamageByEntityEvent e) {
    if (e.getDamager() instanceof Player) {
        Player player = (Player) e.getDamager();
        if (e.getEntity() instanceof Player); {
            LivingEntity victim = (LivingEntity) e.getEntity();

            ItemStack item = player.getEquipment().getItemInMainHand();

            PersistentDataContainer data = item.getItemMeta().getPersistentDataContainer();


            if (data.has(glowkey, PersistentDataType.STRING)) {
                victim.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 600, 1));
            }
        }
    }
}

@EventHandler
public void GlowInteract(EntityInteractEvent e) {
    if (e.getEntity() instanceof Player) {
        Player player = (Player) e.getEntity();
            ItemStack item = player.getEquipment().getItemInMainHand();
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer data = meta.getPersistentDataContainer();

            ItemStack item2 = player.getEquipment().getItemInOffHand();
            PersistentDataContainer data2 = item2.getItemMeta().getPersistentDataContainer();

            if (data2.has(glowkey, PersistentDataType.STRING) && item.equals(Material.DIAMOND_SWORD)) {
                data.set(glowkey, PersistentDataType.STRING, "glow");

                item.setItemMeta(meta);

                player.sendMessage(ChatColor.LIGHT_PURPLE + "Your weapon glows with an ethereal light.");
            }
    }
}
dusty frost
#

NamespacedKey glowkey = ImbuementsMain.glow.glowkey;
You don't assign that to the property in your main class ever

fathom kestrel
#

wdym?

dusty frost
#

in your onEnable, this.glowkey = glowkey

lyric gyro
#

@tight junco actually the bug isn't that it displays the wrong duration, the bug is that it applies the wrong duration from the CustomPotionEffects πŸ₯΄

tight junco
lyric gyro
#

The duration applied should be an 8th of the duration specified, it displays it correctly but it applies the effect without reducing it lmao

crisp robin
#

hey so i just started using spigot and i have a basic knowledge about java, anyways so i was trying to make a cooldown for my "FeedCommand", but i was getting this error!
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.HashMap.get(Object)" is null at me.cqveman.learning_everything.commands.FeedCommand.onCommand(FeedCommand.java:32) ~[?:?]

neat pierBOT
#
πŸ“‹ Your paste: cqveman
https://paste.helpch.at/hajoqikupi

A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.

crisp robin
#

im a beginner so plz explain

tight junco
#

you need to check if the player's UUID is in the map after line 32

#

because timeElapsed == null

#

also strange messages but aight

crisp robin
#

as i said im a beginner..

tight junco
#

d;Map#containsKey

uneven lanternBOT
#
boolean containsKey(Object key)
throws ClassCastException, NullPointerException```
Description:

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Parameters:

key - key whose presence in this map is to be tested

Throws:

ClassCastException - if the key is of an inappropriate type for this map (optional)
NullPointerException - if the specified key is null and this map does not permit null keys (optional)

Returns:

true if this map contains a mapping for the specified key

crisp robin
#

great, now i have no idea wtf should i do

#

PERFECT

tight junco
#

im not gonna spoonfeed you CB_fingerguns

crisp robin
#

dude

#

ugh

#

can u atleast explain

#

in a better way

#

please...

crisp robin
#

so true

icy shadow
#

ay bro that message is almost 2 years old

#

did u really have to ping lmao

crisp robin
#

o ya

#

sry man

icy shadow
#

np

crisp robin
#

hey uhm