#help-development

1 messages Β· Page 1093 of 1

zenith bobcat
#

and i think it broke at 1.20.1

lost matrix
# zenith bobcat and i think it broke at 1.20.1
public class PlayerConnectionSpoof extends ServerGamePacketListenerImpl {

  private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {
    // Implement the abstract methods here, but keep them empty
    @Override
    public void setListener(PacketListener packetListener) {

    }
  };

  public PlayerConnectionSpoof(ServerPlayer player) {
    super(MinecraftServer.getServer(), DUMMY_CONNECTION, player);
  }
}

Then when you create a ServerPlayer:

    GameProfile gameProfile = new GameProfile(UUID.randomUUID(), id);
    ServerLevel world = ((CraftWorld) location.getWorld()).getHandle();
    this.nmsPlayer = new ServerPlayer(MinecraftServer.getServer(), world, gameProfile);
    this.nmsPlayer.connection = new PlayerConnectionSpoof(this.nmsPlayer);
zenith bobcat
#

thanks wait i will implement it

tardy delta
#

if you go deeper than 2 levels, torvalds will bonk you

zenith bobcat
#

but is there any documentation about how this connection thing and login procedure works internally in nms i know its nms but has someone done something like this

lost matrix
#

This is the pure protocol specification. Nothing about the nms internals

zenith bobcat
# lost matrix https://wiki.vg/Protocol

yeah i saw this website without that i couldnt have done the Packets for the Player but i meant in code someone who gets over the Project structure of NMS

noble flume
#

How might I create a map of locations and block types from a world edit clipboard?

maiden thicket
#

hey, how would i go about adding a custom modeled block using a resource pack? 😭

lethal knoll
#

Anyone knows if there is an interface to check if a mob is resizable?

pseudo hazel
#

any mob is resizable

#

except for ender dragon I think

lost matrix
#

*If you are speaking about adding additional blocks instead of replacing them

maiden thicket
#

i think i got the mushroom block thing working but the mushroom block seems to be rendering with my model and overlapping so its weird

hushed spindle
#

for ItemMeta#setFood(FoodComponent) how are you meant to use FoodComponent

#

are there any implemenations of this interface or an intended way of usage

#

or do you gotta make an implementation yourself

slender elbow
#

you get it

#

modify it

#

set it back

rough hinge
#

why?

slender elbow
#

what's the exact warning text?

#

copy paste it or take a screenshot

rough hinge
slender elbow
#

x to doubt

#

the exact, literal text

rough hinge
#

wdym

kind hatch
#

?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

rough hinge
#

i verify if null on canplace .-.

slender elbow
#

what's the full method like?

#

or is that another method?

rough hinge
slender elbow
#

oh I see

#

they are two separate methods..
I don't think it's smart enough for that, idk if the rest of the method can return false as well in any other parts?

#

idk, it's weird but yeah

rough hinge
#

then this shouldn't happen

dense falcon
#

How can I add and check if there is a custom NBT tag on an Item πŸ€” ?

fleet light
#

quick question if I wanted to remove the +2 Armor +3 Damage text from an Item when I hover it what do I have to change on the ItemMeta?

#

im trying to remove that from the item

dense falcon
echo basalt
#

?1.8

undone axleBOT
dense falcon
#

Yes and?

tardy flame
#

Heyo, would it be possible to send message as OfflinePlayer? I tried calling the event (AsyncPlayerChatEvent) but it requires Player object. I want to achieve seamless integration with existing chats plugin that may change formatting of messages

echo basalt
#

how would sending a message to someone that's not online work

tardy flame
#

From, not to

#

Using external service, from web panel / mobile app

chrome beacon
#

Just don't send it as the player

#

broadcast a message

echo basalt
#

pretty much

tardy flame
#

How can I match the formatting of messages in the server?

royal heath
#

He might be trying to integrate it with the chat plugins

echo basalt
#

Or create a fucked up instance like an npc or something

tardy flame
chrome beacon
royal heath
#

I'd imagine you could use packets or something to achieve this

#

Actually maybe not

chrome beacon
#

You'd have to spoof the player being online

#

Not worth the effort

tardy flame
#

Alright then, thanks for help

royal heath
#

From 2019 might not work anymore

tardy flame
#

Okay

topaz cape
#

you could google it youll find the github repo

slender elbow
#

surely you're running your own 1.8 fork anyway? you could add your own api for it

topaz cape
#

im sure your interference would be of benefit if you have less assumptions and more helping:D

(not everyone who makes a 1.8.8 is making it for his own server, version is outdated but was never cancelled on twitter and finally almost nobody runs their own fork, people just run forks please stop with your weirdness :D)

dense falcon
grim hound
#

how can I refresh a player's tab? Like have it sync with the server's

topaz cape
#

good question.. actually no bad question

#

is there a context hidden behind that

grim hound
topaz cape
#

where πŸ˜„

grim hound
#

I block all tab packets coming from the server during a certain period

#

I then often get complains from users that a tab plugin isn't working properly

#

these modifying the outgoing player info packets

topaz cape
#

you would most likely have to recreate those packets, or just hide and show all players

grim hound
chrome beacon
#

Have you tried capturing and resending at a later point

grim hound
#

also, these can stack greatly

grim hound
chrome beacon
#

There isn't much else you can do

topaz cape
#

just hide n show missing players through the spigot api

#

should probably fix it

grim hound
#

wait

topaz cape
grim hound
#

it won't

topaz cape
#

what version are you on

grim hound
grim hound
grim hound
topaz cape
#

let me check moderndisguise

#

ill see how i do it

grim hound
topaz cape
#

well just do that then

#

o.O

grim hound
grim hound
#

I just said that I'm looking for a better solution as tab plugins break

topaz cape
#

integerations into those tab plugins for a refresh is possible πŸ’€

#

nothing else you can do really

grim hound
#

that literally every plugin can possibly modify tab

#

you can't really say whether it does

topaz cape
#

true, but there are like 1 - 2 common tab plugins

#

just tell people to use those

topaz cape
#

way easier

grim hound
#

not good

#

solution

topaz cape
#

