#help-development

1 messages Β· Page 1979 of 1

quiet ice
#

Actually

grim ice
#

Anyways

quiet ice
#

Eh, I don't understand this

grim ice
#

gpg: skipped "2Hex myemail@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

grim ice
#

still malding on how to fix this

restive tangle
#

I understand the error, but I'll the others handle this

#

Lmao

grim ice
#

Lool

grim ice
#

no

#

i dont know how to install it

quiet ice
#

Do you have minGW installed or anything like it?

grim ice
#

their website sucks

#

no

lost matrix
#

And the node id?

quiet ice
#

Then it is a certified Java IDE moment

grim ice
#

wdym

wet breach
# lost matrix And the node id?

right axed off the node on accident lol, although not technically required depending which version you want to use πŸ˜›

#

fixed it lol

lost matrix
quaint mantle
#

how do i make sure the block face of the new type of the block is the same face as the one before?

        Block b = e.getBlock();
        if(b.getType() == Material.JACK_O_LANTERN) {
            Location l = b.getLocation();
            ItemStack i = new ItemStack(Material.TORCH);
            //Block target = e.getBlock().getWorld().getBlockAt(l);

            e.setCancelled(true);
            //b.getFace(target);
            b.setType(Material.CARVED_PUMPKIN);
            e.setDropItems(false);
            b.getWorld().dropItemNaturally(l,i);
        }
quiet ice
#

block data or something like this

lost matrix
quaint mantle
#

kk

lost matrix
#

And with copy i mean just creating a variable because getBlockData() returns a snapshot anyways

opal juniper
#

it is pathfinding to the left here, the yellow stained blocks are the nodes that it has considered... what i mean is why does it consider all these extra nodes which end up not being needed? There must be an issue with my heuristic no?

grim ice
#

gpg: skipped "2Hex email@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

Still looking for help

quiet ice
#

Try using an alternate git client I guess

grim ice
#

how

lost matrix
quiet ice
#

Install Github desktop, git bash, there are a few git clients out there

grim ice
#

committing to github

quiet ice
#

Pushing or creating a commit?

grim ice
#

commit

wet breach
lost matrix
#

intellij should do quite a bit for you in that regard

wet breach
#

you actually need to upload your key to your profile on github

grim ice
wet breach
#

so that it can verify

grim ice
quiet ice
#

Well in that case GH is not the culprit

worldly ingot
#

GitHub does have an article on this

lost matrix
quiet ice
#

He likely does not have a key

quiet ice
wet breach
#

And Choco to the rescue

quiet ice
#

Windows moment

wet breach
#

with the links

worldly ingot
#

It also has an article on creating keys as well

grim ice
#

thats the first time this happened to me

grim ice
#

anyways idk how to install gpg

#

their website complicated

worldly ingot
#

See above link

wet breach
worldly ingot
#

It's mostly copy/pasting commands

wet breach
#

if you use https you need your secret random password GH generates

worldly ingot
#

Right. Do you usually sign your commits?

grim ice
#

dk how

grim ice
lost matrix
# opal juniper yee

Then you should first do a 2D pathfinding using chunks.
Then do a separate per chunk pathfinding. Chunks can be snapshotted which means
you can even multithread this if you wanted to.

quiet ice
worldly ingot
#

May have enabled it in your config then. You can disable it. Sec

worldly ingot
#

Gotta find the option

#

git config --global commit.gpgsign=false

opal juniper
quiet ice
worldly ingot
#

Correct, but just Material.POTION should be your water bottle

grim ice
#

error: invalid key commit.gpgsign=false

lost matrix
# opal juniper yee

But if the per chunk stuff is too much hustle:
Weight your nodes when computing A*
Get all surrounding nodes, calculate the distance sqaured to the target of each node and
proceed with the one that has the lowest distance to your target.
Thats called weighting.

worldly ingot
#

Mustn't be set in global then. Maybe on the repo. git config commit.gpgsign=false

#

