#help-development
1 messages · Page 1785 of 1
like you know your blood is a good buffer
for example, when you add hydrogen peroxide to water it gets super basic on the ph scale right
but if you add hydrogen peroxide to blood, the effects arent as big
its cause your blood stores hydrogen atoms and releases them when necessary to balance ph levels
its pretty cool
Yeah
bad naming conventions probably
XD
also anti cheat code is hard to read anyways
cause like 99% of the time authors dont give a shit about anyone who looks at the code
no comments
Well tbf if its good code, then i dont think comments are needed
but like.. this is just horrible code
xD
if funkemunky had anything to do with it, its bound to be a bad project
I only use comments for stuff that is super hard to understand even if the code is well written. For example, like very mathematical stuff
i also like how most of the reviews on the download pages r from the devs
also cant stand CheckA/B/C/D/E/etc
like name the class after what it does or merge it with a more generic class
also im sorry is it instantiating a new check class object every time it receives a packet
Is CraftPlayer cannot be cast to EntityPlayer me being dumb, or is that supposed to work?
IDE isn’t complaining
CraftPlayer#getHandle
ha cool https://imgur.com/3JXwYD8
how do i get a player from an entity again
Check and cast
im trying to saave a hashmap with player inventories to a .properties file in my server. When I try to load the file I get an error with items.putAll(properties); my code: ```java
package net.ntdi.tazpvp.managers;
import net.ntdi.tazpvp.TazPvP;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.io.;
import java.util.;
import java.util.HashMap;
import java.util.Map;
public class ArmorManager {
static Map<UUID, ItemStack[]> items = new HashMap<UUID, ItemStack[]>();
static Map<UUID, ItemStack[]> armor = new HashMap<UUID, ItemStack[]>();
final static String outputFilePath = TazPvP.getInstance().getDataFolder().getAbsolutePath() + "/inv.properties";
final static String outputFilePath2 = TazPvP.getInstance().getDataFolder().getAbsolutePath() + "/inv.properties";
public static void storeAndClearInventory(Player player){
UUID uuid = player.getUniqueId();
ItemStack[] cont = player.getInventory().getContents();
ItemStack[] armcont = player.getInventory().getArmorContents();
items.put(uuid, cont);
armor.put(uuid, armcont);
player.getInventory().clear();
remArmor(player);
}
public static void restoreInventory(Player player){
UUID uuid = player.getUniqueId();
ItemStack[] contents = items.get(uuid);
ItemStack[] armorContents = armor.get(uuid);
if(contents != null){
player.getInventory().setContents(contents);
} else {
//player.getInventory().clear();
}
if(armorContents != null){
player.getInventory().setArmorContents(armorContents);
} else {
//remArmor(player);
}
}
public static void remArmor(Player player){
player.getInventory().setHelmet(null);
player.getInventory().setChestplate(null);
player.getInventory().setLeggings(null);
player.getInventory().setBoots(null);
}
public static void saveinv() throws IOException {
File file = new File(outputFilePath);
Properties properties = new Properties();
properties.putAll(items);
properties.store(new FileOutputStream(outputFilePath), null);
}
public static void savearmor() throws IOException {
File file = new File(outputFilePath2);
Properties properties = new Properties();
properties.putAll(armor);
properties.store(new FileOutputStream(outputFilePath2), null);
}
public static void loadinv() throws IOException {
Properties properties = new Properties();
properties.load(new FileInputStream(outputFilePath));
items.putAll(properties);
}
}
how can i stop formatting in a TextComponent leaking to other components in a BaseComponent[] /// ComponentBuilder()
oh hi sorry
when I try to use player.setBedSpawnLocation(x, true) despite me setting override to true it still says "you have no home bed or it was obstructed" and respawns the player at the world spawn
how can I fix this
Using Mojang mapped. If I try the traditional method, I get
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.EntityPlayer org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.getHandle()'
Must be an issue with my remapping, hmm
Yeah mappings in 1.18 are fucked up. But this is (1.18-pre) so hopefully they will be fixed in a stable release.
Ah lol, thanks. My first attempt at using Mojang mapped 🤦♂️
I'll test against 1.17 instead
Before I let my mind lose with ideas. Is it possible to create custom blocks (without armor stands) with resource packs without replacing existing blocks?
Those are workarounds but yeah
anyone have any idea of why AbstractArrow#getAttachedBlock() always returns air no matter what?
it seems to be getting the block adjacent to the block fired at, not the block it actually landed on
getRelative attached Face
relative to what?
the attached face
from the ProjectileHitEvent
because 99.99999% of arrow shots are irrelevant to what I want to do this and I'd rather have the overhead of tracking an arrow for 3 seconds once a month than checking every arrow ever shot to see if it's one of mine
I'll try getfacing from teh arrow method first
This sounds like magic in my ears
Because comments are redundant if code can explain itself
In addition
Comments can lie
Code never lies, sure it can fool you, but it never lies to you
Clean code and comment everything. Old school.
Hey, I'm trying to create a Clan plugin where it has clan point and other data, but what is the best way to make the plugin can sync (clan points, members) across all servers?
Either have a socket server-socket event system across the servers, or something like redis pub/sub, rabbitmq or Kafka to synchronize updates across servers
redis 
Then have something like a redis cache to cache recently queried objects from your persistent database
But I’d avoid using the pub/sub redis mq as its quite vulgar
Is it gonna be a spigot or bungee plugin?
That’s not on me
What would you do?
Idk, not my plugin
hmm, okay
You can think of redis as a shared hashmap between servers
do i need database server like mysql?
I highly suggest
Okay so, for example, I have a Clan object that holds a list of members, and someone joined the clan, how can I sync it?
You store the object in a database. I don't suppose you need to sync the object at all times in all servers?
I need to sync it for every changes
If you update the Clan object on one server, just update it in the database and make your plugin on the other server fetch the latest object from the database
You don't need for fetch it immediately, you can do it only when those members for example are requested
Oh, so save it on the database and then "ping" the other server that the server need to fetch that recent update?
You telling me to just get the value directly from the database?
does anyone know why i get an error saying that this.plugin in GamerulesCommand class is null?
GamerulesCommand class: https://paste.md-5.net/emeguruted.java
main class: https://paste.md-5.net/joqivelici.java
Why are you not passing the instance through the constructor
wdym
You are also using 2 objects for the same command
No you don’t get what I’m saying you are creating 2 instances of the same command
i'm not sure, but i think i need to use the same gamerules gui object so that's why i have a method for it in main
You should only make 1
I literally just said
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
isn't that what i'm already doing?
Isn't that bad? Because I want to cache the clan data on the server so I don't get the value directly from database everytime.
wdym
You don't have a choice?
Public Gamerulescommand() {} is a constructor
Public void something() {} is a method
You could still cache it and just update the data
Note the void
I mean I could make a method to sync the cached clan data with the database every 5 minutes or so.
??
No
Unless you want the data to be desynchronized?
you mean like the thing that if it's named after the class then it runs when the glass is referenced?
This is why you should learn Java first even just the basics and you would know what is wrong
can someone help?
We did we linked you multiple things that will help you
could i get an explination on why my code is not working?
I'd cache stuff only if necessary, because keeping everything in memory will take longer to load and save aswell as bigger memory usage. I'd cache clans only if members are online, otherwise load them asynchornously
I'm still confused on what is the best design for creating a plugin like this.
Yeah data management is quite difficult
what clan data would you store? does a clan have much data? i would say its just the members, so you wont need to save it every 5 minutes but when joining/leaving the clan. since your local clan object will probably only hold the members online, i would also create a ClanInfo object which just contains the most necessary informations about the clan
So far I have this, i could add more data later in the future.
/**
* Clan:
* - Clan Name
* - Clan Slogan/Description
* - Clan Owner
* - Clan Moderators
* - Clan Members
* - Clan Tag
* - Clan ColorTag
* - Clan Balance (to purchase upgrades)
* - Clan Points (for competitive purposes)
*/
Don't forget to give each clan an ID, a UUID to be safe
store and read data based upon the ID as players will want to change the clan name
noted, thanks
i'm guessing if i made this plugin for bungeecord it would be easier? (to sync the clan data)
the thing is, clan points is gonna be changed very often and its gonna be hard to sync it
Redis cache and a proper message broker could solve it
who needs sync anyways?😂
You can either make it a bungee plugin or have it in each server and use the plugin messaging channel
Plugin message channels are probably not a good option as it uses player connections thus dependent on players being online
The messages you publish in a plugin message channel would be awaiting, and then once a player joined they’d get sent
Which can result in a denial of service
Can you give me an example for redis cache?
Hey, does anyone know what the methods are called or if there is a link to the mappings where I can look? This is in the 1.18 and I would like to send that via packets ^^
Is that bad? xd
well medieval fonts would be fitting for a minecraft plugin, right? Bows, crossbows, sword, plate armor, shields...
yo everyone I got a weird problem. I wanted to create a plugin that simply bundles the apache commons lang library as it was removed in 1.18. So I just created a new project that simply shades apache commons and relocates it to the old path (org.bukkit.craftbukkit.libs.org.apache.commons.lang3). However, not even this plugin can access classes although Apache Commons is clearly included in the .jar, at the correct path.
package de.jeff_media.compatlib;
import org.apache.commons.lang3.Validate;
import org.bukkit.plugin.java.JavaPlugin;
public class CompatLib extends JavaPlugin {
@Override
public void onEnable() {
Validate.notNull("");
try {
Class.forName("org.bukkit.craftbukkit.libs.org.apache.commons.lang3.Validate");
getLogger().info("Libraries loaded");
} catch (ClassNotFoundException e) {
getLogger().severe("Could not load libraries:");
e.printStackTrace();
}
}
}
It anyway results in this:
https://paste.md-5.net/gufoyaruju.cs
Any ideas someone? :/
it blurrs in my head
Obviously Validate is correctly located at the right path in my jar:
They changed it I think
Like they are no longer relocated like such
I know, that's why I'm making this compatibility plugin
Didn't you read my text?
Yeah
So I just created a new project that simply shades apache commons and relocates it to the old path
might be but that doesn't help me
I manually shaded it to the old path
but it's still not found there
Hmm
I'm doing this compatlib plugin so I don't have to provide two different versions for 1.17 and 1.18
all I want is to provide a plugin that has apache commons included at the old path 😦
guys
how to optimize teleporting like 30 players to a location
player.teleport()
what do you need to optimize there?
why should it crash?
are the chunks loaded where you are teleporting the players to?
cause i remember
there was a minigame plugin that when the game ended and players teleported to spawn, server crashed
bedwars1058 was the plugin
you can use PaperLib to load the chunks before teleporting the players
or teleport them async using paperlib
paperapi right ?
PaperLib
what is that
yes
can you show us your pom/build gradle?
Post and share your source code or server logs here.
but as said, the lib is indeed shaded at the correct place, I checked with WinRar and Recaf
what I'm trying to achieve is basically a library plugin that simply provides the removed / relocated libraries at their old location so plugins won't break on 1.18
@hybrid spoke Here's the full project: https://github.com/JEFF-Media-GbR/CompatLib
i am not a maven pro, but what if you force the scope to be compile?
and yeah, i know its already in the jar
because compile is shade iirc
and its that mode by default
"compile" is default
and as said, it IS located at the correct location. It seems like the Bukkit classloader is preventing something :/
I also opened a forums thread btw, this is really urgent for me 😄
anyway I'll try again with compile but I doubt that it changes anything
nope, same error 😦
btw it does work when I use a package name for relocating that's NOT org.bukkit.craftbukkit...
but that doesn't help me because the purpose is to provide it at the old location :/
hey i have issue
so i created new plugin
and added a command
and everytime i run the command
it sends me the usage of it
like the one on plugin.yml
even if i remove the usage thing
you are returning "false" instead of "true" @west oxide
does the command work though?
yes
i tried it on other plugin
and made sure everything is same
sorry
then do as mfnalex said
the onCommand method returns a boolean. When you are returning false, it shows the usage, when you are returning true, it doesn't
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Nick implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
if(args.length == 0) {
sender.sendMessage("§dPlease provide a username to change nickname to : /nick username");
}
else if (args.length==1){
Player p = (Player) sender;
p.setDisplayName(args[0]);
}
else{
sender.sendMessage("§cWrong usage , usage: /nick username");
}
}
else{
sender.sendMessage("§dCommand can only be run by players.");
}
return true;
}
}
returnign false will display the usage, return true to consume the command
👀
does it show your own "Wrong usage" message, or the one provided by bukkit?
the one provided by bukkit
impossible with that code
then there's no way that the command actually works. seems like you didn't register the commandexecutor
i did
import online.shakiz.BwNick.commands.Nick;
import org.bukkit.plugin.java.JavaPlugin;
public class BwNick extends JavaPlugin {
@Override
public void onEnable() {
getCommand("nick").setExecutor(new Nick());
getServer().getConsoleSender().sendMessage("§dBwNick §fhas been §2enabled.");
}
@Override
public void onDisable() {
getServer().getConsoleSender().sendMessage("§dBwNick §fhas been §cdisabled.");
}
}
show your onEnable and plugin.yml pls
version: 1.0.0
author: Shakiz
main : online.shakiz.BwNick.BwNick
api-version: 1.8.8
commands:
nick:
description: nicks player into new username
usage: /nick username
the command works on my other plugin
i just wanted to make it on seperate plugin
and literally copied everything and then changed to make it work
can you upload the whole plugin to github pls? that's probably easier
btw api-version 1.8.8 is useless
||idk how to use github||
then just zip your project
oh do i have to change it ?
i'll send here
i have question how does it know that am trying to change nickname ??
i even tried changing usage on plugin.yml to /nick test and it still sent /nick username
you said you copy pasted it from your other plugin
are you running both at the same time?
yes but
well
i removed the command from the other one
yes
send your whole latest.log pls
i tried removing the plugin and then trying again
?paste
it sent the help spigot message
Do you get any errors when the command is run?
no
i still dont know why tf it shows me "usage /nick nickname" when i changed usage on plugin.yml to "/nick test"
hm you're not using maven or gradle, I don't have time to test it when I can't simply compile it, sorry
okay
are these better ?
better than what? ^^
than what am using
@west oxide If using InteliJ, go install this: https://plugins.jetbrains.com/plugin/8327-minecraft-development
I have no idea what you're using
ok
it seems like you are not using any dependency / build manager at all
so
yes, maven/gradle is better than nothing
ok
What's even the purpose of that plugin?
ty
changing nicknames
i'll try to fix and update here
@west oxide Send me your .jar as DM please
It’s awful
?
you guys are so toxic lol
yeah this channel is to help people, not to insult them
Who?
^
everytime I see someone asking for help there is a guy criticizing the code
Hmm, yeah, if you’re going to help someone here, you should be purely supportive.
Because those kind of people have nothing better to do
oh btw @ivory sleet since you have "ping for help" in your name, maybe you can help me? https://www.spigotmc.org/threads/apache-commons-for-1-17-and-1-18.535057/
I think people forget the fact that everyone was a beginner at some point
indeed
my first plugins were total garbage but I continued and now I got better at doing it lol
i hope so too
99% copied from existing product and just changing some message and called it my own
It looks like you’re relocating but not shading
Expertise
I am shading
there's a screenshot in the forums post showing that it got shaded and relocated correctly
my first plugin is 10 years old now lol
yes pog
they still had the command declared in their other plugin's plugin.yml
so the other plugin simply overrode the command
Oh damn, reaching the granny era
I'm 20 so go figure when i started programming aha
my first "coding" was VBScript when I was 6 but that doesn't count 😄
then I had a very bad time and decided to learn PHP
finally I got to java in school at some point
Finding my passion saved me from Depression
but that still doesn't help me with this stupid apache commons thing D:
I like php
Gets stoned to death for saying that
But i mainly work with C# and now Java for mc modding
Same I have Java class in school
Netbeans 🥺
mwoaaa
Eclipse 🤢
Ohoh netbeans
i used it in my class years ago
intellij is much better compared to it
VS is sloooow :(
luckily i started with java
blueJ compile time half a second 🤓
Same
imagine starting with cpp
that would be fun i guess
just doing the basic stuff
and then you see all the possibilties
🌝
So does anyone know how I can use Bluetooth to communicate with my program
Language doesn't matter
Write your own Kernal driver 😄
to start with c++ can be pretty aids but also fun. its also good for learning fast and efficient since its very close to the machine, OOP and is fucked up
uhu
Yeah that's not included with the jdk. And the available implementations are either dead or paid
Link?
there are many possibilities and i just found 3 by googling "java bluetooth connection"
Ah that's BlueCove the dead implementation I was talking about above
heh
even easier if you dont have any language specification
arduino 🤓
Yeah I've been looking around a lot
btw I got an answer on spigotmc forum explaining why relocating the class doesn't work
what the
this basically breaks my whole idea
now I have to shade apache commons into every of my plugins, so they will all be 700kb bigger >.<
I just pinged md_5 on spigotmc, I hope I won't get shot lol
Dont worry, you will be hanged instead 😄
uuugh my poor neck
heh
I'm not an instanceof Hanging
what the heck is my cat doing
cat things probably 😄
because its a state
that's the most generic cat name ever lol
very cute though
oh that looked like your food or something
oh are we showing our dinner for today?
this tho
Doge
Wait wha
doggo
@tender shard can you send a selfie? because you are my snack
lmao
u eatin the gays?
no my right eye is swollen, no selfies today
kinda fruity
soft meat
you can host craftbukkit src?
?
So that’s how you get your daily dose of vitamin C
doge sleeping next to het hot place 🌝
I'd rather get a dose of vitamin D but I'm too lazy to leave my chair
Vitamin B(ukkit)
vitamin A(lerithe)
Craftbukkit source is fine
except for the pluginclassloader, that source is cursed
Since it’s only patches, it doesn’t contain the actual NMS
LoL
shemamabo
every time i go programming i forgot my ideas
same
and then i remember them and realize idk how to lol
I just ping my todo list people and let them add my ideas to my kanban board lol
omg
mee6 is my todo list
and i just add things to my todo and never do them
auwch
that's also a good idea
later opening the todo while idling in my ide
seing the amount of todos
closing both
I know that feel
I already get annoyed by just seeing the todo list and that's only one plugin ....
Which app do you use?
I don't remember
let me check
wekan
installed through snap
snap install wekan
of course you'll need a reverse proxy if you already got a webserver running
trello but with a better boards ordering
Trello vs Github projects board
yeah trello is actually the best
but I like to selfhost stuff and wekan comes really close to trello
is it possible to get your trello-boards like in wekan?
i mean like that its on the top
@EventHandler
public void MobSpawn(EntitySpawnEvent e){
Entity entity = e.getEntity();
entity.setCustomName("§cMeat");
if (entity.getType() == EntityType.CREEPER){
}
}
}```
how do i ignite the creeper?
oh, no
just check if the entity is instance of Creeper
Creeper#ignite
then cast it to a creeper
ok
and ignite
yes
declaration: package: org.bukkit.entity, interface: Creeper
@hybrid spoke you want to use wekan and trello and have both in sync?
if so, no I don't think that's possible^^
well not its more like a visual setting in trello
that you dont have to go to your board dashboard or over a dropdown menu to change the board
so it would be like here, all boards ordered at the top
ah I understand
wait using snap but on windows?
actually that's also not all boards, that's just all the boards the user has starred
wait thats the server not the
it doesn't actually show all boards
im smart
hugh?
snap
i was idiot and thought u used it on ur machine
and got confused when i saw windows
no it's public of course 🙂
otherwise I couldn't force my people to add things for me there lol
debian gang
I'm only on windows right now to play MSFS and Anno 1800 😄
normally I'm on Linux Mint ❤️
hmm
and debian for all the servers
been thinking about fedora recently
oh and one server is on ubuntu because CheckMK doesn't run on Debian 11 -.-
f
yeah but it's rolling release, isn't it?
idk
idk fedora is probably fine but I like to stick to what I already know
that's why I keep using Debian, also the major upgrades are always awesome done within 10 minutes without any problems
im just scared debians gonna be hell with proprietary drivers
well linux mint is based on debian but I never had any driver problems on the desktop
manjaro 😳
even my ASIO soundcard is working fine
raspberry pi smh
mmm raspbian
raspbian goes brr so i thought lets choose something else
mwoa
maybe I should run apt again lmao
I recently got my first dedicated server
well, renting it
the hostname is kidney
what hostnames are you people using? I always use parts of the body 😄
been looking to change my server host actually, from ovh over to hetzner
the jumphost is called leg, mailserver is eye, gameserver is kidney, webserver is lung, etc 😄
scary
I'm using hetzner for dedicated and virtual test servers, and netcup for all other servers (all virtual)
yeah hetzner would be around $5 cheaper than my current ovh plan for the same hardware specs
ew, netcup
what's wrong with netcup? 😄
they have to know who to sue when you do shit 😄
the servers are AWESOME for the price
yeah but for that they dont need every information
i can live with my name, email, phone and adress
@hybrid spoke check out this https://www.netcup-news.de/2021/11/22/fahrplan-fuer-den-black-friday-2021/
but they want way more
yeah they want to prove your identity once
I'm there since 2018 and I can confirm the servers are indeed awesome
I'll try to get the RS 2000 G9 for 11.20€ instead of 16€ on friday
but it will probably be sold out within minutes
i will choose hetzner/OVH anyways over netcup
yeah hetzner is nice too but you pay like 1.5x as much as netcup
currently at contabo for discord bot hosting and small mc testserver, but their VPS are shit
i disagree
and ovh u pay 1.5x than hetzner 
but you get a free firework show
only in france
I use contabo and never have issues
looking for self hosting 😳
well don't they even limit inodes?
also their IO is slow as hell even when you have SSDs
but maybe that changed meanwhile
my last server there was 1-2 years ago
let's compare servers with benchmarks 😄
anyone here has any good alternatives to CheckMK?
yes
why it doesnt work on this case ?
message.put("test","more test","even more test");```
it shows error when i try to write .put
just use
Map<String,String> message = new HashMap<>();
A Hashmap has a key and a value
if you want a key to have more values you need to use a set or a list as a value
oh ok thank you
nvm that didnt work
what are you trying to do?
even with only 2 it didnt fix
just learning about hashmaps
what does it say
you cannot map three objects together
well its red because you didnt put the () behind it
i didnt even get to that point and it shows error
and you need to add the values in the () so that it doesnt show an error anymore
message.put("Hello", "test");
HashMap<String,Integer> ages = new HashMap<>();
ages.put("mfnalex",26);
ages.put("Obama",60);
System.out.println(ages.get("Obama")); // <-- will print "60"
then you can get the result "test" by typing message.get("Hello");
you are probably not inside any code block
@west oxide it needs to be inside a method
inside a code block*
btw reading the error messages most of the time tells you what's wrong
its inside of a class
aarh whats the difference between float and long again?
you cannot run statements outside of code blocks
float is with a "."
yeah it needs to be inside of a method
long are just long integers
float float float ah yes thats a float
3.141592653589793238 is a float. when casting it to a long, you'll end up with 3
but internally it always has them
of course you can store 3 as a float but it will end up being stored as 3.0000000000
depends where the jvm puts the point, im unaware of how it implements the mantissa / exponent shit
oh btw speaking about floats
there's this awesome video on youtube which explains the quake fast inverse square root thing
i have seen it
In this video we will take an in depth look at the fast inverse square root and see where the mysterious number 0x5f3759df comes from. This algorithm became famous after id Software open sourced the engine for Quake III. On the way we will also learn about floating point numbers and newton's method.
0:00 Introduction
1:23 Why Care?
3:21 The Cod...
yeah
definitely worth to see for everyone interested
saw that on yt
Too hard for my smol humanitarian brain
there reason why all the schedular stuff keep askin for my plugin instance
cause it wants it
idk
there is some reason
under the hood
that it needs it
not exactly a deal breaker?
To cancel your task if you disable your plugin
Does anybody know if SpigotMC provides a rest API to access the buyers list of one of my own plugins? (pls ping)
no but u can fetch it anyways thru the html body
this exists but yer what SP said https://github.com/SpigotMC/XenforoResourceManagerAPI
that's all I know abt the website api
nah that doesn't have an endpoint for getting the buyer list
ye
You can send a request to
https://www.spigotmc.org/resources/<id>/buyers?page=<page>
(note that the request needs to be authenticated)
and parse memberListItem
but glhf doing that
If MapRenderer#render() gets called every tick (atleast thats what someone on spigot.org said), why do maps on the client only update every ~15 ticks?
Does the client just refresh the map every 15 ticks, but get packets for the map every tick? or does he only get a packet every 15 ticks?
In other words: Can i make a 20 fps map by sending the map packets myself?
anyone know how I can get a ProtectedRegion from a location through the WorldGuard API?
ah I think I figured it out. WorldGuard.getInstance().getPlatform().getRegionContainer()
if I softdepend, does that also guarantee my plugin is loaded after the other plugin?
the plugins are loaded before your plugin yeah
but they arent necessary to load your plugin the first place. its like sorta addons and shit
just crashed server using for loop feeling good 👀
you need any help or you figuring it out?
is there a way to pass a method into the superclass constructor without using static?
why dont you wanna do it with static?
yes i was afk cuz trying to figure it out and i did lol
but thank you
all this time to fix it lol
because I need to use non-static fields in my method
Anyone happen to use pipelines with gitlab?
Does the Client only update its surroundings or process packets every tick?
Or can i send a Packet 60 times a second to visually change a block 60 times a second?
A server runs at 20 ticks per second, I think the client updates as often as you have fps
the problem would be that the server probably wont send 60 packets a second
not even if i use a normal (non-bukkit) scheduler?
is the sendPacket NMS limited to 20 tps?
try it 🙂
you can't fucking stop me
appearently its not possible to do anything more than 20 times per second
alright
so i was wrong, even the client works at 20tps
Pretty sure that thread is wrong.
You can send packets faster than 20 per tick and they will be sent
I'm getting a NoClassDefError on com/sk89q/worldguard/protection/flags/Flag. It's expected that the class doesn't exist, but the exception shouldn't happen, I'm not shading nor do I have it installed, testing how the plugin works without it.
Am I not allowed to cast to classes that are not loaded? What gets loaded when the class gets loaded at first? I've specifically not used any class members with types that don't exist in vanilla Java.
https://pastebin.com/FDCYB0fM
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
but the client wont process them at a faster rate than 20 tps
will be sent, yes.
but the client will only process them every tick
You may run into a bandwidth issue, but the client will process packets as fast as it receives them
i think thats true, but idk, dont have a client open right now
Hey! Im currently learning to develop spigot plugins. Everything works, i just now want to do a build system. Bascially i tried the maven thing, but it seems dififcult (atleast to me). I wanna setup gradle groovy. https://www.spigotmc.org/wiki/build-you-spigot-plugin-with-gradle-groovy/ will this work on Eclipse IDE?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
dont
use maven
The client has to process packets faster as you have multiple things happening in a tick. It can;t only do one per tick
what is better mcmmo or aureluimskills ?
if it processes 2 blockchanges in one tick, doesnt really only the second one take effect?
different case, thats not packets
whats wrong with gradle. Ive seen plugins use it
if you use packets to change a block faster it will be displayed on the client
.
thats interesting. will keep it in mind 🙂
Use Gradle Kotlin or Maven.
nothing is wrong with it but for a complete noob maven might be a bit easier? Gradle is essentially just the same thing but you can write Groovy (or Kotlin) code to customize your build process, which most don't need, especially in the beginning :)
ArmorStand animations
thanks for explaining 👍 then ill search more on how to use maven since i only found like 6 year old stuff on git, and the spigot repos
can you actually visually tell the difference between 20fps armorstand animation and higher?
gotta try that, would definetly proof ur point
is there a plugin?
ive gotta look at sending packages too. havent gone too far into that
same
i wanna do an emulator on a map (which the player holds in his hand). thats why im asking
would love if it was 20fps or even more
right now it only updates like every 10 ticks or so (on the client side)
Are you trying to find another reason to use packets
I dont hate packets. I hate when people use them even if there's better and more stable ways. Packets are internals that changes, like every minecraft versio
well then whats the better way to get a map to refresh more often than every 10 ticks?
dont think there is any
cant u use reflections or stuff like that to make nms work across versions?
atleast i heard of that, didnt look further into it
yeah same xD
Yes, but
- Reflection based code is a nightmare, especially when it becomes more complex than calling a single method
- The packet structure by itself can change very easily, so even reflection wouldnt save you from that
I see
can you just set the item in the players hand to an updated map?
or am I thinking of something the wrong way
cuz if that works the at least 20 fps on the map could be possible
true
Is there a way to pass a method into the superclass constructor without using static?
Does anyone know a way to use an offline player in a command argument?
Yeah
Anyone have experience with gitlab pipelines? Trying to find an image with java 17 to build a plugin with and it keeps telling me none exist
what really? didnt they remove that feature?
@final fog keep in mind that people can change their name. just saying
alright
It plays the maps open animation :c
gotta use packets then
but might be limited client side
to like 2 fps
which i dont hope
playing around with bukkit scheduler, i got an error that said The blank final field plugin may not have been initialized on line 13 when starting my server. doesnt seem right, since when i try to initialise it, it says Cannot instantiate the type JavaPlugin
code:
private final JavaPlugin plugin;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Update.p1.add((Player) sender);
Update.p2.add(Bukkit.getServer().getPlayer(args[0]));
BukkitTask task = new Update(this.plugin).runTaskTimer(this.plugin, 6000, 6000);
return true;
}
return false;
}
}
can anyone help me with setting an egg's velocity?
whenever i spawn it in, it always just dies almost immeidately
even when i set the velocity
is there a good guide to setup maven for plugin coding on Eclipse IDE?
i think velocity needs java 11+
im on java 16
its deprecated
but if you only have a name you can use it
Fishy try passing the instance of your main class (which extends JavaPlugin)
it can perform a web lookup tho so you might consider to do it async
or just make the main a Singleton, and use MyMain.getInstance() instead of this.plugin
Vector vector = p.getLocation().add(0, 0.5, 0).toVector().subtract(bossEntityLocation.toVector());
Egg projectile = (Egg) Bukkit.getWorld(bossEntityLocation.getWorld().getName()).spawn(bossEntityLocation.add(0, 1.5, 0), Egg.class);
getLogger().info(vector.toString());
projectile.setVelocity(vector);
anyone got any clue why this wouldnt work? it works if i apply the velocity to the player
I'm probably being very stupid, but how do i do something like this: /broadcast H E Y and make it send [CONFIGPREFIX] H E Y. I know how to do it a hard way, but not that im willing to do.
The way im thinking of: ChatColor.translateAlternateColorCodes('&', Main.getPlugin().getConfig().getString("prefix") + args[0] + args[1] + args[2] ...
but I have no idea how many args are going to exist
i messed around with it and got it to work, but now i get [17:31:51 ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'start' in plugin when trying to run my command
this error message is very useful to me
running the command :P, its not very specific on what
that cant be ur whole log lol
looks like the scheduler
send the whole error log
?paste
error logs are mostly like
at:
at:
at:
...
Caused by: <-- important
at:
...
or just ats, then look at the first
the vector being the difference between two locations, doesnt that make the entity travel that distance in 1 tick?
no cause whenever i apply the velocity to the approaching player, im flung back
and it takes a few seconds for me to completely move
hmmmm weird
um
what
can anyone tell me which better mcmmo or aleruimskills
Hey does anyone know how to switch the version of a premade server on 1.17 to 1.18 when it comes out. (basically upgrading the server's version) and have the all progress be saved just new items to get will be available along with newly loaded chunks be in chunks in 1.18?
@full forge send the whole log instead of reacting "HELP" lmao
hi whit speak french please for help
im german, sorry
i am now on discord web version
i couldnt talk here for some reason
anyway heres the log
test
there we go finally
i dont see code but your are try to use a getplugin or what?
Thats what hes trying
so yeah, getplugin basically. u got any idea @late sonnet ?
My idea was to simple make the main a singleton and use that
thats what i am doing all the time, works just fine, idk if its bad practise or if theres a better way tho
wouldnt it be better to just use <MainClass>.getInstance() ?
thats what i just said yeah
public class MyMain extends JavaPlugin {
private static MyMain instance;
@Override
public void onEnable() {
instance = this;
...
}
public static JavaPlugin getInstance() {
return instance;
}
thats my standard main @full forge
then you have a standard static getter for instance
and then you can, in your other class, do MyMain.getInstance();
and then you call that anywhere to get your instance
yea
is my code right now @crimson terrace ?
i always make the instance public cuz i prefer MyMain.instance.whatever
but bad practise
xD
wasnt bad code, sorry if I said something along those lines
and then i just say private Main plugin = Main.instance;, correct?
you could, yeah
or just use "Main.instance" all the time, instead of "this.plugin"
@full forge
you can try using this https://www.spigotmc.org/threads/misuse-of-the-singleton-pattern.193376/
should both work
Hey does anyone know how to switch the version of a premade server on 1.17 to 1.18 when it comes out. (basically upgrading the server's version) and have the all progress be saved just new items to get will be available along with newly loaded chunks be in chunks in 1.18?
well either way it worked, ty
I agree with that guy:
"ehrm, the plugin class loader prohibits you from creating a new instance of your main class, so it is indeed a single ton and it is perfect fine to create a getter for the instance. "
No problem! ^^
is there any event fired when a player is using a spyglass? I checked PlayerInteractEvent and nothing was fired
why do people put instance = null in their onDisable?
for a reload?
because the jvm doesnt shutdown?
What if some other plugin will access the already disabled plugin with getInstance? Probably it will cause some problems
any encounter git issues on gitlab pipelines?
36A problem occurred evaluating project ':Heroes'.
37> Cannot run program "git": error=2, No such file or directory
38* Try:
what is better mcmmo or alleruimskills
?
but if the plugin is disabled can another plugin still call methods from it?
no classnotfound or something?
not talking to you btw
ye ik
Yes, the Plugin is a regular java object
Bukkit.getPlugin will return null for disabled plugin but not getInstance
unless you set the instance to null manually
(Dependency injection is still better)
ah
Can i cast a MapCursor (org.bukkit.map) to a MapIcon (net.minecraft.world.level.saveddata.maps) ?
doesnt have a handler :(
Probably not
getMapIcon
@Nullable
public MapCursor.Type getMapIcon()
Get the MapCursor.Type that this structure can use on maps. If this is null, this structure will not appear on explorer maps.
Returns:
the MapCursor.Type or null.
yes but MapCursor has no sub or super classes, so no https://hub.spigotmc.org/javadocs/spigot/org/bukkit/map/MapCursor.html
my MapCursor doesnt even have that function huh
How long after 1.18 will release will spigot have server version 1.18 ready?
4
Uh?
public static JavaPlugin getInstance() {
return instance;
}
i used to do
public static MainClass getInstance(){
return instance;
}
?1.18
There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.
😅
?paste
I mean the latter there is probably more useful
hi conclure
Hola (:
How long did it take for spigot 1.17 to be released?
hey everyone so i made this
https://paste.md-5.net/qabedonixo.java
and
whenever i run any of those commands i get this error https://paste.md-5.net/paxibacoja.cs
a week or something
Okay
explain doe
Because the latter exposes your plugin instance’s full type
i tried for too long and idk what the issue is
So with the assumption that you’d have some getters for managers and what not in your main plugin class, then you’d be able to get those through the singleton
If you’re now gonna use the singleton
shakiz
You’re creating a new object of BwCore
So in principle
You got two or more objects of type BwCore floating around (at least that’s what you’re trying to achieve)
Oh yeah we didn’t cover objects right
uhh can you show me part of code where that happens ?
private BwCore plugin;
public CreateTag(BwCore plugin) {
this.plugin = plugin;
}```
Good afternoon all, what do I need to do in order to have ${project.version} replaced?
Gradle or maven?
Oh yes, maven
Ah @eternal oxide might be able to assist then (I use gradle)
mkay, thanks anyway for passing it on :)
how do I use a persistantdatatype?
for an entity or an itemstack
entity
when is the clearactions called?
on Object init before constructor i believe
How can i stop the player from looking around (clientside)?
besides making him spectate an entity
when its initialized, before any constructor methods are called
oke
how can I give a player an item instantly?
player.getInventory().addItem(item)
thanks!
Map<Integer, ItemStack> leftovers = player.getInventory().addItem(item);
if (!leftovers.isEmpty()) {
int amount = 0;
for (ItemStack item : leftovers.values()) {
amount += item.getAmount();
}
player.sendMessage(amount + " items could not be added because your inventory is full.");
}
if u wanna add an inventory full check
just thought id send this
Controllable cursor! :D
Now i just gotta find out how to get rid of the stuttering. any ideas?
you cant
:/
i mean maybe you could control it with vectors and stuff
to try and make it more smoothe
probably gonna allow the player to turn and then tp him back if he reaches pitch 90 or 45. would be smoother i guess
thats my only idea
any better idea? xD
right now i tp him back everytime he looks around even a little bit
tp him back = reset where hes looking
the problem is if he looks all the way down (pitch 90), he cant look any further down
therefor not being able to move the cursor down further
how do I make a custom command?(is there a tutorial?)
hey i have a question ...
test: test
test2:Testt
for example this is config file and i want to get all the elements in "Tags"
so like test and test2 in this case
yes plenty of tutorials
1 sec
configurationSection
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
it lists them all ?
thanks!
because i want to make them in gui
yh
no problem ^^
ok thank you
look into docs about it k?
https://www.youtube.com/watch?v=r4W4drYdb4Q
i am currently following this series if you want (am learning too)
Howdy all and welcome to my all-new series for Plugin Development! New videos every Monday. Join my discord for help and more :)
Download Eclipse: https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers
Download Java Jre: https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Down...
will also try this
i dont understand why it would make sense if you instantiate a command class with the constructor that you have to give a plugin instance which the command class uses to call super(plugin) with
if every command does that with the same instance, whats the point? it never gets modified again?
class Base {
private Plugin plugin;
public Base(Plugin plugin) {
this.plugin = plugin;
}
}
class Derived extends Base {
public Derived(Plugin plugin) {
super(plugin);
}
}```
whats the point of doing this every time with a command class so the plugin is always replaced with the same?
new Derived(this)
FileConfiguration Set
how do I get a Player from a username
probably type that question into google
you then run into this https://www.spigotmc.org/threads/get-player-by-name.318148/
but should I use getplayer, getplayerexact, or matchplayer?
what does it mean by exact name?
exact name
what's the difference between a normal name and an exact name?
getPlayer("fourteen") can return fourteenbrush is fourteenbrush is online
getPlayerExact("fourteen") would return null
Anyone know how I can fix this? ```
'java' is not recognized as an internal or external command,
operable program or batch file.
It's defined in system variables
Hello everyone i hope your all doing good, i have a little question : how can i change the color of the player name above the player head ?
i know this isnt a spigotmc related question but here goes:
im trying replace two strings ("%online%" and "%player_name%") however it doesnt return with the value i want to replace it with, it just returns %online% for example
code:
@Override
public List<String> getLines(Player player) {
return plugin.getConfig().getStringList("scoreboard.lines"
.replace("%online%", Bukkit.getServer().getOnlinePlayers().toString())
.replace("%player_name%", player.getName()));
}```
im using missionaryboard as a scoreboard library
what value does online and/or player_name store? if it's a string, try directly putting the variable instead of surrounding it with "%
the goal of the .replace was so i could have placeholders in the config returning certain values
this didnt work sadly
the % represents a placeholder in the configuration file
online stores the number of players in a server, and player_name stores the player name as a string
are you sure it didn't replace it? maybe the method returns the value before replacing?
what
what do you mean
how are you checking if it's replaced
im not checking if its replaced
im quite literally using the java.lang replace method
^^