well thats your only choice, the fact that you block player tab packets is actually sad

grim hound
topaz cape
#

can’t do anything about it

grim hound
topaz cape
#

unlucky for you

grim hound
#

or just trying to make me make a worse plugin

topaz cape
#

no its just that you’re doing something that is so stupid like blocking tab packets and then complaining about how it breaks tab

lethal knoll
topaz cape
#

my advice, don’t block tab packets

lethal knoll
#

I already figured out ther is no interface for it

pseudo hazel
topaz cape
#

?xy

undone axleBOT
pseudo hazel
#

livingEntity.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(newScale);

#

this is from 1.20.5

grim hound
grim hound
topaz cape
#

???

#

ok

grim hound
#

where's this aggresion coming from?

topaz cape
#

im the aggressive one?

grim hound
topaz cape
#

oh you're one of them

grim hound
#

can't place you in a majority of any sort

topaz cape
#

ok πŸ‘

grim hound
#

let's not fight

#

we just had an unnecessary conflict

#

peace out

topaz cape
#

πŸ‘‹

lethal knoll
pseudo hazel
#

I dont know any setSize method

lethal knoll
#

There is on a few interfaces

pseudo hazel
#

oh

#

I dont know

lethal knoll
#

Phantom, Slime,

#

etc

pseudo hazel
#

right

#

I think thats a different thing

lethal knoll
#

But if I can use the Attribute, and it works the same,

#

oh

pseudo hazel
#

if you just want to size those specific mobs, the most specifc interface is just the mob itself

#

but its only a thing for slimes and phantoms

lethal knoll
#

Yeah, but because it doesn't use an interface, I have to to the implementation for every individual mob

pseudo hazel
#

so not a lot of trouble I imagine

lethal knoll
#

No for more

pseudo hazel
#

like what

lethal knoll
#

Actually no, you are right indeed

#

Was just checking

#

but I don't care about non LivinEntities

pseudo hazel
#

I didnt even know you could set the size of phantoms until you told me haha

lethal knoll
#

so I guess I'll just do the implementation like that

pseudo hazel
#

yeah its only 2 checks

#

so its fine

lethal knoll
#

haha, I also don't see a reason why you would πŸ˜„

#

But hey, apperently it's possible

pseudo hazel
#

does anyone know what the technical reason is for registering configurationSerializable objects? is it so spigot can find the type to construct for the data when deserializing?

#

im asking because im trying to make a similar system which might be solved by using registers too

lethal knoll
#

I believe it's mainly done for the deserialization part, and telling upfront that it's use SnakeYML

#

Because the format is different than a regular YML

pseudo hazel
#

right but the whole configuration api is snakeyml

pseudo hazel
#

whats the other part?

pine crest
#

but also because deserialization can happen through different ways for example

#

that is w constructor, static method, or sometimes even delegated to another class

pseudo hazel
#

right

#

so the registering allows spigot to get all information it needs to create the object

pine crest
#

yes

pseudo hazel
#

I see

#

I think I know enough now, thanks πŸ™‚

pine crest
#

on skibidi

pseudo hazel
#

okay I retract my thanks

#

πŸ˜‚

grim hound
#

does anyone know how to view IntelliJ's statistics?

#

like lines, autocompletions etc

onyx fjord
viscid carbon
#

@river oracle the idea behind the java private final HashMap<UUID, User> playerData = new HashMap<>();
is to save data later correct?

pine crest
#

yes

#

or at least not lose it

#

because its kept in memory

viscid carbon
#

but what if its not saving?

pine crest
#

well I mean you still have to save and load the in-memory-data to on-disk-data

viscid carbon
#

yeah putting it into memory aka java playerData.putIfAbsent(playerUUID, new User(playerUUID, new FileHandler("players", playerUUID.toString() + ".yml")));

#

then to get it and modify java public User getUser() { return playerData.get(playerUUID); }

pine crest
#

use computeIfAbsent

#

but else

#

sure

#

save it on quit event

#

and load it on the apple event

viscid carbon
#

Did that, and also onDisable.

#

but when i get that data from Join event theres nothing

#

im also setting it before anything else with java public void setUser(UUID playerUUID) { this.playerUUID = playerUUID; playerData.putIfAbsent(playerUUID, new User(playerUUID, new FileHandler("players", playerUUID.toString() + ".yml"))); }

#

well now

#

ComputeIfAbsent

pine crest
#

with putIfAbsent u create a new user object regardless

#

goofy

