#help-development

1 messages · Page 821 of 1

west prairie
#

Yes

eternal oxide
#

100% sure? open it with any zip tool

west prairie
#

I put it as a resource on the project

#

Yes 100% sure

minor junco
#

Shouldn't the file output be

new File(getDataFolder(), "config.yml")
```?
#

Ah nvm

west prairie
#

But actually it cannot be generated in the folder of the server

eternal oxide
#

?paste your Configuration class

undone axleBOT
green plaza
#

I created proxy and when i connect player to the server i put inside LoginRequest these data

Kazaruma:fd516454-89e9-435d-a163-2a8cbea8f145

Server respond me with this data in LoginSucess packet

Kazaruma:b164e9fa-de12-391f-91e9-24ce1ecfc512

Any ideas why that happen? UUID that starts with "fd" is my online-mode UUID

west prairie
#

Yes it cannot generate config

eternal oxide
#

ok, scrap that whole class

west prairie
eternal oxide
#
    @Override
    public void onEnable() {
        saveDefaultConfig();
        ...```
#

then anywhere that accesses the config you use Plugin#getConfig()...

smoky oak
#

hey elgar do u know how to design software?

eternal oxide
#

yes

smoky oak
#

ye so issue

west prairie
#

@eternal oxide So, ```@Override
public void onEnable() {
saveDefaultConfig();
...

    map = new LeafMap();
    
    getCommand("leavesreload").setExecutor(new CommandExecutor());``` ?
eternal oxide
#

if you need to access the config in LeafMap you do java map = new LeafMap(this);and add a constructor to the LeafMap class to pass JavaPlugin

eternal oxide
#

it just means continues, more etc

smoky oak
#

im trying to write a library to make the event passthrough easier -I need that for some plugins im working on
what i basically need is a starting point on how to design it

My idea is to have some sort of interface in the library that other plugins extend and register with the library

#

but i absolutely do not know how to structure it

river oracle
#

mojang is going to drive me crazy

      public MapColor getMapColor(BlockGetter level, BlockPos pos) {
            return this.mapColor;
        }
``` behold the method with two parameters that uses exactly 0! of them
eternal oxide
#

lol

river oracle
#

this leaves making the API interestingly annoying. I feel obligated to use a Location paramater in the method, but it does fucking nothing!!!

eternal oxide
#

getMapColor(null, null)

river oracle
#

😮‍💨 the issue with that is what is mojang does something down the line with those two weird ass params

#

then the API breaks

eternal oxide
sullen marlin
#

Sure it's not overriden

river oracle
sullen marlin
#

Are you sure there aren't blocks that override it

eternal oxide
smoky oak
river oracle
#

seems like they may have plans or something?

smoky oak
#

events then call that empty method

west prairie
#

Need import ?

smoky oak
#

I'd like to handle it in a way that's more like actual event handlers

eternal oxide
#

yes

smoky oak
#

if that makes sense

eternal oxide
#

if I were you I'd just plug in to the Bukkit event bus

#

simplest and all plugins already implement it

west prairie
west prairie
smoky oak
eternal oxide
#

server running a remapped jar

#

as you are not remapping you can;t run against a remapped jar

#

thats what maven and specialsource does

#

all teh translations for you

west prairie
#

I can't use a spigot basic server?

eternal oxide
#

not unless you remap

west prairie
#

Ahh so I need Maven to remap?

eternal oxide
#

?nms maven+specialsource

eternal oxide
#

maven will be included with your ide

west prairie
#

I wanted to avoid Meaven lol

eternal oxide
#

you just have to convert your project to a Maven project

#

and setup your pom.xml

west prairie
#

I need to delete all librairi on the project two no?

eternal oxide
#

Which IDE, I'm guessing InteliJ as you decompiled into it

west prairie
#

Yes InteliJ

eternal oxide
#

I don;t know InteliJ enough to tell you have to auto convert

wet breach
west prairie
#

I don't know, I like the basic artifac build

wet breach
#

Ah ant build system

west prairie
#

I came from Eclipse at the time aha. Maven is very useful for using open source projects

wet breach
#

Maven is useful for many kinds of projects including non open source ones

west prairie
#

But as a result I have never converted a project to Maven. Where can we find this?

eternal oxide
#

I use Eclipse due to light memory footprint and personal preference.

#

probably somewhere in teh File menu

wet breach
west prairie
#

I've already seen several

wet breach
#

You will have to slightly alter your src directory as ant and maven dont quite use the same

eternal oxide
#

in InteliJ its add Framework

#

right click Project

#

add framework support

smoky oak
#

elgar, my question?

eternal oxide
#

your lib shoudl be as simple to use for everyone

#

so don;t go making your own event system

#

you could have yoru own event registry if you want

#

but fire it all through the bukkit event bus

west prairie
#

I don'y have framework on the list

eternal oxide
#

right click project name

#

there shoudl be an option in the menu to add a framework

#

that opens a window and should have maven and gradle

#

unless it is already mavenized and you just don;t use it

#

does your project have a pom.xml in its root?

west prairie
#

Yeah that tells me a few more things, but no trace in the right click

#

No Pom.xml

#

It's very strange

#

I see video and he have add framework

eternal oxide
#

I remember seeing somewhere ages ago that INteliJ may not offer the maven framework if it's never had a maven project before

#

create an empty new maven project

#

you can throw it away after

#

see if you then can add the framework to your plugin

west prairie
#

i have meaven project lol

#

very strange

#

i try to restart

eternal oxide
#

setup your pom.xml the same as in the NMS wiki

#

?nms

eternal oxide
#

just change version info for the correct one

west prairie
#

InteliJ Crashed

#

Still no framework display. I think I'll just copy everything

charred blaze
#

implementation group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '4.7'

west prairie
#

Ok get it

charred blaze
#
Searched in the following locations:
  - https://oss.sonatype.org/content/repositories/snapshots/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.pom
  - https://oss.sonatype.org/content/repositories/central/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.pom
  - https://repo.codemc.io/repository/nms/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.pom
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

#

how do i fix this?

#

what repo do i need to link for it?

dry hazel
#

central

proud badge
#

How could I go about using a new line? I tried using \n a while ago and it kept printing stacktraces

#

Specifically: discord webhook

#

Or maybe this isnt the right place to ask

charred blaze
dry hazel
#

joptsimple is on maven central

#

mavenCentral() for gradle

exotic obsidian
#

hello

slender elbow
#

hi

exotic obsidian
#

who has experience with anti-cheat?

dry hazel
#

not me

slender elbow
#

same

dry hazel
#

ask your question

exotic obsidian
#

ahh

#

i don't know which anticheat should i buy

#

there's two

#

Adavnced AntiCheat (AAC)

#

or

#

Verus

smoky oak
#

hm, brute force might work here. how expensive are event/method calls?

#

like just the call itself

charred blaze
#

now i get this error

dry hazel
charred blaze
#

whats that's url?

slender elbow
#

mojang's maven repo for mc

dry hazel
#

://

slender elbow
#

:/

eternal night
#

:@

charred blaze
#

uhh

west prairie
#

I think I did well with Meaven

eternal oxide
#

you need to fix any access to the config

charred blaze
#

okay no errors now

#

but why

eternal oxide
#

Leaves.getInstance().getConfig()...

west prairie
eternal oxide
#

LeafTypes.java:69

west prairie
#

The plugin already used Leaves.getInstance().getLogger() or getConfig

eternal oxide
#

not quite, it used to use Leaves.getInstance().getConfiguration()...

west prairie
#

LeafTypes 69 is not config

smoky oak
#

oh elgar u still here
found a way to describe my issue better

eternal oxide
#

ohg

west prairie
#
        net.minecraft.world.level.block.Block block = CraftMagicNumbers.getBlock(material);
        MapColor mc = block.defaultMapColor();
        return Color.fromRGB(mc.col);
    } <- 69
}```
:/
eternal oxide
#

