#help-development

1 messages · Page 1676 of 1

proud basin
#

yea

#

assets/nitrous/background.png

eternal oxide
#

ok, then so long as you load it correctly, specifying the modid it should work

proud basin
#

🤷

eternal oxide
#

new ResourceLocation("nitrous", "background.png");

proud basin
#

oh? I don't need to put assets/nitrous?

eternal oxide
#

You need to read teh first thread I linked you to

#

4th post, it explains it all

proud basin
#

hm

eternal oxide
#

if its still not workgin, open your jar and make sure you have an assets folder in the root

exotic obsidian
#

hello guys

#

who's have experience with mysql?

dry pike
#

How would I get a direction vector with 2 locations. Im looking for the direction from fromLocation to toLocation.

Im using this code;
toLocation.subtract(fromLocation).toVector();

But the direction dosent seem to be correct.

eternal oxide
#

toLocation.toVector().subtract(fromLocation.toVector());

dry pike
#

Let me give it a shot, thanks

exotic obsidian
#

guys if i want to store a value from player with mysql what the command i should to use?

eternal oxide
#

That all depends on your sql table

exotic obsidian
#

the types i used its boolean

eternal oxide
#

That data seems very minor. do you really need it in sql?

exotic obsidian
#

yup

proud basin
#
[20:47:29] [Client thread/WARN]: Failed to load texture: nitrous:background.png
java.io.FileNotFoundException: nitrous:background.png
``` ugh
eternal oxide
#

file not found? it shoudl be looking for a resource in teh jar

proud basin
#

🤷

dry pike
#

Hmm that didn't work either :/. That gave me no direction I'm pretty sure. So I'm trying to generate a location that is in a direction to another location at a specified distance... Basically a waypoint for pathfinding over long distances.

Here is the class;
https://pastebin.com/MCJyEmX3

It seems that the direction is where the problem is, I'm calculating distances between locations to debug, on one access it works. but if i move diagonally to the other side of the the destination location the generated location actually gets further away from the destination, which I assume is because the direction vector is still facing the same direction. I'm no good with vectors and still very new to them but any help would be appreciated.

eternal oxide
#

final Vector vector = targetLoc.toVector().subtract(sourceLoc.toVector()); Definitely works

dry pike
#

Just noticed that from google. toLocation.toVector().subtract(fromLocation.toVector());

eternal oxide
#

I use it in a lot of code

proud basin
#

man this is dumb

eternal oxide
#
    /**
     * Pass a Projectile and a destination
     * to set its direction and new velocity.
     * 
     * @param projectile
     * @param targetLoc
     * @return
     */
    public void setTarget(final Projectile projectile, final Location targetLoc) {
    
        final Vector velocityVector = targetLoc.toVector().subtract(projectile.getLocation().toVector());
        velocityVector.normalize().multiply(projectile.getVelocity().length());
        projectile.setVelocity(velocityVector);
    }```
proud basin
#

It's like it straight up ignores it

eternal oxide
#

make sure 100% the resource exists in teh correct location inside your jar

proud basin
#

it is

eternal oxide
#

um, assets.nitrous?

proud basin
#

it's at the top

#

yea

#

don't you make a folder for both?

eternal oxide
#

nitrous should be a folder inside assets

proud basin
#

it is

eternal oxide
#

ok

proud basin
#

but since there is nothing else in assets

#

it does that

eternal oxide
#

and it is actually copied correctly inside the jar?

proud basin
#

yea

#

I can check again

eternal oxide
#

as a test try new ResourceLocation("nitrous", "nitrous/background.png");

proud basin
#

ok

#

nope

eternal oxide
#

well all I find says just background.png should be correct

#

you did set your ModId to nitrous?

#

as nitrous is not what you said it was before

proud basin
#

yea

eternal oxide
#

then from what I can see it should be working

ancient plank
#

modding is on a different level of wack

proud basin
#

tried different image still doesn't work

eternal oxide
#

it won;t be the image, its either the name you set for teh mod or, well no idea. from what you have told me its correct

proud basin
#

i tried a diff name

#

I also get this ```java
[21:06:06] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu
[21:06:11] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu
[21:06:22] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu

eternal oxide
#

make the name a static final, defined in your main so you can just use the variable elewhere

proud basin
#

make ResourceLocation name static?

eternal oxide
#

no your modId

proud basin
#

in my gradle...

eternal oxide
#

in your mod

proud basin
#

so you just want me to do public static final MODID = "nitrous";

eternal oxide
#

so you only change it in one place and don;t have to reype it

#

yes

#

then use that everywhere you need the modId

proud basin
#

hm ok

#

well didn't fix it

#

although I wasn't expecting it to fix it

eternal oxide
#

from this point I'd need to see code to spot any thing wrong

#

I've shown you how it "should" work

proud basin
#

What's your github name?

eternal oxide
#

the same as here

ancient plank
#

ECoral

proud basin
#

I sent you something

eternal oxide
#

got it

#

Pretty sure most of that texture loading should be in the init() method not render

#

render is called a lot and you don;t want to be loading the texture every time you render

#

however I see no issues with yoru code so far

dry pike
#

When normalizing a vector it basically just becomes a direction correct? Then after multiplying by say 10.0 the vector should be 10 blocks away in that directions?

eternal oxide
#

normalizing limits its length to 1

#

yes, multiply would make it 10 blocks, IF you are facing in one specific direction

dry pike
#

im getting results over 100 blocks away grr

eternal oxide
#

normalize the result of the subtraction

dry pike
#

yes

eternal oxide
#

then multiply

#

it can;t be beyond 10 blocks then

dry pike
#

private static Vector getDirectionToLocation(final Location fromLocation, final Location toLocation) {
return toLocation.toVector().subtract(fromLocation.toVector());
}

private static Location getLocationAtDistanceWithDirection(final Location location, double distance, final Vector direction) {
    return direction.normalize().multiply(distance).toLocation(location.getWorld());
}
#

How do i paste code

eternal oxide
#

please wrap in 3 `

proud basin
#

oh

dry pike
#

3` private static Vector getDirectionToLocation(final Location fromLocation, final Location toLocation) {
return toLocation.toVector().subtract(fromLocation.toVector());
}

private static Location getLocationAtDistanceWithDirection(final Location location, double distance, final Vector direction) {
    return direction.normalize().multiply(distance).toLocation(location.getWorld());
}3`
proud basin
#

it's a white screen

eternal oxide
#

three ` not 3` 😉

dry pike
#

lol sorry