viscid carbon
#
user = new User(playerUUID, new FileHandler("players", playerUUID + ".yml"));
playerData.computeIfAbsent(playerUUID, k -> user);```
something like this?
#

never used this before

#

always just checked containsKey

pine crest
#

you are trolling

#

var user = map.computeIfAbsent(id, key -> {
return new User(key,...);
});

viscid carbon
#

i guess im stupid because i cant get it to work

soft tendon
#

Hey! I've noticed a fun issue while working on Geyser-Spigot recently - i am currently working on disabling the plugin if it is wrongly configured; however it seems that running Bukkit.getPluginManager().disablePlugin(this); doesn't actually disable the plugin and continues to call onEnable of the plugin.

Relevant code:
https://github.com/onebeastchris/Geyser/blob/detect-improper-setups/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java#L151-L162 checks in onLoad, that disable the plugin if need be.

However, it looks like onEnable is still called; leading to errors when enabling the plugin. Isn't disabling the plugin during onLoad supposed to stop onEnable from being run? Or am i misunderstanding it?

acoustic pendant
#

Do someone know why I can't access any 1_20_R4 nms? I've been working with a multi supportive version but this is the only one giving error

It says cannot find symbol also but don't get any error on intelij

#

here's my pom :

#

I don't know why this is happening

#

It could be the .jar?

#

bad class file: C:\Users\adriw.m2\repository\org\spigotmc\spigot\1.20.6-R0.1-SNAPSHOT\spigot-1.20.6-R0.1-SNAPSHOT-remapped-mojang.jar(/net/minecraft/core/BlockPos.class)
class file has wrong version 65.0, should be 61.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

#

Should I download it using java 17?

junior geyser
#

Tried with 21 and 22

viscid carbon
#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project spigot-api: Fatal error compiling: error: release version 17 not supported

#

oh its build tools

junior geyser
#

I used java 21

viscid carbon
#

what does your bat look like?

#

your command

#

sorry

junior geyser
#

Just ran /lib/jvm/jre-21-openjdk/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped

viscid carbon
#

use git

junior geyser
#

Sorry?

viscid carbon
#

right click in dir and open with git bash

#

java -jar BuildTools.jar

junior geyser
#

I know what git is. I just need the shit in my m2 folder

viscid carbon
#

oh

#

i have no idea, sorry

junior geyser
#

okay thanks anyway

river oracle
viscid carbon
#

ayyye y2k im stupid and need helps if your willing

river oracle
#

not atm I'm busy

viscid carbon
#

okay

junior geyser
#

I have tried java 17, 21, and 22

/lib/jvm/jre-21-openjdk/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped

river oracle
junior geyser
#

same error

#

I also cannpot get the gui to open

#

what is the command to open the gui?

river oracle
#

double click the jar if you don't have a .desktop file to open them use java -jar BuildTools.jar --gui

#

though I'd just reccomend making a .desktop file for jars

junior geyser
#

Same error with gui

#

as expected

#

I am going to downgrade build tools and see if it helps

river oracle
#

clear your caches

#

send the full buildtools log

#

?paste

undone axleBOT
river oracle
#

show the debug information as well in a paste too please

junior geyser
river oracle
#

show your debug info too please

junior geyser
#

What is the flag for debug info?

river oracle
#

there is no flag

#

click the Debug Info in the GUI

#

bottom left hand corner

junior geyser
#

ah I see

#

k 1 sexx

#

cc

#

oops

eternal oxide
river oracle
#

almost definitely

eternal oxide
#

ignore me I was scrolled up

river oracle
#

but debug info shuld show if they have other versions installed

junior geyser
#

I have like 5 other java versions installed

#

I onder if its cause they are the red hat varients?

river oracle
#

please send Debug Info in a paste and we'll go from there

junior geyser
#

Yep working on that. Running it rn just loading

#

If I try using java 8, it just stops me right away, saing unsupported java version

#

java 21 and 22 get stuck here

river oracle
#
  1. You have all JRE's you can nolonger buildand run spigot with a JRE
  2. Java 22 is still a bit buggy especially on windows, not sure about linux, but I've seen nothing but issues

Download a JDK version for java 21. Ensure it is selected when compiling.

junior geyser
#

Oh shit they use the microsoft one now right?

river oracle
#

the provider doesn't matter

#

just don't use a JRE

#

JDK is required

junior geyser
#

oh, huh

#

is that change recent?

river oracle
#

as of the switch to 1.20.6 I believe

#

JRE's are trash anyways

#

especially if you are a developer having a JRE is worthless

#

as a user JRE's also just limit the software you can run

junior geyser
blazing ocean
remote swallow
#

thats a jdk technically

junior geyser
#

sudo /lib/jvm/java-21-openjdk-21.0.4.0.7-2.fc40.x86_64/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped

river oracle
#

DONT RUN WITH SUPE RUSER

#

BAD

#

NAUGHTY

junior geyser
junior geyser
river oracle
#

for some reason buildtools thinks you're using java 17 here's what I'd do

#

open the GUI

#

and explicitly set the jar

#

its possible maven may be falling back to your default JRE which is at 17

#

that or set the JAVA_HOME env var in your terminal once around for this

junior geyser
#

Oh thats smart. Okay Ill give that a shot. Can I enable remapped from the gui?

river oracle
#

yes its under options

#

same menu where you'll see the JDK override

junior geyser
#

Okay ill give it a shot

river oracle
#

if that doesn't work change your JAVA_HOME to direct towards your java 21 JDK in the command line

#

then run buildtools with java should pickup on the change automatically

junior geyser
#

Kniw the command to do that off the top of your head?

river oracle
#

just set a variable in bash

junior geyser
#

okay Ill try the tool first

river oracle
#

I must go

#

best of luck

junior geyser
#

Okay thanks for the help ❀️

remote swallow
junior geyser
rough hinge
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.Furnace (org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState and org.bukkit.block.Furnace are in unnamed module of loader 'app'
this error happen when the block isnt furnace?~

slender elbow
#

check if it's a furnace before casting

#

blockstate instanceof Furnace
or check the block Material before getting the block state

rough hinge
#

can i remove from the cache while i interact?

Collection<Furnace> furnaces = furnaceService.getAll();

    for (Furnace furnace : furnaces) {

        Block block = furnace.getLocation().getBlock();
        
        if (block.getType() != Material.FURNACE && block.getType() != Material.BURNING_FURNACE) {
            furnaceService.remove(furnace);
            continue;
        }


@Override
public Collection<Furnace> getAll() {
    return cache.values();
}

@Override
public void remove(Furnace furnace) {
furnaceRepository.delete(furnace);
cache.remove(furnace.getLocation());
}

slender elbow
#

not like that, you should use either the collection's Iterator (and call Iterator#remove to remove the "current entry"), or use something like Collection#removeIf

rough hinge
#

isnt possible with iterator then

slender elbow
#

uh you could pass the iterator instance but that's yuck

#

alternatively, you can copy the collection before iterating it

rough hinge
#

i ll make this @Override
public void remove(Furnace furnace, boolean cacheRemove) {
furnaceRepository.delete(furnace);
if (cacheRemove) cache.remove(furnace.getLocation());
}

#

and use iterator.remove

#

and remove method with false boolean on 2ΒΊ arg

#

its correct right

slender elbow
slender elbow
#

it feels error prone, what if you forget to pass the correct value you're intending to pass?

junior geyser
rough hinge
#

I prefer it this way. I'm not going to create a new list for this

slender elbow
#

another solution is to have a method in furnace service, like, "removeStaleEntries" or something, that calls removeIf on the values and such

#

I mean you don't have to create a new collection, it's just one option out of many

#

if you're okay with that solution, go for it

rough hinge
#

thx

gentle inlet
#

How could i make something like this?

young knoll
#

Is that a plugin?

river oracle
#

fully

#

oh well if restarting fixed it W

junior geyser
# river oracle clear your caches

I think that is what it was. They were in like some temp folder. I kept deleting them, but I dont think they were actually being removed. Restarting allowed me to remove them all the way. Maybe cause I ran as super user to test one time... ? Not sure. Working now though

humble lynx
#

Nvm, would be hard to get the hover message I think

gentle inlet
humble lynx
#

Yeah actually reading into it, hover and click events are supported in books, although you can't force the client to open a book.

Are you right clicking an item to open the GUI?

humble lynx
#

Is it a 1.8 server? I think that version you could force players to open a book

humble lynx
#

Tbh I haven't looked into it too much. I just remember trying to open a writable book for a player. Maybe it works for already written books

gentle inlet
humble lynx
river oracle
#

Its so strange

#

Client moment

humble tulip
#
[ERROR] Failed to execute goal on project BetterShops: Could not resolve dependencies for project me.saif.bettershops:BetterShops:jar:0.0.1: The following artifacts could not be resolved: me.saif.bettershops:API:jar:1.0-SNAPSHOT (absent): me.saif.bettershops:API:jar:1.0-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
#

I'm thinking API is not being built before dependencies are being resolved

#

how do I ensure API is built first. I can do it via intelliJ but i want it such that if the repo is cloned, anyone can just build it

#

i'm running mvn clean install btw

#

oh my god

#

i swapped the order of API and Plugin in the parent pom

#

putting API firt fixed it

wet breach
# humble tulip putting API firt fixed it

In case you are unaware, but you can place dependencies needed for modules in the parent pom and therefore not duplicate your dependency lists as well as ensuring projects sharing a dependency all have the same version.

wet breach
#

Love setting up module projects because of that

dawn flower
#

how do you create an empty pdc?

drowsy helm
lost matrix
muted otter
dawn flower
#

also, ty

orchid trout
#

what is this

#

whys the version like the github commit id thing

wraith dagger
#

guys

#

how to make awsd rideable entity in 1.12.2?

#

?mappings

undone axleBOT
alpine urchin
orchid trout
#

not mine

#

random repo i found

lost matrix
sterile breach
#

hi can I ask about NMS code here?

alpine urchin
lost matrix
alpine urchin
wraith dagger
#

i've tried thiss

#

but somehow the method og g return to float

#

nolonger null

sterile breach
lost matrix
wraith dagger
sterile breach
#

to "reload a chunk" (I mean change its blocs) sending a new chunk data packets is sufficient or I need to unload it?

sterile breach
lost matrix
lost matrix
#

Spigot has methods to send blocks to the client

sterile breach
#

just to the client (not real chunk content?)

wraith dagger
#

bruhhh ;-; i just didn't know where is the g() in spigot 1.11 gone when update to 1.12

#

this is 1.11

sterile breach
sterile breach
#

I should use nms so

lost matrix
# wraith dagger this is 1.11

Reading decompiled code makes it even more difficult.
Im so glad i dont have to work with ancient versions like that.

lost matrix
wraith dagger
#

ohh

#

i found it

#

brrr

#

it changed to a()

#

and add other float

sterile breach
lost matrix
#

That is going to be unimaginably expensive

#

This might be a really really tricky system to develop

#

How do you track those chunks?

sterile breach
#

sure no replay plugins really restore the chunk

sterile breach
# lost matrix How do you track those chunks?

first I wanted to use packet events I intercept all chunks load packets and store it if I start a replay I get the packet to resend it to replay the problem here, is that if between the time the chunk packet is loaded and the chunk is modified I have to update this packet but manipulating chunk packets is quite complex and I would have liked to do it differently, then I thought of nms with this code (I had to recreate a similar chunk to send it but it didn't seem to work) and here I am

(I can show you the nms code if you want)

floral drum
#

One way to do it @sterile breach is have the world presaved as a slime world, Load it when you need it. Then do what hypixel does and track when blocks are broken, and when blocks are placed.

#

just the basic explanation

#

They of course do more than just blocks

sterile breach
#

Ihv already done the replay code itself the problem is the map

floral drum
#

What kind of map is it? Skywars? Generated?

sterile breach
#

generated

#

and player can tp

floral drum
#

ah I see

sterile breach
#

in other worlds

floral drum
#

Yeah depends on how big the world is. But I would still recommend slimeworldmanager or whatever to store the world in.

#

It’s a very optimized format to store worlds in

#

And they load quite fast, in memory

sterile breach
#

to replay I tp my player here and replay on the map

lost matrix
#

We are talking about possibly terrabytes of data here. Its not viable.
The only way to handle this, is to save deltas, and not the entire world.

sterile breach
#

so I should save chunks

karmic falcon
#

hi, can somebody help me i get this exception whenever i try loading in my world Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\\users\\oussama\\desktop\\iyad\\minecraft server\\plugins\\eftm\\eftm worlds\\eftmtemp at worldCreator.createWorld(); I dont think the world is the problem cuz i really just downloaded a parkour world for testing and renamed the main folder to eftmTemp and placed it in the correct path, this is the only exception im getting.

lost matrix
#

In other words, the deltas

sterile breach
karmic falcon
#

maybe the tick counter

lost matrix
lost matrix
sterile breach
lost matrix
sterile breach
#

ah yes coreprotect can do the job

lost matrix
#

You would have to read their DB and apply the actions retrospectively on current chunks. You will have to do a lot of multithreading and async programming to make this not straight up crash your server. And a very clever format to keep the entire replay in memory.

#

I hope you have a ton of experience, because this sounds like a very advanced project

sterile breach
#

sure

sterile breach
#

make a field X and Y and show in the config the formule like this

(X* level) + (Y * difficulty)

lost matrix
#

Our fellow dev boxbeam created a really nice expression parser

#

You can literally do something like:

attack-power: "cos(0.5 * level) * log(3.5 * difficulty^2)"

etc

#

This dependency is meant to be shaded. So you will basically "copy" the entire code into your own project, making it available on
runtime. The server owner doesnt have to do anything.

#

Just add those two entries and make sure you have the maven shade plugin installed in your pom.

karmic falcon
#

i removed every space

lost matrix
karmic falcon
wraith dagger
#

guys

#
if (this.passengers != null) {
            EntityLiving passenger = (EntityLiving) this.passengers.get(0);
            this.yaw = passenger.yaw;
            this.lastYaw = this.yaw;
            this.pitch = (passenger.pitch * 0.5F);
            setYawPitch(this.yaw, this.pitch);
            this.aN = this.yaw;
            this.aP = this.aN;
            float speed = 0.4F;
            this.k(speed);
            Float speedmultiplicator = 3F;//Here you can set the speed
            sideMot = passenger.be * speedmultiplicator;
            forMot = passenger.bf * speedmultiplicator;
            if(forMot <= 0.0F) {
                    forMot *= 0.25F;// Make backwards slower
            }
             java.lang.reflect.Field jump = null; //Jumping
                try {
                    jump = EntityLiving.class.getDeclaredField("bd");
                } catch (NoSuchFieldException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (SecurityException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
                jump.setAccessible(true);

                if (jump != null && this.onGround) {     // Wouldn't want it jumping while on the ground would we?
                    try {
                        if (jump.getBoolean(passenger)) {
                            double jumpHeight = 0.5D;     //Here you can set the jumpHeight
                            this.motY = 1D;      // Used all the time in NMS for entity jumping
                        }
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();
                    }
                }```
