#help-development

1 messages Β· Page 1227 of 1

torn shuttle
#

it's always good when I have to manually manage memory in java

slender elbow
#

you're stuck with plain text

torn shuttle
#

that's how you know you're having a good time

slender elbow
#

unless of course, 😏

frail pilot
#

πŸ‘€

summer scroll
#

For example trying to make wooden sword display diamond sword's localized name.

slender elbow
#

you'd need nms for that to set the translatable component

#

unless..

#

if only there was a components api

summer scroll
#

paper?? xd

#

not touching nms, no no

frail pilot
#

Well, using only bukkit API you're screwed

glossy laurel
#

quick question, if you provide Vector(2, 0, 0) as the direction and 1 as the max distance, will the maximum collision be offset by Vector(2, 0, 0) or by Vector(1, 0, 0) ?

eternal oxide
#

it will use teh max distance

glossy laurel
eternal oxide
#

you wouldn't do any of that

#

its a method call

glossy laurel
eternal oxide
#

what?

eternal oxide
#

neither

glossy laurel
#

tf

eternal oxide
#

the vector is simply a direction. It doesn;t matter that you did not normalize it

glossy laurel
#

okay so in here it wouldn't matter if I pass a normalized or non-normalized version of the same vector right?

slender elbow
#

the direction vector simply defines the infinitely-spanning line

glossy laurel
#

Another question, is it possible to "raycast" a bounding box? or I could call it... bounding box cast badum tss without casting from all 8 corners?

tame wolf
#

Anyone has any ideas about this?

old coral
#

I wanna make a game where you get random items every ... seconds. To do that I've made this system that technacly works but the server is lagging extremly and eventually crashes even when the code currently just sends an message in the console every .. seconds.
Why is that and how do I fix it?

LocalDateTime gameEnd = LocalDateTime.now().plusMinutes(gameTime);
LocalDateTime nextDrop = LocalDateTime.now().plusSeconds(interval);

server.broadcastMessage(ChatColor.GOLD + "Game is starting...");
teleportPlayers(gameWorld);

gameRunning = true;

while (LocalDateTime.now().isBefore(gameEnd)) {
  /*
  Other stuff will happen here later
  */
  if (LocalDateTime.now().isAfter(nextDrop)) {
    nextDrop = LocalDateTime.now().plusSeconds(interval);
    System.out.println("Item Drop");
    giveItems(); //doesn't do anything yet but will give the items later
  }
}
kind hatch
#

I mean... is it being run on the main thread?
Why not use the bukkit schedulers for a task like this?

old coral
torn shuttle
#

I have come up with a very funny way of placing blocks

glossy laurel
#

can I do the screen tilt a player gets when they are damaged but without actually damaging the player?

eternal night
#

damage them for 0

#

that might work

blazing ocean
torn shuttle
#

hm

#

now

blazing ocean
#

0 won't work with the vanilla command but might work via API /shrug

torn shuttle
#

what should be the longest amount of time my splittable task should take in a tick

#

I guess the server's budget is 50ms right

blazing ocean
#

1.0e-63 nanos

torn shuttle
#

what is that, a plank?

#

10 ms should be safe right

#

surely

#

how bad could it be

thorn isle
#

50ms minus the current mspt

torn shuttle
#

I think if I do that some servers will never finish generating this

thorn isle
#

plus maybe a safety margin of say 5ms

#

capped to a minimum batch size of n blocks

#

basically you don't want your batches to be too small or else most of your time will be spent on scheduling overhead rather than placing blocks

torn shuttle
#

is there even a realistic way of making sure a task runs at the end of a tick

#

feels like if I try to get a read on the current tick that's going to go sideways quite easily

thorn isle
#

paper has a tick end event, but apart from that, it shouldn't really matter; the start of the next tick isn't much different from the end of the current tick timing wise

#

and scheduler tasks run at the start of the tick

torn shuttle
#

k so the only way to do it with the current mspt is heuristically

thorn isle
#

you of course can't predict how long that next tick takes, but with tps catchup, going over budget isn't really a big issue

#

if you go over budget your logic will allot a smaller time usage on the next tick, and the server won't sleep as long waiting for the tick after that, so you end up in balance

torn shuttle
#

have we gotten a way to check current mspt, I think the last time I checked you had to calculate it yourself

thorn isle
#

you'll get some ~30ms jitter at worst, which isn't really noticeable

echo basalt
#

paper has a tick start event too

thorn isle
#

it does

echo basalt
#

so you can get tick start, store it somewhere and subtract stuff

torn shuttle
#

I'm not using paper

#

at least not specifically

thorn isle
#

if you were using paper, you could listen to tick start and tick end, and then calculate the time between to know how long you can place blocks for without going over 50ms, exactly

torn shuttle
#

if I was modding factorio I'm sure there's also many other things I could do

thorn isle
#

on spigot i'm not sure if you can even get mspt

#

you can't really calculate it from a scheduler task, like you can tps

torn shuttle
#

would be nice to at least have a tps check in here

#

then I could just express this as a % of a tick instead of ms and run it based on current tps

#

that'd probably be close enough

thorn isle
#

the issue with this is that tps is basically always expected to be 20

#

i'd uh maybe have a rolling number clamped to 2-40 and increase it by 1 for every tick that took <50ms and reduce it by 1 for every tick that took >50ms

#

that'd keep you at the 20tps redline

torn shuttle
#

or, hear me out

#

I just set it to 10ms, ship it and call it good enough

#

they'll never see it coming

thorn isle
#

seems fair enough

torn shuttle
#

takes 4 seconds at 20ms but 20ms feels like it might be flying a bit too close to the sun

#

it's just 16 mil blocks

thorn isle
#

make it configurable and call it a day

torn shuttle
#

yeah actually already have that in place anyway

#

but I'll do it as % of tick instead of ms

#

it'll be less confusing and in the future if I get around to improving it the configs will stick

#

now for my next trick

#

I make a very fancy, very long animation

#

to cover for the fact the animation is hiding the loading time

#

and by very long I mean like 6s long

thorn isle
#

use sendBlockChanges to send them as clientside blocks so it looks instant even though you're actually still placing them 🀑

torn shuttle
#

oh I don't need to worry about that

#

the world isn't in view

#

it's creating a new world

thorn isle
#

what are you doing actually

torn shuttle
#

oh I guess I haven't been showing

thorn isle
#

pasting a minigame arena or something?

torn shuttle
#

making an extraction game in minecraft

thorn isle
#

neat

#

the map is procedurally generated i assume? or else you'd be copying regions as file operations before loading them as a world

torn shuttle
#

wave function collapse

#

there's 75 possible modules

thorn isle
#

i've actually been working on that too recently

#

although i'm not using modules but voxels and a sample structure for the weights

#

similar to texture synth, but in 3d, using minecraft blocks

thorn isle
#

very nice, i've seen a few tech demos done in basic game engines and unity and such, but i don't think i've seen wfc done in minecraft yet

torn shuttle
#

yeah it's usually just tech demos

#

and I get why

#

it's uh

#

unwieldy

#

to say the least

thorn isle
#

it has its problems

torn shuttle
#

very much so

thorn isle
#

a naΓ―ve impl is fairly simple but it will shit bricks in practice

torn shuttle
#

honestly the map gen for the extraction game could've been done in about 10 minutes with basic code, wfc is complete overkill for what we currently ahve