#
        return toLocation.toVector().subtract(fromLocation.toVector());
    }

    private static Location getLocationAtDistanceWithDirection(final Location location, double distance, final Vector direction) {
        return direction.normalize().multiply(distance).toLocation(location.getWorld());
    }```
eternal oxide
#

return location.add(direction.normalize().multiply(distance));

dry pike
#

ahhhh

#

that makes sense

eternal oxide
proud basin
#

no errors

eternal oxide
#

I'm seeing nothign wrong in your code

median anvil
#

so for a big network server is it recommended to create your own permissions/rank plugin or just use luckperms?

eternal oxide
#

LP or GroupManager.

#

LP if you are talking a BIG network

median anvil
#

I'm trying not to rely to heavily on 3rd party plugins

eternal oxide
#

GM has been here since the year dot. LP is newer and handles larger networks better

median anvil
#

yeah, the goal is thousands of players.

#

I mean, I'm not expecting thousands of players immediately, but hopefully the server makes it years. basically everything is being made custom

#

no thousands on one server either, its a network, so multiple servers on one network, with ideally one database

eternal oxide
dry pike
#

@eternal oxide Thanks for the help man, its nice not getting screamed at for not knowing something 😛

eternal oxide
#

everyone is a noob with vectors to start.

dry pike
#

Right, they are like magic

median anvil
eternal oxide
#

pretty much, till you get your head around the 3d world space

dry pike
#

yea

formal dome
#

the database drivers in the spigot api are for MySQL right

eternal oxide
median anvil
#

oh okay lol

eternal oxide
proud basin
#

wym

#

like at the top

eternal oxide
#

yep, in your build folder it looks like its nested under main

#

whats it look like in your final jar

proud basin
#

yeah

eternal oxide
#

Then I'm afraid I can;t help any further. From what I can see everything is correct.

#

I see nothign wrong in your code

ancient plank
#

kfc

#

🐔

median anvil
#

is there a way to change nametags?

#

player nametags

#

something with scoreboards or something right?

eternal oxide
proud basin
#

The fix was only removing the /

#

and I never had a slash

eternal oxide
#

Not quite, it was how he was using the class

#

specifying the modId and location

proud basin
#

I was doing that before though

eternal oxide
#

yep

#

Just pointing out the error is identical

proud basin
#

oh

eternal oxide
#

If you manage to find the fix let me know

proud basin
#

not sure why the background is white though

eternal oxide
#

white? you have the texture not erroring now?

proud basin
#

no errors

eternal oxide
#

oh

#

just blank

proud basin
#

wait

#

no I do

#

i am just blind

#

same thing

#

java.io.FileNotFoundException: nitrous:kfc.png
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?]

#

but it is just blank

eternal oxide
#

it will be, it says it can;t find the resource

proud basin
#

yea

#

honestly this is pretty dumb that this is happening

eternal oxide
#

in the runnable are you getting any blocks or checking any locations?

#

Well your error says you are triggering a new chunk load while the chunk is already being created in another thread

#

that runnable can;t have anything to do with it

#

I'm going to assume you have set a getCore()

#

then no I don;t see its possible

#

Not with the code you have shown

#

do you have ANY world/chunk/populator listeners?

#

a different error is good

proud basin
#

well

eternal oxide
#

um, are you running on windows?

#

you

#

is your server running under windows?

#

ok, make sure you only have one server instance running

#

./hubworld-2409fcd5-20be-45e7-9c8e-9f5aac03b105 has a session lock from another minecraft instance

#

perhaps from an earlier crash

proud basin
#

Yeah so right now its a white screen and if I full screen it turns black

eternal oxide
#

That just means there is no texture loaded/applied

proud basin
#

right

#

well at least now it's not what it was before

#

wait does the image have to be a jpeg?

eternal oxide
#

not from what I've seen

proud basin
#

let me try

#

okay yea nvm

#

I literally done everything

eternal oxide
#

Yep I see no reason for your issue. You will have to find some Forge expert

proud basin
#

You think I will find any here

eternal oxide
#

doubtful

proud basin
#

well I guess thanks

eternal oxide
#

stop server, delete any session.lock files

quaint mantle
#

how can i read a file including semicolons

#
    final var name = prompt();
    return name;
String text = reader.lines().map(String::trim); // removes all ending semicolons
eternal oxide
#

tried a scanner?

quaint mantle
#

that should work, didnt think of it

quaint mantle
#

spaces, etc.

#

i dont feel like making a pattern

#

why does it remove semicolons anyways

eternal oxide
#

else you will have you use a reader

quaint mantle
eternal oxide
#

ah sorry yep

quaint mantle
#
// Before
call getName() {
    final var name = prompt();
    return name;
}
// After
call getName() {
    final var name = prompt()
    return name
}
        InputStreamReader scanner = new InputStreamReader(Assess.class.getResourceAsStream(args[0]));
        StringBuilder builder = new StringBuilder();

        while (scanner.ready()) {
            builder.append((char) scanner.read());
        }
#

its doing \r's

#

i gotta make my own implementation

eternal oxide
#

why not nextLine()?

quaint mantle
eternal oxide
#

removes spaces?

quaint mantle
#

mhm

#

oo

#

found an apache utils class

#

StringUtils.chomp(txt, "\r")

#

we arent obligated to help you

#

im asking for help aswell

#

be patient

eternal oxide
#

Which website?

quaint mantle
#

works fine for me

eternal oxide
#

do you mean sigot or actually spogit?

quaint mantle
eternal oxide
#

spigot has been up fine all week

#

refreshing didn;t clear it?

#

You get a new challenge page when you refresh

#

Open Date and Time by click the Start button, click Control Panel, click Clock, Language, and Region, and then click Date and Time.

Click the Internet Time tab, and then click Change settings… then check list Synchronize with an Internet time server with name Server : time.windows.com 761 and click Update now. Try that website again because that how i solved my problem with “This challenge page was accidentally cached and is no longer available”.```
cold tartan
#

is there a way to get a plugin to interact wiht a datapack? like read the lines and maybe add custom commands

eternal oxide
#

there are no datapack API methods in Spigot yet

cold tartan
#

dang

cold tartan
eternal oxide
#

You would have to experiment. I've not heard of anyone doing it

cold tartan
#

ok

worldly ingot
#

I thought about making API to load/unload datapacks but it's just such a sketchy thing to do

worldly ingot
#

Oh they do have one. Yeah that's kinda what I'd had in mind when I initially looked at datapacks but I opted against adding it for the sole purpose that plugins really shouldn't be intermingling with datapacks imo

hexed orbit
#

Hello everyone, everything good? can anybody help me? I would like to detect when any player hits the diamond block that the giant zombie is holding. It is possible?

#

Unfortunately I can't upload the image here, to get an idea

quaint mantle
#

How to put and use HikariCP in project?

chrome beacon
quaint mantle
chrome beacon
quaint mantle
#

this?

chrome beacon
#

Yeah

#

Alright so you're not using any of them

quaint mantle
#

😶

#

What should I do?

chrome beacon
#

I recommend creating a maven project since it will make things easier

quaint mantle
#

hey hey, wondering what the event is for when a player right clicks holding an item

#

NOT PlayerInteractEvent

#

just when they right click

chrome beacon
#

PlayerInteractEvent

#

That's it

quaint mantle
#

nvm it is

#

yeah

#

im just stupid

dusk needle
#

can somebody fix my plugin

quaint mantle
#

well Action.RIGHT_CLICK_AIR isnt working

#

for some reason

dusk needle
#