did you remove all libs from teh project, like spigot jar?

#

and depend on spigot in your pom?

west prairie
#

Normally yes

eternal oxide
#

?paste your pom

undone axleBOT
west prairie
#

All external librairie is Meaven

eternal oxide
#

looks good

smoky oak
#

the problem im having is that i want to tie specific things to specific players, and most of those things trigger off events
as a result of that the different 'interactions' need different evenets
if i were to do the events normally, i would have to register the event classes every time i instantiate the interactions, per player, which sounds... bad, and de-registering is probably similarly annoying

thats why i originally did the passthrough in the first place, to not have to do so much event stuff. I can just collect all instances in one large arraylist and every time an event happens tell each interaction instance 'hey this event happened'

eternal oxide
#

are you running maven package in teh maven window?

west prairie
#

Yes

eternal oxide
#

Maven window -> lifecycles -> ...

west prairie
#

Yes yes

#

Clean

#

And Package

eternal oxide
#

hmm

#

that method should be there just fine

west prairie
#

Afterwards, he gave me 4 plugins, which one can I use?

eternal oxide
#

the one with the shortest name

west prairie
#

I have
Leaves-1.0-SNAPSHOT-remapped-obf
Leaves-1.0-SNAPSHOT-remapped
original-Leaves-1.0-SNAPSHOT
Leaves-1.0-SNAPSHOT

#

I use the last

eternal oxide
#

yep

