#help-development

1 messages · Page 1914 of 1

tardy delta
#

maybe something to make myself :kekw:

young knoll
#

I think that is his equals()

tardy delta
#

thats what im doing kekw

spiral light
#

wow xD

tardy delta
#

shall i count that?

#
public static boolean equals(Object... args) {
        Validate.isTrue(args.length % 2 == 0);
        for (int i = 0; i < args.length - 1;) {
            if (!args[i].equals(args[i++])) return false;
        }
        return true;
    }```
spiral light
#

static equals O.o i would rename it

grim ice
#

wont u need to override it

tardy delta
#

i dont know if it would work

quiet ice
#

myeh, it's fine

#

You can call it via ClassName.equals

tardy delta
#

im making like an utility method instead of doing stuff like this

spiral light
#

its fine but the name is already used

quiet ice
#

See Objects.equals

spiral light
#

what about "isSame" ?

#

or "isEqaul"

quiet ice
#

equals is perfectly fine

tardy delta
quiet ice
#

I wanted to say that it is perfectly legal to name your method like that

tardy delta
#

lemme try to run that code

tender shard
tardy delta
#

it works i guess

#

yea im doing weird things sometimes even though i like it

young knoll
#

It’s a nice little convenience method

#

Even if it is jank

tardy delta
#

it works 👀

hasty prawn
#

Why does it only accept an even number of args

spiral light
#

why is that red omg

#

my eyes

tardy delta
#

because its supposed to work with pairs

hasty prawn
#

Ah

tardy delta
#

equals(loc1, loc2, world1, world2) like that

#

😔

hasty prawn
#

I see

tardy delta
#

i think its ++i smh

smoky oak
#

intellij.
How do i make this spit out the actual documentation again?

tender shard
smoky oak
#

ye

tender shard
#

press shift twice

#

and then

#

oh wait

#

I thought it's here but it isnt

#

one sec

smoky oak
#

pressing shift twice doesnt do that

tender shard
#

check this

#

go to any bukkit file (decompiled)

#

then at the top "Download Sources"

#

or just

#

pres sshift twice

#

enter "Download Sources"

#

then choose "Sources AND documentation"

#

idk if it works for spigot, but it should work for spigot-api

smoky oak
#

thanks that did it

tardy delta
#

i see alot of utils

smoky oak
#

i needed to click on 'edit sources' tho to get that bar at the top

tardy delta
#

cant you ctrl click it?

pseudo shore
#

How can i build my plugin without maven or gradle?

smoky oak
#

i can but the bllue bar with 'download sources' doesnt show up that way

tender shard
tender shard
#

that's like asking "how can I fly a plane without altimeter, navigation and autopilot"

young knoll
#

Flying it isn’t hard

#

Landing might be

tender shard
quaint mantle
lavish hemlock
#

I could walk you down the complicated path of manually compiling shit with javac but you don't want to do that.

#

And I don't want to do that either.

pseudo shore
#

i didnt want to mean that

spiral light
#

well you can easy modify the result of creating it with that template O.o

visual tide
#

or just like

spiral light
#

you just need to know what the pom is if your using maven template

visual tide
#

modify one line in your pom.xml or build.gradle 😐

strange patrol
#

Because the newest version does support 1.18

red sedge
#

How do I

lavish hemlock
red sedge
#

get the direction of a block on a blockplaceevnet

lavish hemlock
#

How do you?

red sedge
pseudo shore
#

How can i implement JDA with maven?

vocal cloud
#

By adding it as a dependency

lime wave
#

hi!

#

so

#

if i have that:

red sedge
lime wave
lime wave
strange patrol
#

just use SlimefunItems.class

vocal cloud
#

Okay why did you want to do that

lime wave
#

i am editing slimefun items to be in portuguese brazil

#

this is in english, but when i traduce i want to know what to do

tardy delta
strange patrol
#

You need to download the entire slimefun peoject, then edit the file and compile it again I guess

vocal cloud
#

Are they not open source?

strange patrol
#

They are

vocal cloud
#

Lmfao

lime wave
#

ye

vocal cloud
#

Just change the source then compile the whole project

tardy delta
#

870 lines smh

vocal cloud
#

You can't compile 1 class file

lime wave
#

ohh

tardy delta
#

look at what's inside 😳

vocal cloud
#

With all those depends

tardy delta
#

it scares me

lime wave
#

ok so

#

what i do

vocal cloud
tardy delta
#

is it worser?

vocal cloud
lime wave
#

step by step

#

how i build the project

#

;-;

#

i am new with that

quaint mantle
#

and maven?

strange patrol
quaint mantle
#

is this what it feels like to mod?

vocal cloud
#

Yes

quaint mantle
#

what is this BUS thing?

vocal cloud
#

Event bus

tardy delta
#

ai ai ai

quaint mantle
#

wow

lime wave
quaint mantle
#

the only part I understand from this line of code FMLCommonSetupEvent is F my life

#

daannnnnnnngggggg

#

and what does this 500 lines of code do?

tardy delta
vocal cloud
# quaint mantle the only part I understand from this line of code ```FMLCommonSetupEvent``` is F...
GitHub

Contribute to MikeTheShadow/VoluminousEnergy development by creating an account on GitHub.

#

I added a tonne of comments to help tho

quaint mantle
#

omg

#

ur pretty good at code game

vocal cloud
#

I'm pretty mediocre

quaint mantle
#

there are ppl better???

#

geeeeeeeeeeeeeeez

lime wave
#

pt-br

vocal cloud
#

The people who made forge are way better for example

quaint mantle
#

ok... @vocal cloud how did you learn modding? I want to

lime wave
#

portuguese brazilian

tardy delta
lime wave
#

português brasileiro

lime wave
tardy delta
#

idk

vocal cloud
quaint mantle
#

dang

lime wave
#

to use intelliJ i need a licence?

quaint mantle
#

any good resources that could help me learn modding?

quaint mantle
#

the community edition is free

spiral light
undone axleBOT
vocal cloud
vocal cloud
spiral light
# lime wave to use intelliJ i need a licence?

well... some countrys?(maybe all) like germany have something thats called "Github student" .... with that you get a lot shit that is to expensive for students for free (as long as you go to school/university)

vocal cloud
#

I mean use community you're just changing a few lines of text to Portuguese then compiling

#

Not like you need flight recorder or any of the more powerful tools

vocal cloud
#

? That's what the guys doing

true vault
#
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <encoding>UTF-8</encoding>
    </properties>```