somebody made it for me but accidentally did for wrong version and never fixed it

quaint mantle
#

its not calling for Action.RIGHT_CLICK_AIR

#

which is what im doing, im right clicking the air..

robust forge
#

How do I check the direction a block is facing?

hybrid spoke
quaint mantle
hybrid spoke
quaint mantle
#

fair

outer sorrel
#

is there a way to check if the player is eating without an event?

crimson terrace
#

p.isEating()?

outer sorrel
#

o i forgot i was using 1.13 api for 1.8-1.17

crimson terrace
#

Ive only worked with 1.17 so far. Sorry.

outer sorrel
#

cant find iseating even with 1.17

crimson terrace
#

Weird. I was sure ive seen it

#

Make your own iseating by making a hashset with all players and a boolean and setting a players boolean to true while theyre eating? Just an idea

#

Would require a listener or 2 tho...

crimson terrace
chrome beacon
#

Check the 1.17 release post

chrome beacon
sullen marlin
#

you wont get a right click air event if not holding an item

#

this is noted in the documentation

#

it is impossible to detect because the client does not send a packet

chrome beacon
#

He's holding an item

hybrid spoke
chrome beacon
#

Aight

quaint mantle
#

hi yes sry all good

wraith apex
#

I've been experimenting with trying to get NPCs (Emulated players) to work with skins. Does the skin packet (using PacketPlayOutEntityMetadata) need to be sent before or after the EntityPlayer spawns? There seems to be a chance whereby the skin doesn't always get loaded on the NPC when you join the server. Interestingly, the skin doesn't work at all during a new client session the first time you join the server.

#
public void updateSkin(Player player)
{
    GameProfile gp = npcEntity.getProfile();
    
    if(this.npc.getSkin() == null) { return; }
    
    if(gp.getProperties().containsKey("textures"))
    {
        gp.getProperties().removeAll("textures");
    }
    
    // Sets skin
    gp.getProperties().put("textures", new Property("textures",this.npc.getSkin().getTexture(),this.npc.getSkin().getSignature()));
    
    // Destroys npc entity
    destroy(player);
    
    DelayedTaskUtils.executeDelayedTask(new Runnable()
    {
        @Override
        public void run()
        {
            // Respawns npc entity
            spawnEntity(player);
            
            DataWatcher watcher = npcEntity.getDataWatcher();
            byte allSkinParts = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40;
            npcEntity.getDataWatcher().set(new DataWatcherObject<>(17,DataWatcherRegistry.a),/* 127 */allSkinParts);
            PacketPlayOutEntityMetadata skinLayer = new PacketPlayOutEntityMetadata(npcEntity.getId(),watcher,true);
            
            PlayerUtils.sendPacketsExceptOne(Lists.newArrayList(skinLayer),npcEntity);
        }
    },2L);
}
chrome beacon
robust forge
#

How do I get which direction oak log is facing? I have tried to use

        Directional data = (Directional) blockData;
        BlockFace face = ((Directional) b).getFacing();```

But I get this error: craftrotable cannot be cast to directional
chrome beacon
#

What is the block

robust forge
#

OAK_LOG

chrome beacon
#

Use the rotatable interface

robust forge
#

Ok thanks

echo ether
#

Are there any reason to make scoreboard NMS in 1.17? Spigot's scoreboard system already works perfectly even it's not async and it does not effect server at all...

wraith apex
#

I wouldn't think so

#

As outlined in md_5's post about devs using NMS for things like scoreboards and bossbars even though there is already API for them

echo ether
#

That's what I was thinking actually... The only good thing about NMS could be it doesn't save scoreboard in the world file but you can avoid by resetting scoreboard in your plugin.

wraith apex
#

Or sent the scoreboard using packets

#

fake scoreboard

robust forge
#

Why do I get an error: CraftRotatable cannot be cast to org.bukkit.block.data.Rotatable

blockData.getRotation();```
#

Im trying to get OAK_LOGs rotation

thin venture
#

Why is it saying multiple root tags?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>me.chrissquartz</groupId>
    <artifactId>nocheststeal</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>NoChestSteal</name>

    <description>Players can't steal items in chests</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>chrissquartz.cf</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
#
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <outputDirectory>C:\Users\user\Documents\Stuff\mc-servers\Paper-plugin-test\plugins</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
</project>

<repository>
    <id>papermc-repo</id>
    <url>https://papermc.io/repo/repository/maven-public/</url>
    <id>sonatype</id>
    <url>https://oss.sonatype.org/content/groups/public/</url>
</repository>



<dependency>
    <groupId>io.papermc.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>1.17.1-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>
sullen marlin
worldly ingot
#

Your tags are malformed, Quartz

#

This is what you have currently

<project>
</project>

<repository>
  <id></id>
  <url></url>
  <id></id>
  <url></url>
</repository>

<dependency>
</dependency>```
thin venture
#

ok

worldly ingot
#

What you want

<project>
  <repositories>
    <repository>
      <id></id>
      <url></url>
    </repository>
    <repository>
      <id></id>
      <url></url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId></groupId>
      <artifactId></artifactId>
      <version></version>
    </dependency>
  </dependencies>
</project>```
#

(fill in the stuff in there obvs)

thin venture
#

ok thanks, and also thanks for using Quartz instead of like Chriss or smth like that

worldly ingot
#

It was a 50/50 lol

thin venture
#

¯_(ツ)_/¯

thin venture
#

Hi

echo ether
#

What is the maximum length for scoreboard team prefix and suffix in 1.16+? (not for name tags, just for scoreboard sidebar display)

kind coral
opal juniper
#

That is the only way to really update blocks exclusively with the api

#

other ways require nms normally

hybrid spoke
#

NMS is not needed but should be faster and more performant afaik.

magic raptor
#

Can i ask for bungeecord here?

hybrid spoke
#

yes

magic raptor
#

lemme send

proper notch
#

Which line in the method is the null pointer thrown at?

summer scroll
#

Does the server affects connecting/accessing a database? Like if the server is slow, it will require more amount of times to access a sql database

proper notch
#

You should be doing database queries on a separate thread so they're not affected by load on the main thread.

magic raptor
proper notch
#

That's a single method.

summer scroll
proper notch
#

Oh wait you probably can't read errors

proper notch
proper notch
summer scroll
#

Is it normal to just search if specific player's uuid exist on the database took 30 seconds?

proper notch
#

No

#

You're probably doing your query wrong or something

magic raptor
proper notch
#

Then pingTask is null

summer scroll
#

It's called in async btw.

proper notch
#

I don't know SQL in or outside of java so I wouldn't be able to spot an issue there. I guess you could see how long an extremely basic query takes though

magic raptor
#

but i don't see any difference

#

wtf

summer scroll
#

alright thanks

proper notch
#

Where do you set pingTask and where is the method that's causing the null pointer called from

magic raptor
#

how's possible

dire marsh
#

Is it possible to check if a player is currently colliding with an entity

tame coral
#

Found this

#

(first google result btw)

lean gull
#

hii mrs darth

#

cause

#