(in the repository directory to which you're trying to commit)

#

Yeah which is a water bottle

grim ice
#

git config commit.gpgsign=false

#

error: invalid key: commit.gpgsign=false

wet breach
worldly ingot
#

Yep

#

Beat me to it

#
ItemStack potion = new ItemStack(Material.POTION);
PotionMeta meta = (PotionMeta) potion.getItemMeta();
meta.setBasePotionData(new PotionData(PotionType.WATER));
potion.setItemMeta(meta);```
grim ice
wet breach
#

it is deprecated but you could just do setType on the potion

#

well it doesn't specify why it is, probably because there is PotionMeta

worldly ingot
#

I would open your .gitconfig manually then, @grim ice

wet breach
#

ah I was right about the deprecation

worldly ingot
#

On Windows, go to %UserProfile%

wet breach
#

it states it at the top instead of in the method lmao

worldly ingot
#

You should see a .gitconfig file there

wet breach
#

well generally should avoid deprecated methods but it doesn't mean you can't use them

worldly ingot
#

If you see any of these, Hex, remove them from the .gitconfig, save, and try committing again

wet breach
#

I am not entirely sure, haven't kept up with all the new stuff in the game

quiet ice
#

Do you want to get a water bottle?

halcyon quail
#

what is this?

#

?

lost matrix
halcyon quail
quiet ice
#

What is Survival running?

halcyon quail
#

Bungee

quiet ice
#

I. e. what is the output of /icanhasbukkit on that instance?

quiet ice
dusk flicker
#

prob smarter to tell them to run version as its hardcoded, while the hasbukkit command can be easily removed in the commands yml

quiet ice
#

pff, that is half the fun

dusk flicker
#

fair lol

smoky oak
#

so um...
I defined a command in plugin.yml, made a class implement CommandExecutor, overwrote it's onCommand, then used getCommand("name").setExecutor(new CommandExecutorClass()); in my onEnable. Issue being... when i reload the plugin and type it in, it doesnt trigger

opal juniper
warm light
#

Anyone here used EDB Lib?

quiet ice
#

unlikely. What is it for?

warm light
#

I am getting many errors on ubuntu when using this lib in my plugin

quiet ice
#

What sort of errors?

warm light
#

java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 168 out of bounds for byte[112]

quiet ice
#

What is the full stacktrace?

warm light
#

I am not so pro in java. so I can't get whats wrong on that lib

bold flume
quiet ice
#

But this sounds very much as if it is a library issue, in which case I'd suggest opening a bug report

warm light
#

okay

smoky oak
#

geol, any idea why registering a command isnt working?

quiet ice
#

Did you change your plugin.yml?

smoky oak
#

yes

#

it just echoes back the 'usage' from plugin yml

#

instead of executing

#

but i have it registered

#

written, registered, reloaded the plugin in fact

#

thats why im so stumped as to why it isnt working

warm light
quiet ice
#

that does not do this

quiet ice
#

Chances are there is a typo somewhere

smoky oak
#

do you want everything or the relevant parts?

#

wait a moment

#

it errors out on reload?

#

why

quiet ice
#

Reload or restart?

bold flume
quaint mantle
#

iirc returning false from a command shows the usage as well

worldly ingot
#

Stacktrace would be helpful ;p

#

(& the plugin.yml)

smoky oak
# quiet ice Reload or restart?

reload. The issue was that i updated the handling on reload, which required an instance of the plugin to be cached. However, that instance of the plugin got cached after that code block, which i did not realize until i looked in the console just now

#

ergo the error was absent on restart

worldly ingot
#

Stacktrace would be helpful ;p
(& the plugin.yml)

smoky oak
#

well the stacktrace is literally Plugin cannot be null, im fairly sure i found the issue

bold flume
smoky oak
#

i just did not realize ther was an error since the COMMAND showed nothing in the chat

worldly ingot
#

Yeah, the command is just going to reverb back to you itself if your plugin failed to load in any capacity

bold flume
quiet ice
#

Why are you registering events 3 times? This is asking for trouble

bold flume
#

idk

#

ok

worldly ingot
#

just in case

#

Also not entirely sure why you're implementing the plugin message listener and not doing anything with it

smoky oak
#

actually what would registering two different commandexecutor classes do?

#

i know actual EventListeners are desinged forthat but commands?

worldly ingot
#

Nothing. Would override it

bold flume
worldly ingot
#

Commands can only have one executor

smoky oak
#

ah thanks

quiet ice
worldly ingot
#

You're doing config.set("", something) somewhere

quaint mantle
bold flume
#

yea

quiet ice
#

this.sbdata.getConfig().set("players.", player.getUniqueId().toString()); is illegal

#

Just remove that line

bold flume
#

??

#

but then it doesn't set the uuid

quiet ice
#

it's illegal

bold flume
#

ok

worldly ingot
#

Well, no, but you're setting players. to something, which isn't valid

quiet ice
#

Do not question my descision

worldly ingot
#

You probably wanted to set "players." + player.getUniqueId() instead

#

To some value

#

this.sbdata.getConfig().set("players." + player.getUniqueId(), 1); for instance would set everyone's value to 1

#

but it would work

young knoll
#

You can’t end a key with a .

quiet ice
bold flume
#

no error so far

quiet ice
#

So just remove it

worldly ingot
#

It would just override previous sets

bold flume
quiet ice
#

hm, would it

worldly ingot
#

Yeah you can set over the same path multiple times

quiet ice
#

It isn't the same path

#

The later lines are childs of that path

worldly ingot
#

I know. If it's a different player it would be a different path πŸ˜›

bold flume
#

well it worked by removing it

#

it is now this:

players:
  db0be134-f6ce-4991-a404-0707a576e524:
    health: 100
    defense: 100
    strength: 100
    speed: 100
    critchance: 30
    critdamage: 100
    intelligence: 100
    miningspeed: 100
    seachance: 10
    magicfind: 100
    petluck: 10
    truedefense: 10
    ferocity: 0
    abilitydamage: 10
    miningfortune: 100
    farmingfortune: 100
    foragingfortune: 100
quiet ice
#

But given of the tree-like structure of the config system, you probably are right

worldly ingot
sterile token
#

Why no go doesnt support saving a Key which a Hashmap value?

#

Mongo*

quiet ice
#

You need to set the block data after setting the type

sterile token
#

Corrector

quiet ice
quaint mantle
#

block data

stuck flax
#

I'm using the <World>.dropItem() method but the item flops around, can I make it so it just drops

quiet ice
#

what do you mean?

#

You might want to use dropItemNaturally, but mostly it is the same thing

lost matrix
quiet ice
#

?stash

undone axleBOT
lost matrix
sterile token
quiet ice
#

Basically you can serialize everything you want in the way you like when you craft your own format

lost matrix
sterile token
#

Serliaze?

#

Isnt Map primitice on bson?

#

Because i use bson + Mongo

lost matrix
#

I would recommend serializing to json as the conversion json to bson (mongodbs format)
is quite easy.

sterile token
#

Json

#

Omg everyone told me that

#

Oh im still confused how to encrypt to stop people skidding when a jar its running on JVM

#

I wish java would be easy

quiet ice
#

Perhaps Graal's ahead of time compiler could be one way, but I never dabbled with it

sterile token
#

I prob will have to spent 512 dollars on ZellixKlassMaster

quiet ice
#

Java is pretty easy to crack

#

Most obfuscators are trash if you want to only protect a single thing

#

Well, perhaps all of them

sterile token
#

Who want to protect 1 string lmaoo

#

πŸ‘€

#

If I want to protect its everything

quiet ice
#

In 99% of cases you only want to protect a string that represents a discord webhook

sterile token
#

I dont wanna see fucked skidders skidding my code

lost matrix
sterile token
#

I want to UE to sell plugins on mc market

#

And free options are discsrted no one its good

quiet ice
#

However, this is where the issues arise: Because most people only obfuscate if they have something to hide, obfuscation basically means malicious jar

sterile token
lost matrix
sterile token
#

Now explain....

quiet ice
#

So don't obsucate (especially due to bukkit's nature it is quite trivial to inject malicious code at the onEnable method)

sterile token
#

A friend has ZKM and never get something deobf

lost matrix
quiet ice
#

Why would you want to prevent deobfuscation?

sterile token
quiet ice
#

If there is no DRM integrated, noone is going to bother

#

And skidders can just ignore obf

sterile token
quiet ice
#

There are automated tools to just add malicious code

lost matrix
#

Do you have a multi hundred hour project with great features that you want to sell for a higher price?

quiet ice
#

Sure, the spigot antivirus is going to detect this, but usually it is not the case

sterile token
#

Oh no one cares that. Because if not mc market wouldnt make money from people selling obf plugins

#

I dont know why you still annoying with that of virus

#

These days no one care

lost matrix
sterile token
#

Are you saying that Im a noob

#

😞

quiet ice
#

Even non-noob code is usually not getting skidded

lost matrix
#

No but you dont have a single resource on spigot.
You put too much time into thinking about protecting your code instead of writing it.

quiet ice
#

But as soon as you add DRM to it, someone is going to deobf it

sterile token
#

My problem its that what fuck me its the resell

#

The resell its big problem

paper viper
#

me seeing these people try to obfuscate resources when i swear i spend countless hours on my open source projects...

#

honestly saddens me

lost matrix
quiet ice
sterile token
#

This will sound socialist but idk how you take it:

I think that open source Project its to serve the food to the richers

lost matrix
quiet ice
paper viper
#

So many developers put countless hours into developing their own open source projects, just to get ruined by some other developer who frickin obfuscated their own code.

#

Be glad that open source exists

sterile token
paper viper
#

That doesn't have anything to do with obfuscation

#

lmao

lost matrix
sterile token
#

I dont know I thimk obfuscation its to keep your thing with you so one else cant use it

paper viper
#

Well, you see, the issue here is that obfuscation only makes it harder for other people to use it, it doesn't prevent them

#

lmao

sterile token
#

But with this society its I possible to sell deobfuscated things

quiet ice
#

Also it makes it a pain in the butt for you

#

And other devs

paper viper
#

Yeah imagine reading an error report

lost matrix
paper viper
#

a, b, c, d, e

quiet ice
#

You cannot debug stacktraces at all

paper viper
#

Your code is definately not gonna be flawless either

sterile token
#

I would love to see you all trying to deobf a obfuscator of +512 dollars (ZellixKlassMaster) and even Stringer +3.000 dollars

lost matrix
#

Verano imagine if Spigot (an open source project) would be obfuscated...

quiet ice
#

I once passed a null value to some bukkit event and it caused an error in an obfuscated premium plugin. I was only able to guess what caused it thanks to someone sending me the jar

quiet ice
#

And it makes everything painfull

paper viper
#

I would love to see you trying to solve an exception in your plugin that is obfuscated

lost matrix
smoky oak
sterile token
#

Because everyone have big mouse to talk but them they cant

#

Hahaha

paper viper
#

Don't even mention debugging

paper viper
lost matrix
smoky oak
#

so nms then

paper viper
sterile token
#

And wait who debug obf code?? The obfuscation its done before its working

smoky oak
#

eh true they just do that to methods

quiet ice
#

How do you debug non-working obfuscated code?

paper viper
#

Lol

quiet ice
#

Proguard kinda is able to aid you, but proguard isn't really obfuscating

sterile token
#

Why you need to debug!! That should be done by the autor

lost matrix
quiet ice
#

As well as other plugin devs

smoky oak
#

give them the steps to reproduce the bug

#

then repeat on a private unobfuscated version

#

:D

quiet ice
#

You'd be astonished at how often you cannot reproduce a bug

lost matrix
paper viper
#

Do you realize how much a pain in the ass it is for not only yourself, but also other developers to fix these issues if your plugin is obfuscated.

sterile token
quiet ice
#

oh then proguard does this

sterile token
#

No

quiet ice
#

It does

sterile token
#

It doesnt i test it

quiet ice
#

It renamed them and deletes params

#

Depends on how you set it up

sterile token
#

Bukkit calling doesnt get obf too

smoky oak
#

wait i found a reason for why to do it. It says that At the same time it shrinks the code size drastically, which helps to reduce the startup time of the application.

#

lol

sterile token
#

I have seen ZKM obf cose and you literally see the strucutre and them just |||| chstacter everwhere

lost matrix
quiet ice
smoky oak
#

website?

quiet ice
#

You can do stupid stuff with method handles

#

But weren't you the guy that wanted to save every inch of performance?

paper viper
#

obfuscation makes your code slower too sometimes

#

lol

#

by adding a ton of unnecessary shit

quiet ice
#

Because those two are mutually exclusive

sterile token
#

So if they are exclusive why telling that they are shit?

#

I do T understand your thoughts

paper viper
#
ThriftBooks

Buy a cheap copy of Introduction to Algorithms book by Thomas H. Cormen. Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and... Free Shipping on all orders over $15.

#

lol

sterile token
#

They are agree, dont agree, agree and that everytime

quiet ice
#

I'm pretty sure that half of the URL is useless

paper viper
lost matrix
#

Im more and more convinced that verano is just trolling us big time.
Who would write Backend developer (JavaScript) in their desc.
He has to be a troll.

paper viper
#

Minecraft configurator

paper viper
#

i just realized that

#

LMFAO

lost matrix
#

nodejs goes brrr....sst and then it dies

quiet ice
#

JESUS

#

The audacity

sterile token
#

Because with Javascript you can write many things hmn

#

I have seen header people but here

smoky oak
quiet ice
#

Also, verano there is this thing called the GPL

sterile token
#

What that?

quiet ice
#

You are legally obligated to disclose the source of your plugin

sterile token
#

What?

#

Explain

quiet ice
#

The most important descision is not a line of code, it's the license

#

And Bukkit's license it the GPL

sterile token
#

I dont care I just see that people on mcmarket sell really good obfuscated resources and no problems happen

smoky oak
#

wait plugins can have their own licenses afaik

#

right?

paper viper
#

but it still happens

smoky oak
#

no like isnt the code yours

visual tide
quiet ice
#

Technically yes

#

But you are forced to adopt a certain branch of licenses

paper viper
#

Yeah

#

i mean that

sterile token
#

I dont care about license file I just delete them

paper viper
#

like it has to be compatible

smoky oak
#

you guys right now

quiet ice
#

Infectious licenses go brrr

paper viper
#

It's cause there are a lot of plugins that don't do that, but also the fact that nobody is going to enforce it either

lost matrix
quiet ice
#

Why are you even here?

paper viper
#

leave lol

sterile token
quiet ice
#

Why do you want help from an open source project if you reject the very foundations of the open source world?

quiet ice
#

At least for bukkit plugins

sterile token
#

When I ask for help its not to sell

quiet ice
#

But you reject OSS by saying you ignore licenses

#

Without licenses there is no OSS

sterile token
#

What oos?

smoky oak
#

dont open source projects usually have a license saying to use their license too?

paper viper
#

What do you expect as an answer? You are literally asking whether if you want to obfuscate in a strongly open source community. At this point you are trolling

quiet ice
#

They are not asking whether, they are asking how

paper viper
sterile token
#

I dont care license because dont anything. They dont prevent people doing mlney etc

hybrid ledge
#

Is it safe to use "this.format" as config key ? Or should I replace dot with something else? I don't want nested keys in this case.

paper viper
#

lmao

quiet ice
#

Bukkit died thanks to this

paper viper
#

Yeah

sterile token
#

A friend buyed dmca and he demande one for resseling his plugkns and they are still in fight since March 2021

lost matrix
paper viper
#

"bought dmca"

sterile token
#

Dont you have to pay for it?

visual tide
#

waitwaitwait so using the bukkit api means your plugin must be open source

hybrid ledge
visual tide
#

\

quiet ice
#

yes

hybrid ledge
#

\ or / ?

visual tide
#

\

lost matrix
#

I think its just html escaping

quiet ice
#

Wouldn't it be bash-like syntax

sterile token
#

\nNew line here

quiet ice
#

So something like "\"key.abc\".child"

#

idk

hybrid ledge
#

Alright "this\.format"

sterile token
#

What trying to do

quiet ice
#

If even it would be \\., but this doesn't sound like valid yaml

sterile token
#

Finalizing the dicussion if in future I sell plugins prob will have to spent money in a good obfuscator

hybrid ledge
#

in yaml I have used String keys before and there was no need to escape dots... you just enclosed it into ""

hybrid ledge
#

"this.is.key"

quiet ice
#

However I doubt that snakeyaml supports that

#

it has always been pretty bad when it came to whack features and this is an extraordinarily whack feature

tardy delta
#

why escaping dots in yaml?

sterile token
#

list-of-key:
key-1: "key one"
key-2: "key two"

Config#getString("list-of-key.key-one")

quiet ice
#

you misunderstand

stuck flax
#

How do you broadcast across all servers with bungeecord

quiet ice
#

probably with plugin messaging channels

tardy delta
#

which results?

#

getConfig() returns a fileconfiguration objects which holds a map internal

hybrid ledge
#

getConfig() always hits the file afaik

quiet ice
#

getConfig is cached and uses hashmaps internally

hybrid ledge
#

usually you save returned FileConfiguration somewhere

quiet ice
#

However it depends on the situation. I assumed JavaPlugin#getConfig here

#

Other getConfig methods may have different behaviour

sterile token
quiet ice
#

Any config object is, as soon as it is read, cached with hashmaps

sterile token
#

Spigot used to have JsonConfig.clsss?

#

Or ima wrong?

quiet ice
#

don't use ".class"

sterile token
#

Oh ok

quiet ice
#

well, depends on when, but in this case you can just use the simple name

#

And no

#

In the last 10 years bukkit and spigot only lost a few classes, if any at all

#

But any valid json is valid yaml so there is no need to have a json config

#

And json intentionally does not support comments, so it makes little sense to use json for configs

tardy delta
#

yaml just doesnt keep comments lmao

lyric cobalt
#

Do you know the command to build that?

quiet ice
tardy delta
#

idk im using the 1.17 api

quiet ice
#

And it was a snakeyaml issue

tardy delta
#

ah they fixed it

upper mica
#

Hello, does PluginDisableEvent event triggers when self plugin disables? Lazy to test it lol so if anyone have tested this, tell me

visual tide
#

if you want to detect your own plugin disabling use onDisable instead

lyric cobalt
#

Which pom.xml file?

#

I've got a few folders with that

upper mica
young knoll
#

Yes

#

onDisable runs when your plugin disables

#

And I assume the event will trigger as well

#

But I’m not sure if you will receive your own plugins disable event

#

Depends if it runs before or after the actual disable

lost matrix
#

I think what he wants to know if the listener which is registered by his plugin
handles the event that is fired when his own plugin disables. So does it catch itself.

young knoll
#

Cancel the entity damage by entity event if the arrows shooter and the target are the same entity

#

The arrows shooter would be event.getDamager.getShooter

lost matrix
#

EntityDamageByEntityEvent
Check if damager is Projectile
get ProjectileSource
check if its a Player
check if the source is equal to the damaged entity

tardy delta
#

what will happen when i call FileConfiguration@getBoolean on a path which returns a long?

#

just wondering

tardy delta
#

i should test it lol

young knoll
#

It may just use Boolean.valueOf

#

Which defaults to false

tardy delta
#

ye

misty current
#

can you get colored glass from a chatcolor constant?

young knoll
#

Not directly

#

You’d need some kind of mapping

quaint mantle
#

the rust in me is saying switch statement
my java self is saying map

young knoll
#

Switch is fine

#

You can use the fancy return switches

misty current
#

thats my idea unless there is a fancy method i don't know of

quaint mantle
#
switch (color) {
    case BLUE -> Material.BLUE_STAINED_GLASS;
}

i forgot the java syntax

misty current
#

it used to be easier when the glass color depended on the damage

glossy venture
quaint mantle
young knoll
#

Some just don’t have a match

#

Like brown

glossy venture
#

oh

quaint mantle
#
public Material matchChatColorMaterial(ChatColor color) {
    return switch (color) {
        case BLUE -> Material.BLUE_STAINED_GLASS;
        default -> null;
    };
}

i really need to stop changing languages every month

hybrid spoke
#

return Material.matchMaterial(color.name() + "_STAINED_GLASS");

young knoll
#

Doesn’t work

#

there is no gold stained glass

#

Or aqua

quaint mantle
#

if you want null

hybrid spoke
#

yep

young knoll
#

True but there are matches

lost matrix
#

return color == ChatColor.BLUE ? Material.BLUE_STAINED_GLASS : null;

young knoll
#

Gold -> orange

young knoll
#

Aqua -> cyan

quaint mantle
#

giving the switch example

quaint mantle
#

even though you can just match material

#

if null, return the default

#

but shorter code != better, right

lost matrix
quaint mantle
tardy delta
#

haha no

lost matrix
#

thats what peak performance looks like

fossil lily
#

How can I test if the open inventory is an ender chest with the InventoryMoveItemEvent?

lost matrix
lapis widget
fossil lily
lapis widget
#

InventoryType.ENDER_CHEST is a thing

lost matrix
#

Guys stop. This event is not fired for ender chests. How should a hopper transfer items into an enderchest?

fossil lily
#

xd

fossil lily
#

CustomEnchants thanks :D

grim ice
#

yeah how would it know the ender chest owner

#

might make a plugin for that tbh

lost matrix
#

Are you guys ignoring me?

young knoll
#

Yes

#

Heck you

lost matrix
#

He will come back soon...

eternal night
#

so glad hoppers are moving items into my enderchest πŸ™

grim ice
#

nah i would never ignore u :o

#

That sounded cringe

young knoll
#

You can’t hopper an ender chest

hexed hatch
grim ice
#

You cant lmfao

hexed hatch
grim ice
#

git is being an ass to me

#

help

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

grim ice
#

gpg: skipped "2Hex email@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

lapis widget
#

its trying to tell you that you don't have a secret key

grim ice
#

Duh

lost matrix
grim ice
#

but how do i fix it lol

lapis widget
#

give it the secret key it wants

glossy venture
#

you would need to assign the chest to a player

grim ice
#

howÉ

glossy venture
#

then you can

young knoll
grim ice
#

Can someone help

hexed hatch
#

You would just have to make the interaction yourself

grim ice
#

gpg: skipped "2Hex email@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

glossy venture
#

not possible in vanilla

grim ice
#

i've been malding over this

royal portal
#

How can I make my server to make sure no mobs will spawn? Thank you for helping ☺️☺️

glossy venture
#

/gamerule doMobSpawning false

#

or use a simple plugin

#

to do it globally

royal portal
glossy venture
#

idk

lost matrix
#

I was so done after that#

glossy venture
#

yeah

#

braindead

grim ice
#

I mean it isn't as bad knowing they're teenagers

#

it's worse when the adults you live with everyday are worse than that

#

yes

#

!!

glossy venture
#
public enum SuccessfullyRemovedOneFromTheSpecifiedInventory {
  YES_IT_DID_SUCCESSFULLY_REMOVE_ONE_FROM_THE_SPECIFIED_INVENTORY,
  NO_LOL
}

public static SuccessfullyRemovedOneFromTheSpecifiedInventory removeOne(Inventory inventoryToRemoveFrom, ItemStack itemToRemove1From) {
        int sizeOfTheInventoryToRemoveFrom = inventoryToRemoveFrom.getSize();
        for (int iterator = (9 - 9) + 1 + Math.pow(5, 0) - 2; iterator < sizeOfTheInventoryToRemoveFrom; iterator++) {
            ItemStack itemInInventory = inventoryToRemoveFrom.getItem(iterator);
            if (itemToRemove1From.isSimilar(itemInInventory)) {
                int amountOfItemInInventory = itemInInventory.getAmount();
                if (amountOfItemInInventory > (9 - 8) * 8 - 1 * 5 + 15 - 17) {
                    {
                      itemInInventory.setAmount(amountOfItemInInventory - 1);
                    }
                } else {
                    {
                      itemInInventory = null;
                    }
                }
                inventoryToRemoveFrom.setItem(iterator, itemInInventory);
                return SuccessfullyRemovedOneFromTheSpecifiedInventory.YES_IT_DID_SUCCESSFULLY_REMOVE_ONE_FROM_THE_SPECIFIED_INVENTORY;
            }
        }
      return SuccessfullyRemovedOneFromTheSpecifiedInventory.NO_LOL;
    }
#

the most efficient and clean way

#

to do it

grim ice
#

actually it isnt possible to do this with java, learn Fortran

glossy venture
#

assembly

grim ice
#

nah binary

glossy venture
#

flip the switches in the cpu

#

to execute the jvm with your hands

grim ice
#

do it with manipulating each bit to form the text you use to code in Fortran

glossy venture
#

yes

#

manipulate each bit to form the java source code, then attach and flip switches in the cpu to run javac, jar and java by hand

#

ah fuck

#

let me fix

#

there fixed it

#

what did i miss

#

no naming inconsistency is good

#

good practice

#

its going to create a .sk file that steals your data

#

i forgot

glossy venture
grim ice
#

a .sk is a skript file btw

glossy venture
#

ii know

#

thats why the review is ridiculous

#

its a reference to a review kacperleague got

#

yeah

#

at google

#

yes

#

and steal files

#

of course

#

get the location and then fly a drone there to physically pick up the computer

#

thats a great idea

#

and then fly back

#

and then remove 1 from the other person

#

because you stole it

glossy venture
trail pilot
#

how i can send title for cooldowns like 1, 2 , 3, go

waxen plinth
#

Should return a boolean for whether it was successful in removal

waxen plinth
#

No

#

Don't use a bukkit runnable

#

People

#

Stop using bukkit runnables

trail pilot
#

?

waxen plinth
#

Schedule a delayed task that waits 1 second and sends "3"

#

Another that waits 2 seconds and sends "2"

#

3 seconds and "1"

young knoll
#

Or

waxen plinth
#

4 seconds and "go" and then does whatever else

young knoll
#

Use 1 task

waxen plinth
#

Yeah you could also use a repeating task

trail pilot
glossy venture
#

i used a better design

#

lmfao

#

yeah that was my idea too but the enum is better

#

for readabiliity you know

#

you want developers to know that it successfully removed one from the specified inventory

#

oh yeah

lost matrix
#

Cooldowns should always be done using timestamps. No exception.
The task that shows a cooldown is just an observer

young knoll
#

I schedule 1 task per second of cooldown

#

Smh

trail pilot
#

so uhm

glossy venture
#

worst code snippet ever

lost matrix
glossy venture
#

nah

lost matrix
#

I did a nice commit to that. Let me find it XD

#

There are some gems in there

glossy venture
#

first thing i click on

lost matrix
glossy venture
#

oh no

#

you know what i will add unnessecary math

lost matrix
trail pilot
#

0 of 0

trail pilot
lost matrix
#

Let me write an example

trail pilot
#

using scheduleSyncDelayedTask for teleport delay

trail pilot
lost matrix
#

This is the recursive approach:

  public void invokeEachDeltaThenRun(JavaPlugin plugin, int delta, int count, IntConsumer nConsumer, Runnable action) {
    Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
      if (count == 0) {
        action.run();
      } else {
        nConsumer.accept(count);
        this.invokeEachDeltaThenRun(plugin, delta, count - 1, nConsumer, action);
      }
    }, delta);
  }
young knoll
#

Ew not a repeating task

lost matrix
glossy venture
#

@quaint mantle
#general message

#

i moved the horrible code

lost matrix
#

Example usage:

  public void tpAfterSeconds(JavaPlugin plugin, Player player, Location destination, int seconds) {
    this.invokeEachDeltaThenRun(plugin, 20, seconds, n -> player.sendMessage("TP in: %ds".formatted(n)), () -> player.teleport(destination));
  }
young knoll
#

I didn’t know β€œβ€.formatted was a thing

rough drift
#

how does spigot actually launch the server? I've looked at the only package there is and this is everything

glossy venture
# trail pilot Uhmm
Parameters of his method:
1 - The plugin.
2 - The amount of ticks between iterations.
3 - The amount of times it will run.
4 - The code to run every iteration, 'n' is the iteration.
5 - The code to run at the end
rough drift
#

confused

#

this is the actual one?

lost matrix
#

Btw this is the iterative implementation of the method:

  public void invokeEachDeltaThenRun(JavaPlugin plugin, int delta, int count, IntConsumer nConsumer, Runnable action) {
    new BukkitRunnable() {
      
      private int internalCounter = 0;
      
      @Override
      public void run() {
        if (internalCounter++ == count) {
          action.run();
          this.cancel();
        } else {
          nConsumer.accept(count - internalCounter);
        }
      }
    }.runTaskTimer(plugin, 0, delta);
  }
glossy venture
#

if you need like 1000 iterations for some reason

young knoll
#

You won’t either way

glossy venture
#

oh yeah

young knoll
#

Because of the delayed task

glossy venture
#

nevermind

#

lmfao

#

thats a con

#

of the method

young knoll
#

But the iterative one is nicer

lost matrix
#

But with the other one you can use the word recursive and people will think you know what you are doing even when im not...

glossy venture
#

no crashes :(

young knoll
#

IMO

lost matrix
trail pilot
young knoll
#

I once caught stack overflows and used that as a limit for my recursion

#

Heh...

tall dragon
#

does anyone know why i get this error? java.lang.IllegalStateException: Already scheduled as 22
when as far as i know i check if its not running yet if (!Bukkit.getScheduler().isCurrentlyRunning(regenService.getTaskId()) && !Bukkit.getScheduler().isQueued(regenService.getTaskId())) regenService.runTaskTimer(this, 5 ,5);

supple elk
#

Hey guys πŸ™‚ - I'm thinking about making some custom projectiles and wanted to know if anyone had any ideas on how to implement. My current ideas are using a location and velocity, then use a ray trace each tick (looking ahead the distance the projectile will travel in the next tick) to see if there would be any collisions with entities or blocks and act accordingly. Could then also move an item along the same path (having disabled it's gravity) or/and particles. Thoughts?

young knoll
#

Why not use a snowball

#

And just change the display item

lost matrix
supple elk
#

What if I don't want the curve of a snowball?

#

ah

young knoll
#

Fireballs work too

#

They fly straight

supple elk
#

I can just set it's velocity

glossy venture
#

you might be able to set the init velocity

tall dragon
glossy venture
#

yeah

supple elk
#

snowball could work nicely I suppose πŸ€”

lost matrix
supple elk
#

are there any disadvantages of using a snowball?

supple elk
#

what are the disadvantages of the system I proposed?

lost matrix
supple elk
#

right

#

Making a system like that seems fun

#

I swear I only make back end lmao

lost matrix
# supple elk Making a system like that seems fun

It is. I wrote a modern weapon system for a server once where they could define everything from the energy density of the powder
to the mass of the bullet. And i added a lot of physics like wind and earth rotation (Coriolis force) to calculate the bullets trace
and impact energy.

young knoll
#

Nerd

#

:D

lost matrix
#

And i stand by it

lost matrix
#

Only problem was that they disabled some features because the players where too confused why their bullets didnt fly straihgt... too much cod

supple elk
#

hahah

#

So I'm guessing I'd have an abstract class for the projectile base, with the basics like raytracing etc

#

then for any one projectile I can make a child

young knoll
#

I still need to do my super realistic survival plugin

#

I keep starting it then giving up for some reason

supple elk
#

punch a tree: dies

#

dig a single block: exhausted for the rest of the day

#

like srsly, digging a meter cubed would take forever

young knoll
#

Good point

#

I’ll also add backhoes

supple elk
#

backhoes?

young knoll
#

Those things

#

Excavator if you prefer

supple elk
#

lmao

grim ice
#

Uh

#

the name is pretty dumb rn

#

but ignoring the name, can you give code suggestions

young knoll
#

Does it save everything

#

Even fancy stuff like villager data

grim ice
#

Yea

lost matrix
#

Your Factory<T, Y, Z> is just a BiFunction<T, Y, Z> πŸ˜„

grim ice
#

Possibly

grim ice
#

didnt think of that

#

should i replace it

#

but it feels cooler having my own interface

lost matrix
#

Nah keep it.

grim ice
#

stuff inside core are supposed to be like

#

the internals

#

and the stuff inside api directory can be used by developers

terse ore
#

What's the difference between EntityDamageEvent and EntityDamageByEntityEvent

lost matrix
grim ice
#

EDBEE: e.g player killed player
EDE: e.g player died from fall damage

young knoll
#

Not all damage involves a second entity

lost matrix
young knoll
#

Like hugging a cactus

grim ice
#

i place a structure

#

so i dont have access to the entity

#

well i can use getEntities() but im not sure if that would work

young knoll
#

So you turn the entity into a NBT structure to save it

grim ice
#

so i have 2 methods atm

young knoll
#

Clever

grim ice
#

I should credit @hexed hatch

lost matrix
#

Wait a second. I just realised that you are just serializing the entitiy into a structure.

grim ice
#

for that

young knoll
#

Probably not as efficient as NMS

lost matrix
#

Interesting

young knoll
#

But hey, it’s all API

terse ore
#

πŸ™‚

grim ice
#

and im gonna make some documenting on how to use it

#

and also test it

#

since its untested rn

#

there are 2 methods

#

one that uses getEntities() of the structure

#

one that returns an EntityResult

#

that you can later spawnAndGet()

#

or spawn()

#

better than exposing structures api to the user

#

which seems dumb imo

mellow edge
#

how hard would be decompiling original mc server file and add /home command in it and compile it again

young knoll
#

Not that hard

#

But like

#

Why

grim ice
#

just make a plugin

mellow edge
#

I made it

grim ice
#

um

#

this.lol?

mellow edge
#

lol

#

private String lol = "";

#

I think that's delhome command, and that this is the only not logicaly named variable

#

yes it is delhome

#

but what if I wanna vhave vannila mc server????? then decompliling it would defenetly be a challange to me

young knoll
#

Why would you need to have a vanilla server

mellow edge
#

redstone gang😎

young knoll
#

Spigot doesn’t change redstone

mellow edge
#

it breaks some machines

young knoll
#

I haven’t had any issues

mellow edge
young knoll
#

I know paper changes redstone, but I don’t recall spigot doing anything

#

Either way, fabric exists

mellow edge
#

why anyone wants me to go to third party servers, ik that performace is batter and plugins are good but that's literaly all

hexed hatch
mellow edge
#

(joke)

grim ice
#

alr

hexed hatch
#

wait so you get EntityResult from that method?

#

and you can just spawn it from that?

#

without placing the structure?

grim ice
#

nah

#

EntityResult is a class i made with methods

#

spawnAndGet()

#

and spawn();

hexed hatch
#

Ah

grim ice
#

you cant get without spawning

#

or you can use the other method

hexed hatch
#

Figured. Still, it's all api

grim ice
#

possibly easier to use

#

literally just:

tall dragon
young knoll
#

Yes

brave sparrow
grim ice
#

EntitySerializer.setPlugin(this);
EntityHolder holder = EntitySerializer.getHolder();

then later:
holder.serialize(entity, namespackedkey);

#

holder.deserialize(namespacedkey);

#

or holder.deserialize(namespacedkey, true)

#

second one returns an entity result

#

which u can use to spawnAndGet() or spawn()

#

what do you think about its complexity?

hexed hatch
#

seems as simple as it needs to be to me

grim ice
#

im just gonna use my library later in the plugins ill make

#

cuz rn it needs testing, not sure if it will work

#

ngl i suck at making READMEs

hexed hatch
#

can you send me a copy of the class?

#

wanna take a look at it myself

grim ice
#

EntityResult?

#

or

hexed hatch
#

Probably EntitySerializer

grim ice
#

that's main class

#

and its pretty ugly atm

#

but alr

trail pilot
#

i want ppl use %delay%

#

so they can do like lol %delay% or %delay% L

grim ice
#

Uh

#

I should make a jitpack thing

young knoll
#

String.replace(β€œ%delay%”, number)

visual viper
#

Hello, how can I make it so that when a player places a block, they have to wait 10 seconds for it to break?

trail pilot
grim ice
#

btw

#

if someone uses the dependency

#

<dependency>
<groupId>com.github.2Hex</groupId>
<artifactId>EntitySerializer</artifactId>
<version>e08535f18f</version>
</dependency>

#

why is the version like that in jitpack

trail pilot
grim ice
#

if you didnt understand what he just said u dont know basic java concepts, u prob should read or watch some tutorial

trail pilot
young knoll
#

String being your string

trail pilot
#

oh

#

just tested it an dont works

#

its always saying my number

#

5

white root
#

How would I access and loop over this configuration```yml
Some-section:

  • Some-Thing: true
    Some-Other-thing: false
    Some-Final-Thing: false
    Information:
    • "String"
    • "String"
    • "String 69"
  • Some-Thing: false
    Some-Other-thing: false
    Some-Final-Thing: true
    Information:
    • "Information"
    • "Or Something"
    • "String 420"
      Some-Unrelated-value: false
      ```How would I go about looping over the "Some-section"?
ivory sleet
#

getMapList iirc

grim oak
#

hi im new to development, i was wondering why for the following event empty lines get printed to the console for each of the trades the villager has (so if the villager has 4 trades, 4 blank lines are printed to the console) ```.jar
Merchant merchant = ((MerchantInventory) event.getInventory()).getMerchant();
List<MerchantRecipe> recipes = new ArrayList<>(merchant.getRecipes());

    for (var recipe: recipes) {
        System.out.println(recipe.getResult().getItemMeta().getDisplayName());
    }```
young knoll
#

getKeys is also an option

white root
#

Alright, thanks for the speedy reply, Ill check those out
<3

ivory sleet
#

I mean it’s a list

young knoll
grim oak
#

wouldnt it just be like 'Emerald' and 'Bookcase' for each of the trade results etc

young knoll
#

No

#

Display names have to be custom names

grim oak
#

ohh

#

so how do i get the item name

young knoll
#

I think there is a getLocalizedName

#

Or you can toString the material

grim oak
young knoll
#

Probably only works if they have custom meta

#

Which I assume they don’t

grim oak
#

nno they dont

young knoll
#

So you’ll have to toString the material

grim oak
#

like so? System.out.println(recipe.getResult().getType().toString());

young knoll
#

Mhm

grim oak
#

thanks

grim ice
#

rate the readme

#

and the code if you want

hybrid spoke
#

-2/10

grim ice
#

pog

#

its close enough

#

not that much of a gap to 3

opal juniper
#

im confused as to the point

#

bukkit already serialises entities

grim ice
#

wat

#

but is there a way to serialize an entity without nms

opal juniper
#

yeah? its done by default? what do you mean? it gets saved with the world

grim ice
#

well

young knoll
#

Yeah but that doesn’t let you copy and paste em

grim ice
#

and we're not doing that much shit

#

we're using structures api

#

bukkit will do the rest of nbt copyng shit

hasty prawn
#

2Hex I don't understand the point of the 2 deserialize methods

#

Why are there 2 and why does 1 have a useless param lol

grim ice
#

well

#

first one might not work

#

second has a higher chance of working

#

its still in development

#

ill test both and see which to remove

hasty prawn
#

Why not just use the second one then lol

grim ice
#

well it might not be what i think

#

so i just wrote both of my ideas

#

kekw

hasty prawn
#

Ah gotcha lol

#

Just one other thing

#

In EntityResult you throw RuntimeException, might be better to throw something more specific

grim ice
#

Yeah ill make my own exception

#

probably

hasty prawn
#

Ok good

grim oak
#

I usually program in c# .Net framework, and in there theres a method called Any(), and you use it like itemlist.Any(item -> item.name == "exampleName") and it returns a bool true or false if the list contains an item with name "exampleName", so my question is, are there any methods like that i can use in java?

hasty prawn
#

list.stream().anyMatch()

grim oak
#

thanks!

lime ferry
#

hey i am seeking a developer for my server dm me if your wana take a change

hasty prawn
#

?services

undone axleBOT
grim ice
#

Anyways I have a question

#

ATM I've realised I might have a mistake

#

which is making a structure everytime I need one

#

(it's only 3 blocks btw)

#

should I make some sort of StructurePool

#

if so any ideas for its logic?

chrome beacon
#

A structure pool sounds smart

grim ice
#

i need some logic tho

#

maybe make a ton of structures

#

check if theyre used or not

#

or

#

add structure when placing it to arraylist

#

or actually

#

nvm

floral pewter
#

Hey, I'm currently trying to integrate the Ebean ORM into my plugin. Although when I start using my models, I get an error saying java.lang.IllegalStateException: Service loader didn't find a SpiContainerFactory?.

I have looked this up and found a thread with my exact problems on the forums (https://www.spigotmc.org/threads/spigot-ebean-orm.452192/). They stated that the solution lies in correctly shading the Ebean framework into my JAR. However I am already shading it, and have verified it by seeing the packages inside the final JAR.

Is there anything I might have missed?

grim ice
#

im not sure what logic should i do when making a structure pool tbh

chrome beacon
#

Are you talking about a vanilla structure pool or a pool system that you want to make

grim ice
#

a pool system i want to make

#

so im making a structure using structure api introduced in 1.17.1

#

but

#

is making a 3 blocks structure every time i need one

arctic moth
#

how would i make a sort of "suction"/orbiting effect kind of like gravity to an object without it murdering the tps

grim ice
#

good

floral pewter
#

Ebeans integration

grim ice
#

prob not

royal portal
#

Why can't I find a spawner in my server in my inventory in creative mode???

floral pewter
#

Just like fire, portal and end portal etc.

#

do /give @p minecraft:spawner instead

livid tundra
#

where do I place the config.yml file in the plugin(before compileing)

floral pewter
livid tundra
#

k, thx!

floral pewter
#

correction: inside src/main, next to your package name

livid tundra
#

ok, thanks!

royal portal
floral pewter
#

Screenshot?

royal portal
terse ore
#

How can I use "Γ‘"

floral pewter
#

πŸ˜… Thanks for the clarification

#

We solved the spawner issue in DMs

mortal hare
#

i dont get it

#

inventory.getItem() returns null if ItemStack is empty

#

i get itemstack object of air

#

from the same method, even though it should return null in that case, since its empty (zero)

livid tundra
#

how would I check if a player is new to the server

#

online

mortal hare
#

usercache.json caches player's uuids which played in the server

#

although there should be wrapper methods to access it

#

^^

young knoll
#

Like this one

livid tundra
#

oh

#

is there a way to edit the hasplayedbefore tag?

young knoll
#

Player

livid tundra
#

like, is there a player#setPlayedBefore()?

young knoll
#

No

floral pewter
#

You could probably do it with NMS

livid tundra
#

nms?

floral pewter
#

net.minecraft.server

#

?

livid tundra
#

yes

floral pewter
#

Ah

#

Regardless. net.minecraft.server is the base minecraft package. Simply said, it allows you to mess with minecraft's code directly

#

But it's difficult and hard to maintain

#

Always use Spigot API if you can