#

but we did it for the suite of things that we can do with it

#

next is probably going to be adding modular underground dungeons for mc

thorn isle
#

wait till you hear about trials

torn shuttle
#

trials, I sleep

#

moria under your house, wide awake

thorn isle
#

mojang's own structure system is fairly competent these days but it definitely has its own set of problems as well

torn shuttle
#

it would be very funny if you just joined a normal mc server, went to dig for diamonds and broke into a massive dungeon that seems virtually infinite and is full of mobs that don't exist in minecraft

thorn isle
#

custom structures have always put on a neat twist on the experience since you get to see new things as a player

torn shuttle
#

yeah they're pretty popular

#

people have been asking me to add modules for a while

#

they'll soon have it

thorn isle
#

as for me i'm taking wfc in a bit different of a direction, more akin to texture synthesis than putting together existing modules

torn shuttle
#

well it can do a lot of things

#

slowly

#

and not that well

#

lol

thorn isle
#

idea is to have a bunch of sample structures to seed the weights from and then run wfc on individual blocks

torn shuttle
#

hm yeah I can see what you're going for

thorn isle
#

by itself it generates tactly put garbage, but with some extra rules i'm fairly sure i can get it to produce decent enough buildings and environments

torn shuttle
#

the structures would have to be massive or they'd just look like trash

thorn isle
#

the main problem is that if you use too small tiles to base the weights on, like say 2x2 or 3x3, you end up with nonsensical garbage

#

but if you make the tiles too large, you end up duplicating the sample structures 1:1, because each tile becomes unique

torn shuttle
#

it does feel like wfc is the wrong tool for every task

#

but a really cool tool

thorn isle
#

my approach to deal with this is to curate the sample structure and add some metadata to it to inform wfc better

#

e.g. define walls to be walls; floors to be floors; roads to be roads, and so on

#

and prohibit certain neighbor pairs

torn shuttle
#

yeah had to do much the same

#

make a module with a door

#

now you have a door that faces a door

#

lovely

thorn isle
#

ideally i suppose you would have an army of minimum wage workers manually defining all the weights for the neighbor pairs

torn shuttle
#

still the best trick I had for it is giving it the concept of "nothing"

thorn isle
#

and maybe we will get there with some sort of ai one day

torn shuttle
#

I took every shortcut I could think of

#

I don't use lists of modules, I use tags

#

and I added a setting to make modules able to just clone a source module

#

for all of their settings

#

so if i want to add a new "road" variant I can do that by just adding a single line to its config file

thorn isle
#

my plan for when i end up writing my own instanced dungeon generator eventually is to have the builder first specify a list of tags that can neighbor a module's face in question and then live-preview them each

#

with an ingame option to veto modules that don't make sense

zealous osprey
#

Very nice

thorn isle
#

much easier to define the adjacency lists when you can live preview the results

#

e.g. that door facing a door situation would be easy to veto out of the list

torn shuttle
#

eh it hasn't been an issue in out designs thus far, we usually have fairly easygoing requirements for it but I also had an idea to be able to quick preview every possible arrangement

#

but we've managed to have tags that are honestly just very easy to deal with

thorn isle
#

the state space is probably going to be far too large for more than just a pair of modules or maybe three of them at most, for anyone to sit through and look at every possible permutation

#

should be doable for a pair of modules, though

rough crane
#

can someone help me? im trying to import material lib but getting this error

No libraries found for 'org.bukkit.Material'

rough crane
#

oh wait

old yacht
#

like can you use ChatColor etc

rough crane
#

java```import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.ItemStack;
import org.bukkit.Material;
import org.bukkit.inventory;


it works for all imports but the last two
old yacht
#

which ide are you using

#

you may have to download java 21 or newer

#

and update IDE

rough crane
#

i ll try it now

old yacht
#

and can anyone help me with creating basic npc plugin, all tutorials are old and dont teach how to do it on 1.21

old yacht
#

@rough crane did it work?

rough crane
old yacht
#

np

glossy laurel
#

dyk what was the default yaw before the update which made it depend on the damage source?

hollow warren
#

Hi, I have a question, I saw on a forum that to delete your own plugin you had to report it saying that you wanted to delete it, how long does it normally take?

worldly ingot
#

Correct. And usually within 24 hours

worldly ingot
glossy laurel
#

Hey guys, is there a limit to how many block displays can be spawned or smth like that? Cuz I tried to spawn a lot and half of them didn't appear. So i'm wondering if its my skill issue or some other limitation?

sullen marlin
#

when you say a lot, how many is a lot?

#

5, 50, 500, or 5000?

glossy laurel
#

lets see

#

1,208

#

to be exact

sullen marlin
#

5 and 50 I expect no issues. 500 or 5000, yeah the client might limit rendering since block displays are entities not blocks (but someone probably knows more than me)

thorn isle
#

the highest i've tried is 24,000 something display entities, and apart from poor performance, there were no issues

#

none of them were missing as far as i could see

sullen marlin
#

guess check there is no entity limiter plugin etc installed

glossy laurel
#

but like

#

its so random

#

hm

sullen marlin
#

also goes without saying, make sure you're running spigot

glossy laurel
glossy laurel
#

just

#

head

#

out

#

rq

dawn flower
#

late reply but BITE

dawn flower
#

soo

sweet pike
#

how do i set a block's light level without changing the actual block (either server-side or client-side).

LightAPI used to be great for this, but their NMS wrappers only go as far as 1.19, and it's proving tougher to update the wrapper as mojang rewrote their light engine (details can be found here).

any suggestions?

sullen marlin
#

not sure, from a why isn't it in the api perspective, generally dislike giving api that puits the world in a broken state

old yacht
#

can you guys help me create basic player npc in 1.21.4? or at least recommend me a lib that works on 1.21.4

old yacht
dawn flower
#

he wants something else

old yacht
#

k

dawn flower
#

or heck even update lightapi urself

torn shuttle
#

assuming it can be done

#

I swear the lighting code is cursed

#

I gave up

dawn flower
#

if something is possible in older versions but isn't in newer versions and isn't a bug then there's a problem with mojang

torn shuttle
#

the lighting changed

#

so

#

it wouldn't be that weird if some stuff that was easy before is now either hard or just not possible

dawn flower
#

unbelievable

torn shuttle
#

you're really just reacting to yourself

#

I didn't say it was a bad thing

#

the old lighting system was dogshit

#

I just also couldn't find a way to manipulate the new one

dawn flower
#

i don't rmemeber the last time they optimized the game

torn shuttle
#

then I recommend you go get yourself checked for early onset dementia

dawn flower
#

anyways what's the best way for "dynamic" lore (custom enchants lore)

#

i don't want it to break if someone adds new lore

hollow warren
#

Hi, I saw that there are people who have spigot with the black theme, is that possible or are they using something weird for the browser?

blazing ocean
#

probably dark reader

remote swallow
#

donators also get a built in one

hollow warren
young knoll
#

MD will find your house and forcibly install Netscape navigator

thorn isle
#

after many years of trying to get my lore bits to play nice with other plugins trying to do the same and both of them failing miserably, i bit the bullet and set up a centralized api where plugins register "lore components" and forked every third party plugin that edits lore to use it

echo basalt
#

client-sided lore

slim wigeon
chrome beacon
slim wigeon
#

What line?

chrome beacon
#

42

slim wigeon
#

You must be thinking about when I open the inv but its not it. You see I try to put a item into the inventory but somehow it just denies

chrome beacon
#

There's nothing else in the code that you sent that would cause that behavior

#

I do have a feeling that the updateView method would be causing issues as well, though we don't have access to what it does

shadow vortex
#

hello, im trying to make my first plugin. im making an item that does something when right clicked. say i use a diamond, how do i tell whether its just a normal diamond or if its the custom item i want to react to the right click?

river oracle
#

then ItemMeta#getPersistentDataContainer()

shadow vortex
#

this seems pretty confusing to me but thank you i will try to look into it

hybrid drift
#

looking for a developer to help me with aternos server! after work is done, i can pay $75 cashapp, venmo or paypal

wet breach
#

eeew aternos

#

last I remembered doesn't aternos only allow you to use plugins on their approved list?

#

if that is true, then you don't need a developer

hybrid drift
#

yeah

#

but i need help

#

n everything

wet breach
#

that may be the case but you don't need a developer specifically for such a thing

#

?services

undone axleBOT
drowsy helm
#

they're probably referring to that

wet breach
#

lol

glossy laurel
#

how can I disable the sound and damage a firework does? (I want just the particles)

eternal oxide
#

why not just spawn the particle you want?

blazing ocean
#

cancel the damage event & resource pack

glossy laurel
#

actually, is it possible to replace the dust particle's animation with the firework particle via resource pack?

eternal oxide
#

doesn;t a FIREWORK particle accept a DustTransition?

#

Is it the firework particle you want and not teh trail?

eternal oxide
#

I see, sparks

glossy laurel
surreal wadi
#

my server is not starting again and again crashing and this is coming

#

@dusty herald

blazing ocean
#

-> #help-server, don't ping staff and make sure you have space left

surreal wadi
#

i have 8 gb space left in disk

blazing ocean
#

then ask paper

#

we are not paper

surreal wadi
surreal wadi
dusty herald
#

Or maybe even pterodactyl πŸ‘€

blazing ocean
#

They probably won't know

#

Usually not related to ptero

sterile axle
#

space on your vm disk != space allocated to the container running your server

#

this is a host issue

#

go yell at them

surreal wadi
#

okay

#

it's hosting issue

#

sry to disturb u all

glossy laurel
#

how do I get the speed of player? I tried velocity but the issue is that the downwards force is counted towards it

drowsy helm
glossy laurel
#

all kinds of speed

#

would be kinda nice

#

not only the horizontal one

quaint mantle
#

How can I check if a player already has a specific item? It could be equipped or in the player's inventory. If the item is already present, it should not be added again.

glossy laurel
#

I'm having the weirdest issue ever... So this is the code right:

            if(result != null){
                return true;
            }```
