#help-development

1 messages · Page 1085 of 1

hazy parrot
#

Yeah I just noticed it's from paper lol

onyx fjord
#

Any way to prevent player from clicking a GUI item multiple times in a tick?

#

Do I need to implement some locking mechanism perhaps

acoustic pendant
#

Hey, I have this code:

private void updateVariables(@NotNull ItemStack itemStack) {
        Tools tools = getTool(itemStack);
        //tools.tools.name
        List<String> expectedLore = getInstance().getConfig().getStringList("tools." + tools.name() + ".lore");

        //Edit level
        int levelLine = -1;
        int prestigeLine = -1;
        int essenceLine = -1;
        int sellModeLine = -1;
        for (int i = 0; i < expectedLore.size(); i++) {
            String line = expectedLore.get(i);
            if (line.contains("%level%")) {
                levelLine = i;
            } else if (line.contains("%prestige%")) {
                prestigeLine = i;
            } else if (line.contains("%essence%")) {
                essenceLine = i;
            } else if (line.contains("%sell-mode%")) {
                sellModeLine = i;
            }
        }

        ItemMeta meta = itemStack.getItemMeta();

        List<String> lore = meta.getLore();

        assert lore != null;
        if (levelLine != -1)
            lore.set(levelLine, expectedLore.get(levelLine).replace("%level%", String.valueOf(getItemLevel(itemStack))));
        if (prestigeLine != -1)
            lore.set(prestigeLine, expectedLore.get(prestigeLine).replace("%prestige%", String.valueOf(getItemPrestige(itemStack))));
        if (essenceLine != -1)
            lore.set(essenceLine, expectedLore.get(essenceLine).replace("%essence%", Utils.formatNumber(BigDecimal.valueOf(getItemEssence(itemStack)))));
        if (sellModeLine != -1)
            lore.set(sellModeLine, expectedLore.get(sellModeLine).replace("%sell-mode%", getItemSellMode(itemStack)));
        
        meta.setLore(lore);
        itemStack.setItemMeta(meta);
    }```
I thought it was really laggy and there could be better ways to update an item lore without having to do all this. Is it possible?
wide cipher
#

ProtocolLib error, not sure how to fix it [18:58:09 ERROR]: Error occurred while enabling Skonic v1.0.5 (Is it up to date?) java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null at ca.nagasonic.skonic.Skonic.onEnable(Skonic.java:45) ~[Skonic-1.0.5.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:190) ~[paper-1.20.2.jar:git-Paper-309] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.2.jar:git-Paper-309] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugin(CraftServer.java:646) ~[paper-1.20.2.jar:git-Paper-309] at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugins(CraftServer.java:557) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:627) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:424) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1086) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-309] at java.lang.Thread.run(Thread.java:1583) ~[?:?]

acoustic pendant
#

line 45 onEnable

wide cipher
blazing ocean
#

are you shading plib

wide cipher
blazing ocean
#

show your pom.xml/build.gradle

acoustic pendant
#

Or is the plugin in the server?

blazing ocean
#

well it's not a class not found ex

acoustic pendant
#

true

blazing ocean
#

so i'm guessing they're just shading plib

wide cipher
#
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.5.0</version>
        </dependency>```
blazing ocean
#

add <scope>provided</scope>

#

and add the plugin to your server

#

also 4.5.0 is extremely outdated

#

latest is 5.2.0

wide cipher
#

ok

drifting bluff
#

how do i get the the entity that places the block in the BlockPlaceEvent?

summer scroll
undone axleBOT
summer scroll
twin venture
#

been a while since i last codded anything , can i do this?
PRIMARY KEY (uuid, quest_mode, quest_name)?

summer scroll
#

Oh yeah you can do that I think.

drifting bluff
# summer scroll It's always a player, you can use `#getPlayer`

?? i rn use this for letts say my damage event


import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

public class pvp implements Listener {
    public static boolean listenersPvP = true;
    @EventHandler
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof org.bukkit.entity.Player) {
            if(!listenersPvP) {
                event.setCancelled(true);
            }
        }
    }
}
twin venture
sterile breach
#

With intelji to compile all modules (spigot plugin and bungeecord plugin) with one click I have to create a build script or something like this?

eternal oxide
#

yes, you set it as a constraint

summer scroll
twin venture
#

A primary key can have one or as many columns as possible

#

thanks

summer scroll
drifting bluff
#

i mean like how would i do that for the BlockPlace Event

summer scroll
drifting bluff
#

how do i do #getPlayer

summer scroll
summer scroll
acoustic pendant
#

Okay, thanks

summer scroll
acoustic pendant
#

Every time the player opens an inventory

summer scroll
wide cipher
#

got this error from this code and have no clue how to fix it, using ProtocolLib btw. ``` ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
List<PlayerInfoData> dataList = event.getPacket().getPlayerInfoDataLists().readSafely(0);
for (int i = 0; i < dataList.size(); i++) {
PlayerInfoData data = dataList.get(i);
Player player = Bukkit.getServer().getPlayer(data.getProfile().getUUID());
if (player == null) continue;
WrappedGameProfile profile = (WrappedGameProfile) SkinUtils.getEffectiveProfile(player);
WrappedGameProfile wrappedProfile = event.getPlayer().equals(player) ?
new WrappedGameProfile(player.getUniqueId(), profile.getName()) :
new WrappedGameProfile(profile.getId(), profile.getName());

                for (WrappedSignedProperty property : profile.getProperties().values()) {
                    wrappedProfile.getProperties().put(
                            property.getName(),
                            new WrappedSignedProperty(
                                    property.getName(),
                                    property.getValue(),
                                    property.getSignature()
                            )
                    );
                }
                dataList.set(i, new PlayerInfoData(
                        wrappedProfile,
                        data.getLatency(),
                        data.getGameMode(),
                        WrappedChatComponent.fromText(wrappedProfile.getName())
                ));
            }
            event.getPacket().getPlayerInfoDataLists().write(0, dataList);
        }```
acoustic pendant
summer scroll
drifting bluff
#

somehow it doesnt cancel the block place event


import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