west prairie
#
        try {
            getSource().save(getFile());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
He say problem here
#

i need to write getConfig().save?

eternal oxide
#

yes, no getSource

#

no fiel or anything

#

just Leaves.getInstance().getConfig().save();

west prairie
#

cannot methode save

grave vale
#

is this chat english only? I might be able to help since we're both french
(also hello ElgarL)

#

if language is being a barrier ofc

eternal oxide
#

Leaves.getInstance().saveConfig()

charred blaze
smoky oak
#

dms are fine, but i believe english is enforced here

grave vale
#

alright

grave vale
#

Anyone got an idea why I keep getting yeeted off the resources publication page whenever spigot decides to save my draft?

#

Whenever I stop typing I get yeeted off and lose my progress

eternal oxide
smoky oak
echo basalt
#

Reminds me of my quests system

smoky oak
#

wym

echo basalt
#

You can for example have each listener with a Collection<UUID> availablePlayers

#

and do stuff

#

And given you just standardize it, will work

smoky oak
#

hm thats a good point, it'd get rid of the 'one instance per player' part

#

theres like a nagging part in my mind thats like 'isnt there an issue with this' tho

young knoll
#

Seems fine to me

smoky oak
#

whats O of collection.contains again

young knoll
#

What collection

echo basalt
#

Depends

#

HashSet is O(1)

#

Shouldn't be that big of a worry if you're only storing 0-200 values

smoky oak
#

true that

echo basalt
#

it causes worries when you're storing like 10 billion

young knoll
#

We love Hashsets

river oracle
#

HasSets only trash if u got lots of collisions

remote swallow
#

do you has set

river oracle
#

Which shouldn't happen given you use a good hashing algo

smoky oak
#

i didnt do anything yet

#

im trying to figure out how to structure it so its less shit than usual

young knoll
#

That’s why I use enums for everything

#

No collisions there

smoky oak
#

i def cant use enums here

young knoll
#

Not with that attitude!

smoky oak
#

no this is a library

#

i cant know what effects other people make

young knoll
#

When do we get 64 bit hashcode

river oracle
#

That'd be fucking crazy though

#

You'd need what 2 billion element array xD

#

No 9 quadrillion element array lmao

#

Imagine

#

Muh ram

young knoll
#

I thought it was like 5 quintillion

river oracle
#

It was either 9 quadrillion or 9 quintillion

young knoll
#

We are both wrong

#

It’s 18 quintillion

#

Actually with a sign bit then yeah

remote swallow
#

can i get that in petabytes

young knoll
#

9 quintillion

river oracle
#

18 quintillion it is

remote swallow
#

9 quintillion petabytes

river oracle
remote swallow
#

uhhhhhhhhhhhhhh

#

maybe next year

river oracle
#

Okay how about a 32bit hashset

remote swallow
#

next year too

river oracle
#

8 bit hashset

smoky oak
#

oh i just remembered i wanted to ask this

#

is there a way to force the JVM to compile? to not have JIT nonsense while profiling?

river oracle
#

Why 💀 wtf cursed shit are you doing

smoky oak
#

testing if hashset really is O(1) if i put 50M values in it

river oracle
#

It is

#

Unless theirs a collision

smoky oak
#

eh, i was mostly joking anyway. I'm not looking for it for a speciffic purpose

river oracle
#

In which case it's O(n) n being the size of the linked list

smoky oak
#

just to actually know how to do it

slender elbow
#

and you can't test it by just having 50M elements

smoky oak
#

i only have so much memory lol

slender elbow
#

you'd need to test for 5, 50, 500, 5k, etc

#

that's what O(x) means

river oracle
#

I always use
'1' as my hash function
HashSets are just glorified LinkedLists 💪🏻

young knoll
#

I just assign every instance an incrementing hash value

river oracle
#

Pray theirs not to many objects created

west prairie
#

@eternal oxide We managed to resolve all the console bugs at startup but there is a problem

#

There is this error when reloading the plugin.

young knoll
#

It’s the perfect algorithm for minimal collisions

west prairie
#
        if(this.players == null || this.players.length == 0)
            return;
        
        final Random r = ThreadLocalRandom.current();
        
        for(LeafSpot s : this.spots) {
            if(r.nextInt(100) > plantChance)
                continue;

            this.world.spawnParticle(Particle.FALLING_DUST, s.getX() + r.nextFloat(), s.getY(), s.getZ() + r.nextFloat(), 1); <- This Line (Line 93)

        }
        
        
    }``` Error is this line
river oracle
#

I think I'd only ever need to use that if I was working on a computer with like 2KB of ram

west prairie
weak meteor
#

where can i find comissions?

remote swallow
#

?services

undone axleBOT
smoky oak
#

what's better: Storing a hashset of player UUID or storing the currrent player object itself? Reference gets null'd/cleard on leave

#

i specifically need to access the player object in my code for the rest

ivory sleet
slender elbow
#

afaik it starts keeping a sort of linked list of elements whose hashes collide

#

oh and if it implements Comparable it will actually be a binary tree

#

which is pretty nice tbh

quaint mantle
#

How can I get the meta of the item attached to the fishing hook?

worldly ingot
#

You can't directly, but you can use FishHook#getShooter() to get the ProjectileSource that cast the line, check if it's a LivingEntity, get the item in its main hand

#

If the main hand is empty or not a fishing rod, the item in the off hand

river oracle
#

@worldly ingot do you think MD would accept a PR around the new Tick stuff. I know he has always been cautious about exposing that stuff in the past and I don't want to waste my time wrapping this stuff if it'll be denied

worldly ingot
#

I mean if it's a server feature then it's a server feature

#

Seems reasonable to expose some tick management stuff. No ticking events still though imo

quaint mantle
river oracle
#

but that's not really something in scope of this PR anyways

#

just kinda exposing the stuff the tick command can do

worldly ingot
# quaint mantle Can you write an example? I've tried so many times and I'm almost giving up now....

I mean I wrote it in English how exactly you'd go about doing it, but sure :p

public static ItemStack getFishingRod(FishHook hook) {
    if (!(hook.getShooter() instanceof LivingEntity entity)) {
        return null;
    }

    EquipmentSlot hand = EquipmentSlot.HAND;
    EntityEquipment equipment = entity.getEquipment();
    ItemStack itemStack = equipment.getItem(hand);

    if (itemStack.getType() != Material.FISHING_ROD) {
        itemStack = equipment.getItem(hand = EquipmentSlot.OFF_HAND);
    }

    return (itemStack.getType() == Material.FISHING_ROD) ? itemStack : null;
}```
wet breach
#

Does it need to be static?

worldly ingot
#

I wrote it kind of in a weird way here but this way gives you access to the EquipmentSlot hand if you wanted to return it in some POJO object

worldly ingot
wet breach
#

Ah

weak meteor
#

i got a question, why people use Interfaces to represent like players and stuff like that?

#

Bukkit Player is an interface

#

LuckPerms is an interface

#

my question is

#

how tf they create an instance of that?

remote swallow
#

bukkit is to seperate api v impl, for luckperms its probably so they have the methods that are on all platforms while having the seperate impl classes that make it work with the platform

#

eg bukkit has Player in bukkit and CraftPlayer in craftbukkit and craftbukkit contains the impl

weak meteor
#

hmm

#

yeah i dont understand to be honest

#

i think i'll still use normal Classes for players

worldly ingot
#

You don't always need an interface but if you find yourself copy/pasting similar methods between two classes that are somewhat related, perfect opportunity for an interface

#

Most common example is List which is an interface. You never create instances of it, but you use it all the time

#

You create instances of ArrayList

weak meteor
#

oh

#

so

#

lemme think

#

i can do like

#

EnderchestPlusPlayer implements Player cause

#

well

#

its a player

#

or is a bad idea

