#help-development

1 messages · Page 731 of 1

worldly ingot
#

It's just math and setting the output colour of a pixel

eternal valve
#

Bunu denedim ve çalışıyordu kendim özel bir şey denedim logo kısmının sınırları vardı

shadow gazelle
#

So it's animated

worldly ingot
#

I can only imagine yes

shadow gazelle
#

I was thinking it was just a loading screen texture

worldly ingot
#

The avocado one seems static :P

eternal valve
#

Thank you very much, but can I logically turn a picture into fsh?

kind hatch
eternal valve
#

Nope

worldly ingot
#

No because textures aren't shaders. These two concepts are fundamentally different

eternal valve
#

Ajwokdkwkdi

kind hatch
eternal valve
lilac dagger
#

Fragment shaders? Is thst what they named pixel shaders or they're different?

worldly ingot
#

Vertex and fragment shaders are part of the OpenGL shader pipeline

dusky river
#

can someone help me, i need a staff member, idk where to put my message but its definetry not going in the help-server channel.

eternal valve
shadow gazelle
worldly ingot
dusky river
worldly ingot
#

Seems they made some sort of generator to convert their texture into a GLSL script

#

Using import statements to copy/paste that if/else-if chain into the shader a little more cleanly

kind hatch
worldly ingot
#

And the changed background script just changes the background colour

#

Detects red, changes it to green

#

Nothing too crazy complicated. You can download those packs and learn a lot

dusky river
#

ya talking about changing the minecraft loading screen without optifine?? Im interested but idk how to use shaders in texture pack...

shadow gazelle
#

Unless you're trying to do something fancy like animate it, you don't need to do anything other than change the texture

dusky river
#

well, i know that you can do this with optifine. But in vanilla minecraft🤨

shadow gazelle
#

Yes

#

For a while now

#

Assuming you're talking about the animation part

dusky river
#

im talking the mojang logo

shadow gazelle
#

You've been able to change that for a long time

dusky river
#

i mean change the mojang logo to annother texture, not change the color. am i dumb or something, cause everywhere i looked, i just found shaders resource pack to change the logo and the texture based one required optifine

shadow gazelle
#

No

#

Pretty sure you've been able to since texture packs were added

kind hatch
#

The logo itself is just a texture. You can replace that with any other image you want. Been that way for a while now.

#

If you want it to be animated, you'll have to mess with shaders.

dusky river
#

ok

#

well thanks

finite radish
#

Hey, is there any way I could use multiple spigot libraries at once?
Like inside pom.xml to have
1.19.2
1.18.2
1.16.5
etc.
Because at the moment I can only put 1.19.2 and 1.18.2

young knoll
#

You should only have one

#

Generally, the lowest your plugin will support

quaint mantle
finite radish
young knoll
#

In that case yeah, you want a multi-module project

finite radish
#

Does maven provide me with that or?

quiet ice
#

Outside of multi-module that is not truely possible anyways

young knoll
#

Or a bunch of reflection but blah

#

Maven has modules, yeah

quiet ice
finite radish
#

I see, I'll look more into it but thanks for providing me with an idea 🙂

quiet ice
#

Multi-module builds are possible under any build system in one shape or form

young knoll
#

Hey I use eclipse too

quiet ice
young knoll
#

So does @worldly ingot
There are literally dozens of us!

quaint mantle
quiet ice
#

I am afraid eclipse should really go to bed too - but one last line of code needs to be written today!

quaint mantle
#

XD

quiet ice
#

Heh, if my ConcurrentInt62Set was anything to go by my current project will take a few days even though it is a single class

young knoll
#

You wrote MD5?

quaint mantle
young knoll
#

Recently?

quaint mantle
#

Ye, I updated him

young knoll
#

Ah okay

kind hatch
#

Glad to know he still has maintainers.

young knoll
#

Did you address the PR merging speed

#

:p

quaint mantle
#

😂

quiet ice
#

Is there any negible difference between x << n and x * y if I happen to know that y is 1 << n but I do not know the exact value of n?
Basically I want to ask if it would be worth to do n = ln(y)/ln(2) and store it in a field

chrome beacon
#

If you're writing something that performance sensitive you really should setup a benchmark

lethal python
#

is PlayerInteractEvent literally just a right click

chrome beacon
#

Yes

young knoll
#

Or left

lethal python
#

what circumstances is it left

chrome beacon
#

Every left click

#

Like punching

lethal python
#

i just want to detect right clicks

eternal night
#

and walking over a pressure plate

chrome beacon
young knoll
#

Then check if the action is right click block or right click air

lethal python
#

:v action

young knoll
#

getAction

lethal python
#

yes

weak meteor
#

coll

#

how old are u

#

just curiosity

young knoll
#

24

weak meteor
#

damn ok

#

thought u were like 15

raw epoch
#

any exemple of this ?

sullen marlin
#

joml has a bunch of rotate / rotateXYZ methods

raw epoch
young knoll
#

Minecraft math isn’t any different than regular 3d math

raw epoch
#

the methods of display entites are mystic

#

like there is no "rotation matrix"

young knoll
#

Pretty sure there is a rotateAroundX method

#

Or something similar

raw epoch
#

lol

BlockDisplay display = player.getWorld().spawn(player.getLocation(), BlockDisplay.class, blockDisplay -> {
    BlockData blockData = Material.STONE.createBlockData();
    blockDisplay.setBlock(blockData);
    //blockDisplay.setRotation(player.getYaw(), player.getPitch());
    blockDisplay.setInterpolationDelay(10);
    blockDisplay.setInterpolationDuration(100);
    blockDisplay.setTransformation(new Transformation(
            new Vector3f(-0.5F, -0.5F, -0.5F),
            new Quaternionf(0, 0, 0, 1),
            new Vector3f(1, 1, 1),
            new Quaternionf(0, 0, 0, 1)));
    //blockDisplay.setTransformationMatrix(new Matrix4f(
    //        (float) (Math.cos(a) * Math.cos(b)), (float) -Math.sin(a), (float) (Math.cos(a) * Math.sin(b)), (float) 0,
    //        (float) (Math.sin(a) * Math.cos(b)), (float) Math.cos(a), (float) (Math.sin(a) * Math.sin(b)), (float) 0,
    //        (float) -Math.sin(b), 0, 0, 0,
    //        0, 0, 0, 0));
});
Bukkit.getScheduler().runTaskLater(CECoreHUD.getINSTANCE(), () -> {
    display.setTransformationMatrix(new Matrix4f(
            (float) (Math.cos(a) * Math.cos(b)), (float) -Math.sin(a), (float) (Math.cos(a) * Math.sin(b)), (float) 0,
            (float) (Math.sin(a) * Math.cos(b)), (float) Math.cos(a), (float) (Math.sin(a) * Math.sin(b)), (float) 0,
            (float) -Math.sin(b), 0, 0, 0,
            0, 0, 0, 0));
    display.setTransformation(display.getTransformation());
    //new BukkitRunnable() {
    //    float yaw = 4;
    //    @Override
    //    public void run() {
    //        display.setRotation(0, yaw);
    //        yaw += 4;
    //        //display.getTransformation().getLeftRotation().rotateAxis(12, 30, 0, 10);
    //    }
    //}.runTaskTimerAsynchronously(CECoreHUD.getINSTANCE(), 0, 1L);
}, 10L);
sullen marlin
#