#

fixed 🔨

visual tide
#

what do vanish plugins do when the allow you to access chests? like your velocity is like in spectator and your hands dont show but you cant go thru walls

tardy delta
#

they actually put you in spectator

spiral light
#

or invisibility effect ^^

tardy delta
#

thats why most of them dont allow you to edit the chest

#

then you would have the chest open effect but yea

spiral light
#

you can cancel the normal open of a chest ^^

#

or dont allow sending those packets

visual tide
#

youre kinda in spectator but you cant actually go thru walls

#

which is weird af

spiral light
#

example ?

tardy delta
#

i should take a look at the sourcecode

spiral light
#

if you "bug" when trying to go in walls its mostly spectator mode but in a special way

visual tide
#

you dont like lag back

#

its like youre in creative or survuval

#

the wall's just solid

spiral light
#

do you can see your hearts ?

visual tide
#

no

#

the ui is like in gmsp

#

but you cant go through walls

#

its super weird

#

try it

tardy delta
#

not all vanish plugins tho

#

i made my own so i cant speak xd

visual tide
#

supervanish does it

quiet ice
#

I know this is a really stupid question, but what method works like #giveExp but also takes mending in account

spiral light
#

spawn exp-entity on player location 🤡

quiet ice
#

I know that there is a dedicated method for this, but I cannot seem to find it

But perhaps I was looking at the paper javadocs, that would explain it...

obsidian tree
#

I created a Multi-module Maven project, and I'm using remapped-mojang. When I try to invoke a method which includes remapped-mojang things from different module, I am getting error like:
cannot access net.minecraft.advancements.AdvancementFrameType

incompatible types: net.minecraft.advancements.FrameType cannot be converted to net.minecraft.advancements.AdvancementFrameType

tardy delta
#

it returns if youre in spectator so i guess you're not in spectator

#

same with some other things

#

however for some things it seems that you enter spectator

spiral light
#

maybe just packet to send player in spectator

tardy delta
#

i dont get any wiser of it lets just take a nap

topaz sinew
#

Is there a dev build of Protocollib for 1.18 available on maven?

topaz sinew
#

Will that work with 1.18?

quaint mantle
#

yes

topaz sinew
#

Aight thanks

lucid root
#

Hello i Play in a spigot server and Many farms doesnt work how i can fix it

mortal hare
#

is there any way in spigot to load world folder without using external plugins

#

i can tp to other world via execute command but im searching for a way to load it

#

i just don't want to use multiverse

quiet ice
#

The bukkit API should have a way to do that

mortal hare
#

yeah but i don't want to create hardcoded plugin just for this

proven river
#

Inside an Inventory holder class how do I access the player, for example if I wanted to get their playtime in a lore?

quiet ice
#

Though datapacks might be able to do it, but that'd be the same as vanilla

quaint mantle
proven river
#

Yea I do already but from that I wouldnt be able to set the lore or not?

quaint mantle
#

what do you mean by "set the lore"?

proven river
#

well exactly what it is, setting the lore

#

the description bellow and item

quaint mantle
#

of an item

#

ok

proven river
#

but with their playtime

#

So an event wouldnt rlly work for it

quaint mantle
#

Do you mean a player inventory

#

I don't get what you are trying to do exactly

#

Maybe im just dumb :D

proven river
#

Okay okay,

#

So

#

In an event you can do
e.getPlayer

and from that get all of the players things for example their playtime
but in an InventoryHolder class you cant do that

#

hope that clears it up

#

I want to access the player

quaint mantle
#

when do you want to access the player

#

If you look at the inventory holder interface, is just has 1 method: "Inventory getInventory();"

#

there is no way of getting the player no

#

Construct a gui based on player stats, and then open it

proven river
quaint mantle
#

you need to pass the information of the player who opened the inventory somewhere.

#

how does one open that inventory

#

through a command?

proven river
#

yes

quaint mantle
#

cool

proven river
#

Everything are in separate classes

#

GUI's
Command's
Event Handler's

quaint mantle
#

You will have to create the items from the inventory when the player runs the command, not before. when the command happens, you pass the player who ran the command to the init function.

#

then you can do whatever you want with it

proven river
#

hm okay I have no idea how to go about it but I'll figure smthn out

proven river
#

oki

quaint mantle
#

what I have:

@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
openYourInventory((Player)sender);
}```
#

of course you need to check if its a player and that stuff

rapid vigil
#

Hello, quick question, a HashMap like this: Map<String, ItemStack[]> map = new HashMap<>(); can possibly cause a memory leak?

ivory sleet
#

nope

#

not inherently

rapid vigil
ivory sleet
#

Though, with that being said, I still recommend encapsulating ItemStack[] into its own class as it gives you more control over the code 😛

rapid vigil
ivory sleet
#

well

#

generally

#

if an object allows mutability

#

which means the state of the object can be changed

#

for instance:

class Obj {
  int i = 1;
}
#

can be considered mutable

#

since we can change the value of i

#

in this case, it is generally not safe to use Obj as a key for a map such as Map<Obj,ItemStack[]>

#

now in this case it is, as you get yourself an identity hashmap implementation

#

this is why we always use Vector::clone, or Location::clone when putting it as a key into a map (namely, Map<Vector,V> or Map<Location,V>)

rapid vigil
#

Damn thanks for the great explaination

ivory sleet
#

anyways the general idea is that, once an object has been put into a map as a key, the hashCode() of that object must NOT change

#

and since String is immutable, they are fine as keys

rapid vigil
#

Now I know why Player in a HashMap causes memory leaks sometimes

ivory sleet
#

yeah

#

Well, using UUID as the key is better in every possible way

rapid vigil
#

So saving UUIDs instead of Player in a HashMap cannot cause memory leaks?

ivory sleet
#

I mean generally speaking

sullen marlin
ivory sleet
# rapid vigil So saving UUIDs instead of Player in a HashMap cannot cause memory leaks?

memory leaks mean that you have some object which:

  1. Cannot be enqueued to garbage collection since it has some strong reference to it
  2. However you cannot manage this strong reference on demand (for instance if some array contains this object in the HashMap but there is no way of fetching it from your side)

Edit: the object is simply unreachable for garbage collection, and is unreachable for you, thus it just floats around in memory purposelessly.

chrome beacon
#

Oh hi poreyy :)

ivory sleet
#

Hello Olivo

#

(:

chrome beacon
#

Hi :)

rapid vigil
rapid vigil
#

Long time no see

ivory sleet
#

Well conversely, Java is incredibly slick when it comes to figuring out what objects can be enqueued for garbage collection. Anyhow, use a profiler maybe (to detect memory leaks)?

chrome beacon
#

Yeah it's been a while

rapid vigil
rapid vigil
chrome beacon
#

That's good

rapid vigil
#

Last time I said that and I was still so bad but now believe me

chrome beacon
#

I've been learning Minecrafts codec system today

ivory sleet
#

dataupperfixer?

chrome beacon
#

Yeah

ivory sleet
#

I tried understanding it before, quite advanced ngl

#

or well lets say, overly functional

chrome beacon
#

I've only just started so far it's looking quite neat

rapid vigil
chrome beacon
ivory sleet
#

Yeah Olivo, if you know some basic ideas of category theory it will make it a lot more understandable btw

sullen marlin
#

Lol

#

Very is an understatement

ivory sleet
#

🥲

mystic terrace
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

young knoll
#

What’s a good default size for a connection pool

onyx fjord
#

In MySQL?

young knoll
#

Yes

sullen marlin
#

1 million

onyx fjord
#

What's the default one

sullen marlin
#

more threads are better, dont you know

young knoll
#

10

#

Well the default for HikariCP is 10 anyway

sullen marlin
#

stick with it then

#

its default for a reason

young knoll
#

Fair enough

alpine urchin
#

md5

#

fan meetup wen

#

post covid spigot party

#

we need

prime reef
#

question: how are CommandExecutors handled internally?

#

e.g. if I've got
command and
command subcommand, and I enter command subcommand, will it be processed as command with "subcommand" as an argument, or?

ivory sleet
#

yep

woeful crescent
#

what's the difference between FileConfiguation.set and FileConfiguration.createSection

#

like can't I just use .set(path, myMap) and that would be the same as createSection

prime reef
charred echo
#

is there some tool to see all packets sent from the server to the client

granite raptor
#

Hello I am having a problem with skript. I am making a rank paper which when right clicked on gives you a rank but the rank papers name is &7&lIron Rank Paper so when I put:
on rightclick holding a "&7&lIron Rank Paper" as a event it says error even without the " so I don't know how to make it work. Here is all the code :
on rightclick holding a "&7&lIron Rank Paper":
if player doesn't have the permission "iron.rank":
execute console command "/lp user %player% parent add iron"
remove 1 "&7&lIron Rank Paper" from the inventory of the player
if player has the permission "iron.rank":
send "&4You already claimed this rank" to player

young knoll
#

Ask in the skript discord

granite raptor
#

Can't find it

young knoll
#

It’s like the first google result for “skript discord”

topaz sinew
#

Hi, I want to edit the major positive gossip when opening a villager trade menu using Protocollib but I can't seem to work out how to do it/which packet to listen for. I made this work a few version ago with nms but wanted to use protocollib as it seemed to promise cleaner/more understandable code.
Does somebody know how I can do this?

prime reef
#

lmao command's "set permission" method returns void for some reason

#

everything else returns the command for chaining

granite burrow
#

Whats the best way to check if a sign is on a block?
And get the block that the sign is on

#

I saw this but it doesn't work from what ive seen

Sign s = (Sign) block.getState().getData();
Block attachedBlock = b.getRelative(s.getAttachedFace());
hot warren
#

Bumping, would like to know if it's possible to have a full automatic release from GitHub

woeful crescent
#

Yes

#

It's called github actions

hot warren
#

yep but I havent seen any spigotmc github acitons

woeful crescent
#

?

#

Wait wdym by upload a spigot plugin jar

#

like to the spigot website?

hot warren
#

yep

woeful crescent
#

alr

#

so you'd have to make a github workflow that used upload-artifact

hot warren
#

If it doesn't exist, that'd be a nice project to do

woeful crescent
#

then set your spigot download to the link to that workflow (https://nightly.link is a good tool for this as users won't have to login to github)

#

bc you can refer to an external site I'm pretty sure

#

does that work?

young knoll
#

Yes

#

But it wouldn’t post a proper resource update

woeful crescent
#

You're right

#

hmmmmm

hot warren
#

Wow, thanks! I'll configure my GitHub Actions to upload there, didn't know people had to be logged in to download release/build artifacts!

woeful crescent
#

Idk

woeful crescent
#

Spigot API maybe?

#

i mean web api

hot warren
#

I bet you the Spigot API doesn't allow you to make a release

woeful crescent
#

there's a web api im pretty sure

hot warren
#

and I've scanned this discord and most of it is basic GETs

not anything that'd let you change the data

woeful crescent
#

rip

#

you COULD just link to the github

#

as the download link

#

link to the github releases page?

young knoll
#

Put full releases on spigot manually

#

And then link to dev builds in the description

#

On Jenkins or whatever

topaz sinew
#

Villager Gossip Protocollib

topaz sinew
#

Then use the blockface to get the block as you already did?

buoyant viper
#

if sign is sign, get block below sign

topaz sinew
#

Yeah

granite burrow
granite burrow
granite burrow
buoyant viper
#

oh then yeah block face

topaz sinew
granite burrow
#

says that it doesnt exist

topaz sinew
#

use org.bukkit.material.Sign instead of the org.bukkit.block.Sign interface (the Sign class is deprecated tho), or change it to Directional and use getFacing().getOppositeFace()

#

So it would be

org.bukkit.material.Sign s = (org.bukkit.material.Sign) block.getState().getData();
Block attachedBlock = block.getRelative(s.getAttachedFace());
// or
Directional s = (Directional) block.getState().getData();
Block attachedBlock = block.getRelative(s.getFacing().getOppositeFace());

granite burrow
#

org.bukkit.material.Sign is deperciated

vocal cloud
granite burrow
#

alright, im a still a bit confused so ima do more research and stuff

#

but this all kinda helps

vocal cloud
granite burrow
#

no, I wanna check if there is a specific block that the sign is on

#

I already have a check for if its a wall sign

#

I just need to find the block its on

vocal cloud
#

ah

scenic knoll
#

so i have a command class, smthn like this

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String testVar = args[1];
 }
#

how would i access “testvar” in a different class?

quaint mantle
#

Hi! How would I check if a player pressed shift while gliding?

#

I know how to do gliding, but idk if I can check if shift was pressed

scenic knoll
#

howww 🤕 im dum

undone axleBOT
quaint mantle
#
class A {
    private final B b;

    public A(B b) {
        this.b = b;
    }

    public void doSomething(String something) {
        b.doOtherThing(something);
    }
}

class B {
    public void doOtherThing(String something) {
        System.out.println(something);
    }
}
quaint mantle
scenic knoll
#

iii

#

hm

#

im trying to wrap my head around it lol

quaint mantle
#

you dont know that

#

then learn java

#

pass it as an argument is what you should understand when you're trying to make plugins, unless you jump into plugin development without any basic knowledge

#

you should stop doing that, at least must know some basic java first

#

?learnjava

undone axleBOT
buoyant viper
#

AMP, gross

quaint mantle
#

who

#

ghostpinged me

#

i dare you to do it again

sterile token
#

I think that learning how to use an api before the laguage concepts/basics is the worst thing a human can do

quaint mantle
#

if you know the basics, you can just grow from there (though it will still gonna be very slow), instead of starting with nothing in your head

river oracle
sterile token
#

Im not lying

#

Cuz first when I changed from programming minecraft script (The one for Skript plugin) I started directly using the apis of spigot and bungee. Without knlwing the basics of java etc

#

It was the worst thing I ever did

river oracle
sterile token
#

Are you crititing me?

#

Xd

#

Im too Young to be programming

#

Im just 15 years

river oracle
#

I started making basic scripts and stuff at 12 because why not 🤷‍♂️

sterile token
#

So imagine. When I was just 5 years I used scratch. Then when I was 7-8 started with Html, css and js

#

Dont ofuscate it

river oracle
#

Why bother 🤷‍♂️ unless your trying to hide something 😏

quaint mantle
#

evil

sterile token
#

Someone who want to deobfuscate will do it

quaint mantle
#

?obfuscator

#

?obfuscate

#

just obfuscating my static abuse 😈

#

?obfuscation

#

no cmd?

#

thats bad

sterile token
#

I explain all with this frase:

Every thing that can be read by computer can be read by human

quaint mantle
#

frase

sterile token
#

Im spanish its the fucked corrector

#

💩

quaint mantle
#

xD

sterile token
#

Dont use Spanish I have been muted before for that reason

#

In resume good obfuscation or decent one = pay/buy a good obfuscator like Allatori premium. Someone told me that he uses it to ofuscate premium resources and they never get deobfuscate up to know

#

Premium resources from mcm cuz spigot doesnt allow obfuscation 🤡

#

Idk why they dont allow obfuscation but i wont fight about their rules

quaint mantle
#

Hi! How would I check if a player pressed shift while gliding?

sterile token
#

I think you can check if player is shifting vía player object

vocal cloud
#

Give me an obfuscated jar and I'll send it back cracked for free uwu . (With permission of course)

sterile token
#

Yeah

#

Obfuscation its really ugly

#

You wont never have something not deobfuscable

vocal cloud
#

Don't need mappings

sterile token
#

That why I develop 1.8x plugkns

#

They never cause me problems

#

1.9 up =yeat

#

Cuz click time

#

Me too

#

Nice

#

Yeah dm me

#

I do r have problems

quaint mantle
#

monke evil

sterile token
#

Like said my father: for dyes (idk the word In English) you have colores

vocal cloud
#

1.18 never causes me issues and has better support

cold pawn
#

Can someone help me check this out and see if there’s a way I can fix this issue.

vocal cloud
glad bridge
#

So I'm attempting to build spigot via Jenkins, but I get an ssl error when attempting to build.
```ERROR: cannot verify hub.spigotmc.org's certificate, issued by /C=US/O=Cloudflare, Inc./CN=Cloudflare Inc RSA CA-2': Unable to locally verify the issuer's authority. ERROR: certificate common name spigotmc.org' doesn't match requested host name hub.spigotmc.org'. To connect to hub.spigotmc.org insecurely, use --no-check-certificate'.
Unable to establish SSL connection.