this is my code for making rideable entity in 1.12.2
#

the left, right move and jump working

#

but i don't know why

void sigil
#

Anyone know how to use external dependencies w NBT-API

wraith dagger
#

the move forward and move backward it not

lost matrix
void sigil
lost matrix
# void sigil yeah

Then just add NBT-API as a dependency to your project (with the provided scope), and install npc-api on your server as well.

lost matrix
lost matrix
# void sigil I don't need to shade it right?

Nope, the rule is:
If its a plugin you have to install on your server, then you dont shade it.

Otherwise the classes will be present multiple times on the classpath. Once from the original plugin and once from you.

karmic falcon
lost matrix
karmic falcon
karmic falcon
#

but didnt wokr

#

gave me same thing

lost matrix
#

Your File declaration is kinda scuffed

karmic falcon
#

whats wrong with it

lost matrix
#

The double backslash is unusual. I would recommend using nio

karmic falcon
lost matrix
#

Then name of your world is
"c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm_worlds\\eftmtemp"

#

That is not a valid name for a world

karmic falcon
#

whyy

lost matrix
#

Im just realizing what you are doing right now

#

Because thats not a world name, thats an entire path.
A valid world name would be "world" or "cool-server-world", but not "c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm_worlds\\eftmtemp"

karmic falcon
#