Quaternion.rotateY

#

Or whatever axis you want

raw epoch
sullen marlin
#

Idk

#

Probably

#

I'm sure someone has made a guide

young knoll
#

I normally make both rotations the same

sullen marlin
#

Left is before transformation right is after

raw epoch
young knoll
shadow gazelle
#

Could you change fog on a client with nms?

#

Fog distance specifically

#

It seems like people have at least removed it entirely with plugins before

full gull
shadow gazelle
#

How do you not have the software to run it

#

I don't think you even need to install a JDK

lethal python
#

playerinteractevent isn't firing when i right click nothing with an empty hand

kind hatch
#

That's expected.

shadow gazelle
#

Either way you shouldn't use things like MCreator to make mods, they commonly produce bad or messy code and you, ironically, usually end up spending more time figuring out how to do things with code blocks that may or may not exist for what you want and make less sense than actual code

lethal python
#

how do i detect all right clicks

young knoll
#

Check if the action is right click air or right click block

#

Note the event doesn’t fire if you right click air with nothing in your hand

young knoll
#

Because the client doesn’t send a packet for that

lethal python
#

damn

#

that sucks mega

full gull
shadow gazelle
#

In a mod or in a plugin?

full gull
#

hopefully a plugin as im running it in a minehut server

shadow gazelle
#

I'm trying to see if I can find how that's calculated

full gull
#

Ok

#

research says its applied every tick subtracting 2% from the vertical velocity. Also says it is applied in this order 1. velocity affects position 2. drag affects velocity 3. acceleration affects velocity

shadow gazelle
#

Seems like the only drag is from water

full gull
#

wdym

#

i mean wiki says drag is more significant in water but it is still present in air

#

there should be a table with all projectiles, their speed, acceleration and drag

shadow gazelle
#

what

#

Okay, it's probably just not controlled in the arrow class it is

lethal python
#

does llama spitting not hurt player

hasty prawn
#

It does

#

It's like 0.5 hearts

lethal python
#

ok i am spawning llama spit but it won't damage mobs

lethal python
#

also i did setbounce but it won't bounce

eternal oxide
#

how are you spawning it?

worldly ingot
#

Imma be honest, I don't think doesBounce() does anything at all

#

Yeah use of that method dates back to 2011, 12 years ago, when arrows were able to either bounce off of players when hit or drop to the ground and inflict no damage

#

I don't know when that functionality was removed but doesBounce() isn't even called anywhere in CraftBukkit from what I can see. Probably worth deprecating that

warped shell
#

Player#setPose() is saying no class defined error?

worldly ingot
#

setPose() doesn't exist. You can't set a player's pose

#

Poses are recalculated every tick and based on certain factors so even if you could set the pose, it would just get reverted by the end of the tick anyways

warped shell
#

then why

#

is it a method

#

in player

#

oh its inherited

worldly ingot
#

Because it might be useful information to get. It's from Entity

warped shell
#

lmao i thought it was in Player

worldly ingot
#

You can call getLocale() as well but not setLocale() 😛

#

Some things only make sense to get

warped shell
#

so is there any way to set a pose?

#

do i have to set it every tick?

opaque scarab
worldly ingot
#

No because the client is going to disagree with you anyways

warped shell
#

fine ill use nms

opaque scarab
#

I was thinking about NPCs

opaque scarab
worldly ingot
#

It's both

opaque scarab
worldly ingot
#

Not that I'm aware of

#

That's also a lot of packets though :P

warped shell
#

i wonder if protocol lib has that

opaque scarab
#

@warped shell What pose are you trying to achieve?

warped shell
#

sitting

#

but id like to do others if i could

#

just testing the waters rn

opaque scarab
warped shell
#

oh interesting

opaque scarab
#

I use that for my sitting plugin

warped shell
#

i hadnt thought of that

opaque scarab
#

Crouch will make you stand, but I’m certain there’s an event you can cancel for that

warped shell
#

i want crouch to make it stand

#

so no need

opaque scarab
#

Ok cool

warped shell
#

cool ty for the idea

opaque scarab
#

Also, just a guess, but you could use NMS to make a block above the player, which may force them to crawl. Preferably a barrier, as that’s invisible.

quaint mantle
#

Im making a region system, is it worth making it so u can like add blocvks to regions instead of just having a min and max point?

shy forge
#

Hello, best-practices question here. How do you guys think is best to handle a custom command feedback system? Currently I've got it so there's a messages.yml file, an enum and a manager to handle the file to enum stuff. However, I find it really unsatisfying that the manager has to use the plugin instance to locate the datafile. Like, ideally, I'd like the messages system of the plugin to work fully on its own but the closest I can get is having to either A: Make the plugin instance public and static or B: only create the mssage manager when the plugin is enabled and it's only really accessible through a plugin instance. Anyone got a better system?

echo basalt
#

Uhh let's see

#

I have a MessagesFile class responsible for sending messages from the config

#

and I just pass it on to my command manager in the constructor

#

something like this

shy forge
#

Oh, so do you query the YAMLConfiguration when you need a feedback message?

warped shell
echo basalt
#

a FileConfiguration / ConfigurationSection is already a cached variant of the file

#

so I'm not doing any IO

shy forge
#

Yh that's what I meant soz

#

Still, I kinda prefer using enums IG

shadow gazelle
#

Is there a way to detect if an arrow isn't flying anymore?

#

not being a dumbass might help

#

I was getting the updated arrow outside of the loop

drowsy cosmos
#

How do I make chat appears different for different players? Say, we have 3 players, Player 1, Player 2, and Player 3.

Chat seen by Player 1

<Player 1> Hi guys!
<Player 2> Oh hey Player 1.
<Player 3> Welcome back Player 1!

Chat seen by Player 2

<Player 1> Hi guys!
<Player 2> Oh hey Player 1.
Message from a muted player..

Chat seen by Player 3

<Player 1> Hi guys!
Message from a muted player..
<Player 3> Welcome back Player 1!

sullen marlin
#

Cancel event and call sendMessage

quaint mantle
quaint mantle
drowsy cosmos
#

Alright thanks. Ill start from the recipients collection

buoyant viper
#

does offhand have a slot id?

#

looking at docs it seems to be 40, hmm

chrome beacon
#

Or listen to projectile hit event

lost matrix
glass mauve
#

is there any detailed description on the plugin loading? especially the resource handling of the plugins? I want to know how I can easily load in resources from a different plugin where I have information about the relative path

upper hazel
wet breach
echo basalt
#

I discovered ServerLoadEvent recently

#

I usually just use a scheduler with a 1 tick delay

pseudo hazel
#

you mean in the handler of the server load event?

echo basalt
#

ye

remote swallow
upper hazel
#

i was check

#

now i dont undestand some reason command "/bot help" not found

#

exists "/bot goodbye" /"bot hello"

#

but first command not exists in metod

#

but when listener registred he exists

#

wth with maps

glass mauve
# wet breach In regards if its from a different plugin you can use the api to check if its lo...

ok yeah my problem is accessing resources "next to it".
imagine this scenario:
I have /model/model.xml which references /images/bgmarker.png with @{../images/bgmarker.png}
the user of my library just provides the model.xml path which my library loads in
then I parse it and it finds a background image property which references the bgmarker
and my library should load it as well:

<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.squidxtv.me/schema/frameui/v1/frameui.xsd"
        id="test-frame"
        width="5"
        height="3"
        background-image="@{../images/bgmarker.png}">
    <div id="first-div" width="640" height="384" border-color="#FFFFFF" border-width="1"/>
</screen>

how do I get access to the whole resources of a plugin?
preferably without passing in the plugin itself, just the Path of the model.xml
I tried using nios Path like this:

Path.of(SpawnTestScreenCommand.class.getResource("/model/model.xml").toURI());

but I get some weird FileSystemNotFound exception by Path.of
I want to prevent that the user needs to load in all images himself and
passing it all to my plugin, that would be not that nice

#

.

#

.

#

some more context

#

and it should also work if the Path is a non resource path but an absolute path to something

#
        URI documentLocation = URI.create(element.getOwnerDocument().getDocumentURI());
        Path path = PathUtils.convert(Path.of(documentLocation), result);
    /**
     * The regular expression pattern for matching Windows-style paths.
     */
    private static final Predicate<String> WINDOWS_PATH = Pattern.compile("^[A-Z]:\\\\.+$").asMatchPredicate();

    /**
     * The regular expression pattern for matching Unix-style paths.
     */
    private static final Predicate<String> UNIX_PATH = Pattern.compile("^/.+$").asMatchPredicate();

    /**
     * The regular expression pattern for matching relative paths.
     */
    private static final Predicate<String> RELATIVE_PATH = Pattern.compile("^@\\{.+}$").asMatchPredicate();

    private PathUtils() {
        throw new UnsupportedOperationException("Utils class, construction not supported.");
    }

    public static @NotNull Path convert(Path xml, String path) {
        if (RELATIVE_PATH.test(path)) {
            return xml.getParent().resolve(path.substring(2, path.length() - 1));
        }

        if (WINDOWS_PATH.test(path) || UNIX_PATH.test(path)) {
            return Path.of(path);
        }

        throw new IllegalArgumentException("Invalid path format: " + path);
    }
#

this is how I handle the custom path @{path}
which shows that its a relative path going out from the xml model file

#

thats why I would be interested in some more in depth view of how spigot handles the resources of the plugins

ivory sleet
#

Embedded resources in jars?

#

Or which ones are you referring to?

glass mauve
#

yeah, but essentially should support both

ivory sleet
#

I mean the way I know one should do it is to just open a ZipFileSystem and read the resources from there

#

I think spigot prob goes through JarFile

eternal valve
#

does anyone know what the match tool does

#

I have 2 different rods and 5 different fish, 2 of them on the first rod and the remaining 3 fish will come out of the 2nd rod.

#

Is it possible to do something like this with the loot table

#

ty

tawdry pilot
#

anyway to detect left clicking on players without EntityDamageByEntityEvent?

eternal oxide
#

why?

tawdry pilot
#

not being able to detect when hitting a player in creative mode

eternal oxide
#

creative is it's own beast and difficult for a server to interact with

tawdry pilot
#

ono

#

does it at least trigger the event

dawn flower
#

quick question, if i cancel a PlayerInteractEvent and i try to left click a block, will it still show the block fracture animation?

quaint mantle
#

Code/System Design Question?

I've got 6 nms modules and I need to implement entities, I need to write a data watcher wrapper for flags for stuff like armorstand ect and wondering what the best way, if the best way is to make an INMSDataWatcherHandler and make some sort of wrapper for setting flags like DataWatcher.builder().setKey(1, 2) or whatever

#

or is there a better way since I believe data watchers have changed a lot from 1.20.1 back to 1.12 and 1.8

glass mauve
drifting nova
snow walrus
#

I just saw the change log for 1.20.2 and it says: The positions that all entities ride on other entities have been adjusted to make more sense

#

Does anybody know the exact value they changed for riding armorstands?

#

Or where to look at it

eternal oxide
#

For a brief second on the client its possible

dawn flower
#

im gonna try anwyays

quaint mantle
#

try and see

glad prawn
#

Yes he is

undone axleBOT
bronze crystal
#

do you know how?

graceful rock
#

Is it legal to distribute a mojang-mapped plugin jar? Lately there have been reports of Mojang-Mapped servers (not Spigot, but forks of Spigot) and I've received requests to make a plugin mojang-mapped-server compatible. Am I [a] allowed to make a mojang-mapped plugin jar for public use and [b] if I were allowed to do that, could I upload it to the Spigot forums?

eternal oxide
#

yes, so long as it contains no Mojang code

graceful rock
# eternal oxide yes, so long as it contains no Mojang code

So just to ensure my understanding is correct and I'm covering all bases:

  • If a plugin was using NMS directly (e.g. import NMS classes), and then was compiled against a Mojang-mapped Spigot jar, then that's not okay?
  • If a plugin was using NMS directly (e.g. import NMS classes), and then was remapped to Spigot so it didn't have any Mojang mappings in the code, then that's okay?
  • If a plugin used reflection to access NMS and had something like if mojangMapped then { access field "mojMappedField" } else { access field "spigotMappedField" }, then it is okay?
eternal oxide
#

yes you are not including any Mojang code.

#

you are using mojmapped names which mojang provide.

graceful rock
#

So using mojmapped names counts as containing Mojang code?

eternal oxide
#

doesn;t matter if you call .a or .connection you still include no mojang code

remote swallow
eternal oxide
graceful rock
eternal oxide
#

it doesn;t matter if you use Mojang provided names or the encrypted ones, it's not code

remote swallow
#

probably works the same way paperclip distributes the obsfuscated code

#

paperclip is already a gray area

graceful rock
#

The reason I'm asking is because there's this one line in the mojang mappings legal text: You may copy and use the mappings for development purposes. My interpretation is that if you're using mojang mappings, then build a moj-mapped .jar file for distribution (e.g. upload to the Spigot forums), then it's no longer "for development purposes"

eternal oxide
#

so long as you don't go packaging a Mojang class you are fine.

remote swallow
#

yeah paper will remap automatically when they start running it

river oracle
#

Just to add mojang released these mappings for developers to use and include in their code it'd be highly contradictory to then pursue those devs in legal action for using the provided mappings

prime reef
#

you could always google it :p

#

it's a pretty common use case

#

hmm

#

this is incredibly vague, but would y'all have any thoughts on how to "organically" determine "land claims"?

#

"land claims" meaning they're not actual land claims but rather the server's understanding of where a player has set up shop

#

what

#

wait are you talking to me or someone else

#

"set up shop" is just

remote swallow
#

has setup shop means where they've settled

prime reef
#

a colloquialism

#

yeah

#

these aren't actual shops

#

that's not it

#

lol

#

this is a design question, not an implementation one

#

basically "how would a bot determine if they're in an actual player's base"

#

bot-to-bot is easy, the server can just share their "claim" information

#

player-to-bot is also easy because players have brains

#

(usually)

#

bot-to-player on the other hand? that's the tough one

#

time spent in an area? persistence and variety of blocks placed by the same player? tileentity usage within an area?

#

i guess some combination of those could provide a rough estimate, since individually they all have flaws (e.g. someone just spamming blocks, or going afk in spawn, or raiding a base and repeatedly accessing chests/doors), but I'm not sure if there's a better way lmao

#