#

Will I be fine to just insecurely connect?

sullen marlin
#

Yes but idk what is up with your server or cloudflare

#

Worksforme

vocal cloud
#

works on my machine a tale as old as time

prime musk
#

When u need to add some comments to code to entertain yourself

quasi flint
vocal cloud
quasi flint
#

🏓

kind hatch
#

Is HikariCP supposed to take up about 250KB worth of space when compiled into a jar?

I’m using maven to import it and it just seems like a bit much. My jar goes from 432KB to 658KB.

quasi flint
#

Why that jar so massive

#

432 still huge boy

kind hatch
#

Oh shit sorry I meant KB not MB

kind hatch
#

Yea… but I want to keep it as low as possible. The limit for plugins is 4MB and even though I’m not even close to it right now (about 11%) I’d rather keep it low in the first place.

quaint mantle
kind hatch
# quaint mantle Cant you post an external link to the plugin download?

Maybe, I’d have to find somewhere to host versions. It might also break how my plugin updater works. It also adds that extra step of having to leave the site in the first place, which some users don’t like.

I’m not close the the 4MB limit, its just that I could easily reach 1.5MB quickly with what I want to add.

Also, all I’m using with Hikari is the DataSource class which I would hope isn’t 250KB.

quaint mantle
granite burrow
# granite burrow I just need to find the block its on