worldly ingot
#
public List<String> getAList() {
    return new ArrayList<>();
}```
Now apply that same concept to Bukkit
```java
public Player getPlayer() {
    return new CraftPlayer();
}```
weak meteor
#

ITS A TERRIBLE IDEA

remote swallow
#

i would avoid implementing any bukkit classes

worldly ingot
#

Yeah, if it's a Bukkit interface, unless explicitly stated otherwise, don't implement it :p

weak meteor
remote swallow
#

the only class that should should ever really extended is bukkit runnable

weak meteor
#

and it didnt even finish impelment methods

weak meteor
#

but for that i'll need an interface and a class and well, i just need UUID and a Enderchest

#

so i guess its not the appropiate

worldly ingot
#

Yeah you're probably fine with just a regular ole class

weak meteor
#

thanks

crimson scarab
#

how do i shade a dep?

chrome beacon
crimson scarab
#

nvm figured i all out

minor junco
#

I mean you could implement the player interface and proxy method calls to an underlying player object (which stems from Bukkit.getPlayer), you would need to ensure if the player is still valid

#

But that's a lot of work for when you could just do yourEnderchestPlayer.getPlayer(). ...

proud badge
#

What happens if I make the event handler a private void

#

instead of a public one

icy beacon
#

?tas

undone axleBOT
quaint mantle
#

Depends on java security

proud badge
#

also any1 know what I did wrong for it to not work?

quaint mantle
#

Did you register it?

proud badge
#

I forgor

quaint mantle
#

No usages in class

scenic onyx
proud badge
#

that works?

scenic onyx
rotund ravine
twin venture
#

hi , iam working on new system which is favorites maps :
in mysql should be :

  • uuid : map1
  • uuid: map2

but its weird .. its only saving 1 map only

ocean hollow
#

Problems with math, what's wrong?

icy beacon
#

Shouldn't it be Math.sin(Math.toDegrees(cannonPitch))

twin venture
ocean hollow
icy beacon
#

Fair enough

native bramble
#

u can do one

twin venture
#

that didn't change anything , i change it few minutes ago

#

yk how intellij idea can be sometimes

native bramble
#

i think its because u use insert statement, not update

ocean hollow
native bramble
#

u should use update statement if u already have data in db

twin venture
#

so what iw ant it to looks like is :
:
uuid : map-1
uuid : map-2
another uuid: map3

#

alr thanks let me try it out

#

well i use update iam not using insert ?

twin venture
native bramble
#

u need to check if this any info in db

#

if yes than use update statement

#

if db is empty than use insert statement

twin venture
#

it sasve only 1 string in database , it should save them one after another

#

like : uuid , map1 , uuid , map2 etc etc

dim sandal
#

How do I handle the command logic and tab completer in an organised way for a large command like this? Will the brigadier/lamp api make this easy?

claim
  - permissions
    - create
      - <newConfigName>
    - delete
      - [configName]
    - edit
      - [configName]
        - name
          - <newConfigName>
        - icon
        - scope
          - everyone
            - [permission]
          - <player | nation | nation_rank>
            - add
              - <newTargetName>
            - remove
              - [targetName]
            - permission
              - [targetName]
                - <permission>
                  - <true | false | unset>
slate pendant
#

How is inventory.first(ItemStack item) implemented? Does it have some optimized searth algorythm or it just iterates over all slots as usual? I mean, maybe it has some cache or smth like that

#

Seems like api doesn't contain the implementation

ocean hollow
#

Is it possible to rename a horse's gui?

twin venture
#

so it should be adding a second line :
uuid : sw [the other map name i added to the favorite Set<String>

shadow night
#

if a user goes from the overworld to the nether, will his pdc be different?

mellow edge
#

If I give two items of the same type different lore, will they be unstackable?

twin venture
shadow night
#

you can only stack items with the exact same nbt data iirc

mellow edge
#

That's good for me

shadow night
native bramble
mellow edge
#

That's what I am trying to do

#

Thanks for confirmation

twin venture
#

this one .

native bramble
#

send class where u use this methods

twin venture
#

for loading / saving :

#

for example :

#

so it works just fine if i just in the server and select them , they works just fine in the gui they show

#

but if i leave [ which will result in saving them into database ] , it will only save one..

native bramble
#

at first i recommend u use try except for automatically close statement

#

ur function createNewUser should add new unique uuid?

#

or it can be two equal uuid but with different maps?

#

as i understand swUser.favorites() return list or array with different maps for one player

twin venture
#

that's what i do :

#

yes exactly

twin venture
#

and it should be a set , so it won't duplicate maps name

native bramble
#

when u creating table u set uuid to primary key

twin venture
#

this is before i log out , after i clicked on the maps i want to add as favorite

native bramble
#

so it cannot be only one unique uuid in table

twin venture
#

oh that's why!

native bramble
#

yeah

twin venture
#

isn't that gonna be bad ?

#

if each user have tons of uuid in sql and map?

native bramble
#

u can just add another column like id

#

and its will be just indexes

twin venture
#

can't i have something like this :

uuid : map1,map2,map3,map4

native bramble
#

1 2 3 4 ... 100111...

twin venture
#

and then deserlize it ?

native bramble
#

and make this new column id primary

twin venture
#

alright thanks

native bramble
#

like u want

#

somebody creating a new tables for uuid

#

but i dont recommend u

chrome beacon
native bramble
#

because u will have many tables, dont think it good idea

twin venture
chrome beacon
#

Databases are specifically made to handle large amounts of data

#

You don't have to worry about storing multiple rows for favorites

native bramble
#

If you only need to store this data, you can use yml

chrome beacon
#

Well I this seems like some minigame thing

#

So it might need to be synced between servers

twin venture
proud badge
#

how would I make my code not have the return statement without it giving an error?

#

like I want it to void

alpine urchin
#

change the first String at the top to void

#

public void

proud badge
#

oh thanks

alpine urchin
#

that indicates what that function returns

proud badge
scenic onyx
proud badge
#

how

proud badge
#

retrooper already explained it

#

and if it works why change it

scenic onyx
dry hazel
#

lombok literally makes your code incomprehensible to anyone that doesn't use it

dry hazel
#

that's a fact

scenic onyx
#

Simple: @Getter = getFunction @Setter = setFunction

#

simple

dry hazel
#

what if I've never used or seen lombok, but used java, how am I gonna read your code then

#

not to mention it's an awful compiler hack

#

your IDE can already generate getters and setters for you

brazen hollow
eternal night
#

I mean, your IDE will literally not work unless you install a fucking plugin kekwhyper

#

there is also ✨ records ✨

molten hearth
#

Me when the developer doesn't understand what @Getter does

#

Back to the gulag

hazy parrot
#

All my homies hate lombok

dry hazel
molten hearth
#

User issue due to lack of knowledge

#

@Data my beloved

wet breach
#

just wanted to be sure I was part of that list uwu

hazy parrot
wet breach
molten hearth
#

I be teaching my uni classmates that barely know what an enum is how to use lombok

#

THEY DONT KNOW ME SON

wet breach
#

it really depends at what part of the process your processor acts on

eternal night
#

We love the "I have 0 idea what the fuck is going on" developers

dry hazel
wet breach
dry hazel
#

the api doesn't provide means to touch the ast

wet breach
#

this is why annotation processors can act before, during and after compile time as well as at runtime

#

take lombok for example. It acts at compile time and adds code

mellow edge
#

I dont understand from docs what IronGolem.setLeashHolder(Entity e) does

#

Could any1 explain what that does in-game

wet breach
# dry hazel the api doesn't provide means to touch the ast

as I said, there is no rules really in regards to annotation processors. If you want to base an annotation processor on what the JDK API provides the sure, however processors are not required to use the JDK api nor are they limited to said api exception being if its a processor that acts at runtime but even then it still depends as you could technically use native code. It really depends on what exactly the processor is for or what it is suppose to do

eternal night
#

if you put a leash on an iron golem, you are its leash holder

upper hazel
#

why when I create an error in the config (for example, I delete a value from a key) the log does not display this but shows the default value of the key after a reboot, although the key is empty in the config

wet breach
#

deleting a value from a key doesn't necessarily create an error

mellow edge
#

Oh I get it now, didn't know leashes were in 1.8.9

wet breach
#

as for showing default value, have to keep in mind that it depends at what time. The config stored is not necessarily the same as what is in memory

upper hazel
wet breach
#

well we have no code to look at, but not sure how your handler works either because yaml spec says anything null should be removed

#

logs are not going to help with this either all that much especially if you are trying to change the behavior in how snakeyaml works

#

you will need to provide your own output or debug messages as most like to call it

#

to understand where and what everything is doing or not doing

wet breach
#

not much to really look at here

upper hazel
#

When I load a value from a key in the config, the value should be null, but when I display the value, it shows the default value as if I hadn't touched the config.

#

values in plugin and config do not match plugin lives its own life lol

#

value empty but in plugion not

wet breach
#

well again not much code to look at

#

are you caching anything?

#

are you using statics?

#

if you use statics you may encounter some issues

upper hazel
#

no use

clever lantern
#

how to apply model data to an item?

upper hazel
#

itemStack.getItemMeta.setCustomModelData();

chrome beacon
#

Don't forget that get item meta returns a copy

upper hazel
tame wolf
#

Is there an event for when an item is destroyed by fire/lava? If not how would I go about detecting it

smoky oak
#

there is

#

dunno the name

#

think its damage

shadow night
#

I only know that the damage entity event fires when items get hurt

tame wolf
#

item

#

like a thrown item

shadow night
smoky oak
#

yea void doesnt fire ANY events

shadow night
#

Void being ass

upper hazel
#

EntityDamageEvent i gess

tame wolf
#

Yeah I found it :D

#

EntityDamageByBlockEvent

wet breach
#

Items are technically entities 🙂

shadow night
#

Why "technically"

wet breach
#

because they are not normal entities

upper hazel
#

they are entities

shadow night
#

Well, entities are anything that is an entity

#

Items are too, and they behave like entities, almost

upper hazel
#

they inherit the entity interface so they entity

shadow night
#

You mean implement?

wet breach
upper hazel
#

yea

shadow night
wet breach
#

anyways, as I said they are not a normal entity like other things classed as an entity lol

upper hazel
#

like zombi or skelet

shadow night
#

All entities have their own mechanics, their own AI, etc.

upper hazel
#

By the way, has anyone thought about adding AI to mobs to make it very hardcore?

#

normal AI

#

self-learning

shadow night
#

You mean making mobs extra smart?

upper hazel
#

yea

wet breach
upper hazel
#

i was try but this but it's harder than I thought

shadow night
#

Making AIs work is hard

shadow night
wet breach
#

no

shadow night
#

Why no

wet breach
#

they don't have pathfinding, goals or ai

shadow night
#

What if I make them extend LivingEntity

#

Or whatever it was

upper hazel
wet breach
#

while you can make your own custom stuff, it doesn't mean the server implements it

shadow night
#

Who told you I'll use spigot/bukkit

upper hazel
#

the server has a certain set of data that cannot be changed

shadow night
#

What if I do the good move and switch to fabric with mixins

#

Or just patches

upper hazel
wet breach
#

I guess but I was going by mc/spigot code related things. Like yes they are an entity but they are also not treated as an entity

shadow night
upper hazel
#

translate error dem

shadow night
#

You mean the core/software

upper hazel
#

yes

shadow night
#

Time to run buildtools, make a patch and get AI'd items

upper hazel
#

I was wondering if it is possible to add something new via bukkit api if you hack the client during the game and modify the client and server. 🤣

shadow night
#

frostalf Do you know mc code or bukkit code

wet breach
#

both

shadow night
shadow night
wet breach
lethal turret
shadow night
upper hazel
shadow night
#

I looked through mc code before, fucky shit

upper hazel
#

extrime code yee

shadow night
#

But everything besides rendering is simple

upper hazel
wet breach
# shadow night Time to run buildtools, make a patch and get AI'd items

but yeah items are weird since they justt don't behave like most of the other entities in the game. For example, items can't suffocate. They don't collide with other entities except for boats for some reason. If an item gets trapped in blocks they just fly out of them. Items have health but you can't attack them directly and neither can mobs. With the exception of Nether Stars, items despawn. Items that merge together the timer gets reset to which ever item had the highest time left. Also, items merging doesn't cause a death event or despawn either when technically this is what happens when an item merges with another.

upper hazel
wet breach
#

have no idea what you are trying to say

#

arrows despawn

shadow night
#

Projectiles behave similarly to items, more similar to items than to other entities atleast

quaint mantle
#

Hi, any idea why this doesn't work?

public void LaunchProjectile (ProjectileLaunchEvent e){
        ProjectileSource Shooter = e.getEntity().getShooter();
        Projectile p = e.getEntity();

        if(p instanceof Fireball){
            if(Shooter instanceof Ghast){
                Ghast g = (Ghast) Shooter;
                LargeFireball ball = (LargeFireball) p;

                if(g.getName().contains("Distorted")){
                    ItemStack fb = ball.getDisplayItem();
                    ItemMeta meta = fb.getItemMeta();
                    meta.setCustomModelData(1);

                    p.setGlowing(true);

                    fb.setItemMeta(meta);
                }

            }

        }

    }
remote swallow
#

@worldly ingot spam (check logs)

shadow night
#

Hope he goes to the shadow realm

wet breach
#

I see you like to ignore the rules

shadow night
#

?services also

undone axleBOT
wet breach
#

shame for you I suppose

#

@vagrant stratus

remote swallow
#

@ancient plank

shadow night
#

Man how dumb are people

wet breach
#

@tender forge we have a rule breaker 😦

shadow night
#

Can't even discuss minecrafts core mechanics with frostalf without a spammer

icy beacon
#

Just block the dude lol

glad prawn
#

@ancient plank

shadow night
#

Ah, how beautiful

glad prawn
#

@worldly ingot

icy beacon
#

Came to discuss some stuff and figured I'd take a laugh first

worldly ingot
#

My guy

shadow night
#

What if we report him

worldly ingot
#

?ban @silent widget Spam

#

jfc

undone axleBOT
#

Done. That felt good.

icy beacon
#

L

worldly ingot
#

Some fucking people, man

remote swallow
#

thanks choco

quaint mantle
#

thanks

shadow night
#

Thanks

wet breach
#

finally, Choco to the rescue

#

😄

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.

worldly ingot
#

I saw his messages getting deleted earlier and I was like "Oh okay, sure, someone's giving him a chance. That's fine". Then he doubled down -,-

icy beacon
#

xD

worldly ingot
#

Ah

vagrant stratus
#

sup nerds

remote swallow
#

i think cafebabe was doing something too

worldly ingot
#

Well I saw them haha

icy beacon
#

Sup

shadow night
#

He also had his dms closed lmao

remote swallow
vagrant stratus
icy beacon
#

Is that some web dev stuff that I'm too backend to understand?

smoky oak
#

personally i dont delete messages, i just remove them

icy beacon
#

Fair

vagrant stratus
#

technically XF is all back end if you self-host since it's php 😆

quaint mantle
icy beacon
#

Best of luck 🙂

vagrant stratus
#

it's fucking pain

icy beacon
#

What is it, anyway?

#

In simple words

#

The xenforo 2 thingy

#

Ah, nvm, I see

vagrant stratus
#

currently trying to figure out how tf they handle upload attachments & shit

icy beacon
#

Why? Are you rewriting xenforo to make Spigot more customizable?

vagrant stratus
#

trying to make an addon, which scans attachments on upload 😆

icy beacon
icy beacon
#

Going a step further with your antimalware

vagrant stratus
#

can't do that if you can't hijack the upload code lmfao

icy beacon
#

xD

wet breach
vagrant stratus
#

XF2?

#

I can just decompile those and modify one KEK

wet breach
#

xf2 is made with php, so really not much to the mod

#

the actual brunt of the work would be the php lib/addon

vagrant stratus
#

yea but the code is all over the place, so I can't find what's needed kek

#

so if I can just modify a premade addon that's even better

wet breach
#

well if you can find the right addon with php you wouldn't need a xf2 mod

#

as it would be built into php

#

actually, I think there is even an apache mod that does this too

#

so no php stuff needed

vagrant stratus
#

I need to send the attachment to a web server, and then either delete the resource shove it to the moderation queue, or approve the resource which means XF2 addon

wet breach
#

uh....by the time xf2 gets it, its been sent to the webserver

vagrant stratus
#

given it's purely xenforo interactions

wet breach
#

like webserver gets the info before php ever does

vagrant stratus
#

okay and? it can still not be saved, or pushed to the queue, or approved and made public

#

still gotta do it through the XF2 api so it doesn't get messed up

wet breach
#

you don't need php if the webserver can handle it automatically

vagrant stratus
#

I'm not looking to outright block or delete files lol

wet breach
#

I would

#

why waste resources when you can just delete from the start if its not wanted

vagrant stratus
#

I'm not. Not every logged file is malicious, so it has to be shoved into the queue to be looked at and I'd prefer it be the XF queue to keep things organized

#

and it also means I don't have to fuck with things more than I have too, especially if a logged file is a false-positive. All I'd have to do is accept it within the resource queue and call it a day

brazen badge
#

a question. I created files with snakeyaml, how can i make a command like "/bb reload" and the files will be reloaded on the game?

young knoll
#

Just load the data from them again

#

Via YamlConfiguration.loadConfiguration

vagrant stratus
#

what I also wish for @wet breach is a job that would let me just burn enough money to purchase everything like that one person lmao

I'd easily be able to find everything I need, probably

#

oh wait. I think I found one I can modify lol

wet breach
#

nice

vagrant stratus
#

Yea. I'd use it as is, but fuck virus total KEK

#

not sure if it'll work on the latest version either 😆

#

not pushed to queue though. That's annoying

shadow night
#

hmm, how tf do I make patches for spigot

young knoll
#

spigot or cb/bukkit?

shadow night
#

hmm

#

cb/bukkit ig

young knoll
#

Just modify the vanilla classes and then run makepatches

wraith dragon
#

?

vagrant stratus
shadow night
wet breach
#

o.O

remote swallow
#

from the work/decompile-xxxxx for the versions bt

fossil flax
#

someone know a good world preloading plugin 1.8?

remote swallow
#

the vanilla classes already added are in src/main/java/net/minecraft

wet breach
#

just so you know, not all vanilla classes are used, so depending on what you are trying to do you may need to include the vanilla class you need

shadow night
#

ooh

#

fucky

wet breach
#

ones not used are left in the minecraft.jar

#

and that gets shaded into spigot

#

so if there is something you need from there, you need to move it to spigot

#

or CB

young knoll
#

ApplyPatches will get you all the nms files we already modify

#

If you want a new one then yeah, grab it from that folder

shadow night
#

well, maybe I should've choosen mcp or mixins for what I'm doing lol

remote swallow
#

well what are you doing

shadow night
#

modifying... minecraft

remote swallow
#

what modifications

shadow night
#

like, changing the way it works

#

to be exact

#

changing the way dropped items work

remote swallow
#

you can change the despawn timer with api iirc

shadow night
#

well

#

that's not something I'll need

remote swallow
#

if you need to modify item stuff you would need mixins bc adding new items to spigot wouldnt work because of registry sync

young knoll
#

What exactly do you want to do

winter galleon
#
            if (armorStand.getEquipment().getHelmet().getType().equals(Material.AIR)){
                player.sendMessage("as");
                armorStand.remove();
           }```