public class place implements Listener {
    public static boolean listenersPlace = true;
    @EventHandler
    public void BlockPlaceEvent(BlockPlaceEvent event) {
        if(!listenersPlace) {
            event.setCancelled(true);
        }
    }
}```
summer scroll
drifting bluff
#

it should be

#
    private boolean b = true;

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {

        if (b) {
            getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fenabled placing!");
            listenersPlace=true;
        } else {
            getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fdisabled placing!");
            listenersPlace=false;
        }
        b = !b;
        return true;
    }
}
summer scroll
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

drifting bluff
summer scroll
covert sphinx
#

Hello! How do i make a single item have different textures? I know this is possible bc this is done in Wynncraft. Both items are minecraft:paper but they have different textures. How is this possible?

drowsy helm
#

And a resource pack

covert sphinx
#

i see, thank you so much!

slate siren
#

I coded my own plugin with Kotlin and everything went great, but I forgot one thing, the settings are not applied back after /reload, so I forgot to save it in json. And I have no idea how to do it

#

Can you help with this?

eternal oxide
#

why are you saving settings in json? Spigot has a built in configy.yml support

slate siren
#

How can I benefit from this?

kindred sentinel
#

Is there any way to check if player dragged something? Like not clicked, dragged

eternal oxide
tardy delta
#

you only realized now?

#

thats why i always send the bukkit cofig reference

eternal oxide
#

I'd never really read it

#

?configs

undone axleBOT
tardy delta
#

ah thats even another thing

eternal oxide
#

much better

tardy delta
#

still bad

eternal oxide
#

its basic so good

#

I just wish these "tutorials" would forget about the defaults and copyDefault(true) until the end. Its pointless to even describe them if they have not even covered .set

tardy delta
#

mmh

slate siren
#

override fun onEnable() {
val config = config
config.addDefault("youAreAwesome", true)
config.options().copyDefaults(true)
saveConfig()
logger.info("Blocksin Aktiffff")
server.pluginManager.registerEvents(this, this)

tardy delta
#

config.apply uwu

slate siren
tardy delta
eternal oxide
#

you converted config to a local scope variable

#

kotlin is wierd with no getters

tardy delta
#

youll get used to it

eternal oxide
#

I won't as I don;t use kotlin 😉

upper hazel
#

why PrepareAnvilEvent not work in custom inventories?

eternal oxide
#

custom inventories has not backing logic

upper hazel
#

demm

#

this bad

eternal oxide
#

you handle it yourself on click events

#

or tick the inventory with yoru own logic

kindred sentinel
#

What's the difference between Kotlin and Java?

#

Idk anything about Kotlin

eternal oxide
#

syntax mostly

shadow night
#

Kotlin is full of syntax sugar

upper hazel
#

How can you add a recipe or simulate so that you can make a new recipe with a working anvil animation

shadow night
#

I'd even call it the diabetis language

slate siren
#

I can't figure it out, can someone check it please?

tardy delta
slate siren
#

I've been working so hard on things now that I can't think

upper hazel
tardy delta
#

lol

eternal oxide
#

saveConfig only saves the original config

tardy delta
#

why is pluginConfig a field

eternal oxide
#

you don;t even need it

#

don;t define a field/variable for config

#

just config...

#

delete pluginConfig just use config

magic drift
#

I have a few questions really just some bacics like what program do i use

tardy delta
#

intellij

eternal oxide
#

Eclipse

tardy delta
#

unpopular opinion

eternal oxide
#

Netbeans

#

use whatever IDE you prefer

tardy delta
#

vim

echo basalt
kindred sentinel
#

Visual Studio Code...

quaint mantle
dawn flower
#

hello

slate siren
magic drift
#

Also how do k code in javascript

tardy delta
#

havent tried hard enough

quaint mantle
#

step by step

eternal oxide
#

You will get the most support using InteliJ. You will also suffer teh most hiccups. The simplest is Eclipse with Netbeans being out there somewhere 🙂

kindred sentinel
#

I learnt javascript how to code minecraft plugins?

dawn flower
#

so uh, this is my first time saving data into a database and idk how it works fully
but is the database supposed to be hosted locally in the data folder of the plugin?

#

and if it should be locally hosted, should i use mongodb or sql or other stuff

tardy delta
#

things like a h2 or sqlite database are just one file in the plugin folder

#

things like postgres or mysql are just some files on your pc somewhere

dawn flower
#

ah

#

do u suggest postgres or mysql?

tardy delta
#

tbf ive only ever used postgres in college and mysql 5 years ago

eternal oxide
#

mysql, because even if the server has postgres it will support an mysql connection

dawn flower
#

ok

dawn flower
slate siren
#

....

#

Why hasn't it happened yet Where is the mistake

tardy delta
#

learning javascript was the mistake

dawn flower
#

is there any guide to databases, this is hella confusing

eternal oxide
#

Many. 30+ years of them

dawn flower
tardy delta
#

its a start

dawn flower
#

alr

covert sphinx
#

Hello. I have a geysermc server and I was wondering how I would go about making a gui thats different depending on the platform? I've seen it done on other servers wherein if you are in java you get the gui with the chest and you have to click but in bedrock its like just a ui

slate siren
#

Friends, I ask you, can you do this for me to re-apply the settings after reload? I really tried every method and it's been 2 hours and it's tiring.

tardy delta
#

what

#

reload is just onDisable() and onEnable() being called

slate siren
#

But it doesn't call

quiet ice
#

It doesn't call what exactly?

slate siren
#

I could not save and recall the config

#

I try hard

tardy delta
#

i also try hard to understand

slate siren
#

If you know, can you edit it?

eternal oxide
#

change addDefault to set, delete teh config.options... line.

#

and delete teh friggin LOCAL VARIABLE config

slate siren
quiet ice
#

copyDefaults doesn't do what you want

#

However, #set probably also does not do what you'd like as it overwrites the previous value unconditionally

eternal oxide
#

If you want to keep defaults.

slate siren
#

ACTUALLY, I ASK YOU, CAN YOU TRY TO WRITE IN 15 SECONDS WHAT YOU EXPLAINED IN 1 MINUTE

calm steppe
eternal oxide
quiet ice
slate siren
# quiet ice wat

Sir, I swear I don't understand anything you say right now, I've been sleepless and tired for exactly 18 hours, so if you know, I sent the code I would be very happy if you edit it and post it.

calm steppe
eternal oxide
#

its not saving because he's converting the this.config to a local variable

calm steppe
#

OH WAIT I FIXED IT

#

NVM

eternal oxide
upper hazel
#

getRenameText from AnvilInventory is Deprecated

quiet ice
upper hazel
#

how i can get text

quiet ice
#

That would be really really dum

eternal oxide
#

no he is doing that

quiet ice
#

He doesn't to what I can see?

eternal oxide
#

but yes you have to apply to set it back to this.config

#

as far as I know

#

I don't do kotlin so unsure

quiet ice
slate siren
#

What

slate siren
quiet ice
eternal oxide
#

its something to do with variable scope in kotlin

quiet ice
#

I'd get rid of the following lines:

        // Varsayılan konfigürasyon ayarlarını ekle
        config.addDefault("youAreAwesome", true)
        config.addDefault("armorstands.enderchest1.duration", 30) // Örnek bir varsayılan süre
        config.options().copyDefaults(true) // Varsayılan değerleri dosyaya kopyala

altogether

quiet ice
eternal oxide
#

no clue, kotlin

slate siren
#

Problem not solved 🙄

eternal oxide
#

I've really no interest in learning a bastardised version of Java.

quiet ice
#

?jd My assumption is that OP didn't RTFM of copyDefaults, but it's been a few years since I've developed plugins

undone axleBOT
eternal oxide
#

copyDefaults(true) simply applies defauls AS the value IF there is no value set.

#

so it saves to file as set

quiet ice
#

Uh great, the javadocs are as helpful as ever

#

yeah then I'm not entirely sure what the original problem is

eternal oxide
#

me either

slate siren
#

My only wish is that the settings I made continue to be applied again after reload... I've been trying for 2 hours and it didn't work. 🙄

eternal oxide
#

I'm going to assume he's actually manually editing the config and expectign it to change on reload

eternal oxide
quiet ice
eternal oxide
#

no config file at all?

slate siren
#

No

eternal oxide
#

?paste your servers latest.log

undone axleBOT
eternal oxide
#

I'm now betting on missing or broken plugin.yml

#

nah unlikely

slate siren
eternal oxide
#

use pastes.dev

slate siren
#

ops

quiet ice
#

My other bet is that they are editing the config file in the jar instead of the one on disk - but i'm not entirely sure what saveConfig() does exactly

eternal oxide
#

looks like Blocksin is loading and disabling fine

slate siren
#

Soo what

#

mm

eternal oxide
#

you are 100% certain you have no config.yml in your plugins/Blocksin folder?

slate siren
#

aaa

#

config in plugins/Blocksin

eternal oxide
#

so you do have a config

slate siren
#

yep

#

It saves but does not load.

#

ig

#

mm

quiet ice
#

and which config you are editing? the one in src/main/resources?

eternal oxide
#

its all working fine. He's just not reading it properly

slate siren
#

src/main/resources

This contains only plugin.yml

eternal oxide
#

show the code where you try to read teh config

slate siren
#

okayy

#

1m

#

@quiet icecheck ur dm ill send screenshot

tardy delta
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

slate siren
#

aa

#

thats good

#

screenshoot

eternal oxide
#

what command are you entering which is failing?

#

your config is fine, saving and loading is fine

slate siren
#

Like this, I give a particle effect to the armor scarf, then I put /reload for testing purposes and after reloading, the particle doesn't come back, it disappears completely.

#

Normally particle happens all the time unless I reload.

eternal oxide
#

teh particle will not come back unless you are spawning it

#

if you reload your code needs to fetch all stands from the config and start spawning particles

slate siren
#

Likewise, I place a head on the armor stand, and when I right click on it, it breaks, it comes back after 10 seconds, after breaking it, I reload it.

#

And it doesn't come back after reload

eternal oxide
#

same issue

slate siren
#

Well then, what is the solution?

eternal oxide
#

you are not checking your config and restarting yoru helmet/particles

#

when you reload all your schedulers stop

#

you have to start them again

slate siren
#

I don't know how to do it, I can't think logically because I'm so tired.

tardy delta
#

sleep is for the weak remember

slate siren
#

But I won't sleep without doing it, I'm a little stubborn person

slate siren
#

Should I open my hands and pray because I've tried every way

eternal oxide
#

move all your scheduler code out of yoru command classes

#

so you can call it from anywhere by passing variables

#

you need to store ALL data to be able to start teh scheduler in the config for each stand

eternal oxide
#

so when onEnable runs you loop over all saved stands in your config and start the scheduler, just as you are currently doing in your command

slate siren
#

Do I need to set up all commands again?

eternal oxide
#

no

#

you just need to move teh scheduler code out to be a callable method

slate siren
fresh drum
#

Hello, I was wondering if anybody knows about the changes in advancement granting with packets between 1.19.4 and 1.20.6?

The following code is working in 1.19.4 but in 1.20.6 it only registers the advancement for the client, and it doesn't give it to him :

        AdvancementHolder advancementHolder = new Advancement.Builder()
                .display(displayInfo)
                .addCriterion(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION, CriteriaTriggers.IMPOSSIBLE.createCriterion(null))
                .requirements(AdvancementRequirements.allOf(List.of(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION)))
                .build(resourceLocation);

        AdvancementProgress advancementProgress = new AdvancementProgress();
        advancementProgress.update(advancementHolder.value().requirements());
        advancementProgress.grantProgress(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION);

        NewAdvancementNMSWrapper.plugin.getLogger().info("isDone: " + advancementProgress.isDone());

        WrapperPlayServerAdvancements wrapper = new WrapperPlayServerAdvancements();
        wrapper.setAdvancements(List.of(advancementHolder));
        wrapper.setProgress(Map.of(resourceLocation, advancementProgress));
        wrapper.setReset(false);

        wrapper.sendPacket(player);

Thanks a lot uwu

#

And of course I get isDone: true in the server console

quaint mantle
#

can i make mobs with display entities and edit sizes?

valid burrow
#

they dont have ai

#

they wont do anything

slender elbow
#

there is no "Entity" display entity, there is only text, block, and item displays

#

just spawn the real entity and use the scale attribute?

safe furnace
#

Hi, so i use bungeeonlinetime, and placeholder doesn't work .. when i type /papi parse me %onlinetime_hours% show just a blank line

quaint mantle
#

aight guys ty

pseudo hazel
tepid crater
#

Hi guys, so it seems when I have an arrow with custom nbt, shoot and pickup the nbt is lost, same thing for blocks, when i have a block with nbt, place it and pickup again, it dissapears, any workaround on this?

river oracle
#

That's pretty par for the course

#

BlockEntities aside as of latest nbt is lossed when going from block to item and item to block.

#

Likewise this is true for arrows given that the arrow data isn't related to some potion effect

#

Re apply your custom nbt

magic drift
#

I have $50 for the first person to make me my big plugin

river oracle
#

50 bucks is nothing

tepid crater
#

lmao

magic drift
#

$70 max

river oracle
#

It's big no let's talk about 20 to 25 an hour

pseudo hazel
#

I mean can it be done in like an hour

river oracle
#

My guess that means an entire mini game

magic drift
#

Most of the script can be copyied from kings smo

river oracle
#

Or the foundation of his server

pseudo hazel
#

or a copy of another paid plugin 💀

magic drift
#

Its not copyed straight up

river oracle
#

I'll do it for 25 an hour final offer

magic drift
#

Fine

river oracle
#

What the fuck lol

#

It'll take me 10 days of work time btw

magic drift
#

The no deal

#

Then*

river oracle
#

That's only 6,000 dollars

magic drift
#

Yeah and im only 5930 short

river oracle
#

I could burn 6,000 dollars for warmth

#

That's how small that amount of money is

subtle folio
#

Whats the default view range of text displays?

pseudo hazel
#

I mean 70$ is not gonna be enough for a "big" plugin

#

but in any case, you should look at

#

?services

undone axleBOT
magic drift
#

Guess i will resort to fiverr

river oracle
tepid crater
#

💀

river oracle
#

There are some idiots out there

pseudo hazel
#

yeah on fiverr they will

tepid crater
pseudo hazel
#

on fiver everythig is like 5 bucks

#

buy a soul for 5 bucks

tepid crater
#

Last time i got a work from fiverr, was full chat gpt, and was not fully working

pseudo hazel
#

oof

#

they probably told you to compile it yourself

remote swallow
fleet kraken
#

How to teleport player to other dimensional? (the end, nether)

#

Using world doesn't looks good, because the world name can be different

eternal oxide
#

Player#teleport(Location)

fleet kraken
pseudo hazel
#

wdym

#

you would need the world name or uuid

#

to get the world

eternal oxide
#

World#getDefaultSpawn()

#

Bukkit#getWorld(String)

fleet kraken
eternal oxide
#

so nothign to do with developing a plugin then

fleet kraken
#

hm?

pseudo hazel
#

thats not a thing in plugins

eternal oxide
#

thats default MC commands

grave lion
pseudo hazel
#

a minecraft "world" consists of 3 actual worlds, overworld, nether and the_end

fleet kraken
#

yes, but what I want is to teleport to the nether, if his world doesn't have the nether with the exact name it won't work

pseudo hazel
#

the name of that worlds nether should be <world_name>_nether

eternal oxide
#

Bukkit.getWorlds().get(1) for nether. Or is it an array I forget

pseudo hazel
#

its a list

eternal oxide
#

so long as you don;t have anything messing with early world loading

fleet kraken
#

hm

#

maybe something like:

Bukkit.getWorlds().find { 
    it.environment == World.Environment.NETHER
}
#

I'll try it

pseudo hazel
#

if your server does not have <world_name>_nether as their nether world

#

they have other problems

#

but yeah sure that might work

shadow night
#

The nether can be disabled

pseudo hazel
#

right

#

in which case neither will work

subtle folio
#

What is the default view range of the players nametag? is it like 60 blocks?

shadow night
#

And there is also multiverse

fleet kraken
#

but if it's disabled, it won't go to Bukkit.getWorlds, right?

shadow night
#

Exactly

pseudo hazel
#

right

shadow night
#

And your search will return null or whatever find does when it can't find anything

eternal oxide
#

if (Bukkit.getAllowNether())...

pseudo hazel
#

just check if the search failed

fleet kraken
#

yeah, so that's exactly it, I'll use find, thank you all

grave lion
#

spyry

shadow night
grave lion
#

create a function something like teleportAnywhere(Player player, Environment dimension). create a stream of the worlds then filter, something like ⁤filter(world -> world.getEnvironment() == dimension).findFirst(). make sure to check its its not null, then you simply teleport the player to whatever location in the world/dimension. calling the method would be something like teleportAnywhere(player, Environment.THE_END) you could modify to whatever suits your needs. i only use a stream because performace impact will not be noticable and its easier to read and maintain

tawdry shoal
#

Hello, is it possible to somehow lower the player’s camera (view) by one block? Allegedly the look of a recumbent, version 1.20.1

grave lion
#

player.setEyeLocation

river oracle
#

2

tawdry shoal
grave lion
#

its not going to be pretty

slender elbow
#

.5 scale?

eternal oxide
#

there is no set for eye location

grave lion
#

get

eternal oxide
#

🙂

slender elbow
#

get indeed

tawdry shoal
#

Location eyeLocation = player.getEyeLocation(); double eyeHeight = player.getEyeHeight(); eyeLocation.setY(eyeLocation.getY() - 1.0); player.teleport(eyeLocation);

#

?

eternal oxide
#

um, why?

grave lion
#

yeah you have send a packet of a location 1.5 blocks below player location

eternal oxide
#

teleporting the player to the location they are already at

grave lion
#
        location .subtract(0, 1.5, 0);
        player.teleport(location );```
