#help-development
1 messages ยท Page 1434 of 1
what is the value?
and team, what is that value?
and double check this data is actually in the config and exists when you request it
might just not be loading anything from your locations.yml
Looking to hire a dev - needs to be very good with MC world gen source. Willing to pay a premium. please contact me!
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
I have unfortunately, not many bites!
Trying to give away some money here I can't believe how hard it is haha
yeah usually devs are up for anything if its paid
on that's interesting
And which realm/level it's in
Has to be fast.
If possible, I'd prefer just all ore vein XYZ and abundance to be saved to a Json/yaml file
Ore to start with anyway
ah so, the plugin would be
- fetch a chunk given the x,y coords and world
- find ore veins in chunk
- save them into file
Yep exactly. Or if the ore gen can be run by itself and just hand back XYZ and abundance, even better
doesnt sound too complicated.
did you make a thread in the development hiring category?
usually there are plenty of hungry devs, weird how no one's applied
oh haha
Need a week and 20 posts which I can't spend time doing right now unfortunately
to create a thread? really?
didnt know that
i'd just check the Offering category, msg everyone there who seems capable enough.
that plugin sounds pretty basic though, I'm sure some newer devs would love the chance at a low cost
https://www.spigotmc.org/threads/open-matheus-programming-professional-fast-reliable-nms-world-gen.502151/ this guy says he knows world gen
Yeah that's what I've been doing basically. Open the offering page and msg every single person on discord
I've done about 20 I think and all said can't do or no-show so far
Thanks for the link I'll contact him! Honestly though I think it's one of those ones that sounds simple but it's going to take someone who really knows what they're doing
I've already paid one dev and I don't think they're going to satisfactorily complete it
Ah I'm already talking with him aha
Hello, I'm new to Java and coding minecraft plugins. I know some basic java. I actually saw this video of Dream and George(Minecraft youtubers) who also code their own plugins. Here he is using an arduino with using Java code. I just want to know how that works, like are their any dependencies of stuff. I'll show an image of the code.
Im not copying their code or anything Im just curios how can an arduino work with java
Also I asked about this in this server coz its about minecraft
This is what you're looking for: https://github.com/kurbatov/firmata4j
Probably an api or smtng
Yeah it's the API I linked above
Ah
oh lemme check
ok maybe im just too dumb idk how to even add that
well thanks for helping tho
jesus
Do you know how to use Maven?
I recommend reading these:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
https://www.tutorialspoint.com/maven/index.htm
Maven Tutorial - Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build,
If you have any questions ping me
Can you fine fellers share a few tips and tricks for tidying up code? :D Just learnt about switch, which is better than using 100 if's and I wonder if there are any other ways to make code more efficient.
I wouldn't worry about it too much
Mostly learn as you go, but if you want feedback on your code feel free to post it here
Ok Olivo I read about it. So how do I like uk import that thing?
you read the maven guide and then follow it
Here's the dependency:
<dependency>
<groupId>com.github.kurbatov</groupId>
<artifactId>firmata4j</artifactId>
<version>2.3.8</version>
</dependency>
oh
since the repository isn't mentioned it's likely at maven central
wait lemme do that real quick
Yeah it is
Two different events run the same code. Is there a way to only need to write this code once?
yes
declare a method and move the code there
and then call the method from the event handlers
wait ive to do this in firmat4j project right?
https://paste.md-5.net/xujiliconi.cs If I use for example the ip method why do I get java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 ?
*Bungee is active!
No do this in your project
<?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>groupId</groupId>
<artifactId>CustomPlugins</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.github.kurbatov</groupId>
<artifactId>firmata4j</artifactId>
<version>2.3.8</version>
</dependency>
</dependencies>
</project>```
like that?
Yes but you should have a better groupId and artifiactId
line no. 8 and 9 right?
Yes
use your domain or github or whatever for the group id
<groupId>com.github.Aaryesh24</groupId>
<artifactId>CustomPlugins</artifactId>
<version>1.0-SNAPSHOT</version>
``` this ok?
jeeez this is too complicated
It's not really complicated. groupId should be your package and artifactId plugin name
ok my plugin name is 'CustomPlugin'
and ill let the group id the github one xD
alr thanks its done
๐
Im getting this error while copying his code....maybe ill do this thing someday when im capable enough of understanding this xD
did you try to load plugin without spigot?
Lol
the only way is with enchants.
You can then disable the showing of item enchants if you wish though
I want to hide the enchantmente lore with ItemFlags...
I already did this but it still does not work.
Glow class : https://pastebin.com/1nJ6Wb2Z...
I have seen plugins not use enchants
And how do you know they don't?
Did you like... read what I said?
You can then disable the showing of item enchants if you wish though
I want to hide the enchantmente lore with ItemFlags...
I already did this but it still does not work.
Glow class : https://pastebin.com/1nJ6Wb2Z...
Yeah
but the item does not have enchantments and it still glows
when I add enchantments the enchants show
you can add a flag that makes the item glow like its enchanted
ItemFlag.HIDE_ENCHANTS
nothat would hide enchants
thats not what he said
you can add a flag that makes the item glow like its enchanted
really? what flag?
/give @p stone{Enchantments:[{}]} 1 is vanilla atleast
I'm on LogicalDark's side here
i guess just give it an enchantment flags with no enchants
Give the item in question an enchantment that doesn't perform its effect when used. Like adding luck or fortune to anything but tools
and just hide the enchant
try
Bukkit.getUnsafe().modifyItemStack(item, "{Enchantments:[{}]}");
get the item meta first
What's the difference between HashSet, ArrayList and List? I wanted to set a list in my config and iterate it over in my plugin so people can add things, but I'm new and don't really understand it
HashSet is a collection of unique objects
Sets can't have duplicates
ArrayList is an implementation of a List
Arraylist is an implementation of a list
List is an interface
nice
List<String> list = new ArrayList<>();
think of it like this: all arraylists are lists, but not all lists are arraylists
ie, all dogs are animals but not all animals are dogs
List is an interface. So it basically dictates the minimum methods an implementation must implement
List has multiple implementations
the most commonly used is ArrayList
You also have others like LinkedList
Don't use LinkedList unless you have a scenario which can utilise it well though
Alright
Same for sets
also btw by default, a set will not have an order to it.
Set<String> set = new HashSet<>();
Can I use sets for like emote list?
what do you mean exactly?
Sets are unordered
like
Or another method?
another method
If you declared a variable in the scope of onEnable(); then you can only use it in the scope on onEnable unless you pass it to another method
You can pass a variable in through a method's parameters.
?
Is there a way to get change in X or Z? .getvelocity always returns zero
Yeah
and how do I do that
public void method(String value, int value2, double value3) {
do stuff with method
}
Ymm I also thought of something like key and value pair, because when im making emotes, it is like <3 = ๐
well uh
whyhax did you figure out how to get an item without enchants yet?
im trying to use it in a event
Oh, make it a class wide variable then.
I think
Bukkit.getUnsafe().modifyItemStack(witherCoal, "{Enchantments:[{}]}"); worked
yay i helped
Unlike an array list though you'd iterate via
Set<Object> set = new HashSet<>();
for(Object o : set)
{
}
// or
set.stream().forEach(v -> );
with enchantglint?
yeah but the changes I make on enable seems to jsut not work on the other method
Or use an iterator
LogicalDark lets go on pv, I'll describe the problem better
class Thing {
private int value;
public void onEnable() {
this.value = 5;
}
public void whateverEventThing(ThatEvent event) {
int newValue = this.value + event.getIdk();
}
}
vc?
Pv
like this?
private ItemStack witherCoal;
@Override
public void onEnable(){
this.witherCoal = new ItemStack(Material.BLACK_DYE);
you can set an enchantment level of 0 which won't have an effect on the item regardless of the enchantment
just make sure to add HIDE_ENCHANTMENTS to it
whyhax didn't want to hide enchants though. good alternate solution nontheless
then add the enchantment strings to the lore
and- if you don't want to hide the enchantments then I see no issue?
better yet if it's already enchanted then no need to add a fake enchant
true but whyhax needed it that way
how can I add attribute?
.equals or .isSimilar
However both require the same durability iirc
Use pdc to add a value to the item
I mean
if they are crafitng that item
im pretty sure it would just be that item
It works
thanks!
AttributeModifier modifier = new AttributeModifier("damageModifier", 50, AttributeModifier.Operation.ADD_NUMBER);
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
why doesnt this work
no errors
Did you set the meta back
yo I dont suppose i can have a hand, feeling a little out of depth but i have been working on this for so many hours with no progress. I have made a custom crafting GUI with a custom optifine pack to go with it (ill post a screenshot below). Now I want to put the default mc crafting recipes in there, but i cant get it close to working :/
I keep going back to this post: https://www.spigotmc.org/threads/creating-a-custom-crafting-gui.430406/
Is there an easier way to go about this - i am happy to use an API if needs be
nvm wont post a picture below since no image perms
This is not really spigot related, but how do you stop a folder from disappearing and moving all it's files to the main directory? And I can't get them by doing getClass().getClassLoader().getResource()
files/folders don;t move unless you move them
When I compile all the contents of the folder gets moved to the main dir and the folder disappears
then thats what your build enviroment is configured to do
How would I change that? I compile it with maven
are you using some custom jar configuration in your pom?
which folder is your issue? resources or something with your dependencies?
How do I make a attirubte only work for hand
This maybe isn't the right place to ask but I want to know what format I should store for my ignore system (I'll be using mongodb kinda like json), the key for each document is the player uuid but do I use something like an arraylist to store the players ignored players (uuid) if that makes sense sorry if Im wording this so stupidily so kinda like
uuid: myuuid
ignoring:
- uuid1
- uuid2
- uuid3```
you would have to monitor the event for the item use and cancel if its ofhand
nono
Ok so
I got this rn
AttributeModifier modifier = new AttributeModifier("damageModifier", 50, AttributeModifier.Operation.ADD_NUMBER);
witherSwordMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);```
but it gives to like
everything
cant I just make the attribute modifier to give the attribute if its hand
as far as I know there is no API method to do that. What you see there is Lore on the item. You'd have to monitor PlayerItemHeldEvent and apply or remove the effects.
but like
cant I just make it so it only gives it to When in main hand
cuz like it is a thing on normal mc
Monitor PlayerItemHeldEvent
Not as far as I know
sec
Seems if you apply a SLOT TAG
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
Hey can someone help me? I am Trying to hide a player from the Tablist using ProtocolLib. currently I have this Java var packetContainer = protocolManager.createPacket(PacketType.Play.Server.PLAYER_INFO); packetContainer.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER); try { protocolManager.sendServerPacket(player, packetContainer); } catch (InvocationTargetException e) { e.printStackTrace(); } but its not working because I don't know how to specify who to hide
does anyone have any experience using a VPS or a proxy to host a minecraft server? I could use some help lol, thanks
What exactly do you need help with?
well i have a server i host on a pc and i want to make it massively public. with my friends i just give them my public ip, but i obviously cant do that with random people. from my understanding i need to set up a vps or some kind of proxy server
This type of question should be in #help-server
But since we are here, I would recommend using another machine that isn't your home PC.
Do you have a vps? If not, that would be the first step
i do not
from my understanding bungee cord is a widely used "thing" that does alot of the complex stuff, right?
i would need to rent some kind of server, i was thinking maybe an azure vm but it may be cheaper to find a minecraft server hosting website because alot of them sell a bungeecord service
Bungeecord is a proxy, basically allows you to connect multiple spigot servers into a network
There are minecraft only server hosting sites, but from what I've heard most of them are not really good
There are services that offer bare metal or vps's, on which you can host whatever you want (including bungeecord). If you have the ability, you'd probably be better off using one of those
i know amazon has some sort of free proxy thing
if you wanna run only-minecraft, take a look at
bloom.host
thats where i am
so you just use that for bungeecord?
thank you discord, for your dumb link feature
you can yeah
one sec
this one for example
you can split it into 4 different servers.
so for example:
main/1: bungee
2: lobby
3: survival
4: creative
and tbh, a ryzen 9 for that price is juicy
Someone know how to remove the compass travel from worldEdit with a plugin ? (without change config.yml)
maybe do an own event? idk if they overwrite
own ?
yeah, you're in help-development
ah okay. so i have a physical pc i use for a server at my house, so i could get someone like that (not a beefy) and just link that to my server. i plan to just run a survival. so i would just be using bungeecord as a proxy
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
if you can port-forward, yeah.
then you could host it by yourself
CREATE A LISTENER
wtf
yeah and you listen what ?
I think you have a wrong understanding of what a proxy is, if you just want a survival server you don't need bungee
i already handle interact event but that's not work
ahh okay, yeah im just know kinda learning ab this stuff so bare with me lol
i wanan configure it for the user
by my own
i see
any user interraction required
maybe it works with the worldedit-api? idk
i already ask on them discord server but the tell me that i'm stupid and do it manually
so well
nice developers...
and i still don't understand why they implement this stupid fonctionality inside WE
yeah, worldedit devs are toxic tho
Listen to the event at a higher priority than WorldEdit and cancel it when you want.
hoo i forget this solution i'm trying
i asked one time, how to define a worldedit world, and they're just like
read your docs
yeah duh, your docs sadly are not telling that
don't work
No reason it shouldn;t, unless worldEdit is ignoreing the canceled state
what priority did you try?
HIGHEST
?
i just need a way to allow people to connect to my server while keeping my public ip safe. so i just need a vps, if my understanding is correct now.
sorry i replied to the wrong thing at first
wrong level
not really
HIGH so ?
i guess you just need a domain?
you need to run first https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/EventPriority.html
i mean sure, a vps would do it, but it'd still have a digit-ip
LOWEST okay
Any type of hosting, yeah
okay it work thx
Could be a vps, bare metal etc.
why using a vps for hiding your ip? tf
VPN
i do have a domain, but from my understanding it doesnt completely protect my public ip from ddos
wait maybe i dont
i got a dns from noip, a domain is different right?
im not a network guy XD i can set up all kinds of different servers on linux and thats about it
correct
and dont wants others see the ip
huuuuu the solution work for WE but not for FAWE.... wanna kill my self*
If you host on yoru own server unless you use a service like Cloudflare you will be vulnerable
obv it doesn't. but thats not what a vps does. except it has a ddos-protection
and tbh, no one will ddos you if you don't have 500+ players
Additionally most home IPs will not support over 10-20 players
why that
Bandwidth and packet priority
lol
gotchya
doesn't a domain is enough for him? i dont think he has like 500+ players
I self host on a domain. It simply provides a DNS resolution, name to IP
and if it only supports like 20 people
yeah obv
but if he doesnt have that much players, no one cares about his real ip lol
He probably doesnt want his IP to be public
and allows you to redirect specific ports to other IPs
even though it already is xd
NO way to hide the IP with just a domain
no one wants to take in effort to get his ip
right thats whta I was showing above
tf
that just want to damage you
people have ddosed me before and I dont own a 500 player mc server, there are just some people out there
i mean i have 300mbps up and down, so i would think there is pptential more quite a bit of people. but of course thats odds are small of that happening.
If you host a web server from your home it can be ddos by a single person with a web browser (most home IPs
yeah, thats my reasoning behind doing all this. some people
only my up is trash tho
I could ddos that with a simple F5 refresh on a web page
right but a domain isnt going to hide your IP
I recommend just getting a vps or hosting it on an actual server
not financially. they want to damage you in person
jff
and not your home pc
one sec. whats the worst on a ddos? isn't it just "disabling" your connection for a time?
damage wasnt the right word
There is only one "safe" way to home host. Thats with a hosted server running Bungee as a front end to the server hosted at home.
okay, i think you solved my problem
well you still need to buy a server xd
right, but it can be a cheap one
being just a proxy you can get a cheap one though
proxys doesn't need much
500mb of ram is what i saw
but be absoloutely certain you setup your server/bungee correctly
<500mb
if you do not secure your server for Bungee it can be hacked
i know some mimecraft server hosting services offer bungee
i was thinking maybe azure, but just some random server hosting service might be cheaper
now a bungee server would have to have decent internet speeds corrrect?
well it would be interfacing all of your players' connections
but for a handful of people it doesnt need to be like enterprise leve kek
how do I check if player has specific tag?
i mean tags added by /tag command
Bukkit.getScheduler().runTaskTimer(this, () -> {
//whatever you want to run
}, 0, 20); //20 means it runs every 20 Ticks, so every second
how can I make that repeating
wdym repeating
runTaskTimer is repeating
yeah
forever?
yes
oh
until you cancel
ok
until you stop the task
every 20 ticks in this case
starts instantly, because 0
i personally don't like it because for me it doesn't run on a lag
so i use java's Timer
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(label.equalsIgnoreCase("rankreload")) {
sender.sendMessage("Przeลadowywanie rang graczy. To moลผฤ chwilฤ potrfaฤ.");
for(int i = 0; i >= Main.plugin.getServer().getOnlinePlayers().size();i++){
Main.plugin.getLogger().info("Reloading ranks "+ i);
ArrayList<Player> currentList = new ArrayList<>(Main.plugin.getServer().getOnlinePlayers());
Player current = currentList.get(i);
if(current.getScoreboardTags().contains("vip")){
current.sendMessage("twoja ranga zostaลa oลwieลผona");
}
}
}
return true;
}
why for isn't running?
Looking for plugin developers dm me
i'm new to java and plugins ๐
you're checking if i, which is 0, is larger or equal than the amount of players on the server.
so your player count would need to be 0 or less for the for loop to run
json is a string representation of everything, so def not json
but a byte array can be larger than json, if you're using like 1k bytes for everything?
Ohhh ok can u help me making a plugin?
right? I mean redis already saves it as byte array lol
@dull vault this is not where you hire developers
there's plenty of tutorials in the internet and this is not the place for hiring
@half bane he wasnt talking to you, he's just advertising
Ok sry mb
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
@half bane use for (Player player : Bukkit.getOnlinePlayers()) { player.sendMessage("reloading your rank..."); //do stuff... } instead
thanks! worked
you're welcome
you can't put AI on a player
Citizens uses NMS and overrides just about everything
I have no clue what a gif is supposed to mean
you're a robot then
and youre rude
cannot disagree ugh
You will have to write your own AI for your NPCs
Hi guys, i;ve question about spigot yml hopper settings
Are they also modyfing hopper minecarts?
Cuz im afraid they are not, and im wondering if im doing something wrongly or it is as it is
okay, i've pasted it there
good boy
hey @ivory sleet so i kinda passed out (it was 1am where i lived) but do you mind us to continue with redis (jedis)
i think i needed to create a pool, but im not really sure how to do that
do i need to create a new class or can i just create a new public void?
do smtng like this:
class Conclure extends JavaPlugin {
Jedis redis;
JedisPool redisPool;
void onEnable() {
redisPool = new JedisPool(new JedisPoolConfig(),"localhost"); // ofc change this
redis = jedisPool.getResource();
redis.subscribe(new RedisListener(),"channel");
}
void onDisable() {
redis.close():
}
}
class RedisListener extends JedisPubSub {
//override methods
}``` iirc
Hi guys, is it possible serialize an object into another object serialization?
I'm using the Bukkit API for object serialization
All objects that implement ConfigurationSerializable (and primitives) can be nested.
ok, thanks
https://imgur.com/a/LLq1Kdf
@ivory sleet looks like i got some errors, maybe i didn't import redis/jedis correctly. btw should i change localhost to my server ip/domain?
does the List<? extends Number> type is somehow already registered as serializable or do I need to do it manually?
the natives should be registered already ๐ค
ok, thanks
If a variable can throw a NPE, what is the point of checking that it isn't null if the handling means throw another exception?
can anyone help me executing commands from an website to my server using php or anything else?
oh its suppose to be redisPool.getResource()
alright now everything works as i should!
so now i have a class called RedisListener and it extends JedisPubSub as it should!
where do i continue to connect to the other server
im assuming i have to connect to it and then send requests to it
hello, does any1 know how to sort tablist using teams? or simple way
the team names is what sorts them @vital swift
if I need to make changes to a certain file in NMS that doesn't have a patch yet, can I just copy the file for the work dir buildtools makes?
then if I use makePatches it'll make a patch for that file right?
yes, sort them by naming them alphabetically
so no need to set prefix?
btw ur plugin is amazing the minigames of famous server
i haven't tried it yet
arcade minigames? thank you :D
Is InventoryMoveItemEvent fired when minecart hopper moves item?
yea
@ivory sleet you there?
Hey, so I managed to remove the players from the tablist, but now they disappear after leaving the render distance and never appear again. So after googling for a bit I read to send the PlayerInfo Packet with ADD_PLAYER again and then remove it short after
but that didn't work, does anyone have an idea? https://paste.sentinalcoding.eu/Pj2XLIT24R
Test it
I've tested and its not for me
yes
So which one is fired?
how can i filter out statistics that require a material input
If it is not that, I donโt know
I would have thought it was that one
There most likely isnโt one if it isnโt that
@worn sierra I just came to think about something
.
BuildTool -> MavenLocal
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
How can I get the chat message of an advancement ie wowkster has completed the challenge [Cover Me in Debris]. I tried the BroadcastMessageEvent but it seems like advancements aren't broadcast. I also tried the PlayerAdvancementDoneEvent but it doesnt give you the actual chat message. Is there an easy way to get whatever was sent in the chat? I dont need any info about the advancement just the raw text
you just wanna change text of the advancement or?
I dont even need to change it
just get the raw text
I want to send it in a discord webhook
I cant figure out how to get the text
check for event
i already have it in my pom
which one?
change artifactid to spigot not spigot-api
PlayerAdvancementDoneEvent
same thing
did you refresh the maven
minecraft:nether/netherite_armor
:(
that fixed it thanks
Is the advancement decoded on the client?
that might explain it
I'll take a look at the client 1.16 code and yoink it
yyea
yoink
yoink
and if you getKey().getKey().toString()?
looks like the client has a ClientAdvancementManager class so I'll look there
okay
Pretty sure the values are not actually stored server side. Only the advancement key is sent to the client
It's not actually a chat packet its an advancement packet
yeah maybe that could be it
look at how discordsrv does it
they have their own names for advancements
just a map of em
i think
ok
Hello, does someone knows how can i create multiple Scoreboards not objectives?
@vital swift What do you mean by "multiple"? One for multiple players or multiple Scoreboards for one player?
multiple scoreboards for one player
@vital swift Use different DisplaySlots (Sidebar, PlayerList, BelowName) Or do I get your question wrong?
What exactly do you want to achieve?
You can also split your regular scoreboard into different sections.
HP BW for example shows "team infos" / "event timer" / "per player info" in one sidebar scoreboard split into "sections"
If I have a serialized obj of class B and this class extends class A. When I deserialize that object if the method deserialize() is in class A what will happen? (I'm using Bukkit Serialization API)
If using the Bukkit serialization API you don;t call deserialize
Mh. Is there a solution without copy pasting code? Like using SerializableAs annotation
you are serializing to a file?
yes
what object?
a custom one
then did you correctly implement ConfigurationSerializable in that custom object?
I think so, the problem is I have a parent class that implements the interface and all the relatives methods but then I serialize the child classes
The serialization goes well, the deseralization don't
Your custom class has to implement ConfigurationSerializable, AND you have to register it
I've only registered the parent class
then you havn't correctly implemented CS
CS?
I'm not typing ConfigurationSerializable every time
any Object you want to be able to serialize you have to implement it in
The Bukkit serializer has to understand the class you want to put/get from the config
Besides that you should ask yourself if inheritance is really needed. If you use it for a config for example then you can transfer the information to a data object and then serialize this object. Or keep it behind an architectural boundary then you have the option to change the kind of persistence if needed.
is buildscript bad
i dont get why its saying that implementation reference cant be found
when i included java plugin and shadow plugin
and for some weird ass reason if I use buildscript, the errors go away. But it should be the same
isnt it mostly the same except like syntax?
dependencies {
subprojects.forEach { implementation(it) }
}
plugins {
java
}
u r dumb
like very dumb
plugins block should be at the very top mostly
Oh oops lmao i forgot to declare that before
yeah I was lol
not sure why gradle didnt give me an error tho
gradle is kinda dodo sometimes when working with a lot of modules
like any build management software anyways
lmao
lol
true
Was this sarcasm?
absolutely not
Sounds like^^
have you tried spring?
lol
In the onDisable() method is there a way to tell if the server is shutting down or just reloading?
Not super necessary but would be a nice feature
@ivory sleet For luck not...
lmao
why when I deserialize a float number it is converted as a double? @eternal oxide
unless you are using an object it will be stored and read as a double
๐ฆ
cast it
The problem is that I'm using a list
pretty sure bukkit has a number conversion class
(float) getDouble(path)
yes
why, are you getting an auto boxing problem?
I think so. I need a list of float
config.getFloatList(path)
does that exist?
pog
I'm working inside the deserialize method. I've only access to a Map<String, Object>
The object is already a List of doubles
nice
@ivory sleet Atm I try to decouple my code as much as possible from bukkit/spigot. So I ask myself a lot of such strange questions...
if you have serialized it correctly you shoudl be able to store it as floats
@ivory sleet Often it results in high cohesion^^
then its a pebkac issue
when u're trying to decouple then u shouldnt end up with something more cohesive
and vice versa
It is difficult to serialize it wrong.. The serialize method must return a Map<String, Object> I've just put a entry with values ("mypath", a list of floats)
Am i missing something?
?paste show me some code
Is it possible to send down the new module (project) that I have boxed for intelij idea?
as if it was a different project. It looks so complicated that way
and bc I want to work with 2 projects at the same time
Sorry, I've just updated the code with lamba. Wait a minute that I rollback
https://paste.md-5.net/uzukovijuh.js @eternal oxide ok
@ivory sleet decoupling result always in cohesion? Or I am wrong? Small cohesion -> high coupling and wise versa... ?
does that packet name reflection even work?
its hard to tell exactly without any concrete code
yes it works...
ok
are you seeing an error? as that looks fine to me
so long as your floats are actually floats when you put then
wait a sec, I take a pic of the memory
The list that is actually stored inside the map is stored as a list of doubles from the very beginning... So I think that this is a bukkit problem @eternal oxide
RIP me
hi, im trying to create a hologram but it says this
how many floats did you try to store in teh SS?
it shows 2 doubles
It should be 2 floats
will it cast without error?
then you are getting 2 floats out but the only issue is that its storing as doubles
I solved using lamba
And mapping all to float
I'd not wory about the storage type if the data is retrieved correctly
anyone know what i should do? it says this isnt a statement
(this.pointsHologram = (Hologram)HologramsAPI.createHologram((Plugin)this.plugin, this.plugin.getPointsLocation().addLine(CC.translate("&7&m-----&b&l Top Factions &7&m-----"))));
but it is
why do you have the outer brackets? @lyric grove
show how you solved please, for future
packet.floats = ((List<Double>) args.get("data-floats")).stream().map(Double::floatValue).collect(Collectors.toList());
ah ok
rude?
ahhh, no problem
im kinda new to java so im probably messing this up. but can someone tell me how to deal with this error
org.bukkit.plugin.InvalidPluginException: Cannot find main class `Minebot.MinebotRun'
your plugin.yml has a line that is supposed to point at your plugin's main class
the value on that line is incorrect
simply write the location of your main class
the first line in your main class should be package somethingsomething
and your main class might be named MyPlugin
in that case the value would be somethingsomething.MyPlugin
where it is.what it's called
ok my package is minebot and the main is minebotrun so wouldnt that make it minebot.minebotrun
yeah...
assuming they're both in lowercase, yes
package MineBot;
import org.bukkit.entity.*;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import java.io.IOException;
public class MinebotRun extends JavaPlugin{
@Override
public void onEnable(){
it is uppercase
main: Minebot.MinebotRun
name: Minebot
version: 1.0
description: Beta
author: dragonblade316
api-version: 1.16
thats my yml
^^
oh
use proper naming conventions
packages should be all lowercase
minebot.MinebotRun
ok thx
did you do the excercises
hi
out of what?
i've never actually done any excercises or tutorials so idk how good those are but they're probably better than nothing
oooh
i mean only now im getting stuff i dont know
how do i load a config from the resources folder in bungeecord
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yea i have loaded it and saved it
but it still isnt showing up
i havent even made a bungeecord config my bad
<
I have 0 context to what you have done - strangely i don't know
private void registerConfig() {
try {
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(getDataFolder(), "config.yml"));
ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, new File(getDataFolder(), "config.yml"));
} catch (IOException e) {
e.printStackTrace();
}
}```
probably so wrong huh
that isnt throwing an ioexception though
you need to save it right?
yea i did
ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, new File(getDataFolder(), "config.yml"));
tbh just use some config library or framework
nothing that is bundled with bungee is ever good
https://www.youtube.com/watch?v=hqy3mI3AgSY
maybe try this
nvm
does anyone have a way of getting all blocks in a circle around a point in a way that is optimized for efficiency?
i did it
how big of a circle are we talking about
up to a radius of 30 blocks, give or take
getting the blocks themselves will cost you significantly more time than calculating the locations
and this is a circle not a sphere
just compute the squared distance and compare to a limit
yeah what they said ^^
math is cheap
even sqrts and powers are relatively cheap
it turns out that computers are sort of made for computing things
hm
most cpu's have math coprocessors built in so just about any math operation is cheap
I guess my main question is one of resolution, as in how do I optimize it so I get only the right amount of blocks and not way more or not enough
although i'm not sure if java leverages the actual cpu level instructions
http://www.javadecompilers.com/
can anybody access this site? Or is it just me?
Java decompilers online: *JAD, *JDCore, *Procyon, *Fernflower, *CFR. โ A user interface to extract source code from .class and .jar โbinaryโ files.
i know when using strictfp and strict math they don't
but iirc in regular use they're just forwarded to the processor and are executed as a single instruction
any idea for the resolution question?
just iterate a square up to the maximum range
and check the distance of each block
distance squared, that is
sqrt might be cheap but there's still no point in spamming it needlessly
but surely block distance would vary right
oh I see what you mean
ok
that was not how I was going to approach it lol
I guess it would be sort of an edge fill system
for bigger circles it might be beneficial to flip some signs and swap some axes so you only need to compute 1/8th of the blocks in the circle
and for even bigger circles you could sort of A* it to draw an outline and fill that till the origo but that's probably unnecessary
yeah 30 blocks should already be the maximum radius of the math done here
I was also considering just caching the results honestly
measure once cut a thousand times right
but probably not worth the effort
yeah that's what I meant
perhaps that may work
thing is when it does activate it's constantly going to be calculating blocks from ranges 1-30
because it's a shockwave effect
bit of a waste
precompute the blocks asynchronously ๐
that's unironically what I did with the rest of my rotation math so I don't see why not lol
then use protocol hacks to do the shockwave ๐
ok that's too far
don't synchronize to main at all and just read from the block palette of the chunks ๐
man these memes make me want to remake the first minigame I ever played in minecraft
back in classic, the arenas that would autofill with lava
it just invoked the api asynchronously, so each call to getBlock or getType would block the async thread for like 50ms
can you even make blocks modifications async?
it was thread safe but super slow
doubt
because bukkit forces it to sync
prolly glitches
bukkit forces the world modifications to happen synchronously
but they are only scheduled to the start of the tick
so it takes like a tick per every 3 or 5 blocks
try{async()}catch(DumbshitException ex){sync()} hey guys I made async mcmmo
and you're jumping between main and the off-thread like 100s of times
this is pretty fun though
I'm making a classic mmorpg power where there's a slice of terrain that is safe and the rest is deadly
feels good doing fun stuff like that
no fun allowed
oh shit it's the fun police
quick, hide that temporary solution from 3 years ago currently holding up the core features of your plugin
is there a way to naturally place a block as a player
taking stuff like clicked face and whether the block can be placed into account
spoof a block place packet or something for the player and hope there is no anticheat plugin installed
beyond that, it's nms town
spoof an incoming one?
myeah
there is a method somewhere that does it, I remember it popping up in some noteblock thread where someone was trying to make noteblocks not interactable
lemme see if I can find the thread
idr if there is anything of use there for you but i vaguely remember someone mentioning a nms method that does it there
wowee
next stop is auschwitz
I guess no one ever expects the nazi inquisition
hmm seems odd that the method is in itemstack though, i'd think there would be something in EntityPlayer or Human
you could say that they did nazi it coming
my jokes are so killer that the chat died
I guess jokes shan't set you free after all
is there like a tutorial for packets somewhere
where the hell are they in the nms code even
protocollib is your friend
more dependencies bro really
just about anything hacky or complicated depends on protocollib anyway
it's the vault of 1337 developers
alright well how would i send the packet to the server
is it possible to use TranslatableComponent in an Item's name?
@ivory sleet hey there so i have everything you have said and now have a class called RedisListener which extends JedisPubSub. Where do i continue with what im assuming is connecting to the server and then running public void's on it
idk if you can on spigot
not sure how to go about it. LocalizedName no longer works past 1.13
if there is a name setter that takes components, use that
if there isn't, you're out of luck
check if ItemStack or ItemMeta has a spigot() method
a lot of dumb stuff is hidden behind those
or use paper :fingerguns:
well i am using tuinity lol so I should have access to papers methods
ItemMeta::displayName
takes Adventure components
use Component.translatable() to create a translatable component with the key of your choice
tunuti
uwuinity
is it possible to get the exact collision Location for a ray trace result?
either that or the distance from the raytrace origin
can you even fish with the offhand?
because if there's one in the main hand, it's the main hand, otherwise it's the offhand
what if i'm dual wielding fishing rods
if you cast with offhand and put one in your main hand it switches to main
do i shoot 2 bobbers at once?
kinda seems something that should be on the event though
main hand has fishing rod = main hand did event
implements Handy
public void reloadConfig() {
super.reloadConfig();
saveDefaultConfig();
config = getConfig();
config.options().copyDefaults(true);
saveConfig();
}```
is this an effective way to reload config file?
really just need saveDefaultConfig and reloadConfig
ideally saveDefaultConfig first in case the existing one was deleted
dont really need a variable called config either
so if i just put reloadConfig(), it gets the job done, but all the other things are to make it safier
all you need is saveDefaultConfig() and reloadConfig()
in addition to writing it there if it isn't there already
idk, i never bother to write reload commands for my plugins
I just make them work fine on reload and expect people to use a plugin manager to reload them
yea ig
only one of my plugins doesn't work properly over reloads and that's because slimefun is trash and just explodes on reloads
pretty sure you need reloadConfig
though I did rewrite parts of it so it works now
ยฏ_(ใ)_/ยฏ
because I don't like restarting my test server
PacketPlayInBlockPlace packet = new PacketPlayInBlockPlace(evt.getHand() == EquipmentSlot.HAND ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND);
EntityPlayer player = ((CraftPlayer) evt.getPlayer()).getHandle();
player.playerConnection.a(packet);``` how the hell can i spoof the packet to the server from the server? this doesn't do anything
whats the different between get x and get block x
what
do you mean the methods on the Location class
just yes or no will do
i think yes