btw if someone could help with this that would be great

chrome beacon
#

They told you how to fix it

lean gull
#

smort 1 sec

#

works thank

opal juniper
#

last element in an array? i forget if there is an easy way like -1

lean gull
#

anyone know how to do this without linking the two variables?
ItemStack fourOakPlanks = oakPlanksItem;

#

sure

lyric grove
#

Does anyone know how i can parse e.g. 2 into "double" or 3 into "triple"

north drum
#

Minecraft preferr IPv6 on connect

lyric grove
golden turret
#

i would like to know if that is possible

hybrid spoke
#

its not

golden turret
#

basically is boat rotating (y) with a player as passanger

golden turret
hybrid spoke
hybrid spoke
golden turret
#

:C

golden turret
#

any way to rotate the player?

toxic mesa
#

Idk if im stupid or whatever but I'm using a hashmap to put the player's uuid and a Date and later getting it, but for some reason getting the hashmap with the player is null but it shouldn't be.

private HashMap<UUID, Date> lastPacket = new HashMap<UUID, Date>(); <- hashmap
saving:

    Bukkit.broadcastMessage("saving");
        lastPacket.put(player.getUniqueId(), new Date(System.currentTimeMillis()));

later null check:
if (lastPacket.get(player.getUniqueId()) != null) {
It somehow doesn't pass this null check even though it has been saved and the debug message has been broadcasted. Am i just stupid?

quaint mantle
#

you should use instants

#

almost all of Date is deprecated

toxic mesa
#

Aight

toxic mesa
harsh idol
#

Just a quick (non Spigot) question, does NBTs have changed in 1.17.1 ? I don't find any equivalent of net.minecraft.server.v[version].NBTTagCompound class

tardy delta
#

Hewwo

harsh idol
wraith apex
#

Is there an event that fires later than PlayerJoinEvent when the player actually appears on the server and can see things?

golden turret
#

no but yes, it is called lag

wraith apex
#

It was a serious question...

golden turret
#

you can try calculate his ping and throw a runnable

wraith apex
#

PlayerJoinEvent is fired as soon as the players connection is accepted. Not when they appear in the world a few milliseconds later

worldly ingot
#

Bukkit.getScheduler().runTask() will suffice

golden turret
#

maybe ik

#

when the player joins, if he have an item at his hotbar, a packet will be sent

#

you can intercept this packet

wraith apex
#

so get their ping and / 20 + 1

golden turret
#

the packet is PacketPlayOutSetSlot iguess

wraith apex
#

and schedule a task

golden turret
#

i think the best way would be by intercepting the packet

wraith apex
#

I know how to intercept packets ye

golden turret
#

you can use protrocollib

wraith apex
#

PacketPlayOutSetSlot is sent when they're in the world

wraith apex
#

I'd rather not use ProtocolLib but thanks ^^

golden turret
worldly ingot
#

If they aren't being sent chunks, they won't receive whatever you're doing in the task anyways

#

You're overcomplicating things

golden turret
wraith apex
#

Already have

golden turret
#

maybe the client can send a packet after he joins the world too

wraith apex
vernal pier
#

👻 <- choco

worldly ingot
#

What are you even trying to do?

wraith apex
#

Long story involving Npc's The skin will not update if you send a PacketPlayOutInfo about the npc being removed from the server too quickly

#

The player must be able to see the npc before this packet is sent

#

otherwise skin doesn't show

#

So I was looking for an event that could fire as soon as the player has loaded into the world and can see

worldly ingot
#

Are you handling your own NPCs? Or what's the issue? Because again, the player won't see the NPC before you send it to them which in and of itself is reliant on their ping

wraith apex
#

I'm handling my own Npc's no libraries

worldly ingot
#

Yeah so you should be fine to just send the info packet followed by the metadata packet both in a runnable

narrow vessel
#

why not use citizens for your own sanity

worldly ingot
#

I'd also second the use of Citizens but I mean if you're already done with your own then whatever

wraith apex
#

and because I choose to learn how stuff works

narrow vessel
#

you dont need to make everything yourself

#

it just slows you down

wraith apex
#

Nah, it gives me more granular control

narrow vessel
#

i like integrating existing api’s and libraries because that means i get what i want faster

narrow vessel
wraith apex
#

The problem with any plugin or library or api is you have to rely on someone

#

they become a dependency to your project

#

If I want to update on day 1 I should be able to

narrow vessel
#

and then you write your own when its not supported anymore

wraith apex
#

and not wait for someone else

narrow vessel
#

or use an alternative if one exists or gets made

wraith apex
#

and that's what I'm trying to avoid

#

I don't want to keep switching api's

#

xD

wraith apex
worldly ingot
#

oh you don't want them seen? o.O

wraith apex
narrow vessel
#

go ahead and use minestom and rewrite the parts you need

wraith apex
#

This Packet

#

removes them from the tab list

worldly ingot
#

oh i see what you mean

wraith apex
#

I have a delay as 10 seconds for testing

#

that works for me

#

but for some other people it may take way less or way longer

#

It's really just about calling that packet to be sent as soon as they've loaded in

cold tartan
#

Does anyone know of a good way to store constantly changing info about a player? like health, defense, etc.

wraith apex
#

not just when they've joined the server and are still logging in

#

let alone if the server is sending them chunk packets

wraith apex
#
Map<UUID,PlayerData> playerData = new HashMap<>();
cold tartan
hybrid spoke
#

the player object already stores that for you

cold tartan
#

no like custom defense

wraith apex
#

Nah I think he means custom data

cold tartan
#

^^^

wraith apex
#

HashMap is the simplest of ways to do this

lime jay
#

Hey how do I make it so my dependency’s for my servers plugin get auto updated on start?

wraith apex
#

with your own custom PlayerData class

hybrid spoke
#

then wrap the uuid

#

and make a custom class

#

instead of using a hashmap

stone sinew
#

Or use persitantdata

cold tartan
wraith apex
#

persistent data is stored on the player itself

hybrid spoke
#

persistent data is stored in playerdata file

eager hinge
#

Hello, What's the way to save defaults only for properties which haven't existed before for a custom configuration file . (In case of update of plugin when added new properties)

wraith apex
lime jay
wraith apex
#

Nope

hybrid spoke
wraith apex
#

spigot just makes sure they get loaded first

wraith apex
lime jay
# wraith apex Nope

Ye so I want them to be auto updated to the latest version on the server on start so no human interference needs to happen

hybrid spoke
#

okay now i am confused

hybrid spoke
#

in what way

lime jay
hybrid spoke
#

so you would have to make a custom downloader

#

with given link to the download for each jar

lime jay
#

Ye but I’m not quite sure how I would go about making the downloader

wraith apex
#

or if you're getting updates say from a github repo, you'd clone, compile, and replace

#

Correct me if i'm wrong but I think spigot disallows auto-updating plugins on their site

#

because malware

lime jay
lime jay
wraith apex
#

oki

#

could compare the date of a commit to the current date as a check for an update?

#

and then if so, clone the repo to a sub directory somewhere (maybe in your plugins data folder), compile it and have it replace the current plugin jar.

#

this can be achieved with JGit

lean gull
#

hey so im makin a crafting table gui thing and i want to make a method where i can choose what ingredients i want, if it's shaped or shapeless and whatnot to make a crafting recipe in my crafting gui, but i have no clue how to make that method.
if anyone got ideas for it and you can share that would be awesome, thanks!

halcyon coral
timid kraken
#

guys is it possible to hide the player nametags?

reef peak
#

Hello, got a problem: My friend got a custom plugin but it doesn't save any data, make no files on the server (Tags)
Server Version: 1.16.5

#

If any developer can help, there are no errors just the file not saving the datas and generating anything

proud basin
#

Why not contact the developer that made it?

reef peak
#

He's not active at all, that's the problem

#

He didn't replied since more than a week

#

It's a premium plugin, just need a quick fix for user data save

#

After opening the Jar using WinRAR, I can see the userdata file but that seem not saving

#

When you unlock tags and restart the server, that says I don't own any tags after owning some...

restive tangle
#

is the data stored in a yaml file

severe oracle
#

how do i check if there is a player that is on a team and in certan world ?

proud basin
#

@eternal oxide I was messing around and I finally got it working

ivory sleet
#

Pog

proud basin
#

now just gotta figure out how to use custom font

ivory sleet
#

Easy as pie for you 😉

proud basin
quaint mantle
#

I'm trying to make it so that when you harvest stone, it gets replaced by gold ore. Tried in creative and survival and I did register it in my plugin class.

    @EventHandler
    public void onOrePlace(PlayerHarvestBlockEvent e) {
        //Player p = e.getPlayer();
        if (e.getHarvestedBlock().getType() == (Material.STONE)) {          e.getHarvestedBlock().getLocation().getBlock().setType(Material.GOLD_ORE);
        }
    }
}
olive valve
#