#

see how that works before you get into sending a packet

#

i dont know how well it will look with player control intact.

last sleet
#

hi

#

how do I check if an entity is undead ? I used to use getCategory() but now it tells me that it's not supported anymore and I should use tags. I've looked a bit but how do I do this?

#

Nvm I solved this xd

gentle inlet
#

So this is my first time using nbt API so I'm not really sure how it works but I got up to the part in the wiki where it said to put this code in my onenable method so I did that but it has an error

grave lion
#

are you using maven? @gentle inlet

blazing ocean
mellow edge
#

player can't change dimensions in PlayerMoveEvent right? Because it is inserted in handlemovevehicle and handlemoveplayer and I'm not sure whether the dimension changes.

worldly ingot
#

If you want to edit a vanilla NBT tag of an entity or an item, there's probably a method for it in Entity or ItemMeta

torn shuttle
#

is there a way to copy an entire directory from the resources directory and save it into the data folder recursively?

#

I know there's getResource but that's for single files right

#

or can it be interpreted as a folder?

eternal oxide
#

nope

torn shuttle
#

so it can't be done?

eternal oxide
#

path will be preserved but it needs an actual file name

torn shuttle
#

hm

#

well it's just a few files, bit of a shame but I can just do these manually

worldly ingot
#

I have a method for this