But the raytrace returns true when it shouldn't. And when i check the position of the collision... it returns NaN for X Y Z?? Like what???
#

it almost seems as if it is casting an infinite ray downwards??

#

nvm

#

but

#

the max length

#

isn't

#

working

#

like at all

quasi gulch
#

Which event is called when an Elytra generated inside of an itemframe naturally in the end cities?

quasi gulch
quasi gulch
#

hmm ok

quasi gulch
dull mango
#

Just mark all item frames placed by Players

#

Use the PersistentDataContainer

quasi gulch
#

okay

sacred saffron
#

"Cannot find declaration to go to" with class Material in spigot and spigot-api version 1.20.1. Can anyone help me? :3

sacred saffron
#

rl? Does the IntelliJ update fix this?

#

in spigot 1.20 found Material Class but not in 1.21

chrome beacon
#

so Intellij cannot read that class since that's what modern Minecraft uses

sacred saffron
#

because every other spigot class is found except really the Material Class

chrome beacon
#

Just update Intellij

#

I'm not here to argue with you

sacred saffron
#

that wasn't meant in a bad way at all

sacred saffron
#

i really thank you bro :3

torn shuttle
#

hey, what is the appropriate data to store if I want to basically store a sign to place on a block in a future date, including the text I want it to have

#

I noticed that blockdata doesn't seem to store that

#

I think it's blockstate?

#

on the api I see that the sign block has SignSide

#

is there any way to do what I'm trying to do without a bespoke class?

eternal night
#

BlockState yea

young knoll
#

You could store the NBT

#

But that’s outside the api

torn shuttle
#

I was hoping the API would have a class that would just store all the data

young knoll
#

Blockstate then

torn shuttle
#

it also does stuff like rotation right

#

guess I need to look at how to inject it back into the world

young knoll
#

Yes

#

#update will place it back

#

But you can’t change the coordinates

torn shuttle
#

there's a #setBlockData in Block

#

do I need to set block data AND block state?

young knoll
#

The state will also set the data

chrome beacon
#

^^

#

Copy the BlockState to the location you want

torn shuttle
#

yeah but how do I replace a block's sate with my own

chrome beacon
#

and then call update on it

#

BlockState#copy(Location)
BlockState#update

torn shuttle
#

gotcha

#

thanks

young knoll
#

You’ll need to call update with the force Boolean

torn shuttle
#

ok now I need to figure out how to extract block state from a worldedit clipboard lol

smoky oak
#

sanity check: if a constructor has no access modifier, can it be called from non-inheriting classes?

torn shuttle
#

hopefully the full block thing is block state

young knoll
#

No access modifier = package private

chrome beacon
young knoll
#

Only accessible from the same package

smoky oak
#

good enough, i just dont want people using the classes calling a internal method lol

torn shuttle
#

anyone here happen to know what the path from worldedit clipboard to spigot BlockState is?

chrome beacon
#

A clipboard stores more than one block

torn shuttle
#

one of these days i'm just going to give up on WE, I only use it for storing schem files

chrome beacon
#

Which one do you want

#

all of them?

torn shuttle
#

I already have the selector done

#

I'm iterating

#

I was looking at BaseBlock

#
    private static List<Pasteable> generatePasteMeList(Clipboard clipboard, Location worldPasteOriginLocation, Integer rotation) {
        List<Pasteable> pasteableList = new ArrayList<>();
        AffineTransform transform = new AffineTransform().rotateY(normalizeRotation(rotation));
        Clipboard transformedClipboard = null;
        try {
            transformedClipboard = clipboard.transform(transform);
        } catch (WorldEditException e) {
            throw new RuntimeException(e);
        }

        BlockVector3 origin = transformedClipboard.getOrigin();
        BlockVector3 minPoint = transformedClipboard.getMinimumPoint();
        origin = BlockVector3.at(minPoint.x(), origin.y(), minPoint.z());

        World world = worldPasteOriginLocation.getWorld();
        int baseX = worldPasteOriginLocation.getBlockX();
        int baseY = worldPasteOriginLocation.getBlockY();
        int baseZ = worldPasteOriginLocation.getBlockZ();

        Clipboard finalTransformedClipboard = transformedClipboard;
        BlockVector3 finalOrigin = origin;
        transformedClipboard.getRegion().forEach(blockPos -> {
//            BlockState blockState = finalTransformedClipboard.getBlock(blockPos);
//            BlockData blockData = Bukkit.createBlockData(blockState.getAsString());

            BaseBlock baseBlock = finalTransformedClipboard.getFullBlock(blockPos);
            BlockData blockData = Bukkit.createBlockData(baseBlock.toImmutableState().getAsString());
//            BlockState bs = 
            if (blockData instanceof Sign sign) {
                Logger.debug("ladies and gentlemen, we got him");
            }
            if (blockData.getMaterial().toString().toLowerCase().contains("sign"))
                Logger.debug(WorldEditUtils.getLines(baseBlock).toString());
            int worldX = baseX + (blockPos.x() - finalOrigin.x());
            int worldY = baseY + (blockPos.y() - finalOrigin.y());
            int worldZ = baseZ + (blockPos.z() - finalOrigin.z());

            Location pasteLocation = new Location(world, worldX, worldY, worldZ);
            pasteableList.add(new Pasteable(pasteLocation, blockData));
        });
        return pasteableList;
    }