best i can do is piece together what the average player does in a base in terms of server events

#

i suppose a claimed bed would be a good one as well

hybrid spoke
#

every players base has at least a chest, furnace

#

crafting table

frank kettle
#

Hello boys
@young knoll @eternal oxide @kind hatch @wraith apex @lost matrix

Sorry for the ping, I felt like updating you about the ClassNotFound from yesterday, seems like the issue truly came from uploading the plugin file while the server is running and then restart.
Since then I been actually stopping the server and then uploading the plugin file, and the server hasn't given the error of ClassNotFound 🤔

Hopefully this was the issue, since it was a easy fix 🤣

eternal valve
#

Can I give a custom loot table to my fishing rod with custom model data using the match tool

mellow snow
#

Hello guys, I'm back with another question.

I need to send a message to a group of player.

Here's is how I create the group (class: dropGroup)

if (plugin.droplog_list.contains(p.getUniqueId())) {

                    plugin.droplog_list.remove(p.getUniqueId());
                    p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("prefix") + ChatColor.translateAlternateColorCodes('&', config.getString("dropsOff"))));

                } else {

                    plugin.droplog_list.add(p.getUniqueId());
                    p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("prefix") + ChatColor.translateAlternateColorCodes('&', config.getString("dropsOn"))));

                }```

Now I want to send a message to this group in this event:

@EventHandler
public void PlayerDropItemEvent(PlayerDropItemEvent event) {

    Player p = event.getPlayer();

    if(!p.hasPermission("thelogger.bypass")) {

        ItemStack item = event.getItemDrop().getItemStack();

        p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("dropEvent").replace("%eventplayer%", p.getDisplayName()).replace("%eventitem%", item.getType().name())));

    }

}```

Now for the test is p.sendMessage(.....)

I want to make something like: droplog_list.sendMessage(....);

How can I do this?

clever lantern
#

is there a way to implement whitelist by a permission, so if player doesnt have permission hes not whitelisted?

wraith apex
#

You will get a ClassNotFoundException if you replace the plugin with a new build while the server is STILL ON because the JVM is freaking out that the original plugin has just disappeared. If the parts of the plugin still loaded in the JVM attempt to ask for a class that's not been loaded you will get this error. /reload or using a Plugin that facilitates a "reload" is also good way to get random bugs. You shut down the server before deploying a new build or you roll the dice for weird behaviour. Can also just kill the server if you don't care about the testing world getting corrupted chunks

wraith apex
#

Though you wouldn't use the default whitelist system

#

you can just reject their connection and kick them if they don't have a permission as they're joining the server via PlayerJoinEvent

wraith apex
remote swallow
#

the easier way would be use Bukkit.broadcast(message, permission), if you dont want to do that just loop the list and sendt he message

mellow snow
#

I don't know how to loop

wraith apex
#

aight

clever lantern
wraith apex
#
for(UUID uuid : plugin.droplog_list)
{
  Player p = Bukkit.getPlayer(uuid);
  p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("dropEvent").replace("%eventplayer%", p.getDisplayName()).replace("%eventitem%", item.getType().name())));
}
remote swallow
#

not the netbeans format

mellow snow
clever lantern
#

yeah and?

#

looping is most basic concept

mellow snow
clever lantern
#

you wont learn by getting spoonfed

wraith apex
mellow snow
#

only this

wraith apex
#

I'd recommend you look at these articles for loops

#
mellow snow
#

thanks for help @wraith apex

wraith apex
mellow snow
#

thanks

frank kettle
wraith apex
#

I also asked if you restart your server for a new build

eternal valve
#

Can I give a custom loot table to my fishing rod with custom model data using the match tool

frank kettle
#

the problem seems to have come up when you are "updating" a plugin every single time

wraith apex
#

possibly

eternal oxide
#

yes, if you want it to be popular

wraith apex
#

Mojang stick with LTS versions of Java aka Long Term Support

eternal oxide
#

11 + if you want popular

#

or 10

#

I forget which

#

it does but majority don;t use 1.20

wraith apex
#

if you build on 21 then the user/server owner has to update their java to 21

eternal oxide
#

if you ONLY dev for 1.20 then 17

wraith apex
daring holly
#

pls help 🙏

wraith apex
#

think this is the wrong place for that lol

hollow flare
hollow flare
#

Yeah. Actually didn't want to use that point. Saying "majority" with only .1% over 50% doesn't feel right to me though

eternal oxide
#

My point stands, if he wants to appeal to teh majority of servers he can;t restrict to 1.20 only

hollow flare
#

Probably not. Java 17 would still be required for the most used versions

eternal oxide
#

he needs to code for the lowest version he wants to support

hollow flare
#

Great idea. Omitting modern features of Java just to support some ancient version of Minecraft.
I personally would always start developing for the newest version of Minecraft and then continue with supporting new Minecraft versions while keeping support for every Minecraft version the plugin has ever supported.

chrome beacon
#

Then you'll get 1 star reviews for no 1.8 support

ancient plank
#

I'll be honest the only thing I use from modern java is the instance of casting

#

That I can remember

#

That's usually the only thing I have to change when I downgrade versions

prime reef
#

I'm more concerned about spigot methods that were added between server versions ngl

hollow flare
#

I mean, I'm just expressing my opinion. I think it's not smart to start developing a plugin with the idea in mind to support ancient versions of the game.
People who want to use my plugin, use my plugin. People who don't want to use my plugin, don't use my plugin. People who can't use my plugin should update to a modern version of the game.

eternal oxide
#

support whatever versions contain the methods you are going to use

prime reef
#

I am inclined to agree though, I don't write plugins to support shit like 1.7.10 and don't plan on it

#

that's LARGELY due to spigot limitations

eternal oxide
#

I generally support back to 1.16.5. if I can

prime reef
#

I'm not sure how far back support for my stuff goes, I generally don't use Spigot methods where I can help it

#

only to interface directly with the game

quiet bough
#

lol

prime reef
#

says who

#

i don't write general utility plugins

#

i write gameplay overhauls and dumb shit

#

there is no in between

ancient plank
#

My beautiful fishing plugin ezpz 1.14

prime reef
#

wish there was some kind of "added in version x" for spigot documentation

#

i didn't see any last time i checked the javadocs

prime reef
quaint mantle
#

is there any docs or guides for data watchers ?
I dont have a data watcher already and need to initiate and properly modify it and then wrap it back up to send to the clinet

quaint mantle
clever lantern
#

do you recommend foundation library for gui's?

echo basalt
quaint mantle
#

with the whole mark dirty shit

quaint mantle
#

but im not really sure how I could do that cross ver

clever lantern
#

whats the best gui library right now?

tall dragon
#

there is no "best"

#

whatever feels best for you is best

river oracle
#

idk if there even are any good gui libraries tbh

#

I've tried some out wasn't a big fan of any

tall dragon
#

ur best off just making ur own imo

#

so u can add stuff u want

#

easily

river oracle
#

most of my libraries are pretty light weight. all of the utils I need for everything only take up like 200kbs shaded

#

including nms uwu

lilac dagger
#

Nms usage is the worst in terms of space taking

river oracle
#

module hell

wraith apex
#

shame nms has two meanings

river oracle
#

it doesn't

#

unless you're talking about the game no mans sky ig

#

but context should be obvious

wraith apex
#