Alright I got it

        Block b = e.getClickedBlock();
        Sign sign = (Sign) b.getState();
        WallSign wallSign = (WallSign) b.getBlockData();
        BlockFace attached = wallSign.getFacing().getOppositeFace();
        Block attachedBlock = b.getRelative(attached);

For anyone who has the same issue

cerulean jasper
#

Can I use

Bukkit.getServer().getConsoleSender().sendMessage

in async task?

undone axleBOT
hasty prawn
#

?tas

chrome beacon
#

Or you know just use the Logger

#

Which you should be doing if you want console messages

smoky oak
#

If i only use Bukkit imports, does the resulting plugin work on every server? With plugin support i mean

#

and how is it with NMS imports?

quaint mantle
quaint mantle
#

after 1.18

#

because they used moj mappings now

quaint mantle
chrome beacon
#

And Minecraft still changes

quaint mantle
#

well, that is only if you dont change the shade plugin

#

i mean craftbukkit things still only on your computer only why dont you change the shade plugin 🙂

#

but like if that plugin is public then uhh okay then

#

and mojang mappings are compile-time only. Obfuscation at runtime may change as well

chrome beacon
#

^ was about to say

smoky oak
#

i meant

#

if i compile a plugin with only bukkit/nms imports

#

will it run on everything

#

not different versions

#

different plugin supporting servers

#

like paper etc

spiral light
#

what can i do if a runnable jar opens a extra cmd and instant closes (with an error i cant see because its closed to fast ?)

wet breach
#

unless you are making use of OS specific API in Java, yes it will work on every platform

spiral light
smoky oak
#

k thanks

spiral light
#

via player object ... ^^ player.isSneaking

#

as event it would be PlayerToggleSneakEvent

hardy swan
#

hello

ivory sleet
smoky oak
#

someone ban that guy

spiral light
#

@ivory sleet

ivory sleet
#

Someone banned em alr

spiral light
#

oh ... ty anyway

smoky oak
#

it's not possible to detect a right click on air without jumping through some weird hoops right?

zinc spire
#

How can i ride the ender dragon in overworld?

sullen marlin
#

the client literally does not tell the server about right click air unless youre holding an item

#

if youre holding an item the normal event is fired

#

spawn an ender dragon, add upirself as passenger

zinc spire
#

It didn't move

smoky oak
#

can you somehow get extra key presses? Or do all triggers have to be vanilla (for example right clicking with a stick as trigger?)

sullen marlin
#

you cannot get right click air without an item

smoky oak
#

hm

zinc spire
smoky oak
#

is there a list of what client actions get sent to the server? If i can use something like Hightlight Players (Spectrator Mode) as trigger, that would probably solve that problem too, but I'm not sure what the client actually does when that key's pressed

sullen marlin
#

Idk what that is but it sounds client side

smoky oak
#

thats why i asked if there's a list

#

also do you per chance know if the 'swap items with offhand' gets sent to the server if both main and off hand are empty?

sullen marlin
#

No, but there is a list of events in the javadoc

#

And try it and see, but doubtful

spiral light
#

is there an BlockDamageAbortEvent md5 ?

short raptor
#

💀 can't embed links

smoky oak
#

yep

#

its because names can change

#

that method isnt necessarily returning the right player

short raptor
#

Oh that's smart

smoky oak
#
aliases:
      - /```
does this throw an error, or does it allow the usage of '`//`' as a command?
torn shuttle
#

hey, was there a rule about non-english reviews on the forums?

spiral light
smoky oak
#

so i just got an error because i didnt put * in quotes as permission

#

is there any possible error if i just put every value in the plugin.yml in single quotes?

#

also

#

it DOES still send the press of the swap key even if there's nothign in either hand

quaint mantle
#

to check your yaml syntax if it is correct or not

topaz sinew
#

What am I doing wrong?

spiral light
#

did you run buildtools with mojang remapped ?

topaz sinew
#

Yeah

#

I did under wsl tho, idk if that makes a difference

hardy swan
#

what is the value of your ${mc.version}

tacit drift
#

1.18.1

hardy swan
#

you can't use that for remapped-mojang the last i tried

#

1.18 was the latest available

spiral light
#

no 1.18.1 should work

hardy swan
#

hmm

#

maybe i didn't build correctly then

hardy swan
spiral light
#

did you check if your .m2 contains the jar ?

topaz sinew
quaint mantle
#

Hi! How would I make a plugin that allows a player summon zombies that attack other players but not the summoner?

spiral light
#

EntityTargetEvent or smth like that ... spawn them and add a PDC tag to specifiy the owner ... listen in that event for the entity and check pdc for owner ... if owner == new target -> dont do that

short raptor
#