bit of a mess because I'm literally in the middle of rewriting it but you get the idea

young knoll
#

Code wall jumpscare

torn shuttle
#

just looking to turn that WE BaseBlock into a Spigot BlockState I guess

#

which will then hopefully preserve my sign text

echo basalt
#

Imagine using loggers lmao

#

I just use Bukkit.broadcastMessage

torn shuttle
blazing ocean
#

so true

#

println

chrome beacon
echo basalt
#

WE API too slow

#

he could use FAWE and just paste shit async

torn shuttle
#

fawe is bugged and won't work for what I want

echo basalt
#

prolly wants lighting

#

L

torn shuttle
#

that's about all I want

echo basalt
#

rotation is handled by the block data iirc

#

text is nbt

torn shuttle
#

yes

#

rotation is good

#

text is nbt

#

I was trying to figure out if I can get away with an easy conversion because I technically can use my utility class to emulate this

echo basalt
#

you have BaseBlock#getNBTData / getNBT depending on the WE version

chrome beacon
#

Just use WorldEdits setBlock method

old coral
#

How do I delete worlds? I've found this on the internet but it doesn't work:

teleportPlayers(lobby); // Teleports players to the lobby world
server.unloadWorld(gameWorld, false);
gameWorld.getWorldFolder().delete();

(lobby is a world that it always there and gameWorld is the world I wanna delete)

torn shuttle
chrome beacon
#

actually right you're doing the really hacky block placing

torn shuttle
#

yeah

#

I mean

#

let me be real

#

I don't know how slow the "vanilla" way they do it is

#

compare to just doing it via spigot api

#

I would guess probably not much of a difference, if any

chrome beacon
#

I do believe Vanilla is slightly faster

echo basalt
#

prolly a bit faster yeah

chrome beacon
#

but that might just be old information

torn shuttle
#

I would prefer to handle it myself to be more independent from WE

young knoll
#

I mean, it’s less method calls

echo basalt
#

converting nbt data for tile entities is kinda fucked

#

I originally asked if you wanted tile entities and you said no smh

#

the other day I learned that end gateways are tile entities smh

torn shuttle
young knoll
#

This is why I moved away from the we api

torn shuttle
#

someone asked me to keep the signs visible post paste which is why I am doing it

echo basalt
#

we used them as decoration and wondered why 20% of our mspt went to ticking hundreds of thousands

young knoll
torn shuttle
#

so what

#

do I just get the nbt from the baseblock

echo basalt
#

you can yeah

torn shuttle
#

for sure for sure this is going to convert well amirite

echo basalt
#

easiest way to debug these is to make a schematic and just view the nbt

#

yeah should be fine

chrome beacon
#

Do you need Spigot BlockState or is an NMS one fine

echo basalt
#

getNBTData works for most versions

torn shuttle
#

I mean if I have to balance storing nbt

#

tbh

#

I would rather just

echo basalt
#

he already has nms blockstate

torn shuttle
#

read the signs

#

then write them

#

it's the only entity I need like this

echo basalt
#

for now

chrome beacon
echo basalt
#

nms blockstate isn't a tile entity smh

#

he needs tile nbt data

torn shuttle
#

well even if it wasn't if the solution is to manually go read nbt and potentially do conversions for it to work then surely no generic solution would work

young knoll
#

NMS blockstate is Bukkit BlockData

#

Essentially

echo basalt
#

exactly

torn shuttle
#

I wish I could do so without having to do some kind of occult ritual

echo basalt
#
    /**
     * Read the given NBT data into the given tile entity.
     *
     * @param tileEntity the tile entity
     * @param tag the tag
     */
    static void readTagIntoTileEntity(net.minecraft.nbt.CompoundTag tag, BlockEntity tileEntity) {
        tileEntity.loadWithComponents(tag, MinecraftServer.getServer().registryAccess());
        tileEntity.setChanged();
    }
#

this is how WE does it

#

With a bit of

#

NC -> Nms chunk
NP -> Nms block pos
NBS -> NMS block state

torn shuttle
#

... that's hilarious

#

my god

#

guess why they're on fire

young knoll
#

They're in hell

quaint mantle
#

?paste

undone axleBOT
cinder abyss
#

Hello, can I use multiple server resource packs ? (like there is already one from a plugin and my plugin also send one). Can both be on client or do I need to do something more ?

chrome beacon
#

You'd need to merge them

#

So it's just one

echo basalt
young knoll
quasi gulch
#

Im using the EntitySpawnEvent but it seems like it doenst get triggert when an itemframe gets spawned when an End City is generated

#

Only when i place it

upper hazel
#

this pussable enable server for 1.16 in java 21?

blazing ocean
torn shuttle
pallid osprey
#

Hey i have a error when a player place/break block with worldguard

[14:40:19] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to WorldGuard v7.0.10+d9424b1
org.bukkit.event.EventException: null

[14:40:20] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to WorldGuard v7.0.10+d9424b1
org.bukkit.event.EventException: null

cinder abyss
cinder abyss
#

setResourcePack or smth like that ?

blazing ocean
#

probably? I just use adventure

torn shuttle
#

what a day

#

it feels like developing this thing never ends

#

every time I think I'm nearly done something wipes my progress

sacred saffron
glossy laurel
#

is Bukkit.getPlayerExact case sensitive?

worldly ingot
#

I believe so, yes

glossy laurel
#

can I somehow make it not case sensitive?

worldly ingot
#

Not really. That would defeat the purpose of "exact"

#

You have #getPlayer() which does the same sort of player matching that a command target does

glossy laurel
#

wait, so I could technically use getPlayer, then compare it to the input string?

#

after lowercasing both

worldly ingot
#

I suppose that would be one way to do it, yeah

#

Like I mentioned, #getPlayer() works like a command does. My username is 2008Choco, and if I do /give 2008c stone, if I'm not mistaken, it will find me and succeed.

#

So, yeah, I guess you could pass in "2008choco" and check if it equals toLowerCase() of resulting username

#

Not sure why you want to be that strict about it though lol

glossy laurel
#

hold up

#

aren't usernames

#

case

#

insensitive

worldly ingot
#

Yeah I don't think anyone can register the username "2008CHOCO" for example because I have "2008Choco"

pseudo hazel
#

I think the check is probably case sensitive, but yeah you are right, the database or whatever considers names to be duplicates if only the casing is different

#

but player names can certainly have casing

slender elbow
torn plover
#

Merchant merchant = Bukkit.createMerchant();
List<MerchantRecipe> recipes = new ArrayList<>();
recipes.add(createRecipe());
merchant.setRecipes(recipes);
MerchantView view = MenuType.MERCHANT.builder().merchant(merchant).build(player);
player.openInventory(view);