No Mans Sky & Net Minectaft Server

#

:p

#

well yeah context, but a layman has no idea

prime reef
#

network management service 😎

remote swallow
#

yeah i think context can explain what it means

wraith apex
#

ayeee

slender elbow
#

no more suffering

prime reef
#

i don't even bother with NMS tbh

#

but i'm not doing a lot with packets

wraith apex
#

Not many signs

lilac dagger
#

Being on spigot help dev channel might give the context you need

rough drift
#

how can I go from an entity direction to a Quaterion4f for a display entity?

prime reef
remote swallow
#

joml

#

included in spigot now

prime reef
#

definitely not in spigot lmao

#

oh

#

wait

#

what

rough drift
prime reef
#

that's new

remote swallow
#

it was added in 1.19.4

lilac dagger
#

What even is a quarterion?

rough drift
#

It's xyz

#

and w

#

for rotation

lilac dagger
#

Oh

remote swallow
#

for block displayes

prime reef
#

it's a method of storing rotations that's much cleaner than a matrix transform

rough drift
#

or xyz and angle

prime reef
#
  • gimbal lock proof
#

(theoretically)

lilac dagger
#

That should be pretty simple, just change the angle

prime reef
#

lmao

#

i love that gif

rough drift
remote swallow
#

i have the video of that

prime reef
#

damn, I don't need to write my own maths library anymore, I can just use JOML

lilac dagger
#

Well it's most likely in radians

prime reef
rough drift
prime reef
#

do you know how to do that?

wraith apex
#

is JOML literally Just Another Math Library?

prime reef
#

or rather

remote swallow
rough drift
lilac dagger
#

Pretty sure it starts at pi/2 and ends at 2pi

rough drift
prime reef
#

aight

rough drift
#

Java OpenGL Math Library @wraith apex

prime reef
#

so the problem with matrix rotations and direction vectors is that they don't necessarily refer to a single fixed rotation

lilac dagger
#

It should have methods for rotatimg around a coord

prime reef
#

fortunately since this is a game with a fixed orthographic rotation

#

we know the up and right vectors are always gonna be at right angles to the forward vector

lilac dagger
#

You don't really want rolls

prime reef
#

typically no

lilac dagger
#

It would make my head spin

prime reef
#

roll has its place but not in a first person controller outside of like...peeking corners, and that's not really something mc supports afaik

#

a common way of determining an orthographic rotation is uh

#

use an artificial "up" vector (0, 1, 0) and take the cross product of your forward vector and that up vector as your right vector, then cross forward with right for the actual up vector

#

and there are your three axes which you can use to compute a rotation matrix

#

joml probably has shit in it already to convert this stuff

lilac dagger
#

This also makes my head spin

prime reef
#

i work in graphics

#

this is like

#

graphics 101, unfortunately

#

i'm not particularly good at math

lilac dagger
#

I guess it makes sense to you

prime reef
#

believe me

barely

lilac dagger
#

But i never worked with these so i don't have a feel for them

prime reef
#

the people who originally discovered this shit are wizards

lilac dagger
#

Haha

prime reef
#

apparently I'm descended from the dude who invented logarithms, but like

#

I sure as hell didn't inherit the math gene

wraith apex
#

a lotta maths

lilac dagger
#

I have no idea how their brain worked

prime reef
#

that was also about 500 years ago

#

probably got lost somewhere

remote swallow
#

OH YEAH

prime reef
#

and it's because of this guy

wraith apex
#

cos I'm comitting crimes with both direction and magnitude!

prime reef
#

YEP

#

that was the line lmao

rough drift
#

of a slime

prime reef
#

godspeed, soldier

prime reef
#

JOML might have a method to convert for you with some kind of assumption

lilac dagger
#

Oh i remember him, the dude from minions

rough drift
prime reef
#

okay

#

so

#

are you trying to get the slime's rotation about the y axis?

wraith apex
#
public static Vector rotateAroundAxisX(Vector v, double angle)
{
    angle = Math.toRadians(angle);
    double y, z, cos, sin;
    cos = Math.cos(angle);
    sin = Math.sin(angle);
    y = v.getY() * cos - v.getZ() * sin;
    z = v.getY() * sin + v.getZ() * cos;
    y = Math.round(y);
    z = Math.round(z);
    return v.setY(y).setZ(z);
}

public static Vector rotateAroundAxisY(Vector v, double angle)
{
    angle = -angle;
    angle = Math.toRadians(angle);
    double x, z, cos, sin;
    cos = Math.cos(angle);
    sin = Math.sin(angle);
    x = v.getX() * cos + v.getZ() * sin;
    z = v.getX() * -sin + v.getZ() * cos;
    x = Math.round(x);
    z = Math.round(z);
    return v.setX(x).setZ(z);
}

public static Vector rotateAroundAxisZ(Vector v, double angle)
{
    angle = Math.toRadians(angle);
    double x, y, cos, sin;
    cos = Math.cos(angle);
    sin = Math.sin(angle);
    x = v.getX() * cos - v.getY() * sin;
    y = v.getX() * sin + v.getY() * cos;
    x = Math.round(x);
    y = Math.round(y);
    return v.setX(x).setY(y);
}
prime reef
#

I use these in my own library, but that's a few years old

wraith apex
#

eh, if it works it works

rough drift
prime reef
#

yeah they still work lol

prime reef
#

you can just

#

set the direction of the entity

wraith apex
#

^

#

direction of an entity is a vector

rough drift
#

Not on display entities

prime reef
#

even if you can't do it directly, you can create a temporary Location object

#

ensure the Location's direction is set

rough drift
#

They don't inherit rotation from a location

prime reef
#

then teleport the entity to that location

#

wait

#

what is a "display entity" exactly

#

is this some new thing in 1.20

rough drift
#

A display entity is a new entity type

#

yes

prime reef
#

ah okay

#

cringe

wraith apex
#

lol

rough drift
#

no actually

wraith apex
#

Display Entity?

rough drift
#

no ticking, no processing way to display items/blocks/text

prime reef
#

oh that is neat

rough drift
#

yes

#

I am trying to make it rotate accordingly

prime reef
#

huh. okay. so these are a lower overhead way of doing this stuff

rough drift
#

yep

#

Armorstands begone

prime reef
#

instead of packet spoofing or armor stands

#

thank god

#

I should use these for my custom entity framework instead of armor stands

wraith apex
rough drift
#

Only issue is they are completely fucked when using billboard

novel pendant
#

speaking of the display entities, has anyone else noticed interpolation being inconsistent or not working at all in spigot?

prime reef
#

can't comment

rough drift
#

you need to set the start at -1 and the time to like 0 first then set it again to the time

#

some random ass intern made this shit

novel pendant
#

LOL REAL

#

wait so the start -1 and time 0?

#

thats helpful

rough drift
#

and then time again

#

iirc

#

It's been a while since I did interp

novel pendant
#

wait what lol

prime reef
#

why does this look like a huge pain in the ass

rough drift
#

yep

#

-1 start, time 0, time <amount of interval>

#

otherwise it doesn't interp

novel pendant
#

oh I see ok

rough drift
#

anyways

novel pendant
#

thanks, am I good to dm you about it later? Ive been searching all over for interp fixes lol

rough drift
#

ye ye

#

We banged our heads in against the wall at work

#

you're free to ask