I want to make a head with a certain skin but I don't want to rely on some player not changing their skin & I don't have any alts that I can use to have the skin. Is it possible for me to do that?

spiral light
#

yes

short raptor
#

Ok thanks

topaz sinew
#

If I run build tools with --remapped, in which folder do I find the mojang mappings?

smoky oak
#

.m2 i think

#

if i want to store a itemStack in a PDC, the only feasible option is to use serialization, right?

stoic atlas
#
            Arrays.stream(e).filter()```
HOw do i put boat entity inside the filter
ivory sleet
#

?

stoic atlas
#

is it org.bukkit.entity.boat?

ivory sleet
#

Perhaps

#

?tas

undone axleBOT
stoic atlas
#

Where do i find the world uuid then

#

i need that so i can test

ivory sleet
#

Well

#

Bukkit.getWorld(…).getUniqueId()

stoic atlas
hardy swan
stoic atlas
#

"overworld"

#

does this work

hardy swan
#

I dont believe that is the default name of your over world's world

#

It should be just world

stoic atlas
#

ok

hardy swan
#

It is the name of your world folder

stoic atlas
#

incase if i dont know the world name

#

what should i use to get world name (overworld)

hardy swan
#

From the world object lol

#

There is no way of something if there is no way of knowing something

#

If you get what i mean

#

What do you plan to identify your world by

#

You can getWorlds

#

And iterate through worlds and check if they are of certain type

stoic atlas
#

certain type

#

mm

hardy swan
#

?jd

stoic atlas
sterile token
#

Mr. 0

hardy swan
#

World inherits WorldInfo

sterile token
#

Have you learn the basics of Java?

stoic atlas
sterile token
#

Because i wont never recommend using an API without knowing the Basic of the laguage

hardy swan
#

Grrr

stoic atlas
lavish hemlock
#

No String for you

stoic atlas
lavish hemlock
#

I don't think implementing collection types yourself is gonna help you learn the language.

#

If anything, it'll just make you more frustrated and give up trying to learn the language.

#

And even then, Java is tethered to the stdlib in a lot of ways.

#

You cannot use primitives in generics without the standard library (Integer, Float)

#

You can't even pass a value of any type without the standard library (Object)

ivory sleet
#

Oo Maow I like your new pfp :3 uwu

hardy swan
#

Mr.O do read up on javadocs on collections and how to iterate through its members

sterile token
lavish hemlock
ivory sleet
hardy swan
#

arrays are not Collection

lavish hemlock
#

Arrays are technically collections but they're lower-level.

stoic atlas
#

i know hashmap, and set

#

i will look into lists

lavish hemlock
#

You should

#

List is very useful

ivory sleet
#

Odd enough you know maps and sets before lists

sterile token
#

Same dude

lavish hemlock
hardy swan
#

I mean hashtables is more commonly applicable

lavish hemlock
#

Yeah but repeat elements and accessing by index?

hardy swan
#

For most use cases

lavish hemlock
#

Set can't store repeat values.

#

You also have no get

stoic atlas
#

O

sterile token
#

I first learned List, ArrayList and Arrays. Them Maps, Hashmaps, sets and hashset

stoic atlas
stoic atlas
#

WHich java docs did you use

lavish hemlock
#

Arrays, ArrayList, List, Maps/HashMaps, then Sets/HashSets

stoic atlas
hardy swan
#

Technically, you should learn list -> tree -> hashtable, and its corresponding implementations

lavish hemlock
#

The day I was introduced to Maps 😍

vocal cloud
stoic atlas
blazing scarab
lavish hemlock
blazing scarab
#

now start cyberbullying

hardy swan
stoic atlas
#

😂

hardy swan
#

Lmao

lavish hemlock
#

Like

vocal cloud
sterile token
#

The day I was introduced to Mongo my eyes started to cry. Cuz I come from yets like Mysql

lavish hemlock
#

"Hey dude that guy's a furry, go tell him he's a furry"

"Now start cyberbullying"

stoic atlas
#

for simplicity

lavish hemlock
errant bobcat
#

Hello I'm wondering if it is possible to upgrade Java without shutting down the server from ssh

sterile token
#

No

lavish hemlock
#

You cannot hot-swap Java instances at runtime.

hardy swan
#

Dictionary is the worst analogy for hashtables as dictionary implies logn find and provides accessor and predecessor operators

errant bobcat
#

okay thanks

hardy swan
#

In another words, ordered

stoic atlas
#

Seems like coding ninjas

sterile token
#

Rabbit do you know a good tutorial for Genérics fields, method

#

Like T, E

hardy swan
#

Literally

vocal cloud
#

Read the docs?

hardy swan
#

The official oracle tutorials

lavish hemlock
#

Docs aren't good at explaining it

#

imo

hardy swan
#

No joke

sterile token
#

I dont understand to much

lavish hemlock
#

They use a lot of terminology without explaining beforehand

hardy swan
#

What do you not understand, can just ask here i guess

quaint mantle
lavish hemlock
#

I read the docs on generics when I was beginning and they did not help :p

sterile token
#

Like docs are good for methods and etc. But not for explanation

#

🤣

blazing scarab
hardy swan
#

Not the docs, the tuts

lavish hemlock
#

So

#

@sterile token I'll DM you my personal explanation

#

Give me a second

vocal cloud
ivory sleet
#

Maow btw

quaint mantle
#

You are 💩

ivory sleet
#

Do you know much about VarHandle?

vocal cloud
lavish hemlock
#

Yeah back when I was coding

#

THERE WAS A SINGLE PAGE

stoic atlas
#

I cant upload screenshots?

vocal cloud
#

gotta be verified

sterile token
lavish hemlock
hardy swan
#

T, then S then U

#

K and V makes sense

vocal cloud
lavish hemlock
#

I follow typical convention

#

Generic parameters (as in, literally generic, like they don't really mean anything):
T, T, V, T, U, V, T, U, V, K

Collections:
E
K, V (mapping)

etc.

#

There's some more shit but that's the basic gist

ivory sleet
#

Okay so if you don’t mind, I’d gladly appreciate one of the Maow’s comprehensive explanations surrounding getVolatile, getAcquire and getOpaque (more than just the jd documentation)

#

So mainly their differences

lavish hemlock
#

Oh yeah I don't fuckin' know actually

stoic atlas
#
            Entity[] e = i.getEntities();
            Arrays.stream(e).filter(org.bukkit.entity.Boat);
        });```