#

One sec

torn shuttle
#

it's fine it was just 3 files

#

already did it

slender elbow
#

JarFile 🤢

#

FileSystem 😌

eternal night
#

nio enjoyers clowning

torn shuttle
#

moving files manually with a magnet and a steady hand Clownjoy

eternal night
#

the real way to do it 💪

torn shuttle
#

r8 my icon making skills

blazing ocean
#

12/10

torn shuttle
#

damn guess I'll have to try harder next time

eternal oxide
#

Good tree

rough ibex
#

why is only the S antialiased

torn shuttle
#

it isn't

#

you're going blind

rough ibex
#

only for S

torn shuttle
#

well

#

you know what they say

#

it Starts somewhere

rough ibex
#

you missed the third S

torn shuttle
#

missed what

rough ibex
#

starts somewhere

torn shuttle
#

you're just seeing things man

upper niche
#

I'm making a plugin for overriding block breaking behavior and I've encountered a bug that I don't know the cause of
Whenever the block its changes breaking progress stage, instead of displaying that persistently it only shows up for a tick before resetting
I only call the SendBlockDamage method once in my code, which is when the damage progress increases, so it's not an issue of calling it somewhere else
Anyone have an idea why this is happening/how to fix it?

upper niche
#

Which part?

drowsy helm
#

I ran into a similar issue with my system but it could entirely depend on how it’s structured

upper niche
#

The line that calls the update is just player.getPlayer().sendBlockDamage(currentBlock.getLocation(), currentBlock.getProgress());
And the progress is return cumulativeDamage/ore.getResistance()
And this is called whenever the progress increase is > 0.1

drowsy helm
#

Are you sending that every tick

#

Or just on arm swing?

upper niche
#

Every tick the game checks if the block's progress has increased by 0.1 or more, and if it has it sends a new block damage packet

#

Listener for BlockDamageEvent -> get custom block data from plugin -> add it to BlockList
A runnable checks every block in BlockList every tick to handle damage increase, visual damage, breaking, and loot drops if broken

worthy yarrow
#

Hey @floral drum are you busy?

drowsy helm
#

I can’t speculate

upper niche
#

This is across a lot of different classes so what parts do you want to see

floral drum
#

wsg

blazing ocean
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!

worthy yarrow
#

wait

#

you use paper maybe you know too kek

blazing ocean
#

kekw

worthy yarrow
#

Uh

#

So issue with minimessage

#

Somehow legacy characters are getting through to the serialization / deserialization

blazing ocean
#

wdym

drowsy helm
upper niche
#

I have no clue what's causing this flickering, my code seems perfectly sound (for this issue)

#

I don't think any of my code is directly at fault, that's why I'm asking

worthy yarrow
#
public class ColorUtil {

    private static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer
            .builder()
            .useUnusualXRepeatedCharacterHexFormat()
            .hexColors()
            .build();
    private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();