but but but

#

they said i could use a directory instead of a name

#

if i want to not have my world in the main server files

lost matrix
#

The WorldCreator takes in a String. And this String is the name of your world. Not the path to your world folder.
The world folder is defined when the server starts.

karmic falcon
#

wait a sec so i have to pace the eftmTemp where?

lost matrix
#

One moment, let be check if you can use a relative path there

#

But you can for sure not use an absolute path

karmic falcon
#

aight thnx man

#

imma try with a relative path

#

didnt work

wraith dagger
#

it float f2 0.0

#

but when i set 1

#

it automatic move without my control forward

karmic falcon
#

Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: minecraft:plugins\\eftm\\eftm_worlds\\eftmtemp

lost matrix
#

Nope, you are bound to the world container

#

So the name is a folder in your worldcontainer

#

No relative path allowed

karmic falcon
#

so where do i place the world

rough ibex
lost matrix
rough ibex
#

multiplicator

lost matrix
rough ibex
#

you mean a multiplier

ancient forge
#

yo is a good way of getting better finding plugins and almost remaking them

karmic falcon
void sigil
#

"NoClassDefFoundError"

lost matrix
lost matrix
rough ibex
#

I've found success in having an idea and just working on it

#

doesn't have to be the best work but just work

void sigil
karmic falcon
#

@lost matrix This worked!!! thnx man

void sigil
lost matrix
void sigil
#

I just use the build thing and it goes to the target

wraith dagger
#

bruhh idk why the forward and backward not working hmmm

void sigil
#

Its like directly in my folder

wraith dagger
#

but right and left side working

lost matrix
#

So... do you build artifacts or do you run maven goals?

void sigil
#

Artifacts

lost matrix
#

So you could also just delete your pom because you dont want to use maven.
I swear this comes up twice a day. I need to write a ?maven command

lost matrix
# void sigil Artifacts

When using maven

  1. Never manually add any dependencies/artifacts to your project
  2. Always manage everything through your pom
  3. Always build using maven goals

Specifically for you:
Go to the top right of your IDE
Click on the maven symbol
Open your project name there
Open Lifecycles
Run clean once
Run install once

lost matrix
#

And from now on, you only compile using maven lifecycles

wraith dagger
#

@lost matrix i found out the issue

#

the new 1.12.2 a() got new f2

#

it was the forward

#

so just use the passenger f2 and set for vecile and done

#

thank you so much @lost matrix

lost matrix
#

Glad i could help

stray monolith
#

Can someone help me make a clickable placeholder for essentials

rough ibex
#

you need a class that extends PlaceholderExpansion()

#

override persist, onRequest, getIdentifier, getAuthor, getVersion

#

onRequest is the big thing

#

player and params

stray monolith
#

Idek any of that

#

Could u possibly make me one up

pseudo hazel
#

placeholder has a page on how to make extensions

#

but I dont think this is really what you wanna do

rough ibex
#
override fun onRequest(player: OfflinePlayer, params: String): String? {
  if (params.equalsIgnoreCase("thing")) {
    return "some cool string"
  }
}
#

have fun bye

stray monolith
#

How does that do anything clicking a chat message

stray monolith
rough ibex
#

what do you want

#

a custom placeholder

pseudo hazel
#

he probably wants a clickevent

#

but for essentials