It get red line under org.bukkit.entity.Boat
It says: Expression expected
ivory sleet
#

Frick

lavish hemlock
#

pff

vocal cloud
#

Group study session lol

hardy swan
stoic atlas
#

how do i create it

lavish hemlock
#
  1. Why create an entire Stream just to iterate
  2. Why nest a Stream within a Stream
hardy swan
#

To learn function/consumer or those in that league you need to know about functional interfaces

hardy swan
#

And potentially learn about pecs

vocal cloud
#

I wonder what happens when you run out of alphabet?

sterile token
#

So it isnt wrong to have this method on Interface:

T query(K... query);

I did like that because this will be Implemented by MongoDB and Mysql classes.

T - Cuz for mongo I need to return Document and Mysql a ResultSet

K... - Cuz Mongo and Mysql requires different Arguments

lavish hemlock
ivory sleet
hardy swan
sterile token
#

Why?

hardy swan
#

What usefulness does K provide

sterile token
#

I need Arguments so i them do a conclusiok

lavish hemlock
#

Yeah you'd be better off with Object

ivory sleet
#

Verano usually you probably want to provide an even higher abstraction

lavish hemlock
#

There's no need to use generics if you only use them in one place

young knoll
#

I don't even expose queries atm

ivory sleet
#

Assuming you’re trying to create a polymorphic design of some sort

sterile token
lavish hemlock
#

e.g. This is pointless:

public <T> void uwu(T o) {
    if (o instanceof String s) {
        // ...
    }
}
#

Sorry wait no

ivory sleet
#

uwu

vocal cloud
#

Polymorphism uwu

lavish hemlock
#

Because you never re-use T

#

And it could just be replaced with Object

hardy swan
#

As far as polymorphism is concern, if you have a common interface such that you can declare K to be <K extends SomeSuperType> then K will be useful

#

But i assume you dont

dusk flicker
#

Pog abstraction

ivory sleet
#

I don’t believe we have super in generics

hardy swan
#

So Object it is

ivory sleet
#

except if it’s a wildcard

lavish hemlock
ivory sleet
#

Thingy

#

Not like T super List

lavish hemlock
#

I'm pretty sure that's a thing

visual tide
#

yes

hardy swan
#

Hmm maybe not

#

Idk

visual tide
#

you've got extends and super

ivory sleet
#

And it’s also kind of sad we don’t have union types, only intersection types

lavish hemlock
#

Anyway the thing about that tho

visual tide
#

and for interfaces u use extends as well

ivory sleet
#

No lvj

lavish hemlock
#

You know where?

ivory sleet
#

There’s no T super A

lavish hemlock
#

Exception handlers.

ivory sleet
#

Ah true

#

But that’s for exceptional cases

lavish hemlock
#

I actually once used exceptions to implement union types as an experiment.

#

It worked.

ivory sleet
#

O

dusk flicker
#

Lmao

hardy swan
ivory sleet
#

I guess every type can be seen as an option type since null

pulsar radish
#

fix-climbing-bypassing-cramming-rule:
In which file do we find this configuration?

dusk flicker
#

Maybe Google it

#

Or look in the files

topaz sinew
#

How can I retrieve the Villager (mojang mappings) from a InventoryOpenEvent? I tried some things but I mustly ran into errors when trying to cast certain objects to some nms Classes

sterile token
lavish hemlock
#

This is awful, do not do this ^

sterile token
#

In oblise to use K... because mysql and mongo have different method parameters

hardy swan
sterile token
#

Hum

hardy swan
ivory sleet
#

This is beautiful and horrible at the same time maow

hardy swan
#

Since arrays are covariant

sterile token
#

Object[] right?

ivory sleet
#

Also remember when people used try catch to “smart cast”

vocal cloud
#

Huh I can't seem to find a generic limit

lavish hemlock
#

I do not remember that

#

That is awful

lavish hemlock
#

Or 127

hardy swan
lavish hemlock
#

Or something like that

vocal cloud
#

gonna get python to test it

lavish hemlock
#

Theoretically there shouldn't be a limit as it would only matter to the compiler, not the JVM

#

But then again generic type data is stored, just as a "signature" as to not break libraries I assume

sterile token
#

Hahaha

lavish hemlock
#

Callable exists

sterile token
#

Java 1.8!

#

Dude

lavish hemlock
#

Oh wait a minute

#

Is that

#

Oh dear that's not an interface, is it?

dusk flicker
#

just update /s

#

Even when I use to run mc 1.8 I ran java 11 lol

lavish hemlock
#

I'm eventually gonna make my own bytecode lang

#

Just you wait

hardy swan
#

addi t0 t1 5

lavish hemlock
#

Might implement the VM in Rust w/ a LLVM backend or smthn

#

So it can do JITing

sterile token
lavish hemlock
#

"sneaky reflections"

#

What is that?

sterile token
#

Omg If you see the Interface you will kill me

#

Wait I will translste it

#

Remember in spanidh hahaha

hardy swan
#

My spidey senses are tingling

quaint mantle
#

SneakyThrow.sneaky

lavish hemlock
vocal cloud
#

Alright so I think intellij is having a harder time processing a 5000 type generic

lavish hemlock
#

I've sent it many times before

dusk flicker
#

Hell no

sterile token
#