java.lang.IllegalArgumentException: The given title must not be null

Anyone that can help?

smoky oak
#

as for why im here, does this look correct for projecting parallel rays onto a sphere?

public List<Location> project(Set<Location> shape, Vector direction, Location sphere, double radius){
        direction.normalize();
        ArrayList<Location> impacts = new ArrayList<>(shape.size());
        Vector center = sphere.toVector();
        World world = sphere.getWorld();
        for(Location location : shape){
            Vector origin = location.toVector();
            Vector toCenter = center.clone().subtract(origin);
            double distApproach = toCenter.clone().dot(direction);
            boolean inSphere = origin.isInSphere(center,radius);
            if(distApproach < 0 && inSphere) continue; //No ray intersection
            double distCenter = toCenter.length();
            double distInnerSquare = radius * radius - distCenter * distCenter + distApproach * distApproach;
            if(distInnerSquare < 0) continue; //No ray intersection
            double distIntersect = distCenter + Math.sqrt(distInnerSquare) * (inSphere ? 1 : -1);
            Vector hit = origin.add(direction.clone().multiply(distIntersect));
            impacts.add(new Location(world, hit.getX(), hit.getY(), hit.getZ()));
        }
}
torn plover
#

i tried that but i get this
java.lang.NoSuchMethodError: 'org.bukkit.inventory.view.builder.MerchantInventoryViewBuilder org.bukkit.inventory.view.builder.MerchantInventoryViewBuilder.title(java.lang.String)'

smoky oak
swift onyx
torn plover
eternal night
#

Paper does not have a string method, it has a component method

#

So either switch your server to spigot or develop against the paper-api if you wanna use API added to spigot/paper post paper's hardfork

torn plover
#

alright thank you

quaint mantle
#

Anyone know of a plug-in that has the ability to charge a different currency for different items like I have two currency one that’s usd and another that’s gems I want blocks etc to be bought and sold using usd currency in game amd the higher tier items to be bought with gems

echo basalt
#

It's usually done with separate shop plugins

misty ingot
#

is there a way to make a FAWE selection "glow" (with a specific color, if possible)?

#

like the outlines of the entire selection get the glow effect

#

i think ive seen people make blocks glow before

next stratus
#

You'd likely need to get the player's selection region and do something with that.

misty ingot
#

... lets say i already have the selection object

next stratus
#

I know entities can have a glow, but I'm not sure on blocks having glows?

blazing ocean
#

Would need a resource pack

#

Could also summon glowing shulker boxes since those connect but that would be a looooot of entities

misty ingot
#

well the selection is at MINIMUM a full chunk of the full world height

misty ingot
#

i think im gonna think of something other than a glow

#

or maybe if i just made the outer surface of the selection glow, it would work for this use case

#

but how would i get the outer surface

blazing ocean
#

Well shulker box

#

fuck

#

shulker boxes would be hella laggy on the client

#

I hate this keyboard why is the backspace key so smol and the return key so large

remote swallow
#

sounds like a uk format

misty ingot
#

sounds like a bad keyboard

blazing ocean
quaint mantle
#

Anyone know of a plug-in that has the ability to charge a different currency for different items like I have two currency one that’s usd and another that’s gems I want blocks etc to be bought and sold using usd currency in game amd the higher tier items to be bought with gems

#

An essentials with this functionality

chrome beacon
#

This channel is for development

blazing ocean
#

not with that attitude

#

@ivory sleet

#

you know of a plugin?

misty ingot
#

oh yeah conclube def knows

#

he is, however, asleep i believe

chrome beacon
#

It's not that late

#

Just 8pm

misty ingot
#

wait nvm hes online

blazing ocean
#

probably busy with uni shit

#

@young knoll then

misty ingot
#

i was just boutta ping jishuna

young knoll
#

?kick beanernator2000 spamming won't get you help faster

undone axleBOT
#

Done. That felt good.

blazing ocean
#

spamming won

smoky oak
#

can you async read data from World objects?

chrome beacon
#

You can

#

Should you, no

#

Spigot should block certain methods as well

thorn isle
#

you "can" in the sense that the call will effectively schedule a sync task to the start of the next tick and then block on that

#

the read itself is still sync

#

and you'll probably end up waiting on it for ~50ms

#

you can also read blocks directly from nms chunks using nms without any synchronization, and this is safe in the sense that it won't make the server explode, but you are liable to read stale data or see air where you expect to see blocks

fickle spindle
#

why is this not working ? p.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, Integer.MAX_VALUE, 3, false, false));

#

it give no error and it doen't give the player the effect

chrome beacon
#

You should use the INFINITE_DURATION constant instead of int max value

#

as for it not working does your code run

fickle spindle
quaint mantle
#

coding your own uwu

fickle spindle
rough crane
#

Can anyone help?
Im trying to make a CrafterCraftEvent event handler that will cancel the event when the items in the recipe contains filled_map with the lore "Uncopyable Map". I cant do it

chrome beacon
#

What part do you need help with

#

Also I don't recommend checking the lore or name to identify items

#

Use a PDC tag

rough crane
rough crane
chrome beacon
#

You can check the inventory of the Crafter

#

get the BlockState from the Block and cast it to CrafterInventory and see if it contains the item

chrome beacon
fickle spindle
thorn isle
#

how are you determining that you don't get the effect

#

you're passing false for both particles and showIcon so it won't show up in the gui

thorn isle
#

check the return value of the method call

#

if someone cancels the event or you are immune to effects for some other reason, it'll return false

fickle spindle
cinder abyss
#

Hello, is there a tutorial to change a bossbar to display text and images ? I want to make a recreation of WAILA using a resource pack

#

Or is there another alternative to display something at player's screen ?

chrome beacon
#

Bossbar would be the easiest

#

What you need to do is create a bitmap font with the textures you want to show

#

and some negative space characters

lyric briar
#

Hello! Is there a way to hide the held items from displaying in F5 and others can not see them too? I tried getting ProtocolLib to work, but there is no 1.21.4 version (downgrading is not an option)

I've hit a dead end. So please help me

young knoll
#

The latest dev build should support 1.21.4

lilac yacht
#

Good day, I want to return the money from Oraxen, there is zero support there, nothing is solved there, they don't help at all, I don't understand how you can allow Oraxen to be with you.

split gull
#

Hi, i know that mojang mappings have been out since 1.14, how do i apply them to versions prior to 1.17 (which is when build tools added them)

remote swallow
#

spigot doesnt offically support it pre 1.17

split gull
#

yeah im asking how to do it in other ways

remote swallow
#

generate the mappings yourself and apply them

split gull
#

yeah but i dont know how to generate the mappings, i know where i can find them, the minecraft wiki has the json for each version

#

but i dont really know what to do with those

remote swallow
#

you have to do exactly what buildtools does for newer versions, its all inside of buildtools and even after that there is no guarantee it will work

#

it would be much easier to just drop older versions

split gull
#

mh

lyric briar
split gull
#

so i need to see how buildtools does it in the source code?

young knoll
#

Well one of the last changelogs was add 1.21.4 support

young knoll
#

Specifically this one

split gull
#

mh

grim hound
#

how do you upload a lib/api to jitpack?

chrome beacon
#

It's automagic

#

Just ensure it's buildable

#

And then it will work

grim hound
chrome beacon
#

If you open jitpack you can see the build log

grim hound
#

also, it relies on github releases and tags, right?