    private static String convertColorCodes(String text) {
        return text
                .replace("&0", "<black>")
                .replace("&1", "<dark_blue>")
                .replace("&2", "<dark_green>")
                .replace("&3", "<dark_aqua>")
                .replace("&4", "<dark_red>")
                .replace("&5", "<dark_purple>")
                .replace("&6", "<gold>")
                .replace("&7", "<gray>")
                .replace("&8", "<dark_gray>")
                .replace("&9", "<blue>")
                .replace("&a", "<green>")
                .replace("&b", "<aqua>")
                .replace("&c", "<red>")
                .replace("&d", "<light_purple>")
                .replace("&e", "<yellow>")
                .replace("&f", "<white>")
                .replace("&k", "<obfuscated>")
                .replace("&l", "<bold>")
                .replace("&m", "<strikethrough>")
                .replace("&n", "<underlined>")
                .replace("&o", "<italic>")
                .replace("&r", "<reset>");
    }

    public static String convertLegacyColorCodes(String text) {
        return SERIALIZER.serialize(MINI_MESSAGE.deserialize(convertColorCodes(text)));
    }```

... 

error was something like cannot convert legacy codes in a mini message component, not the & but to goofy looking one would precede all characters like the input was & color codes when it was actually formatted like <rainbow> / <gradient>
upper niche
blazing ocean
#

Why are you replacing that shit manually

worthy yarrow
floral drum
#

@worthy yarrow create the builder with .character('&')

blazing ocean
#

I don't understand what you meant

worthy yarrow
#

I cannot find the error in my logs kek

upper niche
drowsy helm
floral drum
#

then remove that color code thing

drowsy helm
#

Just send the packet every tick

upper niche
drowsy helm
#

Or delay by a tick instead

worthy yarrow
floral drum
#

make sure you have the other stuff for hex colors

blazing ocean
#

Why are you even replacing them manually

floral drum
#

and then see if it works

drowsy helm
#

Once I get on my pc I’ll send my thing I did to fix it. I used to have flickering aswell

#

Or you can just give mining fatigue

upper niche
#

I have mining fatigue 6 (you can see at the end of the video)

#

This entire goal is to have the visual handled by the server

worthy yarrow
blazing ocean
#

🤨

worthy yarrow
#

🤷

blazing ocean
#

You can literally just do serializer.serialize(miniMessage().deserialize(miniMessageString)) and it should give you the legacy output

worthy yarrow
#

Which is what I was doing

#

And then it broke ?

#

Idek

blazing ocean
#

wha

worthy yarrow
#

swear

blazing ocean
worthy yarrow
#

Was doing:

serializer.serialize(minimesasge.deserialize(input));

#

literally the same

floral drum
#

try what I said kat

worthy yarrow
#

just didnt put the ()

#

I am

floral drum
#

if you haven't already

#

didn't work?

blazing ocean
worthy yarrow
#

Uh I'm just confused which i should do first, the color code serialization right?

upper niche
blazing ocean
#

First you want your mini message -> component

floral drum
#

don't use that method you were doing

blazing ocean
#

and then you would want it to be legacy serialized

worthy yarrow
blazing ocean
floral drum
#

what's your current code look like?

worthy yarrow
#

kek

remote swallow
#

nuclear what are you trying to do

blazing ocean
#

convert minimessage -> legacy

remote swallow
#

do i have the class for you

worthy yarrow
slender elbow
#

the funny part is that you can't just string replace the codes because the grammar of the formats are different

remote swallow
# worthy yarrow I don't either, it literally broke
.hexCharacter('#').hexColors().useUnusualXRepeatedCharacterHexFormat().build();```


with 

public static String translate(String toTranslate) {
return (ChatColor.translateAlternateColorCodes('&', SERIALIZER.serialize(MiniMessage.miniMessage().deserialize(toTranslate))));
}

#

you prob dont need the translate but hey ho

slender elbow
#

I mean you can just use the section symbol instead and skip the ChatColor part

remote swallow
#

im pretty sure passing character('&') removes the need for translate

floral drum
remote swallow
tardy delta
#

git makes it pretty interesting to design a build system

slender elbow
#

huh

tardy delta
#

like verifying a git url is valid

eternal night
#

verifying

build system

#

pfft

tardy delta
#

what

eternal night
#

verifying is for beginners, blindly run at it

blazing ocean
#

Interpreted lang users:

alpine urchin
#

interpreted language makers:

quiet ice
worthy yarrow
blazing ocean
#

What the fuck

worthy yarrow
#

It's fucking stupid

#

It was literally working then it wasn't

blazing ocean
#

Why are you not just serializing the component to Legacy

#

Just LEGACY_SERIALIZER.serialize(MINI_MESSAGE.deserialize(miniMessageString))

worthy yarrow
#

tried that too

#

but then output just has a bunch of & formats

blazing ocean
#

Isn't that what's supposed to happen?

worthy yarrow
#

No I mean it literally puts the & in the text as well

blazing ocean
#

at nuclearkat.playertitles
Nice package you got there

#

Yeah it's supposed to

#

That's how legacy chat works no?

worthy yarrow
#

&7Something would be gray right

blazing ocean
#

Yes

worthy yarrow
#

But instead it outputs literally '&7Something'

quiet ice
#

just do string.replace('&', '\u00A7');

blazing ocean
slender elbow
#

you are literally configuring the serializer to output &

quiet ice
#

Is it reliable? No. Does it work most of the times? yea

slender elbow
#

instead of §

tardy delta
slender elbow
#

so, instead, configure the serializer for § character instead of & character

tardy delta
#

i know cargo is able to do that yes

#

lemme throw a best effort git clone at it

worthy yarrow
blazing ocean
floral drum
#

Does the & work now?

quiet ice
worthy yarrow
blazing ocean
#

Whar

worthy yarrow
#

Display name being the display of the item created

blazing ocean
#

Why not close the rainbow tag

#

Idk what happens if you don't

quiet ice
#

Probably auto-closes like HTML does

floral drum
#

Yeah it autocloses at the end of the text pretty sure

worthy yarrow
floral drum
#

<newline> exists

#

if you needed that

tardy delta
worthy yarrow
#

There's not supposed to be multiple lines

worthy yarrow
quiet ice
blazing ocean
#

Or am I misunderstanding this

worthy yarrow
#

I think you're misunderstanding

floral drum
#

Okay, can you show the code and what you're trying to parse?

worthy yarrow
#
public class ColorUtil {

    private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer
            .builder()
            .character('§')
            .hexCharacter('#')
            .hexColors()
            .useUnusualXRepeatedCharacterHexFormat()
            .build();
    private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();