does anyone know why this wont work? if(args[0].equalsIgnoreCase("feathered")){ p.getInventory().getItemInMainHand().addUnsafeEnchantment(FeatheredRegister.FEATHERED, 1); ItemStack item = p.getInventory().getItemInMainHand(); ItemMeta meta = p.getInventory().getItemInMainHand().getItemMeta(); ArrayList<String> lore = new ArrayList<>(); lore.add("§7Feathered I"); lore.add("§7(Feathered) > Sneak to fall slowly"); meta.setLore(lore); item.setItemMeta(meta); it works with another one but its not working with this one. it wont let me use the argument it just gives me the error that i set

solid cargo
#

this seems not to work

vague oracle
#

remove the ; from after the if statement :/

#

I can almost bet thats what the warning is for

solid cargo
#

that is not it, anyways, will try to fix it myself

#

cuz practice makes perfect!!

olive valve
solid cargo
#

ok will make it spoiled

vague oracle
#

You don't have to have {} but you should also probably return as well

olive valve
#

yea

solid cargo
#

before you scream on me about my java knowledge, i do it for fun, not enterprise

vague oracle
#

Its not that its the way you respond when someone gives you the answer

ivory sleet
#

if (condition); is always redundant

olive valve
#

does anyone know why this wont work? if(args[0].equalsIgnoreCase("feathered")){ p.getInventory().getItemInMainHand().addUnsafeEnchantment(FeatheredRegister.FEATHERED, 1); ItemStack item = p.getInventory().getItemInMainHand(); ItemMeta meta = p.getInventory().getItemInMainHand().getItemMeta(); ArrayList<String> lore = new ArrayList<>(); lore.add("§7Feathered I"); lore.add("§7(Feathered) > Sneak to fall slowly"); meta.setLore(lore); item.setItemMeta(meta); it works with another one but its not working with this one. it wont let me use the

ivory sleet
#

yes

olive valve
#

argument

ivory sleet
#

you need to set the item back

olive valve
#

it wont let me use the arguemnt

ivory sleet
#

getItemInHand returns a copy

olive valve
#

what?

ivory sleet
#

getItemInMainHand() doesnt actually return the players itemstack

#

but rather a clone of it

lean gull
#

conclure

#

could u please help me with my problem

vague oracle
#

ask it

ivory sleet
#

Idk, you'll just accuse me again it feels like

lean gull
#

oh right i forgot u tried to steal my plugin

#

can anyone else help then

olive valve
vague oracle
#

What error message?

ivory sleet
#

Anyways buenny I've told you already, stop going around here false accusing people, report to the support mail then. I am getting tired of having to tell you this.

lean gull
#

you literally have never said that quit lying

olive valve
ivory sleet
#

I have, and if you're not changing your attitude soon enough you'll be out of here.

lean gull
#

i really don't know what to say man

#

you're beyond my comperhension, and that's not a good thing

vague oracle
olive valve
opal juniper
#

@lean gull crafting table guis are a pain

#

(if you want it to function as an actual crafting table that is)

vague oracle
#

Im confused, if that message is appearing then you are using the wrong command?

lean gull
#

question: can i make like a non existent crafting table where i can use the items in the crafting table gui and then see if they work to match a recipe?

olive valve
lean gull
#

wdym

opal juniper
#

like will the player have the workbench open?

#

on the client

lean gull
#

which workbench

opal juniper
#

workbench = crafting table

lean gull
#

ye ik, but which one

#

the non existent one or the gui

opal juniper
#

so you want to validate something is a valid recipe?

lean gull
#

lemme re-explain

opal juniper
#

pls 😅

lean gull
#

basically there's a custom gui that has a 3x3 space in it to put items in

vague oracle
#

Ngl woods I have no idea, I'm so lost from what I can understand, you said your only problem is it runs that message, but the only way it runs that message is if you don't type in chat the right argument.

lean gull
#

that is a custom crafting table

#

then i want to make a new normal crafting table, and put the items the player has put in the crafting the to the new crafting table to check if what they put is a valid recipe

proud basin
worthy knoll
#

How do I name my command executor for /sethome

#

:D

olive valve
lean gull
#

also if there's a better way to make shaped and shapeless recipes im all ears

#

shapeless is easy

olive valve
lean gull
#

you add everything to a list then you check if it has a certain amount

#

of each ingredient

opal juniper
#

so i think the only way to do this is probably some hacky way this the crafting matrix and nms

lean gull
#

what's crafting matrix and nms

vague oracle
#

You should have them all in 1 class

#

Idk if a command can have multiple executors I would assume not

olive valve
vague oracle
#

I mean't command btw

#

as in have each enchantment as a different arg

lean gull
opal juniper
olive valve
lean gull
opal juniper
#

just follow fords pseudo code

lean gull
#

who dat and wat dat

vague oracle
#

Well I would have the class called CustomEnchantCommands then have it like this

if(args[0].equalsIgnoreCase("Enchant1") {
  // Add enchant1 to the item here
}else if(args[0].equalsIgnoreCase("Enchant2") {
   // Add enchant2 to item here
}else if(args[0].equalsIgnoreCase("Enchant3") {
  // Add enchant3 to item here
}else {
  send error message
}
opal juniper
#

ford is the user

#

drives_a_ford

#

and pseuodocode is code that follows no syntax but explains the logical steps

olive valve
lean gull
vague oracle
#

I changed it if that helps let me know if not

opal juniper
lean gull
#

wtf is dat

opal juniper
#

decompiler

quaint mantle
#

deco

#

meh

lean gull
#

oh no thank

#

if they dunt hav github then i think they dunt want their code stolen

#

so um wat 2 do

opal juniper
#

Well they use reflection to get at the nms core classes to get the result

lean gull
#

wat

olive valve
lean gull
#

u speak enchantment table language

opal juniper
# lean gull *wat*

They do some hacky shit to get at the core "minecraft code" in order to get the proper result

lean gull
#

ahhh

vague oracle
#

Well if you copied and pasted it, it would. Add a ) on the end of each if statement

lean gull
#

is there a way to just remake the minecraft code for crafting tables

#

without completly copying it

opal juniper
#

yes

#

but sooooo much work

olive valve
opal juniper
#

you could probably brute force it

atomic gyro
#

Anybody know how to access files that are packed in the minecraft.jar file in a plugin?

#

Like if I wanted to pull a loot table from an entity, or smth similar.

opal juniper
#

have never used it tho

#

Im assuming cause it is nullable it will return null if no Recipe is available

#

?stash

undone axleBOT
lean gull
#

so um what do i do with this?

quaint mantle
#

So i tried using blockbreak and still didn't work. Came up with this code, anyone know if i did something wrong?

    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        Player p = e.getPlayer();
        Location blockLocation = e.getBlock().getLocation();
        if (p.getWorld().getBlockAt(blockLocation).getType() == Material.STONE) {
            p.getWorld().getBlockAt(blockLocation).setType(Material.GOLD_ORE);
        } 
    }
proud basin
#

Hey I'm back how come the copyright text gets pushed whenever the game gets full screened but Test doesn't? https://imgur.com/jsNXzY1 (mixins with forge gradle)

quaint mantle
#

Like this?
Player p = e.getPlayer();
Location blockLocation = e.getBlock().getLocation();
if (p.getWorld().getBlockAt(blockLocation).getType() == Material.STONE) {
blockLocation.getBlock().setType(Material.GOLD_ORE);
}
}

opal juniper
#

just get the crafting matrix

quaint mantle
#
    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        Player p = e.getPlayer();
        Location blockLocation = e.getBlock().getLocation();
        if (blockLocation.getBlock().getType() == Material.STONE) {
            blockLocation.getBlock().setType(Material.GOLD_ORE);
        } 
    }
#

@quaint mantle

#

ok

lean gull
#

i'll use craftItem

opal juniper
#

why no

lean gull
#

cause then i can just input all the items the player has put in

opal juniper
#

it calls the prepare craft event

quaint mantle
lean gull
#

and if it's not null then i put the thing in there

opal juniper
#

it doesn’t actually craft it

quaint mantle
formal dome
#

does driver manager have any functions to push data to my locally hosted database?

#

and how to fill out specific fields for a specifically implemented object

opal juniper
#

it just returns the craft result but also calls the event

lean gull
#

which

quaint mantle
#

you dont need to location

#

yaa

formal dome
quaint mantle
#

@quaint mantle

    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        Block block = e.getBlock();

        if (block.getType() == Material.STONE) {
            block.setType(Material.GOLD_ORE);
        } 
    }