why its not working
restive mango
#

I don’t need this anymore

#

It’s 1 or close to it

#

Anyone know a good algorithm for modeling the movement of a block through 3d space in a parabola and tracking whether it has collided with something yet?

smoky oak
#

which of those is possible, and if both are, which should i use?

  1. Using reflection to see if a class has a specific annotation, then call the method with that annotation if possible
  2. Use reflection to see if a method is 'not empty', with the intent of making a placeholder interface with all the methods, then calling the methods, if overwritten

The idea is to, when the object is instantiated, register it to a handler which scans the class for which methods in it should be called and when

#

I'd prefer option 2

#

maybe a combination of both

#

(I'd like to avoid doing reflection method calls)

remote swallow
#

you trying to do the same thing as bukkit event api

gleaming grove
young knoll
#

1 is basically the event api

smoky oak
#

abstract superclass placeholder methods

winter galleon
#

why i can't kill a baby invisible armorstand on dismount

young knoll
#

Try delaying a tick?

#

also how are you killing it

proud badge
#

should I make this async or does it not really matter

quaint mantle
#

In my opinion

#

If you can do an I/O operation async, do it

#

Writing to disk is always x100 times slower than anything else

#

Regardless of the processor you have, how many cores, clock speed

#

The disk is always slow, even if its SSD, for the processor, the disk speed is as slow as a snail

river oracle
#

Damn dude wtf did the disk do to you calm down

quaint mantle
#

I'm just saying

#

It's the true

#

The disk is slow as a grandma

river oracle
#

No reason to be such an asshole about it though like what if the disk sees

#

How do you think it'll feel

quaint mantle
#

I think he should be more realistic about himself

#

The disk must learn

river oracle
#

100% of depressed disks go untreated and eventually can't take it anymore and experience data loss

quaint mantle
#

That's not my fault, is the process, the process of life

#

My disk is faster than my ram

quaint mantle
#

You somehow are using your disk as RAM, or you live in a future in where the disks are as fasts a RAM (which again, it's impossible)

river oracle
#

Everything is possible if you believe

quaint mantle
#

Nah

#

Yes it is

#

A disk will never be faster than RAM

#

Mostly because the disk have more much space

#

I made my own ram sticks

jagged thicket
#

rate my wallpaper guys

river oracle
#

10/10

quaint mantle
#

It points to the keyboard distribution

jagged thicket
#

(i made it)

quaint mantle
#

Oh really?

#

Then let me change my opinion

#

It sucks

#

😈

jagged thicket
#

i will make one for you

quaint mantle
#

No please, I'm good with default wallpaper

#

🗿

proud badge
#

ok I tried this

#

Now I need a try and a catch it says

quaint mantle
#

that looks like a really bad way to handle saving

proud badge
#

how

jagged thicket
#

@quaint mantle

#

(rate it) ( i made it)

shadow night
quaint mantle
# proud badge how

It's not flexible, it's static, you can also use a print writer instead

shadow night
glad prawn
proud badge
#

idk im following a youtube tutorial

#

using json/persistant data for the first time

shadow night
#

Also, call me crazy, but I always use FileInput/OutputStreams

jagged thicket
#

windows 12 wallpaper leaked (Free download)

quaint mantle
glad prawn
#

i rate 9/11

jagged thicket
#

WAIT IM IN THE WRONG CHANNEL

#

WHAT THE FUCK

#

why don't anyone tell me

quaint mantle
#

It looks nice 😎

jagged thicket
#

NIc

shadow night
quaint mantle
jagged thicket
#

im going to post the windows 12 wallpaper on general

quaint mantle
# proud badge ok I tried this

Let's say that you have two platforms, one in top of other

  • [main]

  • [platform 1]

Let's call them "main platform" and "platform 1"
Now, you put a person on the "platform 1"

  • [main]

  • [platform 1]

Now, the platform 1 is under the main platform, meaning if the main platform dissapears, the platform 1 dissappears too, but there's still a person on platform 1.
What I'm trying to say is that, your method throws the IOException, which does it on the main thread, meanwile the rest of your code is in another thread, so it don't really reaches the main thread.

What asynchronous do is just executes code from a different thread, this obviously means that you can't for example, expect an asynchronous code called from a function, return a value on that function, because they are on sepparate platforms, the same applies for exceptions

#

Sorry for pasting again, I notice I didn't replied to the message

#

Completely not spam

#

🗿

jagged thicket
proud badge
#

i guess if it only saves every 10 minutes and the json isnt too big having it on the main thread wont be too bad

quaint mantle
#

Do not do I/O operations synchronous

#

Even if it's a file of 1 byte

#

It's better to do it asynchronous

proud badge
#

k so I do it async but I put try and catch

quaint mantle
#

Yes

shadow night
quaint mantle
shadow night
#

why? Good question

proud badge
#

that will look very wonky but let me try

quaint mantle
#

You can wrap the try/catch with multiple exceptions

#
try {
  //Your amazing code
} catch (Exception1 | Exception2 | Exception3 allExceptions) {

}
hushed spindle
#

oh by the way, not doing io operations async is fine if it's on onDisable

#

i dont even think you're allowed to schedule tasks on plugin disable

proud badge
#

its every 10 mins

hushed spindle
#

then yeah its fine

quaint mantle
# proud badge

I would also put the whole code inside the try, instead of trying for each part of the code that requires it

quaint mantle
#

You can create a Thread btw 💀

#

Create a silent process that slowly eats the server RAM

shadow night
#

Lol

quaint mantle
#

Unless GC arrives

proud badge
#

ok its still asking for the trycatch for some reason

shadow night
hushed spindle
#

i haves teeny question, if you retexture a snowball or egg and throw it does it keep its texture while thrown

quaint mantle
#

You just put catch

proud badge
#

oh yeah

#

ok I changed it seems good so far

quaint mantle
shadow night
#

And use the integer

quaint mantle
shadow night
#

Lol

proud badge
#

also what will we do in 2038 when we run out of integers?

quaint mantle
#

Then we will create longlong

#

Then intlonglong

#

Then longintlonglong

pliant topaz
#

long serves for 100b years alr

#

days*

valid burrow
#

100b years

shadow night
#

What you could do is make a class that can store itself and make like 50 instances which points to an instance which points to an instance and like at some point make it point back to the first one, clone it and push it into a list of lists of lists that will be used in 7.4 quintillion years

valid burrow
#

lmao

quaint mantle
#
public class Clazz {
  
  private final Clazz clazz;

  public Clazz(Clazz clazz) {
    this.clazz = clazz
  }

}

Completely not Overflow exception

pliant topaz
#

Btw. anyone knows how I'm supposed to specify the result in a SmithingTrimRecipe? As it lets you specify the armor trim (template), the base item and the addition but not the result

quaint mantle
smoky oak
#

whats the difference between Clazz and Class<? extends something> ?

quaint mantle
smoky oak
#

im pretty sure there was something internal with Clazz

#

ah

quaint mantle
#
Class<?> clazz = Class.class
smoky oak
#

that'd be it

quaint mantle
#

Because you cannot use class as a variable name

smoky oak
#

ye point
is <? extends class> a good hashMap key?

shadow night
quaint mantle
pliant topaz
quaint mantle
quaint mantle
#

If there's a recipe object other than implementing code for each pattern

smoky oak
shadow night
quaint mantle
#

I mean, if you are doing something like

Map<String, Class<? extends Something>> jarClassesWichExtendsMyImplementation = new HashMap<>();

Then you are good

quaint mantle
smoky oak
#

key, not value

quaint mantle
#

I don't know what it does

#

But pretty sure it's a number

quaint mantle
shadow night
#

str1 and str2

quaint mantle
#

It's a set

ivory sleet
#

and then you go back and forth casting

smoky oak
#

why would <? extends class> as key turn a map into a set

ivory sleet
#

what?

quaint mantle
smoky oak
#

that AS KEY

glad prawn
#

huh

shadow night
#

A set of Legos

quaint mantle
#

awdawdj

smoky oak
#

im still trying to figure out how to do my event passthrough

quaint mantle
#

Wait

#

Why do you ? extends Class<?>?

ivory sleet
#

A Set<E> is just a Map<E,Boolean>

quaint mantle
#

Just do Class<?> or as Conclube said Type

slender elbow
quaint mantle
#

someone help my intellij project is broke

#

Cannot load settings from file 'C:\Users\Vasir\Desktop\Intellij projects\mana-core-bukkit\.idea\modules.xml': Illegal character (NULL, unicode 0) encountered: not valid in any content at [row,col {unknown-source}]: [1,2] File content will be recreated

ivory sleet
#

Possibly remove .idea folder

#

And restart (maybe invalidate caches also)

quaint mantle
ivory sleet
#

<project_folder>/.idea/

#

At the very top if u look in ur ide also :>

quaint mantle
#

yes

#

fixed but some class broke

#

am i change java to class ?

ivory sleet
#

Uhm

#

Do u have local history preserved

proud badge
#

what do they mean by "the holder"?

ivory sleet
#

Or did u yeet that with the invalidation of caches?

proud badge
#

this is createInventory btw

quaint mantle
shadow night
ivory sleet
ivory sleet
quaint mantle
proud badge
#

also does the 1st slot of an inventory have ID 0 or 1?

quaint mantle
#

not broke

#

but in intellij yes

#

broke

#

i will try something

ivory sleet
#

Thats… interesting

worldly ingot
#

yep

proud badge
#

thanks

#

also I mean chest

#

not player

#

but I assume its 0 too

ivory sleet
#

(Stole it from paper just… dont tell them :>)

river oracle
#

35 to 103 that's quite the jump they made

ivory sleet
#

Yeah in chest it starts from 0 also iirc

proud badge
#

where is 36-99?

quaint mantle
#

btw i got this warning last times
Call to 'printStackTrace()' should probably be replaced with more robust logging
pST is bad ?

shadow night
#

despawned

ivory sleet
#

but the warning just encourages you to use a logger framework or to properly recover from the exception in some other way

old totem
#

hi, how to fix this problem?

valid basin
#

I started getting this error for no reason when I upgraded my system to win 11. Code remained the same. Someone know how to fix?

de.tr7zw:item-nbt-api:jar:2.12.1 was not found in https://jitpack.io during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jitpack.io has elapsed or updates are forced

river oracle
valid basin
#

I don't even use item-nbt-api

river oracle
#

its in your pom probs

#

just remove it from your pom

valid burrow
smoky oak
#

can i assume Class<? extends Event> would be fine too?

blazing ocean
#

How can I teleport a boat with a player inside?

proud badge
#

also can I still use the Player object after the player disconnects?

#

for example player.getName()

#

or na

blazing ocean
#

OfflinePlayer should be safer

kind hatch
proud badge
#

Rip

kind hatch
#

Use OfflinePlayer ^^

blazing ocean
#

Bukkit.getOfflinePlayer(player.uuid)

proud badge
#

ok what do I do here then

#

I want it to still work after they disconnect, but also get the location

blazing ocean
#

save the location of the player beforehand

kind hatch
#

^

proud badge
#

ok something like this then

blazing ocean
#

yea

kind hatch
#

I'm a little surprised there isn't a #getLastLocation() for OfflinePlayer by now. Maybe a PR for another day.

blazing ocean
#

yeah i had to double-check too

river oracle
proud badge
#

couldnt someone make an API to go into the player.dat file and grab it?

blazing ocean
kind hatch
proud badge
#

nah cus I want the location from when the command was run, what im making is a reports system for staff and they can see the report description and location where the command was run

river oracle
blazing ocean
smoky oak
#

is there an updated full event list?

pliant topaz
#

When I create a SmithingTransformRecipe it works, but for some reason the item meta isn't being applied on the result item. But the item itself has all the meta, ut just not if it's the recipe result. Anyone knows how to fix this?

proud badge
#

does a \n specifically need to be encased in " " or no?

#

For an item lore in this case

shadow night
#

well, if you type it in your ide without "" you'll see if it errors or no

kind hatch
proud badge
#

item lore

river oracle
#

ItemLore is a list

rotund ravine
proud badge
#

rip

blazing ocean
kind hatch
#

Config structure for item lore isn't all that bad either. Makes it easier to read in most cases too.

blazing ocean
#

so if you want to have multiple lines, do it like this: kt val lines: MutableList<String> = mutableListOf() lines.add("hello world") lines.add("this is line 2")

kind hatch
#
item_lore:
  - "Line 1"
  - "Line 2"
  - "Line 3"
river oracle
blazing ocean
slender elbow
#

literally impossible to read

blazing ocean
#

i literally dont care

slender elbow
#

klingon language

river oracle
#

that's rad

#

smh smh

#

i think they meant

record Person(String name){}
proud badge
#

uh I made this now how do I use it? ReportMenu.openChestMenu or openChestMenu seem to not exist

#

specifically: different class

dry hazel
#

you need to do it on an instance of the enclosing class

worldly ingot
river oracle