#

We also found a bug

wraith apex
#

oh

rough drift
#

which is big

#

and marked as won't fix

#

so that's fun

wraith apex
#

this entity uses joml internally

#

for the transformation

#

.-.

remote swallow
rough drift
wraith apex
#

Now we have Vector and Vector3f

remote swallow
#

oh its a mojang bug

#

event worse

rough drift
#

Filed by my coworker

#

we wanted to use those for some funky stuff

#

but no

remote swallow
#

mojangis amazing

wraith apex
#

back to armour stands lol

rough drift
#

Text is armor stands

wraith apex
#

yup

#

they actually seem to work better lel

rough drift
#

we found a way to reverse the client interpolation just because of that

#

On the server

#

just don't worry abt it

prime reef
remote swallow
#

im gonna say he doesnt, its just a lot of people that have jobs in mc use normal work terms

echo basalt
#

who tf is sem van der whatever

#

SemmieDev ok

remote swallow
#

when if irst read it i thought it was sem ver der

smoky oak
#

is it possible to interrupt plugin loading without throwing an exception?

remote swallow
#

disable the plugin

#
  • return the method prob
smoky oak
#

whats that call?

#

and can i do it in onEnable?

remote swallow
#

yes

#

getPluginLoader().disablePlugin(this) or Bukkit.getPluginManager().disablePlugin(this)

lilac dagger
#

I think there's setEnabled(false)

#

And return

remote swallow
#

so there is

#

TIL

#

im gonna say theres a high change it just calls one of those methods

#

all work

lilac dagger
#

Yeah, for sure

smoky oak
#

different topic, if im storing per-player inventories, should i do so in one table globally or in one table per player?

#

I'm worried about high player counts slowing down access

opal juniper
#

table as in a db?

#

if so you arent gonna notice that until you have a LOT of players

smoky oak
#

does potentially a few thousand ones count

lilac dagger
#

Cache or access database

#

But you can definitely hold all your player's inv in 1 table

#

No need to make one for each player

smoky oak
#

k

spare prism
#

Is this a correct way to use HEX colors? The problem is that it just sets the minecraft default colors that are similar to the hex ones that I provided

public class HexUtils {

    private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");

    public static String hexFormat(String s) {
        if(MinecraftVersionUtils.isVersionGreaterThan(1, 16, 0)) {
            Matcher matcher = pattern.matcher(s);
            StringBuilder result = new StringBuilder();

            int lastAppendPosition = 0;

            while (matcher.find()) {
                String color = s.substring(matcher.start(), matcher.end());
                ChatColor chatColor = ChatColor.of(color);
                result.append(s, lastAppendPosition, matcher.start());
                result.append(chatColor);
                lastAppendPosition = matcher.end();
            }

            result.append(s.substring(lastAppendPosition));

            return ChatColor.translateAlternateColorCodes('&', result.toString());
        }

        return ChatColor.translateAlternateColorCodes('&', s);
    }

}
compact haven
#

are you on a version lower than 1.16?

#

like that's exactly what the code does

#

convert it to default color codes if you're not on a version compatible with hex codes

spare prism
#

it appears that my colors are set to red, because I'm using TextComponent, is there a way to fix that?

spare prism
#

yeah, it doesn't work with textcomponent

shadow gazelle
spare prism
#

at all

shadow gazelle
#

at the very least gravity is gone

full gull
#

darn

shadow gazelle
#

arrows fly forever now

full gull
#

i need gravityy

#

l,maoo

shadow gazelle
#

the 0.99 is gone too

full gull
#

right

shadow gazelle
#

whatever that was actually doing

full gull
#

reducing horizontal speed

#

and vertical speed

shadow gazelle
#

yeah, everything

#

There are a lot of lines that might be drag

#

drag isn't exactly calculated, more like just a static ??? thrown in at some point

#

Maybe it's just that 0.99

#

Because that same var is changed to the water intertia value if it's in water and gravity is -0.05000000074505806

#

If I'm right then removing gravity and the 0.99 (or 0.6 in water) then adding gravity back should get rid of drag

#

yeah I think that was it

#

it was

#

there's no drag in water now

solar sparrow
#

Hi, has anyone here touched the miniaturepets plugin? I would really like to know its API, because I'm trying to find it and I can't find it anywhere

shadow gazelle
#

bruh

#

throwable projectiles use a different variable for gravity and drag in water

zealous scroll
#

is there a way i can read all key-values in a pdc container without having to specify a specific type? or instead is there a way to get the type of a pdc entry?

shadow gazelle
#

@full gull alright so I'm pretty sure I figured it out

#

projectile velocity minus gravity, divided by drag, then gravity added back

#

I'm not 100% sure that value that gets removed is actually drag, but it seems to work

young knoll
#

Maff

wet breach
#

This way your api only needs to be concerned with the directories where the jar is and allows you better organization in terms of providing customizations

pallid dew
#

hi, are devs allowed to use colors in console or is it a bad practice?

placid moss
#

If you want to although the console should be for logging mostly

wet breach
dark jolt
#

Is there a way to fully delete a advancement, I have a plugin that creates advancements through a config but in order for my reload command to work I need it to fully delete all advancements then recreate them

river oracle
#

Red means error otherwise just keep it normal

rough drift
quaint mantle
#

anyone know what the index for EntityDataSerializers#getSerializer is? I am trying to get a serializer just from type

prime reef
rough drift
shadow night
#

What would reflection be useful for in spigot dev?

quaint mantle
shadow night
ivory sleet
#

You’re referring to the 3rd party dependency reflections

full gull
#

Why do you add gravity at the end?

spare prism
#

Text doesn't get added to my TextComponent

#

?paste

undone axleBOT
vague oracle
#

Where would I start with making it so when I create a world it only uses whitelisted biomes, I have had a look at biome provider but it changes the biome but doesn't change the generation.

smoky oak
#

does the API have a method to render a particle to one player only?

#

hm the method exists but it doesnt say if its for that player only

undone axleBOT
smoky oak
#

oh nice thanks

sullen marlin
smoky oak
#

iirc theres something in the player class that does things globally, hell if i can remember what tho

#

also the api only saying 'Displays particle' doesnt help with the confusion

vast wraith
#

Hey uhhh is it intentional that the Spigot jar uses Spigot classnames, but mojmapped method names?

smoky oak
#

the spigot api isnt the most reliable thing

#

i just say 'Detect left click'

#

GOOD LUCK MATE

#

BRUH

vast wraith
#

Noticed the obfuscation in 1.20.2 was significantly different to 1.20.1, so I looked at a few class files and they're mojmap function names

#

So just wondering if it's intentional (and therefore won't be reverted, etc)

quiet ice
vast wraith
#

Partially

#

It still uses Spigot classnames

smoky oak
#

i mean its happening on my server

#

spigot class names, obfuscated method names

#

and i made sure not to run remapped this time

quiet ice
#

Noice runtime mojmap

vast wraith
#

java -jar BuildTools.jar --rev 1.20.2 is what I ran just in case I've forgotten how to use BuildTools, freshly downloaded buildtools

#

Was just semi hoping md_5 could confirm whether it's a bug or intentional lol

wise mesa
sullen marlin
#

Spigot uses obfuscated method names, you are probably running the wrong jar

smoky oak
#

maybe buildtools is broken somewhere