#

thank you

outer crane
#

This is a very odd use case, but is there a possibilty of hiding a command execution from from console? (i know its a weird use case, and preferrably through api)

honest iron
#

Question about teams:
Where are the teams saved? (Scoreboard Teams)
And are PacketPlayOutScoreboardTeam saved?

opal juniper
lean gull
#

ah ok

lean gull
#

but the one u sent says it returns the recipe and not the result, what does it mean

#

do u kno why e2.getCurrentItem().equals(null) says it's gonna be always false?

            if (e2.getSlot() == 24) {
                if (e2.getCurrentItem().equals(null)) {
                    e2.setCancelled(true);
                }
            }```
quaint mantle
#

dont use .equals for check null

#

e2.getCurrentItem()==null

lean gull
#

ok thank it not say that anymore

wheat cove
#

Will a 1.16.5 plug-in run on a 1.17.1 server

quaint mantle
#

y

quaint mantle
wheat cove
#

It is a simple plug-in that only kills withers

quaint mantle
#

what does that mean? sorry im new

#
Bukkit.getScheduler().runTaskLater(plugin, () -> {
  // set block type
}, 10L)
#

plugin is undefined, how do i fix?

#

bruh

#

replace it to your main instance

quaint mantle
quaint mantle
#

ok but i still dont how to fit it in my main class?

eternal oxide
#

?di

undone axleBOT
eternal oxide
#

thats not a valid maven definition

#

what update?

#

?paste your pom

undone axleBOT
eternal oxide
#

have you run buildtools with --remapped?

#

your pom reads 1.17-R0.1-SNAPSHOT but you built 1.17.1

#

have you tried using teh same artifact that you built?

#

1.17.1-R0.1-SNAPSHOT

open vapor
#

what is the cause of this error?

eternal oxide
#

null

#

read the full error

open vapor
#

i don't know what it means

eternal oxide
#

look down the stack trace until you find the first line which mentions your code

open vapor
#

i did

#

none of the lines mention my code

eternal oxide
#

in that line it will tell you what class and line number caused the error

#

no? at me.CoolElectronics.CSkyCore.main.GoldGeneratorHelper.onChunkLoad(GoldGeneratorHelper.java:93) ~[?:?]

open vapor
#

oops

#

didn't see that

eternal oxide
#

the caused by line tells you what the error was.

#

and the line 93 in GoldGeneratorHelper.java is where it came from

#

So have a look at line 93 and see if you can work out what its talking about when it says a boolean being cast to a string

proud basin
#

suh

ivory sleet
#

make a thread

eternal oxide
honest iron
honest iron
#

Is it ever saved on server side?

eternal oxide
#

why would a packet be saved server side?

honest iron
#

Once i made a mistake and made tons of teams

#

Like ~100 teams

#

and now im looking for safer way

#

And the bungee crashes

eternal oxide
#

safest way is via the API

#

delete teams when finished with them

lusty cipher
#

wait can a blockitem not be enchanted in an inv?

honest iron
#

But it uses too much memory until it crashes

eternal oxide
#

Then you are doing it wrong

#

why are you creating a hundred teams?

crimson terrace
ivory sleet
#

Maybe phantom cache the teams

proud basin
ivory sleet
#

always

tardy delta
#

1.17?

stone sinew
#

Since 1.17

tardy delta
#

1.16 smh

lusty cipher
#

🤔

#

could also just update your java?

#

lmao

#

literally gives you more performance and gives you support for 1.17 and 1.18

#

but ok sure

ivory sleet
#

^

#

its a win win

lusty cipher
#

oh god what was that

stone sinew
#

Well ok then...

#

My bat file

#

oh its because my filename is server jars without a space. Fucking stupid

#

🤦

#

Aint that the truth

ivory sleet
#

bootstrapping time does not determine performance tho

lusty cipher
#

yeah

#

I mean by that you could also say you should use JDK 1.8.0_291 because it's 0.1s quicker than JDK 11.0.2

#

You know that's probably because older JDKs can't utilize the CPU as good as newer ones can?

cedar otter
#

hi

#

[LobbyMenu] Loading LobbyMenu v1.0
[21:11:46] [Server thread/ERROR]: Plugin attempted to register net.corvus.lobbymenu.listener.JoinListener@57525ada while not enabled initializing LobbyMenu v1.0 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register net.corvus.lobbymenu.listener.JoinListener@57525ada while not enabled
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:524) ~[next.jar:git-Spigot-db6de12-18fbb24]
at net.corvus.lobbymenu.listener.JoinListener.<init>(JoinListener.java:15) ~[?:?]
at net.corvus.lobbymenu.Main.onLoad(Main.java:11) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:297) [next.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [next.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [next.jar:git-Spigot-db6de12-18fbb24]
at java.base/java.lang.Thread.run(Thread.java:831) [?:?]

cedar otter
eternal oxide
#

Dont try to register any events before onEnable

lusty cipher
#

It makes sense if you think about it. The time per tick is lower than on older JDKs because it's simply quicker. Then because it runs for a shorter amount of time but utilizes more CPU, it seems as if it would be more hungry. It's just task manager etc. can't measure it in that detail and it seems as if its higher.

narrow furnace
#

iphone 6 users dont have issues either but they still upgrade
because iphone 21 is better
difference here is that both are free

lusty cipher
#

also CPU really doesn't make a difference

narrow furnace
#

you are missing out on a free upgrade

lusty cipher
#

I can't even properly measure CPU usage because JDK 17 doesn't really suck up anything on my 5800X

#

it's <8% most of the time

#

Especially if you then also use specialized GC flags

cedar otter
lusty cipher
#

On my own server it takes JDK 16.0.2 ~3 seconds to load it up without plugins. With JDK 17 its just 1.8 seconds.

eternal oxide
#

not in onLoad

lusty cipher
#

Also, this is with JDK 17 and 2 players on right now and Aikar flags. There's literally 0 reason not to upgrade.

#

I've been upgrading JDKs all the time and it's noticeable how performance increases all the time

quaint mantle
#

Wait till you actually get enough players an netty dead locks :3

#

Can’t just slap j11 into spigot 1.8 without updating netty

lean gull
#

anyone know how to use Bukkit.craftItem's crafting matrix?

torn oyster
#

how do i replace the player's name

#

in PlayerAdvancementDoneEvent

eternal night
#

it uses the player display name afaik

torn oyster
#

nope

#

thats what im trying to make it do lol

eternal night
#

oh right, it does not. mb. it uses NMS display name xD

#

Well, paper has a method to modify the message

#

but spigot doesn't really have much to do

torn oyster
eternal night
#

oh sweet, well there is PlayerAdvancementDoneEvent#message(Component)

#

which you can use to modify the component

torn oyster
#

oh nice

#

why do they have to use components

#

its annoying

eternal night
#

it really isn't

torn oyster
#

well i see why

eternal night
#

just static import most component methods (like Component.text)

torn oyster
#

replacing text is 10x harder

paper viper
#

It’s not, it’s 10x nicer

#

You don’t have to do stupid string concatenation

#

Adventure does it for you

eternal night
#

yea using the text replacement config really isn't that complex xD

#
final Component message = event.message();
if (message == null) return;

event.message(message.replaceText(
    TextReplacementConfig.builder()
        .matchLiteral(event.getPlayer().getName())
        .replacement("Not a username")
        .build()
));
#

is just so cute ngl

ivory sleet
#

verbose as hell

#

but adventure is better since it mirrors the way mc handles it

#

so ye

#

pog

eternal night
#
event.message(message.replaceText(builder -> builder.matchLiteral(event.getPlayer().getName()).replacement("NOT A USER")));
#

there

#

pfft

ivory sleet
#

😌

lean gull
reef wind
regal dew
paper viper
#

So I'm trying to update my NMS code from 1.16.5 to 1.17.1, but I can't seem to get it working. For example, for my method displayEntities, the original 1.16.5 code (which is working), looked like this: https://github.com/MinecraftMediaLibrary/EzMediaCore/blob/ffd1025c3d5fa41d7b4180831fbc26876c13984c/v1_16_R3/src/main/java/io/github/pulsebeat02/ezmediacore/nms/impl/v1_16_R3/NMSMapPacketIntercepter.java#L259

The changed code which I attempted to write instead looks as so (1.17.1): https://github.com/MinecraftMediaLibrary/EzMediaCore/blob/97c7d2892d9c8f9183818ae2db676b316de0b3d0/v1_17_R1/src/main/java/io/github/pulsebeat02/ezmediacore/nms/impl/v1_17_R1/NMSMapPacketIntercepter.java#L205

In short, I am setting the color on Entity name tags. The 1.17.1 code which I attempted to write just displays the entities as white name tags, which don't have any color change.

#

Does anyone know where I gone wrong?

formal dome
#

how do i get the entire string from a single log message

reef wind
#

next guy gotta teach you

formal dome
#

okay lol

#

who's the next guy

chrome beacon
#

Guess I can be

#

What log message are you trying to read?

#

Or do you want the entire console log

hexed orbit
#

Hello everyone, everything good? can anybody help me? I would like to detect when any player hits the diamond block that the giant zombie is holding. It is possible?

#

Unfortunately I can't upload the image here, to get an idea

chrome beacon
formal dome
proud basin
#

anyone here know how I can add like a margin to a square corner?

chrome beacon
chrome beacon
#

CSS? Or what

proud basin
#

no I wanna remove the sharp corner in a square

chrome beacon
#

With css?

hexed orbit
proud basin
#

no

#

with java

chrome beacon
#

How are you making the square

chrome beacon
#

Wrong reply ._.

#

Anyway I'm off for today

formal dome
#

is there a function that is triggered everytime a log message is posted? (after the server is done setting up)

formal dome
#

oh

formal dome
lean gull
eternal night
#

you throw in the 9 item stacks in the crafting gui as well as the world the crafting is happening in and it returns the recipe that matches the input or null if none

formal dome
#

olivo's gone now

#

great

chrome beacon
#

U sure

eternal night
#

yes

chrome beacon
#

Aight just checking

eternal night
#

😂

proud basin
chrome beacon
proud basin
# chrome beacon JFrames?

nah Forge gradle ```java
public static void drawRect(int left, int top, int right, int bottom, int color)
{
if (left < right)
{
int i = left;
left = right;
right = i;
}

    if (top < bottom)
    {
        int j = top;
        top = bottom;
        bottom = j;
    }

    float f3 = (float)(color >> 24 & 255) / 255.0F;
    float f = (float)(color >> 16 & 255) / 255.0F;
    float f1 = (float)(color >> 8 & 255) / 255.0F;
    float f2 = (float)(color & 255) / 255.0F;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(f, f1, f2, f3);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION);
    worldrenderer.pos((double)left, (double)bottom, 0.0D).endVertex();
    worldrenderer.pos((double)right, (double)bottom, 0.0D).endVertex();
    worldrenderer.pos((double)right, (double)top, 0.0D).endVertex();
    worldrenderer.pos((double)left, (double)top, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
formal dome
chrome beacon
proud basin
#

mhm

#

It's looking swaggy

quaint mantle
#

How do I make a hashmap to store various information? Money, votes, deaths, deaths.

eternal oxide
#

You sorted your texture loading issue?

proud basin
#

yea

chrome beacon
eternal oxide
#

What was the fix?

proud basin
#

well I had to keep it in renderUI

#

but also it had to be in a assets folder

#

and mod id didn't matter because it wasn't needed

eternal oxide
#

ok

proud basin
#

I was messing around and I had fixed it

#

so that was pretty cool

chrome beacon
proud basin
#

god damn I'm cool

formal dome
proud basin
formal dome
#

tbh i think my issue is that i'm runing your paste within my onEnable() function. where should i be running it @chrome beacon

proud basin
proud basin
formal dome
#

where is the plugin.yml

#

guess it goes in the root directory?

#

tbh i have no clue what to put for the main: attribute

winged anvil
#

your main class path

eternal oxide
#

your package+main class

winged anvil
#

elgar

#

     ArrayList<Player> players = PlayerInstance.getInstance().getPlayerList();
     World world = Butter.getInstance().getServer().getWorld("world");
     Block b = world.getBlockAt(-321,95,487);
     
     //Error Here
     Sign sign = (Sign) b.getState();

     public void updateSign() {
         //Bunch of sign text here cut out for visual sake.

     }

}``` I keep getting a ClassCastExceptinn here. What am I doing wrong.
formal dome
#

i don't really have a package name, can i just use org.spigotmc.<classname>

winged anvil
#

you dont have a package name?

#

in your src folder

eternal oxide
winged anvil
#

import org.bukkit.block.Sign;

#

is there others?

eternal oxide
#

yes, but if that is the import you used then teh block is not a sign

winged anvil
#

do i use this import org.bukkit.block.data.type.Sign;?

eternal oxide
#

If you want to cast the BlockData

formal dome
eternal oxide
#

Do an instanceof check to make sure it is a Sign you are getting

winged anvil
#

ight

formal dome
#

fuck i don't remember how i'm supposed to make the package off the top of my head

eternal night
#

Right click the src folder

#

And click new -> package ?

proud basin
#

Could someone help me center a image with this ```java FROM Gui.java class
public static void drawModalRectWithCustomSizedTexture(int x, int y, float u, float v, int width, int height, float textureWidth, float textureHeight)
{
float f = 1.0F / textureWidth;
float f1 = 1.0F / textureHeight;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)x, (double)(y + height), 0.0D).tex((double)(u * f), (double)((v + (float)height) * f1)).endVertex();
worldrenderer.pos((double)(x + width), (double)(y + height), 0.0D).tex((double)((u + (float)width) * f), (double)((v + (float)height) * f1)).endVertex();
worldrenderer.pos((double)(x + width), (double)y, 0.0D).tex((double)((u + (float)width) * f), (double)(v * f1)).endVertex();
worldrenderer.pos((double)x, (double)y, 0.0D).tex((double)(u * f), (double)(v * f1)).endVertex();
tessellator.draw();
}