chrome beacon
#

You can build specific commits as well

grim hound
chrome beacon
#

Or specific branches

chrome beacon
grim hound
#

yeah makes sense

grim hound
#

do you know how I could automate this process?

#

so that I don't need to create a release manually?

chrome beacon
#

Don't really need to do anything

#

You can just depend on the main branch

#

And jitpack will build for you

grim hound
#

I mean if I have these

#

how can I depend only on the AlixAPI module?

remote swallow
#

if it has the maven-publish plugin running publish/publishToMavenLocal on the parent should run it for that too

grim hound
#

cuz well

remote swallow
#

then you can depend as normal

grim hound
#

of the api module?

chrome beacon
#

Yeah I don't think it handles multiple outputs

#

So make it publish the just api

remote swallow
#

could also use repsy and publish from local machinee

grim hound
grim hound
grim hound
chrome beacon
#

Might want to set the version to the project version variable so you don't have to change in multiple places

grim hound
#

what does this do?

remote swallow
remote swallow
# grim hound what does this do?

creates a publication called "release" using the jars from the java component, group id as that, artifact as that and version as that

grim hound
#

...why

#

also, how

#

I mean this is buildable

#

the default build.gradle.kts is empty

#

so is that the issue?

late abyss
eternal oxide
#

depends. If the chunk had recently been unloaded the entities may still be loaded.

#

in general though, no

late abyss
#

Ok I need to figure something else out when doing this at server start then, thanks πŸ‘

eternal oxide
#

PDC tag on entities and handle them when they are loaded

late abyss
#

that's a great approach, thanks!

late abyss
#

are chunk tickets persistent between server restarts?

eternal oxide
#

no

late abyss
#

ok thanks

grim hound
chrome beacon
#

Root build file

#

Jitpack doesn't know about your submodules

grim hound
#

so I keep it empty

chrome beacon
#

It will just run publish to maven on the root build gradle

grim hound
chrome beacon
#

Can't redirect as far as I'm aware

#

Define your publish task in the main build gradle

grim hound
chrome beacon
#

Not sure

#

Try running publishToMavenLocal on your pv

#

pc* when testing

grim hound
#

same message

#

wtf

grim hound
#

why the fuq does jitpack complain

split gull
#

in build tools, when exactly is this file created? here it reads it and creates a VersionInfo instance but i couldn't find where it gets created

remote swallow
#

its created on version release and stored in builddata on stash

#

?stash

undone axleBOT
split gull
#

ohhh

#

thanks

#

is there a way to view it for past versions?

remote swallow
#

check git history

split gull
#

found it, thanks

split gull
#

any ideas?

#

( the parsed patch part is me debugging the patch with gson )

remote swallow
#

the code it expects to patch and what really exists dont match

#

check you have the right mc version amd make sure you arent giving it mappings its not expecting to use for them

#

and manually check the file its trying to patch and verify the patch would work

split gull
#

mh alright

#

i've already checked the actual file and it looks good to me

#

i'll see if i grabbed the right mappings

remote swallow
#

spigot will internally not support mojmap, the only part you can use mojmap is on your code ensuring you apply mappings correctly

#

and there is still no guarantee that the mappings will work properly or apply properly

split gull
#

yeah im aware

#

im just looking to make it work in the IDE

split gull
remote swallow
#

are you running bt or recreating its steps

split gull
#

bt

#

i cloned it and replaced the info.json file with one using the mappings url from mojang

#

but i think thats not enough

#

i think i need to generate this too but i dont know how

remote swallow
#

use the one for the version you want

split gull
#

im trying to do this for 1.16.5, its found here

split gull
remote swallow
#

you need to generate the correct member mappings, install the correct files with correct names to maven local, then map the server with those install stuff as required with its other files

split gull
remote swallow
remote swallow
#

?mappings would be much much easier, this can help with converting from mojang > spigot

undone axleBOT
split gull
#

it might be easier to avoid it, but that doesnt make it impossible

split gull
remote swallow
#

its not impossible but its a hell of a lot of work for such old versions

split gull
#

mh

split gull
#

but is there some sort of guide on how to do everything you said above?

surreal echo
#

Hello, can you tell me why spigot saves only META-INF folder in jar? Maybe I've built something wrong? I activated the jar:jar process

remote swallow
#

use the package goal

remote swallow
split gull
#

well, is there anybody i could ask?

#

surely someone knows

remote swallow
#

anyone that understands how buildtools works, which is very few people now, and if they do know what to do they will most likely not care about supporting such old versions

split gull
#

ugh

#

i guess thats a bit of a dead end

#

well, thanks for the help, if you happen to figure something out let me know

sullen marlin
#

I assume 1.17 is when build tools added mojmap support

#

So you're really on your own for versions before that

#

?howold 1.16.5

undone axleBOT
upper hazel
#

Is it possible to add to jar files the code I need without decompiling the file?

#

i know in mode this probably can

#

but

#

in plugin how do this?

slim wigeon
#

I asking this because I need the correct number to show and players might think their items are disappearing

pseudo hazel
#

isnt there an api method to put stuff into an inventory with carry overs?

wet breach
#

if you want to do proper inventory management you should extend this at the very least so you are not having to duplicate code all the while being able to create a custom inventory

#

you should extend inventory that is

#

or implement, one of the two

#

anyways, not entirely sure why you end up with 63 it is quite possible it might have to do with actions being done in the same tick?

#

but if they end up with the correct number overall, don't really see the issue

slim wigeon
#

So that is my issue?

wet breach
# slim wigeon So that is my issue?

not really sure, but there is more proper ways to do the inventory stuff without duplicating code like you are that is already present in the api. However you will just have to add some debug messages and do some testing to figure out why its doing what it is doing could even be just something within the server code itself and not necessarily something actually wrong.

slim wigeon
#

I will have to test that but I don't think I was deplicating code, I wonder how Songoda manages inventories

#

You see in the add function that I blocking all items that are enchanted/custom

wet breach
upper hazel
#

bruh why inteliji lib adding system so bugged

#

inteliji not can find class from jar when start compile but this class exists

slim wigeon
# wet breach probably best you don't bring up that name here.

Let me guess, they banned. No wonder they told me to switch to Paper. Just know I got autism. I might be breaking my mom's rules right now but if anyone (Not saying you are) turns into a hostile on me, my anxiety activates and I get banned in the wave. Not going in detail but multiple people tells me to get professional help, just a warning. I don't go on other servers for that reason

#

But I will test that and tell you the results

wet breach
# slim wigeon Let me guess, they banned. No wonder they told me to switch to Paper. Just know ...

there isn't a particular rule about talking about those who are banned that I am aware of, but that person you mentioned is far from being a professional. They really don't create anything themselves. They buy up projects and then pay other devs to fix them just enough and then sell them and they don't even focus on optimizing anything. Anyways aside from that, there is some controversies of them that makes them even more terrible aside from their so called work. So its just best to not bring them up or talk about them. I also recommend looking at other people for inspiration that are far better then them

#

As far as bringing up ailements you should refrain from using them as excuses for anything. I myself have autism and few others here however it is no excuse to act a particular way. I recommend working on that anxiety of yours to where you recongize it and then just go take a breather. Its the internet after all it isn't going anywhere πŸ˜‰

#

not saying you are doing anything wrong, just a response to what you have said nothing more πŸ˜‰

slim wigeon
#