vast wraith
#

The jar was generated using the command I listed above, and I grabbed the spigot-1.20.2.jar file, ran it, then looked inside the \bundler\versions jar file

This was after I noticed reflection calls failing to obfuscated names

Is there something wrong with the command I ran / the jar I looked inside?

sullen marlin
#

no and yes if its not obfuscated

smoky oak
#

i mean

#

the remapped plugin still works so idc lol

vast wraith
#

I mean yeah there's obviously something wrong with the jar; but as far as I'm aware I ran buildtools correctly and everything. It was a new setup/download so there wasn't a previous cache or anything that could've messed it up

#

So it feels like BuildTools might have a bug that's leading to the wrong jars being created

sullen marlin
#

post your bt log and the contents of Spigot/Spigot-Server/target/

smoky oak
#

isnt that too big for discord

vast wraith
smoky oak
sullen marlin
#

try --rev 3890

smoky oak
sullen marlin
#

1.20.2 - are you having this issue too?

#

could be a windows thing, I'm testing now

smoky oak
#

like issue is the wrong word

#

my server still works

#

as do my plugins

vast wraith
#

am checking the outputted jars now

smoky oak
#

but it's not how it's supposed to work

#

see here @sullen marlin

vast wraith
#

Yeah that revision is correct

smoky oak
#

obfuscated methods in spigot class names

#

thats probably a result of spigot mapping no longer having method names

vast wraith
#

3890 = good
3894 = bad

sullen marlin
#

I think I see the issue, and yes probably windows only

smoky oak
#

can you explain what you think it is? I'm curious

smoky oak
#

thats incredibly specifc lol

#

i dont think i would've found that

vast wraith
#

Ah cool, makes sense, thanks for fixing that

icy beacon
#

The day md_5 gets consistent with his whitespaces in parentheses, I'll finally be able to sleep in peace

sullen marlin
#

I didnt write that code

remote swallow
#

why not

icy beacon
chrome beacon
#

Time for Git Blame

sullen marlin
chrome beacon
#

System GC 💀

smoky oak
#

just buy more ram

lilac dagger
#

Why gc twice

young knoll
#

To be extra sure

sullen marlin
#

probably from a stackoverflow post somewhere

young knoll
upper hazel
#

It happens that in gui the state of an item may change. Starting from the lore and ending with the name, but because of this an unpleasant moment appears. How can you get rid of an extra key storing 2 lore state

icy beacon
chrome beacon
upper hazel
#

idk how do this

chrome beacon
#

You want two settings without having two settings?

#

I have no idea what you're trying to say

upper hazel
chrome beacon
#

You can let different items have their own file

#

It really doesn't matter much

upper hazel
#

as an option yes, but there will be too much empty space for these items

sullen marlin
#

Looks fine though idk why they're the same

upper hazel
#

so this

#

be not small

#

cuse this gui

chrome beacon
#

Most editors can hide different sections

upper hazel
#

red end green

#

2 states

#

this is why

ashen turtle
# upper hazel It happens that in gui the state of an item may change. Starting from the lore a...

Both sections contain same exact information. So I cant see reason why you cant just remove one of them entirely. If you need separate between states then you can have dedicated section where you could define colors for instances when you have money and when you dont, and then insert that color into lore to indicate visually current state. That would simplify its looks without a need to duplicate same text twice.

upper hazel
#

now i change

chrome beacon
#

I prefer having two different lore options

upper hazel
#

i think try change collor for placeholders

#

i can do this?

chrome beacon
#

Gives the users more customizability

ashen turtle
#

You can always make it optional, to define different lore for different state, if that doesn't exist then use default one for both states.

icy beacon
upper hazel
#

I don’t think they think so because it will be a copy of another plugin)

icy beacon
#

Superusers will be happy to configure their plugins to conform to their taste. If you think you should decrease the amount of customization, well, sure then, you do you

upper hazel
#

item has color state this all in plugin

#

"2 animations"

#

and by the way it turns out it’s not 2 but 4

#

red - red, red- green, green-red

#

green-green

#

omg

#

no i think this be big

wet breach
#

it may lead to be over whelming for the user

hybrid turret
#

I've been trying to write an inventory to a json file using gson.
I keep getting this error tho:

java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Object java.util.Optional.value accessible: module java.base does not "opens java.util" to unnamed module @4e306d87

My code for now is

Gson gson = new GsonBuilder().setPrettyPrinting().create();
          try {
            gson.toJson(p.getInventory(), new FileWriter(ServerSystem.getPlugin().getDataFolder() + "/secretvaults/" + p.getUniqueId() + "/vault_0.json"));
          } catch (IOException e) {
            e.printStackTrace();
          }

I'm kinda confused since I haven't worked with GSON (or any json in java) yet. Can someone help me out?

wet breach
#

and sometimes for the developer especially if you have enough options that can cause some weird states XD

upper hazel
#

lol

sullen marlin
#

You can't just gson random classes

upper hazel
#

I don't like frontend in bukkit api

#

cuse need big configs

#

for options

hybrid turret
#

ahhhhh wait i've tried with .getContents().
fsr it's missing there

sullen marlin
#

You can use yaml and the config API or otherwise write your own Json serialiser

young knoll
#

Where is there an optional in the inventory anyway

hybrid turret
#

I reaaally hate yaml so that's why i'm trying to use json.
well ig then i'm gonna look into how to write that serializer

sullen marlin
#

Not sure why this has to be Json vs yaml which is natively supported

young knoll
#

JsonConfiguration when

hybrid turret
#

also i didn't get yaml to work fsr, idk

upper hazel
sullen marlin
#

There is, ConfigurationSerializable

wet breach
sullen marlin
#

That's what your Json serialiser needs to take

upper hazel
#

It's a pity not all classes have this interface

wet breach
#

so they could just stuff the json into the yaml file XD

sullen marlin
young knoll
#

I should have seen that coming

sullen marlin
hybrid turret
#

hmm okay ig i gotta wrap my head around that bc i have no idea how to even start there, lol

upper hazel
wet breach
#

pretty sure you can o.O

upper hazel
#

and I'm too lazy to go through their features

young knoll
#

It’s pretty easy to use the serialization api

upper hazel
young knoll
#

ItemStack#serialize to go to a Map<String, Object>

#

And then ItemStack.deserialize to go from Map<String, Object> to itemstack

upper hazel
#

be serizible

#

oh no

young knoll
#

The values of the map can be whatever

#

However they should usually be a primitive, or another ConfigurationSerializable object

upper hazel
#

I think json is nicer in this regard

hybrid turret
#

oh wait so you can serialize ItemStacks but not inventories?

#

huh

young knoll
#

No but their contents are

hybrid turret
#

so you could serialize the contens, but you couldn't store the exact position in the inv then?

#

or wait no

hybrid turret
#

it's null if the slot is empty, right

upper hazel
#

serilization

#

if you want

remote swallow
hybrid turret
#

yeah, that's the problem, i have no idea how

hybrid turret
remote swallow
#

no

#

it would still be an itemstack

#

just not anything

hybrid turret
#

You can have literal air as an item?

remote swallow
#

it could be either bc bukkit

remote swallow
hybrid turret
#

._.

remote swallow
#

most methods wont work on an air item, but the stack can exist as air

upper hazel
#

air not can be serilizable