blazing ocean
#

huge W

pseudo hazel
rough ibex
#

no I just wrote it in kotlin

blazing ocean
#

based

rough ibex
#

because I looked at my own placeholder class

#

which is in kotlin

blazing ocean
#

good

rough ibex
#

I've been converted

eternal night
#

my condolences

rough ibex
#

it's great over here

fossil wigeon
eternal oxide
blazing ocean
rough hinge
#

wtf

eternal night
# blazing ocean no

you code in rust, your eyes presumably are already just a single burning pit of delusion

worthy yarrow
#

As someone who's had to go through salt water training on the eyes, I can say looking at rust code hurts more

rough drift
#

Whenever a player should die in an EntityDamageEvent, I cancel the event, set the damage to 0, set the fall distance to 0, however when they join back they still die?

worthy yarrow
#

Perhaps change the health instead of the damage or something

rough drift
#

example:

@EventHandler(ignoreCancelled = true)
public void onEntityDamage(EntityDamageEvent event) {
  event.setCancelled(true);
  event.setDamage(0);
  event.getEntity().setFallDistance(0);

  if(event.getEntity() instanceof Player player) player.kickPlayer("heyo");
}
eternal night
#

The average developer lifecycle

rough drift
#

nvm not stupid

#

code dumb

eternal oxide
#

Always blame the code, we are all victims.

rough drift
#

nah bro the hell is that nick 😭

hasty hamlet
#

how delete shadow text? 1.20.1 witch resource pack

blazing ocean
worthy yarrow
#

Are you the real rustMINE

blazing ocean
#

that guy uses 1.8

rough drift
#

ah so, you can't set an offline player's fall distance

blazing ocean
rough drift
#

makes fucking sense

onyx fjord
#

Any way to serialize something without the == type thingy?

hasty hamlet
blazing ocean
#

type annotation in yaml

onyx fjord
#

^

rough drift
#

ah

#

make your own

onyx fjord
#

too small project to do that

blazing ocean
#

snakeyaml

rough drift
onyx fjord
#

or maybe yall know how to deserialize a list of objects?

rough drift
hasty hamlet
#

After loading the shader into our resource pack, the item adder stops working

#

Even without a plugin

onyx fjord
blazing ocean
#

then ask their support

rough drift
pseudo hazel
#

what kind of objects

blazing ocean
#

we are not itemsadder

hasty hamlet
#

You need it in the resource pack, don’t you?

blazing ocean
blazing ocean
onyx fjord
#

map list returns Map<?, ?> and ConfigurationSerializable takes Map<String, Object>

worthy yarrow
#

rad do I sleep yet

onyx fjord
blazing ocean
#

how else is it gonna work? telepathically

worthy yarrow
#

It's only 4:09

blazing ocean
#

am?

worthy yarrow
#

yea

blazing ocean
#

nah

#

too early

worthy yarrow
#

It kinda is kek

#

Regular days be up til 7 or so

pseudo hazel
#

well you would ideally deserialize it reverse serializing it... like how did you serialize it?

#

or wait

#

i know what you mean

worthy yarrow
#

Would you tell me a bedtime story in a couple hours rad? :p

onyx fjord
rough drift
#

chat I just wondered why my code didn't work when I didn't even compile

onyx fjord
#

this is how i serialized it

worthy yarrow
#

I'd tell you one if you asked

rough drift
#

if I remember

blazing ocean
#

i don't ask tho

rough drift
#

YES I DID IT

worthy yarrow
#

But IF you did

rough drift
#

I FIXED MY CODE RAHHHHHHH

blazing ocean
#

dub

worthy yarrow
#

I don't ever have to fix my code because it always works 😎

blazing ocean
#

sure buddy

worthy yarrow
#

Don't ask me about legacy string parsing

blazing ocean
#