I know all this, I trying to work on it but I think some people are right when it comes to professional help. For that person, don't tell me they used other people's work because I would unsubscribe from their services. They were not fixing anything so I started working on plugins again. I starting to get my answers to everything more we talk

wet breach
# slim wigeon I know all this, I trying to work on it but I think some people are right when i...

that is because they don't fix stuff that people request, they fix it enough to sell. And they buy people's projects so it isn't like the use of other people's works is illegal in the way they are doing it. They also don't really pay their dev's very much either but that isn't really much of an issue as it is the dev's fault for accepting low pay work. Almost all of them are freelancers as well. But the controversies extends beyond just the plugins and has gone as far as Microsoft disowning them in a way πŸ˜›

#

so I recommend not getting involved with her, no matter how convincing she is

#

I know most of this as she enlisted my services but never paid me therefore I didn't do anything. However it didn't stop her from trying to get me to do work without paying first lol. And I was able to see some of the stuff going on. However I wasn't there for the more serious stuff that happened fortunately lol

slim wigeon
#

I only used their plugins because they created plugins I need but since you said this, I unsubscribing. Thanks. Anyway, back to this inventory issue. Let me test this

wet breach
#

All good, I don't expect everyone to just automatically know πŸ˜›

slim wigeon
#

@wet breach I just noticed I cannot cancel this subscription so I stuck paying them

wet breach
#

to pay that is

slim wigeon
#

Paypal

wet breach
#

go into paypal

#

and cancel the sub

slim wigeon
#

I tried everything

wet breach
#

paypal will cancel the sub

#

I am probably one of the oldest members of paypal lol

slim wigeon
#

When I click "Manage or cancel subscription", it redirects me to their website with no option for this

wet breach
#

turn the autopay for it off

#

once you do that, papal won't allow it

#

doesn't matter if you used their site or not

#

if anything else, just send paypal a ticket

#

they will help you out and remove the sub πŸ™‚

#

if you do have to resort to a ticket, inform them that they don't allow unsubscribing

slim wigeon
#

That might have canceled it

wet breach
#

they don't like it when places do that and will penalize them

#

but it is also the reason why paypal allows forcefulling denying payments too

#

I have had quite a few sites denied sub services because of violating paypals terms πŸ˜‰

#

but yeah, if you went to that link, clicked on the service, on the right it should have a link at bottom that says stop paying with paypal

#

and then you should see it in the inactive list

#

if it is in the inactive list, paypal will not allow their payment to go through anymore

slim wigeon
wet breach
#

πŸ‘

upper hazel
#

EcoEnchants.INSTANCE.values() is empty for some reason

robust helm
#

i heard someone say that ip bans are braindead cuz ip(v4) is dynamic. thats cap right? like i can js use ipv6

slim wigeon
#

@wet breach Does this need to be a interface? I asking because I added extends Inventoryand it asked me to change it to interface

smoky anchor
#

It's telling you this because Inventory is an interface. You just need to use implements.
Buuut I am not so sure if you should be implementing that interface.

smoky oak
#

is there a way to return a Collection reference, but prevent whoever got it from modifying it? i don't want to have to clone it; it has potentially thousands of entries

wet breach
smoky oak
#

wouldnt that also require instantiating a new object with all the values? i want to dodge having to do that computation if possible lol

wet breach
smoky oak
#

guess not lol

wet breach
#

have fun πŸ™‚

glossy laurel
#

Is it possible to either:

  1. Damage a player without them getting any velocity
  2. Make a player red without damaging them
slim wigeon
wet breach
#

give it a try. part of development is learning by trial and error

#

you gain valuable experience and learn what is or is not possible

smoky oak
glossy laurel
#

I want to play them the damage animation

#

but without actually damaging / affecting the player

torn shuttle
#

funny

#

takes like 37 seconds to preload 1024 chunks using 20% of a tick

#

if it's a void world

#

good thing I measured it, I was wondering if my code was slow

#

turns out minecraft is slow

#

alright well let's sideload this process, imagine that, pseudo-parallelized world generation

#

what a time to be alive

smoky anchor
#

You pasting a whole flipping region ?
Could have just replaced a region file on the disk at this point

smoky anchor
#

Yeah I assumed
I don't know the specifics of what you're doing

wet breach
#

even loading one is as well

#

just depends how you are doing it is all

hushed spindle
#

anyone know of a way to make a player stop blocking with a shield?

wet breach
slim wigeon
#

@wet breach I might know what my issue is, the addItem method that my class calls. ChatGPT told me to check every slot

hushed spindle
#

i'd preferably not mess with the players held items but if thats what i gotta do

wet breach
hushed spindle
#

i made a shield disarming stat that applies a shield cooldown on hit, but if the player is blocking while this procs the cooldown applies but they'll still be blocking and protecteed from damage

#

if they lower their shield first, they can no longer raise it due to the cooldown

#

basically do what an axe does

jagged thicket
hushed spindle
#

its just that when you apply the cooldown that held-up shields aren't lowered first

smoky anchor
#

xy I feel like
Should have said that at the start

hushed spindle
#

so if you apply the cooldown while the shield is held up, it will remain up

echo basalt
#

Try calling swingHand or whatever

young knoll
#

Maybe you could do something with the xxItemInUse methods

wet breach
hushed spindle
#

shucks

young knoll
#

Vanilla lowers the shield when you get hit with an axe

#

Could look at how Mojang does it

slender elbow
#

that just applies the cooldown, doesn't it?

native hedge
#

Hello, my HashMap is always reset. I don't know why it suddenly becomes empty during the inventory click event

private Map<UUID,UUID> viewers = new HashMap<UUID,UUID>();

    viewers.put(player.getUniqueId(), target.getUniqueId());



@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    Player player = (Player) event.getWhoClicked();
    if (viewers.containsKey(player.getUniqueId())) {
        event.setCancelled(true);
    }
}

@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
    Player player = (Player) event.getPlayer();
    viewers.remove(player.getUniqueId());
}
young knoll
slender elbow
#

mm yeah spigot does not have api for the method vanilla uses for this

young knoll
#

:(

split gull
# sullen marlin I assume 1.17 is when build tools added mojmap support

Sorry for the ping, but I've gone through the source code and i don't understand what part of it supports them since 1.17, I thought it was something I could replicate easily but apparently not, I'm looking to document my steps so that anybody that wants to do it can follow my steps, but I really don't know where to start, I don't get how I'm supposed to get the correct mappings, all I have is buildtools and the piston-data urls from mojang, if you know something that could help me please do tell lol, I've looked around for so long

slender elbow
split gull
#

Like some had to handle that, somewhere that has to be code to do this process, no?

native hedge
# slender elbow where and how exactly are you adding the player to the map? the event handlers l...

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Β§cΒ§lDas geht nur als Spieler");
return true;
}

    Player player = (Player) sender;
    if (args.length != 1) {
        player.sendMessage("Β§cΒ§lNutze: /invsee <Spielername>");
        return true;
    }

    Player target = Bukkit.getPlayer(args[0]);
    if (target == null) {
        player.sendMessage("Β§cΒ§lDieser Spieler ist nicht online");
        return true;
    }

    player.openInventory(target.getInventory());
    viewers.put(player.getUniqueId(), target.getUniqueId());

    return true;
}
young knoll
#

My guess is you make a separate instance for the command registration and the event registration

#

You need to use the same instance