#

will be error

remote swallow
#

makes sense

hybrid turret
#

huh

remote swallow
#

if its air just make it null and save that as the content

upper hazel
#

wait air exists in game how item?

remote swallow
#

air is weird

hybrid turret
#

so i would have to go through the array that inventory.getContents() gives me and then serialize it? And when deserializing i have to inventory.setContents()?

remote swallow
#

yeah

upper hazel
#

oh wait

#

yes

#

cuse this mateiral

#

lol

remote swallow
#

i think™️ that it should use null as the empty slot and that is fine to get and set back

hybrid turret
#

huh, imma try something

spare marsh
#

So Im looking for a way to have a normal world but with the pre 1.18 tarrain. any ideas?

young knoll
#

You could pregen in 1.17 and upgrade

remote swallow
#

im pretty sure mc will auto add the below bedrock

spare marsh
young knoll
#

Only the below 0 stuff

#

And you can disable that with spigot

spare marsh
#

i dont think it works that way

#

or is it?

quaint mantle
# lost matrix You mean via reflection?

yes I ended up just looking throiugh the static fields and filtering with one for a type of what. i am looking for.

Is anyone able to give me an example on using data watchers like what methods to call according to wiki.vg's entity metadata

young knoll
#

If all terrain is pregeneratted then only below 0 will be updated

#

The game doesn't magically replace the existing terrain

spare marsh
#

everything updates

young knoll
#

wot

spare marsh
#

it updates everything

spare marsh
young knoll
#

Alright now I have to test this

spare marsh
#

alr

#

tell me what you find

young knoll
#

Looks fine to me

nova jasper
#
  • type : item
    key : 1
    amount : 1
    weight : 10
    is there any wrong can some1 know help me pls
young knoll
#

We have no idea what the format is supposed to be

nova jasper
#

ok thank

pastel relic
#

does anyone know how to create a hologram using th HolographicDisplays API?

lost matrix
young knoll
icy beacon
#

Wait nevermind

#

I use DHAPI lol

pastel relic
remote swallow
#

i love decent holograms

spare marsh
#

im talking about chunks that havent been loaded yet

tough mica
#

can please somebody help with maven, please dm.

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tough mica
#

my maven is totally bugged

shadow gazelle
#

You remove it so that you can remove the weird drag calculation, then add gravity back

young knoll
#

hence me saying
If all terrain is pregenerated then only below 0 will be updated

shadow gazelle
#

Also, I'm not sure if that's a typo in the wiki or not, but drag is the same in lava

#

Only water has different drag

spare marsh
pastel relic
#
HolographicDisplaysAPI api = HolographicDisplaysAPI.get(plugin);

Location where = location.clone().add(0.5, 2.5, 0.5);
Hologram hologram = api.createHologram(plugin, where);
TextHologramLine textLine = hologram.getLines().appendText("Test hologram");
Cannot resolve method 'createHologram(org.bukkit.plugin.java.JavaPlugin, org.bukkit.Location)'
nova jasper
#

Does anyone know how to add effect to item and that effect still work if you have that item in inventory

young knoll
#

I already checked it?

#

Pregenerated terrain will not change

spare marsh
hybrid turret
#

Do I understand correctly, that Bukkit.getOfflinePlayer(String name) accesses the minecraft api and looks up if a profile with the input name exists?
If so and if it then generates a UUID for said player upon not being in the api, can I somehow check if an OfflinePlayer exists and handle that? (I don't want to ban non-existent players)

#

Wait, is what I'm looking for offlinePlayer.hasPlayedBefore() by any chance?

hazy parrot
#

hasPlayedBefore returns true if that player joined your server atleast once

hybrid turret
#

That's good enough for that

hushed spindle
#

annoyingly, it seems that interacting at max range with an entity (villager in my case) results in an interact event of LEFT_CLICK_AIR even though i'm right clicking. anyone know a workaround on that?

eternal oxide
#

?interact

#

I forget th ecommand

#

theres two hands, the event fires twice

strong parcel
eternal oxide
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
strong parcel
#

based

hushed spindle
#

ah right lemme check if that works

#

forgot that was a thing

shell robin
#

How do I make durability infinite?

hushed spindle
#

set the item to be unbreakable

#

i think that's ItemMeta#setUnbreakable()

spare prism
hushed spindle
#

maybe it was ItemStack idk

hushed spindle
#

because in this case it doesnt matter the event got fired by both hands

#

if left/right clicking was done by a separate hand then yeah but in this case no

eternal oxide
#

a left click air will not fire if you right click only

pastel relic
pastel relic
#

oh

pastel relic
quaint mantle
pastel relic
#
HolographicDisplaysAPI api = HolographicDisplaysAPI.get(plugin);
Location where = location.clone().add(0.5, 2.5, 0.5);
Hologram hologram = api.createHologram(plugin, where);

hologram.setName("drtp_portal_hologram");
TextHologramLine textLine = hologram.getLines().appendText("A hologram line");
smoky oak
#

how can i do a search and replace that respects capitalization in intelliJ?

pastel relic
#

CTRL + F?

smoky oak
pastel relic
#

🤔

subtle folio
#

in intelliJ’s ctrl f

pseudo hazel
#

thats just to find them

subtle folio
#

then ctrl r

smoky oak
#

its alt c but i see it

hazy parrot
#

ctr shift r is to replace in all files

smoky oak
dry hazel
#

createHologram takes just a position, so remove the plugin argument

hybrid turret
#

I have a TextComponent in a String which for some reason is displayed as the object and not as the HyperLink. Why in the world is this happening?

TextComponent gitHubLinkText = new TextComponent("GitHub");
    TextComponent gitHubLinkText = new TextComponent("GitHub");
    gitHubLinkText.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/.../"));
    sender.sendMessage(formatColors(ServerSystem.getPluginPrefix() + "The project is available on &1" + gitHubLinkText + "! You can reach me there."));
worldly ingot
#

Yes because that's not how text components work :P If you toString() them you're going to get the JSON representation of the components

hybrid turret
#

oh-

#

the internet lied

worldly ingot
#

The whole message should be a component and you'll have to send it via a method that accepts a BaseComponent

BaseComponent[] message = new ComponentBuilder(ServerSystem.getPluginPrefix() + "The project is available on ")
    .append("GitHub").color(ChatColor.DARK_BLUE).event(new ClickEvent(
        ClickEvent.Action.OPEN_URL,
        "https://github.com/.../"
    ))
    .append("! You can reach me there.", FormatRetention.NONE);
    .create();
player.spigot().sendMessage(message);```
#

That should work

hybrid turret
#

ohhhhhhhh

#

why .spigot()?

young knoll
#

Because it's part of spigot

hybrid turret
#

yeah but can't you just player.sendMessage()?

young knoll
#

You could, but we didn't

worldly ingot
#

You would be able to if you're using Paper API

#

Though the Spigot API doesn't promote those, no

hybrid turret
#

but i can tho what

worldly ingot
#

if you're using Paper API

hybrid turret
#

and i'm 100% using spigot

worldly ingot
#

They for sure do not exist on Spigot :p

hybrid turret
#

w h a t

worldly ingot
#

There are Player#sendMessage() methods

young knoll
#

The sendMessage in spigot only accepts a string

worldly ingot
#

They just accept a String, not a BaseComponent