formal dome
#

or while ur starting the project u make it

eternal night
#

Nothing prevents you from making a new package now XD

#

You'll have to update your plugin.yml

quartz mortar
#

What is block metadata?

#

btw im implementing this from scratch just for fun

formal dome
eternal oxide
#

Thats 1.8 packets by the looks

quartz mortar
#

yes it is

eternal oxide
#

You are unlikely to get help here on that, as its 1.8

quartz mortar
#

Do you know where I can?

eternal oxide
#

No clue, 1.8 is a decade old and really unsupported everywhere

eternal night
eternal oxide
#

add to that you are playing with packets

formal dome
eternal night
#

Wild XD

formal dome
#

how do i make this package relevant to my project lol

#

i put my class that extends the javaplugin into it

eternal oxide
#

You create the package then move your class files in there

formal dome
#

ok let me test it on start up

#

of my server

eternal oxide
#

you have to add this info to yoru plugin.yml

#

main: your.package.name.LogReader

formal dome
#

right yeah im' gonna do that now

formal dome
winged anvil
formal dome
#

which file does plugin.yml go in

#

still has it as plugin.yml does not exist for me

#

more specifically Jar does not contain plugin.yml

winged anvil
#

right click src -> new file -. "plugin.yml"

formal dome
#

oh it's supposed to be in src