    public static String convertLegacyColorCodes(String text) {
        return ChatColor.translateAlternateColorCodes('&', LEGACY_SERIALIZER.serialize(MINI_MESSAGE.deserialize(text)));
    }
}```

Technically all I am trying to parse is <rainbow>Testing
tardy delta
#

youd just need a dir where your package lives and the compiler figures it out

blazing ocean
worthy yarrow
#

Like it works for the display names of items but when trying to create a text display out of it:

        §4C§6o§2o§3l§3G§1u§5y```
worthy yarrow
blazing ocean
#

That makes zero sense

worthy yarrow
#

You're telling me

#

I don't know what I did

floral drum
#

You're basically doing it like this right?

worthy yarrow
#

yeah

floral drum
#

Show if you don't mind

eternal oxide
#

You broke it. Minecrafts over.

floral drum
#

real

quiet ice
worthy yarrow
#
public void displayTitle(Player player, Title title) {
        World world = player.getWorld();
        Location location = player.getEyeLocation();
        String titleContents = ColorUtil.convertLegacyColorCodes(title.getTagContents());

        TextDisplay textDisplay = world.spawn(location.clone(), TextDisplay.class);

        Vector3f offset = new Vector3f(0, 0.15f, 0);
        AxisAngle4f rotation = new AxisAngle4f();
        Vector3f scale = new Vector3f(0.75f, 0.75f, 0.75f);
        Transformation transformation = new Transformation(offset, rotation, scale, rotation);

        textDisplay.setText(ColorUtil.convertLegacyColorCodes(titleContents));
        textDisplay.setBillboard(Display.Billboard.CENTER);
        textDisplay.setBackgroundColor(Color.fromARGB(0x80333333));
        textDisplay.setCustomNameVisible(false);
        textDisplay.setPersistent(false);
        textDisplay.setSeeThrough(false);
        textDisplay.setShadowed(false);
        textDisplay.setInvulnerable(true);

        textDisplay.setTransformation(transformation);

        this.activeTextDisplays.put(player.getUniqueId(), textDisplay);
        player.sendMessage(ChatColor.GREEN + "You have just equipped the " + ColorUtil.convertLegacyColorCodes(title.getDisplayName()) + ChatColor.GREEN + " title!");
        player.addPassenger(textDisplay);
    }```
dawn flower
#

this isn't really a development question, but by does it take forever to compile with maven? it takes like 0.7ms to compile gradle and around 8 seconds to compile maven
or am i missing something that i'm supposed to do in pom.xml

floral drum
#

You're converting it twice

#

@worthy yarrow

quiet ice
ivory sleet
#

Like incremental builds I believe

dawn flower
#

any guide on that on yt?

ivory sleet
#

HOWEVER gradle still has the gradle daemon

floral drum
#

see it works for me

quiet ice
ivory sleet
#

So it’s obviously very neat and arguably better than maven

worthy yarrow
ivory sleet
#

0.07 is not much

tardy delta
floral drum
#

That's why it says there's SECTION_CHAR in it, because you're converting it to legacy, which replaces it all with SECTION_CHAR. And when you try parse it, it just doesn't allow you because minimessage doesn't allow section chars to be used

grand flint
dawn flower
#

wait i meant 0.7 seconds not ms lmao

grand flint
#

took me 80 minutes plus building a github repo

#

why u crying over 8 seconds

quiet ice
dawn flower
#

15 minutes..

ivory sleet
dawn flower
#

yeah i was

ivory sleet
river oracle
#

maven does less caching by default

#

use the maven cache extension it should help some

dawn flower
#

but i said gradle takes 0.7ms to compile but i meant 0.7seconds

quiet ice
#

Second time is still 2s

ivory sleet
#

consecutive runs geol take less

floral drum
#

and & works for it too

quiet ice
#

And that assumes absolutely no changes inbetween

quiet ice
#

I believe maven is also dealing quite well in that case

ivory sleet
#

Ugh weird, maybe its a poorly written gradle plugin or sth

worthy yarrow
floral drum
#

lollll

blazing ocean
#

kek

worthy yarrow
#

effin a cotton

#

Hmm that's an issue though

tardy delta
#

the spam when you join..

floral drum
#

@worthy yarrow end the rainbow tag with </rainbow>

blazing ocean
#

fuck essential fr

worthy yarrow
quiet ice
worthy yarrow
#

This is also interesting

blazing ocean
floral drum
worthy yarrow
#
public ItemStack build() {
        ItemStack builtItem = new ItemStack(Material.PAPER);
        ItemMeta itemMeta = builtItem.getItemMeta();
        itemMeta.setDisplayName(ColorUtil.convertLegacyColorCodes(displayName));
        List<String> formattedLore = new ArrayList<>();

        for (String lore : this.lore) {
            formattedLore.add(ColorUtil.convertLegacyColorCodes(lore));
        }

        itemMeta.setLore(formattedLore);
        PersistentDataContainer dataContainer = itemMeta.getPersistentDataContainer();
        dataContainer.set(titleContentsKey, PersistentDataType.STRING, tagContents);
        dataContainer.set(titleKey, PersistentDataType.STRING, key);

        builtItem.setItemMeta(itemMeta);

        return builtItem;
    }```
ivory sleet
slender elbow
#

skill issue

tardy delta
#

does maven do incremental builds?

blazing ocean
#

real

tardy delta
#

you with your real

worthy yarrow
#

real

ivory sleet
#

Or well alex talked about it

blazing ocean
#

not for kotlin by default

floral drum
#

works for me 🤔

foggy cave
#

hey guys i had a question i was struggling with, how to i like tie a class with a minecraft block

quiet ice
#

Though I remember there being some stupid catch here

ivory sleet
#

mayhaps, it was years since I touched maven tbf

quiet ice
#

Regardless the default is plenty fast for 99% of cases

ivory sleet
#

true true

eternal night
#

I thought maven did its shit via the extension

quiet ice
#

I have no idea what you mean with "the extension"

eternal night
#

found le link

quiet ice
#

Yeah, never used it

#

Nor seen anyone use it

eternal night
#

who really needs it

quiet ice
#

You're doing something wrong if you are running your buildsystem so often where a second is an important consideration

young knoll
#

Oh yeah

#

Well how long does it take spigot to compile

quiet ice
#

In my workflows I rarely run the build task

young knoll
ivory sleet
young knoll
#

?blockpdc

undone axleBOT
quiet ice
worthy yarrow
river oracle
floral drum
#

or whatever you're doing

worthy yarrow
# worthy yarrow what the fuq

Also I was more referring to the fact that the itemstacks display name has a different rainbow then the text display

young knoll
worthy yarrow
floral drum
#

oh not that

#

just the setting of this.lore

quiet ice
#

So basically I have an eclipse launch configuration which allows me to debug mods. I generally don't hotswap but at times it is useful to have - especially if you try to dial down to a specific look and feel you are trying to achieve

worthy yarrow
floral drum
#

are you using spigot or paper to test?

young knoll
#

Indeed it does

worthy yarrow
foggy cave
# young knoll ?blockpdc

oh so this can be useful for like an airdrop is what im tryna make, i can just spawn the airdrop as a block and then check if the right clicked block was my custom one or in this case chest

floral drum
#

strange..

#

what version is this on?

eternal night
young knoll
#

Make sure your serializer is configured to not flatten colors

eternal night
#

switch to a proper OS typing

ivory sleet
#

But thats pretty neat

young knoll
eternal night
#

romance

worthy yarrow
#

local host is 1.21, tested and works fine prior like all 1.20s @floral drum

quiet ice
young knoll
#

We love runClient and runServer

valid basin
#

Does player#attack method fires entitybyentitydamage event?

eternal night
valid basin
#

Alright

quiet ice
#

Technically speaking it would be possible to have a similar workflow under bukkit if one is willing enough to have a dedicated main class for IDE launch configurations

young knoll
#

Well there is runpaper

#

Imean

#

What

foggy cave
#

ok i was wondering how it worked thx

eternal night
young knoll
#

You know MD doesn’t want to go that route

worthy yarrow
#

Hey curious ask, how does no clip work in most games?

eternal night
#

https://spigot.lynxplay.io/spigot/1.21/build/142/download when

eternal night
worthy yarrow
#

Yeah

eternal night
#

I mean, you just disable collision checks?

quiet ice
#

Like I pretty much all need to invoke

/usr/lib/jvm/zulu8/bin/java
-Dde.geolykt.starloader.launcher.CLILauncher.mainClass=com.example.Main
-Dde.geolykt.starloader.launcher.IDELauncher.inlineStarplaneAnnotations=true
-Dde.geolykt.starloader.launcher.IDELauncher.modDirectory=/home/geolykt/applications/mods/sane-crab/s2dmenues/mods
-Dde.geolykt.starloader.launcher.IDELauncher.bootURLs=[<snip>]
-Dde.geolykt.starloader.launcher.IDELauncher.modURLs=[[\"file:/home/geolykt/applications/mods/sane-crab/s2dmenues/bin/main/\"]]
-Dorg.stianloader.sll.IDELauncher.propertyExpansionSource=/home/geolykt/applications/mods/sane-crab/s2dmenues/gradle.properties
-classpath <snip>
de.geolykt.starloader.launcher.IDELauncher

And it launches everything just fine

worthy yarrow
#

What about the client?

eternal night
#

you instruct the client to also disable collision checks

hard socket
#

just got a new pc and forgot IntelliJ plugins

worthy yarrow
hard socket
#

any more helpful plugins?

eternal night
#

Well yes because the server also disabled collisions

worthy yarrow
#

hmm

#

Is this a cause of the server trusting the client too much?

eternal night
#

huh?

young knoll
#

What games have straight up no clip cheats

#

Even Minecraft doesn’t have that issue afaik

eternal night
#

a game client will always have to do some form of movement prediction, otherwise your input is going to feel terrible due to latency

worthy yarrow
#

I mean like, I don't understand how both the server and the client can have collision checks disabled as I'd feel collision checks are a pretty base component of a game

eternal night
#

so if a game wants to allow noclip, both the client predictions and server validation have to consider thta

young knoll
#

And that’s how we got spectator mode

worthy yarrow
#

Hmm

#

Still need more networking knowledge

young knoll
#

I mean, in this case you only need to send a single byte

#

0 to disable no clip, 1 to enable

worthy yarrow
#

That's it becoming cheat developer

#

You made it sound too easy

young knoll
#

Well yeah if you make both the client and the server

worthy yarrow
#

well

young knoll
#

You can kinda do whatever you want :p

worthy yarrow
#

yeah kek

#

So then does aimbot work because the server has to hold the "location" as it were of every player, then the client just uses those locations in a way?

young knoll
#

Pretty much

#

Obviously the client needs to know where the enemy is so it can yknow, render them at that spot

floral drum
#

what version of adventure and stuff are you using @worthy yarrow

#

I know it might not to be do with that but..

#

worth a try

worthy yarrow
#

Well for games like rust as an example, the draw distance regulates how far you can render, that being said aimbot only works for the radius of which the client can render?

young knoll
#

Often the game might send position info even if the player is outside render distance

dawn flower
#
    public Set<Punishment> getPunishments(OfflinePlayer op) {
        return punishments.stream()
                .filter(punishment -> punishment.getPlayer().equals(op.getUniqueId()))
                .collect(Collectors.toSet());
    }```
why is this case sensitive? ``Bukkit.getOfflinePlayer("missingreports")`` returns other punishments than ``Bukkit.getOfflinePlayer("MissingReports")``
floral drum
#

Because it's offline players

#

it's not the uuid's

dawn flower
#

can u make it not case sensitive?

young knoll
#

Don’t think so

#

The case matters for minecraft names

worthy yarrow
#

What about like shot validation? Rust has a system for this but still aimbot doesn't seem to be effected by it

floral drum
#

Why are you getting an offline player with their username anyway?

dawn flower
#

then how come moderation plugins allow banning of offline players (where case doesn't matter)

young knoll
#

Idk, what’s shot validation in this context

floral drum
#

is the server in offline mode?

dawn flower
#

idk lemme check

worthy yarrow
slender elbow
dawn flower
#

yeah

floral drum
#

Is it connected to a proxy?

dawn flower
#

no

floral drum
#

that's why

#

turn offline mode off

dawn flower
#

ah

young knoll
#

Well can you aimbot through a rock?

floral drum
#

online-mode: true in server.properties

dawn flower
#

alr

worthy yarrow
#

I have seen it happen

young knoll
#

I assume it just does a raycast from the shooter to the target

floral drum
#

wish I had enough reactions and posts for premium plugins

#

F

young knoll
#

Often there will be some latency from the server to the client

worthy yarrow
#

Host your own plugin market site duh

young knoll
#

So you aren’t quite in the same place the server thinks you are

worthy yarrow
#

I def understand that

#

happens all the damn time

floral drum
#

wait you need 80 POSTS

#

damn

#

rip me

worthy yarrow
#

time to go write "purple is cool" 80 times and post it

floral drum
#

bruhhh

worthy yarrow
#

Were you wanting to post seasons as a premium plugin?

young knoll
#

(You will be banished to the shadow realm)

young knoll
#

Smh

worthy yarrow
#

Ooo please let me test first :p

floral drum
#

time to help people on spigotmc plugin development

young knoll
#

Don’t we already have enough of those

worthy yarrow
#

no...

#

I've only ever seen like one good seasons plugin

floral drum
#

this one is cool that I'm making frfr

worthy yarrow
#

That's why you should let me test

#

I'd know how to break it since yk I kinda tried writing it kek

young knoll
#

I mean

#

Isn’t one premium one enough smh

worthy yarrow
#

Purple just being consumed by greed

floral drum
#

wtf

worthy yarrow
#

Last question about the cheats tho, all cheat clients are manipulating packets depending on the cheat right?

#

Or do they have to?

worthy yarrow
young knoll
#

They don’t have to

#

Tracers just draw a line to things, no packet manipulation required

worthy yarrow
#

How does the client get this data though?

#

I mean idk I just feel like you'd never want to trust the client

young knoll
#

Well

floral drum
#

yay helped 3 people in 5 minutes.

young knoll
#

The client is sent the location of players

#

Or chests

worthy yarrow
#

This is for rendering mainly correct?

young knoll
#

Or mobs, or whatever you want to tracerer

dawn flower
#
    public long getTimeLeft() {
        return System.currentTimeMillis() - endDate;
    }```
this is kinda counting up every second
``endDate = System.currentTimeMillis() + banDuration (E.g: 1000)``
tardy delta
#

please work with duration slash instants

dawn flower
#

what in the world is that

#

you mean Duration / Instant?

#

both classes

tardy delta
#

yes

#

caps broken

dawn flower
#

ok

#

wait i'm confused

#

is the duration the date of when it ends

#

or is the duration the amount of time it needs to wait

tardy delta
#

duration is duration, instant is a point of time

dawn flower
#

ok

quiet ice
#

Or better said, a duration is the difference between two points in time

tardy delta
#

afaik instant is just a fancy epoch wrapper with some methods on it

dawn flower
#

it works

#

sick

#
[00:41:46 INFO]: MissingReports (/127.0.0.1:21763) lost connection: You are banned from this server!

Reason: No reason specified
Ends in: 42s

Moderation ID: #-1```
it kinda spams the console tho, is there a way to not show that in the console
glass wharf
#

does anyone know of any good resources for changing player skins? I can only find resources from many years ago after searching.

I have an account set with a skin. I want to be able to make any player on my server appear as if they have this skin. how can I do this?

glass wharf
hard socket
#

?mappings

undone axleBOT
hard socket
#

?nms

twin venture
#

hi , i have a question ..
why this does not work?

#

it does not show anything ..

earnest girder
#

when a mushroom spreads, how can I get the original mushroom block?

#

BlockSpreadEvent.getSource usually returns an air block in the vicinity of the original mushroom, adjacent to the new mushroom

glass wharf
hard socket
#

how can I make the IronGolem run the hit animation?

#

I tried packets and it doesn't work only for the IronGolem

glass wharf
#

How can I play a sound from everywhere, i.e no directional audio, and no distance fading

via command I could do /execute as @s at @s run playsound minecraft:music_disc.11 master @s and it would play from everywhere

tall dragon
slate siren
#

I cannot save the settings to the config in the plugin I coded with Kotlin.

#

To reload after reload

earnest girder
#

on my server players are able to "steal" items from a gui shop by shift clicking the item and closing the inventory at the same time, even though InventoryClickEvent is cancelled. How can I fix this like other servers clearly have?

#

this is a big issue and seemingly a bug with spigot

worthy yarrow
#

Sounds like a 1.8 issue

earnest girder
worthy yarrow
#

I have never had this issue on 1.21

earnest girder
#

have you tried it?

worthy yarrow
#

You don't think I've ever made a gui listener? kek

#

I'll go test it right now

earnest girder
#

try clicking escape at the same time you shift click an item

#

I'm just testing my plugin rn but I'm glad I caught this before I opened my server lol

worthy yarrow
#

🤷

#

Maybe force close the inventory when they click something

earnest girder
#

I think I know what my issue is

#
package gg.wicklow.events;

import gg.wicklow.Main;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;

public class FreezeInventory implements Listener {

    public FreezeInventory(Main plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if(event.getInventory().getMaxStackSize() == 101) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        if(event.getInventory().getMaxStackSize() == 101) {
            event.setCancelled(true);
        }
    }
}

I'm using the inventory's max stack size as an identifier for my custom guis

#

I thought I was clever lol

worthy yarrow
#

I mean that sounds exploitable but achieves the purpose?

#

I don't think that's the issue however

earnest girder
#

are there any differences between our code that could be the issue?

worthy yarrow
#

I mean

#

I would try to title match first and see if the issue persists

earnest girder
#

ok

worthy yarrow
#

I've never seen this sorta gui validation before so just to verify that the event is actually being thrown for your inventory

earnest girder
#

wait is event.getInventory() the wrong method?

worthy yarrow
#

It gets the inventory of said inventoryEvent

#

I don't think you can get the title of the inventory through getInventory for some reason, might be wrong

earnest girder
#

thats right

#

and yeah that was my issue

#

I need to compare titles not max stack sizes

#

isnt that kinda fucked tho if I have like 20 custom guis and need to check if the player's inventory title matches one of those strings every time they click in an inventory?

remote swallow
#

?inventory

#

?inv

#

?invgui

#

?menu

#

idk what that command is

young knoll
#

?gui

young knoll
#

Rekt

remote swallow
#

feck

earnest girder
#

wow code that looks like that makes me feel slow

#

I dont understand that at all

#

I'll understand it eventually lol

blazing robin
#

hey guys, I wanna open an invnetory after player downloaded resourcepack is it possible?

when I tried this:

 @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        UserMonthlyFeeRepository userMonthlyFeeRepository = ShibaMonthlyFee.getPlugin().getUserMonthlyFeeRepository();
        Player player = event.getPlayer();

        UserMonthlyFee userMonthlyFee = userMonthlyFeeRepository.getMonthlyFee(player.getUniqueId());
        if (player.hasPermission("test.monthlyfee") && !userMonthlyFee.isJoined()) {
            plugin.getServer().getScheduler().runTaskLater(plugin, () -> new MonthlyEffectInventory().open(player), 20L);
            userMonthlyFee.setJoined(true);
            userMonthlyFee.update();
        }
    }

it just canceled to download a resourcepack

drowsy helm
#

Sec

#

Just make sure the status is accepted

blazing robin
#

oh thank youuu!! I've been looking for this

worthy yarrow
#

Breh it keeps automatically doing util.* kek

slate siren
#

Guys, I can't do anything about particle delivery, can you solve the problem if I post it

vast ledge
#

??

blazing robin
kind hatch
vast ledge
slate siren
vast ledge
#

what particle delivery

#

Oh god

#

its

#

its

worthy yarrow
vast ledge
#

🤮 kotlin

worthy yarrow
#

Just putting everything into the island to trim tbf currently

#

see what all I actually need in there

slate siren
#

Ender portal particle spreads a lot, and it starts from the top down, I want to do it the other way around, I couldn't make the armor stand start from the bottom and spread less towards the top.

https://pastes.dev/oBm465HwCv

slate siren
rough ibex
#

kotlin ❤️

vast ledge
#

Sorry cant help, dont speak kotlin ;-;

worthy yarrow
#

nvm found it

#

Hmm what all would you guys store in an island class? (specifically in relation to a skyblock plugin, decided I'm doing separate data classes for settings and visitor logs)

rough ibex
#

what if you want many owners

#

coowners

#

some of this should be in another class like level and score

worthy yarrow
rough ibex
#

eh

worthy yarrow
#

yeah

#

sounds stupider when I say it

#

dunno what I am thinking

rough ibex
#

rubber duck debugging

wet breach
#

I would probably just extend chunk for this

worthy yarrow
pseudo hazel
#

looks fine to me

#

if you keep adding subclasses you ned to click more to get to the definition

worthy yarrow
#

Well level was going to be dependant on score, that being said those calcs shouldn't really be done in the island class imo

pseudo hazel
#

my general approach is are you going to use that score/level class anywhere besides in this island class?

#

if not why not just put it in there

rough ibex
#

tight coupling, SRP

worthy yarrow
#

separation of concerns

rough ibex
#

subclasses is solved with composition, not inheritance

worthy yarrow
#

I feel like readability on a core is more important that just being lazy about where my data is held

pseudo hazel
#

i didnt say anything about subclasses or inheritance

pseudo hazel
#

I mean lazy or simple

#

you chose the words

rough ibex
#

if you deeply nest them sure

pseudo hazel
#

oh right

#

well I meant subclasses as in classes inside another class, i.e. composition

#

my bad

#

all im trying to say ont overcomplicate things

#

i the calculations are gonna be in a single method, it doesnt really matter

#

otherwise you'd need to double back on the calculations

#

like from the outside it would be island.getScoreStuff().islandScore() or island.getScore() and then in island it would be return scoreStuff.islandScore()

#

both is kinda unneeded and adds extra tracable methods

#

anyways thats how I think about it