MyClass instance = new MyClass();
getCommand("poop").setExecutor(instance)
Bukkit.getPluginManager().registerEvents(instance, plugin);
remote swallow
split gull
native hedge
remote swallow
#

Yeah, you basically have to figure out what class the spigot map is talking about then give it the right package and/or name to br able to generate moj memer maps

split gull
#

If it really all is on md's pc then that means I would have to bother him about it which I don't want to

remote swallow
#

He also most likely will just tell you to update

split gull
split gull
remote swallow
#

You could use any mapping you like as long as you get back to reobf/spigot mappings

split gull
#

mh

remote swallow
chrome beacon
#

In theory the mapping process isn't that hard

slender elbow
#

but you know what is?

#

😏

chrome beacon
split gull
remote swallow
#

Chance of all of them

split gull
#

ok well thats a start

chrome beacon
#

So Mojang mappings map nms -> mojang
And Spigot does nms -> Spigot

There for you can do Mojang -> nms -> Spigot

split gull
#

So, to clarify, are these mojang to nms?

chrome beacon
#

yes

split gull
#

alright thats a good starting point

#

but where would i find nms to spigot?

chrome beacon
#

Run BuildTools and they should be somewhere in your folders

#

I can check but it might take a bit

split gull
#

is it this file?

#

or the combined one

#

or any of these?

#

these ones are from the stash

remote swallow
#

Mojang provides one for everything spigot has on for classes. One for members and one for fields in modern versions the members are entirely generated from mojanf

split gull
#

what does "members" refer to here?

chrome beacon
#

methods

split gull
#

kk ty

chrome beacon
#

I'd assume at least

split gull
#

looks like a mix of fields and methods

#

but why are there multiple mappings file from spigot

#

do i need to somehow merge them?

chrome beacon
#

If you want to use the special source plugin you'd need to merge them in to a compatible format

split gull
#

Well, i've cloned buildtools, is it fine to use that or do i need to use specialsource directly?

#

I haven't had much luck with that

chrome beacon
# split gull or any of these?

So what these files are:
.at = access transformer, changes the access modifiers (private, public etc)
.exclude = things that should not be mapped
-cl.csrg = classes
-members.csrg = fields and methods

split gull
#

ohhhhhh

#

thats very useful to know

chrome beacon
#

As for that fields csrg you sent I don't see one when building mine

#

Where was it located?

split gull
chrome beacon
#

yes

split gull
#

BuildData/mappings

chrome beacon
#

Second image is BuildData/mappings

#

The first image looks to be work

split gull
#

wait nvm i misread

true rapids
#

hey, is it possible to place a text on the display like in a ActionBar but on the left Side a bit over the hp bar with a plugin?

split gull
#

yeah it is

chrome beacon
#

my work only looks like this though

#

Did you take the screenshot while it was working?

split gull
#

I think mine is different because i manually added an info.json file to replace the one from the stash since thats where i found some differences between 1.17 and 1.16.5

#
{
  "minecraftVersion": "1.16.5",
  "spigotVersion": "1.16.5-R0.1-SNAPSHOT",
  "serverUrl": "https://launcher.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar",
  "mappingsUrl": "https://launcher.mojang.com/v1/objects/41285beda6d251d190f2bf33beadd4fee187df7a/server.txt",
  "accessTransforms": "bukkit-1.16.5.at",
  "classMappings": "bukkit-1.16.5-cl.csrg",
  "memberMappings": "bukkit-1.16.5-members.csrg",
  "classMapCommand": "java -jar BuildData/bin/SpecialSource-2.jar map --only . --only net/minecraft --auto-lvt BASIC --auto-member SYNTHETIC -e BuildData/mappings/bukkit-1.16.5.exclude -i {0} -m {1} -o {2}",
  "memberMapCommand": "java -jar BuildData/bin/SpecialSource-2.jar map --only . --only net/minecraft --auto-member LOGGER --auto-member TOKENS -i {0} -m {1} -o {2}",
  "finalMapCommand": "java -jar BuildData/bin/SpecialSource.jar --only . --only net/minecraft -i {0} --access-transformer {1} -m {2} -o {3}",
  "decompileCommand": "java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -asc=1 -udv=0 -rsy=1 -aoa=1 {0} {1}",
  "toolsVersion": 105
}```
chrome beacon
#

Specifically one with negative spacing

split gull
split gull
chrome beacon
#

I see but you shouldn't have to modify BuildTools at all

#

if all you want is to use mojang mappings in a plugin

split gull
#

did you type that correctly

true rapids
true rapids
#

Thank you

split gull
#

np

split gull
chrome beacon
#

yes all you need is an csrg file so that special source knows how to transform mojang maps to spigot maps

#

wait no shouldn't have*

#

I did not type it correctly πŸ’€

split gull
#

lol i noticed

split gull
chrome beacon
#

You can look at the one for 1.21.4 for example

split gull
chrome beacon
#

It's in your local maven repo under org\spigotmc\minecraft-server\1.21.4-R0.1-SNAPSHOT

split gull
#

Oh

chrome beacon
#

See the <srgIn>org.spigotmc:minecraft-server:1.21.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn> part when using Special source

#

That's the reference to where the csrg mappings file is

split gull
#

so these 2?

chrome beacon
#

It specifically references the maps-spigot

#

I'm not sure what the other one is used for, probably during the build process with BuildTools

split gull
#

mh

#

so if i can have that maps-spigot.csrg fine in the local mavel repository i'll be able to use mojang mappings?

chrome beacon
#

You'd need to make one for 1.16.5 and then it might work

#

I haven't checked how special source works or anything

#

I'm just making some guesses

split gull
#

mh

wet breach
#

one is to kill lvt

#

the other is to apply the mappings

split gull
#

what does "kill lvt" mean?

wet breach
#

local variable table, to remove the funny snowman

split gull
#

uhhhh

#

no idea what that means

wet breach
#

because you haven't seen the funny snowman in decompiling πŸ™‚

split gull
#

there's a funny snowman?

chrome beacon
#

The obfuscation Mojang uses caused a field to be named β›„

split gull
#

lmao

slender elbow
#

β˜ƒοΈ my beloved

split gull
wet breach
remote swallow
#

spigot didnt support mojmap till 1.17

split gull
#

yeah so now i need to make them myself

#

issue is i dont know how

#

so i kinda need to go on the assumption that buildtools will do it for me if given the right circumstances

remote swallow
#

the only mappings bt will generate if given the right stuff is members

split gull
#

so i need to find another way?

#

man i wish specialsource had documentation

remote swallow
#

its only 10 years old and made to be used in a specific way

split gull
#

well that I didnt know

remote swallow
#

special source can generate mappings if you check the code

wet breach
#

it can do more then that

blazing ocean
split gull
split gull
#

oh

#

so i need to give it an obfuscated jar and a deobfuscated one?

#

Now I'm confused, I don't have the mappings nor a mojmap jar, how do i get it?

wet breach
split gull
#

it feels like i need either to get the other

#

ok uh, slightly unrelated, buildtools doesnt work anymore

#

its stuck at downloading git

remote swallow
#

delete repos and retry

split gull
#

im not using a custom build anymore

remote swallow
split gull
wet breach
#

if I remember right, specialsource 2 can do quite a bit too

#

just it isn't used that way lol

remote swallow
#

when i last looked internally its fairly empty

remote swallow