winged anvil
#

yer yer

formal dome
#

ok i retry

lavish hemlock
#

I don't know if I could help, I'll see if I can understand it

formal dome
#

ay it worked

#

i feel happy :0

lavish hemlock
#

so @proud basin what's the problem with the code above?

eternal oxide
formal dome
#

i just started guessing lol

#

but i found it

#

i saw the file name turn into a spigot symbol lol

#

i was ilk that's gotta be it lol

#

now im' running into actual plugin errors which is good.... time to debug it up xD

proud basin
formal dome
#

default sql url lets see here

eternal oxide
proud basin
#

hm

eternal oxide
#

client resolution, not screen

proud basin
#

do the first 4 matter?

#

can I just set them to 0?

eternal oxide
#

they all matter

#

0 for x/y will place it top left

proud basin
#

if I divide it will go down

eternal oxide
#

divide?

proud basin
#

yea

#

this.width / 2 + 50

eternal oxide
#

no

#

the width is the width of the rect not teh client

#

you are specifying the dimensions of the rect it will draw

proud basin
#

not the first 4

eternal oxide
#

so x,y is the top left position it starts drawing, and width/height is where it ends

#

ignore u/v for now, they are texture coords

proud basin
#

o

#

I got it

#
        Gui.drawModalRectWithCustomSizedTexture(140, 98, 0.0F, 0.0F, 50, 50 ,50, 50);

#

It's in the correct spot

#

where I want it

eternal oxide
#

yes, but you are hard coding the position

#

don;t do that

proud basin
#

right

eternal oxide
#

yoru client window can be different sizes

#

so you need to calculate the x/y based upon teh client width/height

proud basin
#

Is this where i want to use ScaledResolution?

eternal oxide
#

something like x = clientWidth - (width/2)

#

width is teh width of your rect you want to draw

proud basin
#

But do I use ScaledRes or this.width

tepid thicket
#

Hi there, question to particles. I'm spawning a lot of them and it freezes my server.

#

But it doesn't show up in any timings. TPS are 20. Which component is actually hit here?

eternal oxide
eternal oxide
#

unless you are getting a lot of "can't keep up" messages. In which case you are running too much code in a tick

proud basin