Bros name is TextComponentImpl{color=...

eternal night
rough drift
#

what could be the cause of my server straight up taking 15s to load on one specific world πŸ’€ whenever I respawn it takes so fucking long lmao

worthy yarrow
rough drift
#

its instant everywhere else lmao

onyx fjord
#

components for chat, string for anything else

blazing ocean
pseudo hazel
#

getList() should deserialize the objects for you

onyx fjord
#

do i just trust the casting

worthy yarrow
#

I am actually gonna go sleep tho, neurologist said I should be sleeping 10-12 hours a day...

pseudo hazel
#

yes

worthy yarrow
#

what a waste of time

pseudo hazel
#

if it doesnt cast its a plugin error

#

so it should always work

worthy yarrow
#

Though I should abide, I've been skimping the sleep since january

pseudo hazel
#

you can catch ClassCastException probably

worthy yarrow
#

Anyways bye everyone, love you guys, especially rad ❀️

blazing ocean
#

love you too

#

gn

stuck oar
#

ItemStack item = (plugin.getConfig().getItemStack("gkits.gkitbuilder.option1.builderspick.item"));

anyone know why this only returns null?

#

soryy i couldnt format i dont have the button on my keyboard

eternal oxide
#

probably a bad path, or the entry at that path is not an ItemStack

stuck oar
#

idk howe to make it an itemstackk

#

the entry is just

#

item: Material.DIAMOND_PICKAXE

rough ibex
#

yeah that's wrong

stuck oar
#

oh

rough ibex
#

that's for deserializing ItemStack

eternal oxide
#

it has to be a serialized ItemStack

stuck oar
#

whats that

rough ibex
#
thing:
  apple:
    ==: org.bukkit.inventory.ItemStack
    type: IRON_DOOR
    meta:
      ==: ItemMeta
      meta-type: UNSPECIFIC
      display-name: grey leno
      lore:
        - Lore 1
        - Lore 2
        - Lore 3
#

essentially writing an ItemStack class data into a yml

stuck oar
#

oh alright thank you

#

wityh the display name i should be able to do colors right?

rough ibex
#

I suppose

stuck oar
#

i could just use itemmeta tho

#

i think

#

what are the ==:'s

pseudo hazel
#

its the class serialization

stuck oar
#

oh alr ty

pseudo hazel
#

this is automatically written and read by spigot

#

you just have to either provide or get the itemstack back depending on what you want

rough ibex
#

== is special and means the class it's talking about

#

the other keys are just fields

stuck oar
#

ok tyvm imma try it now

tardy delta
alpine urchin
#

yeah

#

deal with it

#

more functionality but functions worse

#

jk

#

had throw in some word play

tardy delta
#

wtf happened with scrolling on discord

#

it always brings me back to the same place

blazing ocean
#

real

torn shuttle
#

uh oh

#

well well well

#

if it isn't the consequences of my own actions

blazing ocean
torn shuttle
#

in my defense I modeled this after blockbench which makes sense since you make models with blockbench

#

problem is blockbench doesn't provide data when it is default

#

even though it is significant

#

well... shit

#

ngl blockbench is kind of a messy system

#

the way it handles storing data is baffling

slate surge
#

How to kick a player from an asyncmethod?

#

speicificly AsyncPlayerChatEvent

slender elbow
#

scheduler, kick sync

torn shuttle
#

bad data? just catch it in post-processing

eternal night
#

why no replay mod xD

torn shuttle
eternal night
#

yea the camera flight looks so cool and then it itches out at the end

torn shuttle
#

I've actually never used that mode before, testing it real quick it actually doesn't work all that well because the final encounter is doing too much packet trickery

#

also this shot was mostly for my team to brainstorm some stuff, not for any kind of serious use

rough hinge
#

What should I do if someone is in a web and damages a player? Should I control the webs on the map and walk through them and if there is a player in the web, deal damage? Or should I walk through all the players and if any are in a web, deal damage?

torn shuttle
#

yeah I'll be recording an actual video today

#

kind of is a shame about the replay mod though

pseudo hazel
stuck oar
#
        ==: org.bukkit.inventory.ItemStack
        type: DIAMOND_PICKAXE
        meta:
          ==: ItemMeta
          meta-type: UNSPECIFIC
          display-name: &cBuilder's Pickaxe
          lore:
            - ChatColor.AQUA + "Builder's GKit" + ChatColor.WHITE + "Item"

anyone know how i would color code the lore and the display-name idk how to

eternal oxide
#

its yaml not java

stuck oar
#

sorry if im being dumb or anyth i started this yesterday haha what does that mean?

pseudo hazel
#

you cant write ChatColor.whatever or do plus operations (or any operation)

torn shuttle
#

oh

stuck oar
#

is there any way to color it

#

from there

torn shuttle
#

actually the replay mod might be viable

stuck oar
#

or do i have to edit itemmeta

eternal oxide
#

you also can;t use &c as it will not be translated when deserializing the ItemStack

pseudo hazel
#

yes use the & or section symbol or whatever

chrome beacon
#

Β§

#

Β§c

stuck oar
#

alr ty

chrome beacon
#

for example

pseudo hazel
#

or some custom method and then replace it in your code

stuck oar
#

isnt that like a mac symbol

#

i dont havce that on my keyboard

#

ill keep it copied

pseudo hazel
#

noone has

chrome beacon
#

I do

stuck oar
#

oh

pseudo hazel
#

its annoying af

stuck oar
#

its a mac thing i think

shadow night
#

I have it on my keyboard as shift + 3

#

Qwertz on top

eternal oxide
#

just copy/paste

pseudo hazel
#

what

chrome beacon
pseudo hazel
#

where is your hashtag

chrome beacon
#

shift + 3

eternal oxide
#

its not on a UK keyboard

pseudo hazel
#

its not on my qwerty either

chrome beacon
stuck oar
#

are you on an imac?

chrome beacon
#

no

stuck oar
#

oh

pseudo hazel
#

wtf is 1/2

shadow night
#

Β½

young knoll
#

A fraction

#

Kek

chrome beacon
#

Β½

#

^^

stuck oar
#

thats a really random thing to have ona keyboard

eternal oxide
#

weird keyboards

stuck oar
#

its the most common fraction but still

pseudo hazel
#

yeah

shadow night
#

This is my keyboard layout

pseudo hazel
#

when did you ever use that

stuck oar
#

bro has degrees

pseudo hazel
#

xD

#

these layouts are maniacal

young knoll
#

Meanwhile mobile

stuck oar
#

mines just a 60% keyboard

young knoll
#

I can type a bunch of stuff via long-pressing

torn shuttle
#

amateurs.

stuck oar
#

cant wait until im home and have arrow keys again

shadow night
young knoll
#

’§°«»¿

stuck oar
#

i hate having to press function for everything i do

torn shuttle
shadow night
#

Β£ay

pseudo hazel
#

its like a sci fi HUD

stuck oar
eternal oxide
#

create the item via code, then config.set("path", itemStack);

stuck oar
#

oh i didnt kjnow u could do that

#

ty

shadow night
#

Imagine a plugin that would let you write any object into a bukkit config for debugging/testing purposes

echo basalt
#

omw to serialize Player

torn shuttle
#

omw to serialize server states

#

replay mod but for servers

young knoll
#

gson reflection magic:

slender elbow
#

Player implements ConfigurationSerializable :>

#

but it's for OfflinePlayer

rough hinge
#

dropitem or dropitemnaturally to player death? what the minecraft "use" for player deaths

rough hinge
stuck oar
#
        ==: org.bukkit.inventory.ItemStack
        type: DIAMOND_PICKAXE
        meta:
          ==: ItemMeta
          meta-type: UNSPECIFIC
          display-name: Β§bΒ§lBuilder's Pickaxe
          lore:
            - ""
            - "Β§bBuilder's GKit Β§bitem."
          enchants: "DIG_SPEED=5"```

how do i format the enchants: it keeps messing it up
#

ive tried without "" but it didnt owrk

#

wokr

eternal oxide
#

did you add it in game then save?

stuck oar
#

illl try that

eternal oxide
#

create the item exactly as you want its final form to be

#

then config.set to save it

stuck oar
#

how would i config.set from ingame would i have to make a command

eternal oxide
#

yes

stuck oar
#

alr

#

ty

#

will try now

eternal oxide
#

trigger however you want

pseudo hazel
stuck oar
#

rn my onnly way to acces config is trhoug my listeners

eternal oxide
#

getConfig().set

stuck oar
#

oh

inner mulch
stuck oar
#

how do i make it so that i can have a config.yml in the plugins folder

eternal oxide
#

getConfig().save()

#

is it not in yoru plugin folder?

#

then saveDefaultConfig();

#

at teh beginning of onEnable

stuck oar
#

ok will do now

#

is that all i need to do

#

will it make a config.yml now

eternal oxide
#

yes, if it's already in your jar, it gets copied to the plugin folder

stuck oar
#

alr ty

#

it didnt do it

#

nvm

#

it did

stuck oar
echo basalt
#

saveConfig

stuck oar
#
                ItemStack iteminhand = event.getWhoClicked().getInventory().getItemInHand();
                plugin.getConfig().set("gkits.gkitbuilder.option1.builderspick", iteminhand);

            }
#

thats what im doing rn

#

idk if its right

echo basalt
#

getCurrentItem can be null

#

so can itemInHand

#

make sure to validate your inputs

stuck oar
#

so check if it isnt null?

eternal oxide
#

also save it after set

echo basalt
stuck oar
#

oh

echo basalt
#

io in the main thread go boom

stuck oar
#

when i do getconfig().save it wants me to give it a file or smth do i just put config.yml

slender elbow
eternal oxide
#

he's only doing it to get a serialized stack

#

not for production code

stuck oar
#

what do i put in the save() arg

eternal oxide
#

nothing. getConfig().save()

stuck oar
#

it wants an argument

eternal oxide
#

or is it saveConfig()

#

yeah saveConfig()

stuck oar
#

its saveconfig()

echo basalt
stuck oar
#

ty

eternal oxide
#

Plugin#saveConfig()

stuck oar
#

ty it worked

shadow night
torn shuttle
lean ermine
#

?pdc

torn shuttle
#

Idk if the recording messed up or the server did but I got it working g correctly

shadow night
#

Actually, I wanna see a plugin that catches all packets and then replays them

rough hinge
#

help guys

shadow night
rough hinge
#

playermoveevent is bomb way

#

playermoveevent is called +1000 times per second brother

#

I prefer to cycle through all players on each tick

inner mulch
slender elbow
#

I mean you can listen to the move event and do some debouncing

hushed spindle
#

whats an example of a tooltip with ItemMeta#setHideTooltip()?

#

like durability or something?

#

or the box you get when hovering over it?

stuck oar
#
                event.getWhoClicked().getInventory().addItem(item);```

would this work with the * or na
hushed spindle
#

what are you expecting this to do

stuck oar
#

give me all of the items from gkits.gkitbuilder.option1

hushed spindle
#

oh, no

#

like

stuck oar
#

gotta do each one

#

or bcould i do a loop

hushed spindle
#

yeah you gotta loop

stuck oar
#

like a for each item in

#

ok

#

ty

hushed spindle
#

like

#

when you do ItemStack item you're assigning whatever your config has to that

#

an ItemStack is just 1 item

#

you cant assign several ItemStacks to 1 ItemStack

stuck oar
#

true

#

how would i do a for loop

#

like a

#

for item in bla

#

cause then

#

i could just

#

for each item in the *

hushed spindle
#

YamlConfiguration#getConfigurationSection#getKeys()

stuck oar
#

it gives me it

#

why the hasghtag

hushed spindle
#

in getConfigurationSection you pass gkits.gkitbuilder.option1

#

and its keys will contain every subsection in it

#

oh hashtags are used to convey you need an object of the class there

eternal oxide
#

plugin.getConfig().get("gkits.gkitbuilder.option1").getValues(true).forEach...

hushed spindle
#

yea

eternal oxide
#

or something close

hushed spindle
#

for future reference, because you will get this more

#

when people do like ItemStack#getItemMeta()

#

we mean you need an ItemStack instance on which you do .getItemMeta()

#

not literally "ItemStack#getItemMeta()"

stuck oar
#

ty guys

hushed spindle
#

anyway back to my question, does anyone have an example of a tooltip in the context of ItemMeta#setHideTooltip()

#

durability/the box you get when hovering over an item or something else

pseudo hazel
#

what?

#

like meta.setHideTooltip(true)?

#

there is nothing more to it I think

hushed spindle
#

no

#

like what is a tooltip

#

what is it referring to

pseudo hazel
#

its to hide the whole text box

hushed spindle
#

so the thing you get when hovering over an item

pseudo hazel
#

like if you want nothing to appear at all

#

yes

hushed spindle
#

oh interesting

#

cool feature

pseudo hazel
#

like you can hide the whole popup

#

yeah its pretty new iirc

knotty meteor
#

Does someone know if this is a public command handler?

/head is for example a main command to put a item on your head
And /head main has the same feature
But with /head help you get the help menu with that commandhandler, so you also can have multiple subcommands

pseudo hazel
#

sounds pretty easy to do..

tardy delta
#

uhu

pseudo hazel
#

if its open source you can see if its a library they used

knotty meteor
#

This is on a server i play but every command in their server core is with this command handler
So i was wondering if it was a public command handler they used because it seems cool

pseudo hazel
#

i see

#

well idk xD

#

try asking the server maybe

#

could be custom

knotty meteor
#

Yeah i also think it is custom or a edit of a existing one but i will ask it πŸ˜‚

blazing ocean
rough hinge
#

yes

#

@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {

    Player killPlayer = event.getEntity().getKiller();

    System.out.println("a");

    if (killPlayer == null) {
        System.out.println("b");
        return;
    }
#

why killplayer is null if i kill him?

royal heath
#

That's the entity that killed him. Was he killed by a player?

rough hinge
#

yes

royal heath
#

and b is printing?

rough hinge
royal heath
#

Try EntityDamageByEntityEvent and check if health less than or equal to 0

rough hinge
#

😭

#

I would like to know why this doesn't work

#

maybe becaused spigot.respawn is called on other playerdeathevent?

royal heath
#

If you have multiple listeners it might cause issues, but if respawn is called before getKiller might turn null