Solar in resume I should change the k... To Object[] on my database Interface right?

lavish hemlock
#

You don't need it to be an [], I think ... works fine.

vocal cloud
#

Maow going to go insane in a few years and make the FurryOS a replacement for TempleOS in the meme world

hardy swan
sterile token
vocal cloud
hardy swan
lavish hemlock
#

I am planning on rewriting FurASM though

hardy swan
#

If you even used it

lavish hemlock
#

It'll have an actual assembler

lavish hemlock
#

And likely better syntax

#

See, FurASM is actually quite raw. You manage function offsets yourself :)

vocal cloud
#

So 5000 generic types works or at least no errors. Just Intellij can't handle it

sterile token
vocal cloud
#

mmlul Can you spot the JVM?

lavish hemlock
#

Okay don't suppress safevarargs

#

Jesus

#

Use the @SafeVarargs annotation.

hardy swan
#

I meant that

#

:I

sterile token
#

@lavish hemlock and @hardy swan here you have my sneaky Interface

@FunctionalInterface
public interface Runner extends Runnable {

    @Override
    default void run() {
        try {
            execute();
        } catch (Throwable ex) {
            throwException(ex);
        }
    }

    void execute() throws Throwable;

    static <E extends RuntimeException> void throwException(Throwable ex) { throw (E) ex; }
}
#

You will kill me

vocal cloud
#

Why

#

😭

lavish hemlock
#

Why would you need a method to throw the exception...?

#

And uhh

#

Why would you declare a generic and then cast to it

lavish hemlock
#

And why would you declare a generic in the first place

#

Other than that, fine ig

vocal cloud
quaint mantle
lavish hemlock
#

Oh I see

#

Ohhh

#

Yeah okay that makes sense

#

It's just to get around compiler enforcement?

sterile token
#

Maow I did that cuz. I need to run code some time and trows exception. Without doing try catch in the method

#

🤣

lavish hemlock
#

Easier solution:

hardy swan
#

Put E as parameters' type should be sufficient

#

Instead of casting

vocal cloud
#

Make your own exception that extends RunTimeException thonk

hardy swan
#

Ok nvm i see wrongly

lavish hemlock
#
@FunctionalInterface
public interface ThrowingRunnable extends Runnable {
    @Override
    default void run() {
        try {
            runThrowing();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

    void runThrowing() throws Throwable;
}
quaint mantle
#

i always forgot

#

if a interface has alot of implementations

vocal cloud
lavish hemlock
lavish hemlock
lavish hemlock
#

The point is that it allows you to do shit like IO within a lambda.

sterile token
quaint mantle
#

for example Map interface with HashMap, TreeMap,..., if i used Map<String, String> monke = new HashMap<>(); it will use the hashmap implementations right

quaint mantle
lavish hemlock
quaint mantle
hardy swan
#

There is a word for it

vocal cloud
#

So sadly it looks like there is a limit to generics sad

lavish hemlock
lavish hemlock
quaint mantle
#

like dam just rethrowing an excpetion is much easier

#

what about


    public Map<String, String> something() { return new HashMap<>();```
will it still use hashmap?
lavish hemlock
#

I'd argue otherwise

#

It's literally less code

#

But does basically the same thing, except it won't uproot your process if a file is missing (IOException) :p

stoic atlas
#
            Arrays.stream(chunk).forEach((i) -> {
                Entity[] e = i.getEntities();
                System.out.println(i);
                Arrays.stream(e).filter((f) -> {
                    System.out.println("OOOOOOOOOO");
                    if (f.getName().equalsIgnoreCase("Boat")) {
                        System.out.println("OPL");
                    }
                    return true;
                }).onClose(() -> {
                    System.out.println("Closed");
                });
            });
        }
        return true;
    }```
Why this no work 
The line sout("OOOOOOOOOO") is not firing
quaint mantle
#

hmmm

#

okay then

#

i always forgot it

quaint mantle
lavish hemlock
#

Likelihood is that it's in a class called Main

hardy swan
quaint mantle
#

?main

stoic atlas
#

It is named JavaPlugin

sterile token
#

I have just realized you can do:

public ArrayList get Array(List<String> list) {
return new ArrayList<>(list);
}

lavish hemlock
#

You think or you know?

stoic atlas
#

It is JavaPlugin

hardy swan
lavish hemlock
#

Like it's a sassy response

#

Since it seems like something he should know

#

IF IT'S IN HIS CODEBASE

lavish hemlock
sterile token
#

Like I think if someone want help at least need to know their main class ame etc

stoic atlas
sterile token
hardy swan
#

What he meant was

#

The method is redundant

lavish hemlock
stoic atlas
#

Me extra stupid my plugin class name is Main and it extends JavaPlugin

lavish hemlock
#

Like

#

Something like Lists.of(...)

vocal cloud
#

Man why do people belittle themselves for learning is beyond me

lavish hemlock
#

Which is preferable to something like new ArrayList<>() -> adding all the elements

sterile token
hardy swan
lavish hemlock
#

Pfff

#

Male

hardy swan
#

Okk

#

I have ethical dilemma when using the word he

lavish hemlock
#

I don't include pronouns bc I don't fuckin' care

vocal cloud
#

It

lavish hemlock
#

But, if you must know, he/him/they

sterile token
#

Maow do you remember mi idea of doing some data broker with netty!

#

I think I have fucked with that many time

lavish hemlock
#

Never used Netty

#

Oh wait

#

No I don't remember that

#

I don't think you told me about that

sterile token
#

Yeah

lavish hemlock
#

Tbh I also don't know what a "data broker" is

sterile token
#

Like I want something all integrantes in custom bungee and spigot. Using their netty. So for sending/receiving data you wont need Redis, Sockets an extra port

#

I think its called correcto y message bróker

lavish hemlock
#

Soooo

#

IPC?

vocal cloud
lavish hemlock
#

Or