#help-development
1 messages · Page 344 of 1
If you plan on doing DRM elsewhere, stop asking here because we have no reason to help you
¯_(ツ)_/¯
again, as if ive ever mentioned wanting to upload it to spigot
?whereami
Refer to above message
if you plan on reading my initial request, all ive asked about was if there was any way i could retrieve an unique server identifier, not if i wanted to make a spigot saas
¯_(ツ)_/¯
and i think that is something i can ask about in the spigot's server or am i wrong ?
which is the string?
what i need to write?
sorry im bad in this
Refer to the above message
If you plan on doing DRM elsewhere, stop asking here because we have no reason to help you
Your DRM is going to get cracked anyways
you are telling me you only help people that want to upload their resources on spigot ?
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(num);
stack.setItemMeta(meta);```
if you're blind or have learning issues, here's a TL;DR
- Don't do licensing on spigot
- If you're doing licensing elsewhere, then don't ask us here (because we help with spigot-related info)
No, there's just no reason to support something explicitly against our rules of our marketplace
"marketplace"
Go to tph or something for advise outside spigot rules.
ty , i will try
i am not going to post anything in your marketplace, i am gong to sell this on my own.
It's like going to a microsoft discord server and asking about making a hackintosh
its almost as if the title of this channel says "Spigot and BungeeCord programming/development help"
Man. Reading is hard
yeah

With technologies such as SSVM it is very hard to use DRM in java world
i dont think making a personal project is against the rules
Just move on with your life
There is like only a single good obfuscator out there and it costs a huge amount of money
crack it
With huge I'm talking at over 1k
you can probably find a torrent
I'm not aware of it being leaked frequently
i could say the same
there are a few leaks here and there but they are a few months to years behind
now , how i can set the slot ?
SpigotUtils.spigotCommand("o give " + p.getName() + " totem_discord" ); p.damage(Double.parseDouble("20")); 🔴 p.getInventory().setItemInOffHand(); ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1); ItemMeta meta = stack.getItemMeta(); meta.setCustomModelData(1); stack.setItemMeta(meta);
set the item in their inv to it
?jd-s
// ItemStack code
player.getInventory().setItemInOffHand(stack);
player.damage(20.0);
no need for the SpigotUtils.spigotCommand
i am doing licensing elsewhere, infact i am NOT ASKING YOU FOR HELP TO LICENSE MY PLUGIN, i am asking IF THERE IS A VALUE I CAN RETRIEVE FROM THE SPIGOT SERVER INSTANCE THAT IS UNIQUE TO EACH SERVER, which i think is spigot related.
reading is hard !
what you asked earlier for wanting a UUID. Literally if you need to ask the client for one then you can't trust it isn't spoofing someone elses UUID. There is literally no way to prevent or check that unless you start locking down stuff to ip addresses because from the server end or external there is not really a lot you can use to identify something other then an IP for uniqueness. Since you won't specify what exactly you are making or being super secretive of your method that somehow prevents piracy. There isn't really much else to help with. Basically you didn't come here for help, rather you came here for ideas especially if you already know how to do all this.
The mac address of the user. 👌🏻
NO there isn't because you can't trust the client
thanks that was literally the only answer i needed
well, not sure how well your anti-piracy mechanisms are going to go if you don't know the basics of security. But good luck to you anyways I guess
thanks :D
how can i see when a player got shot
projectilehit event
Ahaha, true.
hello, I tried to make that when player right click block then send command as console "example command %player%" but the plugin from that command look like can't get the player name that right click block
declaration: package: org.bukkit.event.entity, class: ProjectileHitEvent
I believe you are wrong
it does return an Entity
ooh
wait i was thinking of shoot event
but does that mean that when its shot and it lands on something it will return a value?
code?
Player player = event.getPlayer();
if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack" + player);
if it hits anything it will trigger
as it returns either a block or entity
?earlyreturns
thanks
@quaint mantle can we get anearly returns command with some good link about it
ohh okay I'll trie thank you
ItemStack stack = null;
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
like this?
well a bit on the nose with that
that's null
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
that's all command , can it work (or just try and see)?
`package me.sussolino.juicepvpcore.commands.inviti;
import dev.sweety.swcore.api.utils.ColorUtils;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import static dev.sweety.swcore.api.utils.ColorUtils.color;
public class Discord implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (sender instanceof Player p) {
p.sendTitle("§b§lDiscord", "§dLink in chat", 10, 60, 20);
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
}
sender.sendMessage("&fꐻ");
sender.sendMessage(color(" &d&lDiscord"));
sender.sendMessage(ColorUtils.colorize(" &f➥ &e&nhttp://discord.juicepvp.eu"));
sender.sendMessage("");
return true;
}
}
`
Help? I'm actually using XSound from XSeries for playing a Sound (matched from the config) inside an 1.8.8 server.
AMBIENT_CAVE exists as Enum inside XSound but, when played it gives me this error:
Caused by: java.lang.IllegalArgumentException: Unknown sound: Optional[AmbientCave]
at com.cryptomorin.xseries.XSound.parse(XSound.java:1683) ~[?:?]
at com.cryptomorin.xseries.XSound.play(XSound.java:1597) ~[?:?]
at it.mikeslab.kitpvp.task.player.death.DeathSounds.execute(DeathSounds.java:14) ~[?:?]
at it.mikeslab.kitpvp.task.player.death.DeathManager.onDeath(DeathManager.java:32) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
... 26 more```
yeah
thanks , i will try
String x = (String) null;
System.out.println(x);
just to mess with people
it work but there is a problem , if player has a item in offhand , remove it and place the totem , can i save it and re-place it when i set the health to 20?
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
p.setHealth(20);
after "p.setHealth(20);
check if theres something there, if there is you can probably set it to a variable, give them the totem then give the item back
idk how i can do :(( , if u can help me im happy
Thank You it's working! I tried with DisplayName and do not know that there is also getName
ItemStack offHand = null;
if (player.getInventory().getItemInOffHand() != null) offHand = player.getInventory().getItemInOffHand();
//do stuff
player.getInventory().setItemInOffHand(offHand)
like this??
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1); ItemMeta meta = stack.getItemMeta(); meta.setCustomModelData(1); stack.setItemMeta(meta); p.getInventory().setItemInOffHand(stack); p.damage(20.0); p.setHealth(20); ItemStack offHand = null; if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand(); p.getInventory().setItemInOffHand(offHand);
you need to save the offhand item before setting it to something else
oh ok
That's certainly some of the code ever written
meta.setCustomModelData(1);
stack.setItemMeta(meta);
ItemStack offHand = null;
if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand();
p.getInventory().setItemInOffHand(offHand);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
p.setHealth(20);
set the item in off hand after you damage and health them
ye
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
ItemStack offHand = null;
if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand();
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
p.setHealth(20);
p.getInventory().setItemInOffHand(offHand);
:)?
it's correct?
yeah
i love u
you can probably remove that null check
and just set off hand directly to the item
translated to "remove the null check as its adding code for no reason they should have fired the person that came up with those lines of code"
it work , thanks EpicEbic
@eternal oxide I've a problem with finalDamage
if(event.getFinalDamage() > player.getHealth())
This sometimes becomes false even if the player die.
=
Hey, if i would like to use world edit regions in my plugin. For example make player select an area and then using a plugin it saves the region.
and whats the problem with that?
Like i want to make code that lets me select one corner and then other corner, then save the area using my custom command and then make it generate a specific block in the whole area that was added
like the plugin mineresetlite
world edit has an api
90% of people in this cesspool of a community. They want to belittle you and tell you off instead of helping you on your way to find out why something isn't viable yourself and gain all the experience along the way.
But the 10% exists
Idk but someone thinking that their idea is good and then spending 100h implementing it just for it to be useless might be a "learning experience" but at the same time extremely demoralizing.
I mean you are at teh wrong place if it is about DRM
I was about to suggest going elsewhere but my internet went out xD
Well if they do its there chouse and they shouldnt demoralize them even more just bc they think its not good
Recaf probably might be the best "clear" area that is suitable (that I know of), but even then they aren't the right people
Shouldn't take 100h to find out that something isn't viable. A somewhat capable developer should have a far quicker prototyping process. Btw, the really good developers have countless thousands of hours of debugging, trial and error as well as just straight up experimentation on their account. It's not like deep and fundamental concepts come naturally.
Even if you are gifted, you still cannot know about all the concepts we use in computing right from the get-go.
Not like these grow on trees and are something you're born with. It takes effort to get into some domain.
I think it depends, but I can certainly say that the starting point of the learning curve is different for everyone
Well you can't just dive into cold water regardless of what you are doing
they were not interested in engaging in meaningful discussion in why what it is they are doing wouldn't be viable
Don't bring your idea to a public forum if you don't want criticism imo
I don't think that people are against constructive criticism. But most answers on here just aren't that, lol.
Value doesnt change?
public static void save(HashBasedTable<UUID, UserData, Integer> dataTable, KitPvP plugin) {
YamlConfiguration config = plugin.getConfigManager().getLoadedConfigs().get("values.yml");
dataTable.cellSet().forEach(cell -> {
UUID uuid = cell.getRowKey();
UserData userData = cell.getColumnKey();
System.out.println(userData.getKills());
config.set(uuid.toString() + ".kills", userData.getKills());
config.set(uuid.toString() + ".deaths", userData.getDeaths());
config.set(uuid.toString() + ".level", userData.getLevel());
});
plugin.getConfigManager().saveConfig("values.yml");
}
Kills value is actually 8 but doesn't get updated in the values.yml config.
Value doesn't get overwrited... It's always 7.
So it doesn't come naturally. Of course you can understand concepts very very quickly if you're good at logic in general vs. somebody who isn't, but you still need to invest time and effort to find out about all the cases in your domain if you want to be an expert at it. That time is different for everybody, but never zero.
geol help me
Did you print the paths you're setting at to check their validity? What's behind plugin.getConfigManager().saveConfig("values.yml");?
public void saveConfig(String configName) {
YamlConfiguration yamlConfiguration = loadedConfigs.get(configName);
try {
yamlConfiguration.save(new File(plugin.getDataFolder(), configName));
} catch (IOException e) {
throw new RuntimeException(e);
}
}```
hold on
I am afraid that regulars know my approach when it comes to that
This guy just did what a guy
I.e. I never work with YAML outside of configs - for data storage DataInputStream/DataOutputStream is more suited for me. That of course may not apply to you
But I can tell you, using raw bytes is much nicer than yaml when it comes to debugging
I made a class that does the hard stuff for me so I only needed to debug it once xD
- "That of course may not apply to you"
You're always right geol 🙂
Oh wait, this is the result actually:
why does it repeat more than once?
@EventHandler
public void onJoin(PlayerJoinEvent event) {
UUID uuid = event.getPlayer().getUniqueId();
Internals.DATA_TABLE.put(uuid, RawData.parser(uuid, plugin), 0);
}
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_AIR && player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
}
Is RIGHT_CLICK_AIR not a thing anymore? or my constructor is bad/need to add target or smth like that?
Yes but you don't print it
Or do you?
Show your print calls, otherwise there's no way knowing that
public static void save(HashBasedTable<UUID, UserData, Integer> dataTable, KitPvP plugin) {
YamlConfiguration config = plugin.getConfigManager().getLoadedConfigs().get("values.yml");
dataTable.cellSet().forEach(cell -> {
UUID uuid = cell.getRowKey();
UserData userData = cell.getColumnKey();
System.out.println(userData.getKills());
System.out.println(uuid.toString());
config.set(uuid.toString() + ".kills", userData.getKills());
config.set(uuid.toString() + ".deaths", userData.getDeaths());
config.set(uuid.toString() + ".level", userData.getLevel());
});
plugin.getConfigManager().saveConfig("values.yml");
}
@Override
public void onDisable() {
saveData();
}
public void saveData() {
RawData.save(Internals.DATA_TABLE, this);
}
[18:23:09 INFO]: [KitPvP] Disabling KitPvP v1.0-SNAPSHOT
[18:23:09 INFO]: 9
[18:23:09 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a
[18:23:09 INFO]: 7
[18:23:09 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a
[18:23:09 INFO]: 0
[18:23:09 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489
[18:23:09 INFO]: 0
[18:23:09 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489
you holding iron horse armor and is the event registered
why not xD
?
yes Im holding a iron hors armor in main hand and event is registered in Main class on enable
when I change it to RIGHT_CLICK_BLOCK then everything work perfect
dafuq?
Would be nice if you were to provide the whole logs and code in a paste
which piece of code do you need?
the more the merrier
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
sysout the action
Looks like you got multiple entries for the same UUID in your table, but I have no idea how the implementation of a HashBasedTable works, as I never used it.
Yeah consfusing, I tried also with checking Action before or after checking if item in hand but still same
@echo basalt, please
ConfigManager and your code is the most important code
?paste
What the hell is that class
https://guava.dev/releases/19.0/api/docs/com/google/common/collect/HashBasedTable.html
Something by the googlers, xD
ConfigManager: https://paste.md-5.net/atezuxecuy.java
RawData: https://paste.md-5.net/opocusetus.cpp
KitPvP: https://paste.md-5.net/rasuzizanu.java
ah it comes from the #save method descriptor...
wha?
why the hell does one need such a class though
which class?
same I would personally go for a list of maps probably
or a map of maps
idk what you usecase is
guys, HashBasedTable returns a Row, Column, Value...
It's the same as Map<String, Map<String, String>>
It's a drug for me
Well if that is how it works
lol ew
Yeah, however, where does that error comes from?
help me geol
you're my last hope
there is an error?
owejgjroqejgq
I thought it would just do nothing?
You don't have an error, you have the issue that you literally printed twice per UUID
personally i would make a record for that
if there is an error, giving it to us may be helpful
There's no error, results doesn't simply get updated
Because you override the 8 by a 7 right afterwards...
are you reloading the file
ye
How does that even work with your fancy hash thingy
Yeah, you have definitely duplicate keys then
You literally overcomplicated it to a point where nobody can help you anymore. Why not just use a Map<Player, PlayerData>, where PlayerData wraps kills, deaths and the like.
hi
how do i change the item in an inventory slot when a player clicks on that slot?
so
the way i am currently doing it is just listening for inventory click event
cancelling the click event.
@green prism Could I also see where you change your Internals.DATA_TABLE?
After cancelling the event, doing inventory.setItem().
but
it it does not seem to work
does anyone know why?
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
public HashBasedTable<UUID, UserData, Integer> getDataTable(Config configManager) {
YamlConfiguration config = configManager.getLoadedConfigs().get("values.yml");
HashBasedTable<UUID, UserData, Integer> dataTable = HashBasedTable.create();
for(String key : config.getKeys(false)) {
UUID uuid = UUID.fromString(key);
UserData userData = new UserData(
config.getInt(key + ".kills"),
config.getInt(key + ".deaths"),
config.getInt(key + ".level"));
dataTable.put(uuid, userData, 0);
}
return dataTable;
}
(Internals): DATA_TABLE = new Values().getDataTable(configManager);
And incrementing the kill count?
yep, the event is being triggered.
ItemStack renderItem = createRenderItem(false, this.inventory.getItem(inventorySlot));
Bukkit.getScheduler().runTask(ChunkClaimsPlugin.getThisPlugin(), () -> {
setGUIItem(inventorySlot, renderItem);
});```
Internals.DATA_TABLE.row(uuid).put(userData, getStreak(uuid)); :-:
there is complicated stuff going on but i can tell it is being triggered because of a console log.
It's a little bypass
don't you like it?
boolean currentBoolean = ChunkData.getBoolean(boolIndex, this.booleansBitmask);
ItemStack renderItem = createRenderItem(false, this.inventory.getItem(inventorySlot));
Bukkit.getScheduler().runTask(ChunkClaimsPlugin.getThisPlugin(), () -> {
setGUIItem(inventorySlot, renderItem);
});
System.out.println("Item re-rendered.");```
I'm not sure what that does behind the scenes, another black-box for me.
public static int getStreak(UUID uuid) {
return Internals.DATA_TABLE.row(uuid).get(getUserData(uuid));
}
public class ClaimSettingsInventoryClickEventHandler implements Listener {
@EventHandler
public void onInventoryClickEvent(InventoryClickEvent event) {
Inventory inventory = event.getClickedInventory();
ClaimSettingsInventoryGUI clickedInventoryGUI = ClaimSettingsInventoryGUI.getClaimSettingsInventoryGUI(inventory);
if (clickedInventoryGUI != null) {
event.setCancelled(true);
Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
try {
clickedInventoryGUI.inventoryClickEventHandler(event.getSlot());
} catch (Exception e) {
event.getWhoClicked().sendMessage(e.getMessage());
}
});
}
}
}
HashBasedTable is a
Map<Row, Map<Column, Value>>
?paste
That would mean that duplicate rows would be impossible, wouldn't it?
it sets the value of the cell
quite honestly, it's superflous but I think I know the issue now
sidajsidjasiod?
what's the issue?
i am computing most of the stuff asynchronously then pushing the inventory update to the main game thread with the Bukkit.getScheduler().runTask(); method.
Your issue lies in that you might not be reusing the same UserData instance for row
Do you guys know where i can download world edit api? I think ive clicked every link in there docs looking for it.
does anyone know what is going on?
i.e. you have multiple UserData instances for a single row - thus causing havoc.
oh wait, you recycle it
Have you sent UserData yet? You didn't override hashing with some funny implementation on your own, did you?
it might be useful to print the contents of your tables - column by column, row by row and see what you are doing
even then it would all point to the same UserData instance
so it would need to be a clone...
so, um, any clue why it won't change the item?
Right... Man, what a ratsnest, xD.
alternatively give us all mentions of new UserData and their surrounding lines (or just give the entirety of the plugin at that point)
in vanilla world, they don't (except perhaps the ender dragon but idk if you can consider that spawning)
[18:52:11 INFO]: Printing King Geol requested data...
[18:52:11 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a it.mikeslab.kitpvp.object.UserData@88e62 1
[18:52:11 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a it.mikeslab.kitpvp.object.UserData@bdbbca4 0
[18:52:11 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489 it.mikeslab.kitpvp.object.UserData@3ff86009 0
[18:52:11 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489 it.mikeslab.kitpvp.object.UserData@38ba6984 0
[18:52:11 INFO]: DONE ---> SAVING DATA
(Inside onDisable)
Spigot most likely allows spawning mobs in unloaded chunks - should they be persistent from the start
i had a strange error occuring with the CreatureSpawnEvent being called even though a chunk was not loaded.
it does?
Prints are only half as useful as they could be without sharing their call site.
It might.
@Override
public void onDisable() {
System.out.println("Printing King Geol requested data...");
for(Table.Cell<UUID, UserData, Integer> cell : Internals.DATA_TABLE.cellSet()) {
System.out.println(cell.getRowKey() + " " + cell.getColumnKey() + " " + cell.getValue());
}
System.out.println("DONE ---> SAVING DATA");
saveData();
}
As of now your table should look something like
| UserData@88e62 | UserData@bdbbca4 | UserData@3ff86009
-------------------------------------------------------------------------|------------------
1c5501dc-9f19-4c7b-a22e-dbf3c504945a | 1 | 0 | N/A
-------------------------------------|----------------|------------------|-----------------------
882f8148-7da8-4af1-b32f-34357a33a489 | N/A | N/A | 0
So something is wrong with your choosen architecture
I sincerely recommend to use HashMap there and store the kill streak in the UserData and not in cells
Using Table makes 0 sense
As even without your bug you'll have as many rows as columns
Smth like:
Map<UUID, Entry<UserData, Integer>>?
At worst yes, at best you add the Integer to the UserData
hm, you're damn right
So it's be Map<UUID, UserDataWithKillStreak>
You'll likely want to store that in your config anyways
Hello guys help me pls with my plugin.Im using Poseidon Project Infdev Bukkit api (its like beta 1.7.3 bukkit api) and my plugin shows me this errorhttps://imageup.ru/img251/4190941/izobrazhenie_2023-02-02_205918788.png.html
code:
SkyGrid.java
package net.doh1221;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.logging.Logger;
public class SkyGrid extends JavaPlugin {
Logger log = Logger.getLogger("Minecraft");
public ChunkGridGenerator chunkGridGenerator = new ChunkGridGenerator((net.minecraft.server.World) getServer().getWorld("world"), 1);
@Override
public void onEnable() {
log.info("Armlix SkyGrid Generation initialized");
}
@Override
public void onDisable() {
log.info("Armlix SkyGrid Generation shutting down");
}
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return chunkGridGenerator;
}
}
ChunkGridGenerator
package net.doh1221;
import net.minecraft.server.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.generator.NormalChunkGenerator;
import static org.bukkit.Material.*;
public class ChunkGridGenerator extends NormalChunkGenerator {
int[] Materials = new int[]{STONE.getId(), GRASS.getId(), DIRT.getId(), COBBLESTONE.getId(), WOOD.getId(),
BEDROCK.getId(), STATIONARY_WATER.getId(), STATIONARY_LAVA.getId(), SAND.getId(),
GRAVEL.getId(), GOLD_ORE.getId(), IRON_ORE.getId(), COAL_ORE.getId(),
LOG.getId(), LEAVES.getId(), SPONGE.getId(), GLASS.getId(),
WOOL.getId(), STEP.getId(), BRICK.getId(), TNT.getId(), BOOKSHELF.getId(),
MOSSY_COBBLESTONE.getId(), OBSIDIAN.getId(), CHEST.getId(), DIAMOND_ORE.getId(),
WORKBENCH.getId(), CROPS.getId(), BURNING_FURNACE.getId(), FURNACE.getId()};
public ChunkGridGenerator(World world, long seed) {
super(world, seed);
}
public byte getRandomBlock() {
return (byte) Materials[(byte) (Math.random() * (Materials.length))];
}
@Override
public Chunk getOrCreateChunk(int i, int i1) {
byte[] result = new byte[32768];
net.minecraft.server.Chunk chunk = new net.minecraft.server.Chunk(((net.minecraft.server.World) Bukkit.getWorld("world")), result, i, i1);
for (int x = 4; x < 32768; x += 4) {
if (x % 128 != 0) {
result[x] = getRandomBlock();
} else {
x = x + 128;
}
if (x % 2048 == 0) {
x = x + 2048;
}
}
chunk.initLighting();
return chunk;
}
}
?paste
💀
Why it doesn't work?
we told you
no, I just send parameters and the API returns data
use a stringbuilder then ig
in fact I don't understand what StringBuffer is for
its just a threadsafe stringbuilder as far as i know
... Geol...
it works
But how i can make world not null?
thank you geolll
make sure world exists or smth idk
Get the world after it's loaded
But my plugin generate new world.It needs world to generate world?
You're getting the world too early
hmm didnt even look at it, init it in onEnable ^
Do it in getDefaultWorldGenerator
Hm ok
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
chunkGridGenerator = new ChunkGridGenerator((net.minecraft.server.World) getServer().getWorld("world"), 1);
return chunkGridGenerator;
}
I got this
https://paste.md-5.net/yobenisaso.css
Use the world name from the method
It happened again
Now send your code again so we can have the correct lines in the stacktrace
SkyGrid.java
https://paste.md-5.net/ewofefaseq.java
ChunkGridGenerator.java
https://paste.md-5.net/magololeye.java
Lines don't match
huh?
You could just call br.lines().collect(Collectors.joining()), where br is your BufferedReader, and then feed that string into your JSON parser. There's no need to collect data manually in this case.
Line 32 in your SkyGrid class is in the stacktrace. There is no code on line 32
Java Compiler moment
nice
Okay so I belive you mean this:
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getHand().equals(EquipmentSlot.HAND)) {
System.out.println("Player used HAND");
return;
}
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
System.out.println("Player used RIGHT_CLICK_AIR");
return;
}
if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
System.out.println("Player have IRON_HORSE_ARMOR in Main Hand");
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
https://paste.md-5.net/uzuxozawuc.css
Maybe this is correct?
Sure that it's on the compiler? :)
Yes
Line 33 doesn't have code either
and now: It's still not work when i click in air and no print line in console, when i click on block with right click then I get in console:
02.02 18:18:54 [Server] INFO [STDOUT] Player used HAND
02.02 18:18:54 [Server] INFO [STDOUT] Player have IRON_HORSE_ARMOR in Main Hand
so it checks Hand slot and if item in hand but not the RIGHT CLICK AIR
Sure thing. It's not like the lexer knew where the token was in the file and just handed that information over to the compiler to include it in the debug information. I'm sure it just rolled dice on your line-numbers, xDDD.
Looks good I think, I'd just not close the reader before actually reading from it.
Player used HAND! It was very effective!
just sys out event.getAction
🥹
And what we should to do?
I close after my JsonParser() so ?
Just move in.close(); past the JsonParser#parse call
or use a try with resources
What would it look like? I don't know try with resources
try (Resource r = getResource()) { resource.use() } and it gets closed when scope ends
I'm trying to get two armor stands two move between two locations.
It works properly with a single entity, but has sync issues once two are involved
Ignoring the lack of any sort of proper API for animations or the holograms in general, here's the code lmao: https://paste.md-5.net/gadaguzuku.cs
optic? in help dev? 
I've been here before @remote swallow lmao
lies
scared
https://paste.md-5.net/boqayitebu.java
I think something like this would be a pretty nice solution. It also doesn't create a new json parser instance for each get request, as they can be reused. Resources are closed automatically due to the try-block. I'd also always prefer to not nest readers for readability purposes.
10 dollar 💀
@chrome beacon Maybe this is an error?
net.minecraft.server.Chunk chunk = new net.minecraft.server.Chunk(((net.minecraft.server.World) Bukkit.getWorld("world")), result, i, i1);
I m trying to get two armor stands two
🫠
I thought that was how the concept of premium resources worked? No?
?
why would you pay 10 bucks for smth you can make in half an hour
Yes, and?
We're not looking for only the best plugins to make premium
They only have to follow the guidelines https://www.spigotmc.org/threads/premium-resource-guidelines.31667/
Man, it's literally 25 kb
so?
10kb limit
Anything under 10kb would be impressive
10kb ram 🤓
It's not hard
So sorry to get your time but how to? You mean like that:
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
System.out.println("Player used RIGHT_CLICK_AIR");
return;
}
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
😬
"Low Effort" resources may be rejected.
This is entirely at the discretion of the reviewer, however "Low Effort" resources include those:
With less than 10kb of code.
Contain beginner programming mistakes.
Are similar to those produced by tutorials or examples.
within this part of the guidelines, it's still valid lol
I've seen some of the Achy's previous plugins, their quality were VERY dubious - not sure if they have improved over the months
I sure do hope so
now then, back to figuring out why I can't sync two entities movement properly lmao
System.out.println(event.getAction);
no need for the if check
naming conventions where
?
Backpack
you think i cant read or smth
No it's Backpack
it's on higher level
We can't understand it
But this guy created his own convention
Backpack convention
I'm wondering what it does. Isn't it just a call to setPassenger, or whatever it was? The description isn't very helpful either.
Probably
Cannot resolve symbol 'getAction' then I get
Having a look at the code, it seems fine. There's some super small things, but none of them are make or break
add the ()
But then 25,8kb is too large for single method
ah good
Or...
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<groupId>com.sk89q</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>```
Why does it send an error for <groupid> in <groupId>com.sk89q</groupId>
Maybe they just added maven thingies
https://www.npmjs.com/package/is-even
Probably made too much use of a few of these.
so it's like unused data
you have 2 deps in 1 tag
each dep gets its own tag
in the global tag
damn it has char support
why isEven('3');
returns false
coughs #1070772025330774088 coughs lmao
kind of stupid
Nah, nothing like that
i hope so
How can i fix it?
16 classes actually
we dont use threads
I am kinda afraid I cannot help there. Sorry
make 2 deps in that dependencies tag
I wasn't going too either, but the channel was moving too quickly lol
That is not because I don't want to but because I have no idea when it comes to entity movements.
idk either lmao
<dependencies>
<dependency>
stuf
</dependency>
<dependency>
stuff
</dependency>
</dependencies>
even tried to ChatGPT it, didn't work lol
@chrome beacon now it's 28 string
https://paste.md-5.net/zixajedepi.java
https://paste.md-5.net/xexejekida.java
https://paste.md-5.net/ikahayigix.css
chatgpt broke my driver so wouldnt trust on it
ChatGPT has too little bukkit/spigot data
Actually, I've found it fine for certain things, just not in this case lmao
I asked it to create listener class for spigot plugin in minecraft java and it responded that it's unavailable
:C
Such a silly
also what sort of out-of-sync are we talking about?
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>```
I did it like this, but now
<groupId>com.sk89q</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0</version>
is an error
mvn reload
do you have the repo declared?
ok
Also compile is the wrong scope
You want it to be provided, otherwise you might accidentally shade worldedit into your plugin, which is a big no-no
They don't move together lmao
This could be for a variety of reasons however, the most likely one being they're not starting at the right times
idk im so confused lmao. I reloaded it and its still an error
idk if i even reloaded it the right way
Gimme a sec and I can do a video lol
i just put the command in console
seems I need to also fix the positioning lmao
intelliJ console
If I am right the armor stands should just move up and down every tick?
Correct, which they do, but they end up getting out of sync in terms of movements
I'll do a quick video lmao
https://www.spigotmc.org/wiki/setting-up-the-worldedit-api/
Did you add the repo?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@vagrant stratus it probably is related to the armour stands not starting within their path but outside of it (i.e. 2 / 1.75 blocks below)
Get nothing in console when right click or any get action when set like this:
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_AIR && player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
System.out.println(event.getAction());
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
}
When set like this:
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
System.out.println(event.getAction());
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
Then but only when clicked on block
02.02 18:46:30 [Server] INFO RIGHT_CLICK_BLOCK
02.02 18:46:30 [Server] INFO RIGHT_CLICK_BLOCK
but I guess a video would give clarity
Im sorry, but repo is?
Show us your repositories block
Add this to the <repositories></repositories> section of your POM. If it's not there yet, just add it
That actually mostly fixed it, the issue is still there but definitely not as bad as before lmao
hold plz lol
It should look something like that: https://github.com/Geolykt/EnchantmentsPlus/blob/4xx/pom.xml#L11-L45 (minus the dozen repos you don't need in your case) @icy monolith
gotta upload to YT
Ok i think it worked
Thanks
@quiet ice current state of the desync https://www.youtube.com/watch?v=71qG38X3bcM
make 0.25 evenly divisble by your increment/decrement
0.25 is not evenly divisble by 0.1, thus causing your issue
show code
ah fuck it I hate this code
@echo basalt Yea, I need it working before I get a properly made api created lol
Only difference between then and now is they're now teleported to the starting point first
ignoreCancelled means that your handler ignores a cancelled event. Are you cancelling *CLICK_AIR somewhere else? Did you try removing that from the annotation?
actually no, that shouldn't cause that issue
I'd just make them both move together with packets honestly
I think you have a 1 tick offset provided by that replace function
Got fixed it by my self, set priority to HIGHEST and remove ignoreCancelled!
@EventHandler(priority = EventPriority.HIGH)
public void Backpack(final PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
System.out.println(event.getAction());
player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
}
}
}
}
Priority shouldn't matter in that case, but still, happy you got it fixed! :)
It defo has something to do with teh current.getY() >= start.getY() check though but no idea in the specifics. Could be strange floating point behaviour but that shouldn't be as noticable
That's what I thought as well but with Lowest it doesn't work as well after removed ingoreCancelled even 🥹
Mount them. You can achieve a decent range of gaps with some trickery. Sadly slimes with a negative arent possible anymore.
Yea, I'll most likely try that. I don't want to get into packets lmao
Yea, that's my guess. I want to stay away from packets if possible however
That's what I've tried to do lol
Wait those are not done with packets? 
No lmao
Isn't it because you first teleport and then check bounds? So the first overshoots first, then get's it's direction changed at the next tick, and thus is always one delta ahead?
How can I check if 2 strings are similar?
S1 - world_nether
S2 - world_*
How can I check that S1 is similar to S2?
I tried replacing * with Ø and then checking if S1 starts with S2
but it didn't work for me
Maybe? First time messing w/ entity stuff like this lol
what the hell is Ø
nothing
blank
I'd say that it's an issue with your little state machine there, an isolatable logic issue, and not in the nature of entities, if you get what I mean
I just used Ø to symbolize that there isn't anything
Mojang native hologram when
Ah, so basically .replace("*", ""); ?
yep
.startsWith should work then - how did you call that check?
and then s1.startsWith(s2)
just a sec
So, check bounds first and then teleport both ooor?
unless you have s1.startsWith(s2.replace(blah)) or s2 = s2.replace(blah); s1.startWith(s1), it wouldn't work
Man, I'm kinda blanking myself right now, I feel like it's not that simple. Give me a quick sec, I'll be right back, xD
ConfigTab#getWorlds returns all entries in config, therefore also world_*
world being just Player#getWorld#getName
👍
Current code is https://paste.md-5.net/gadaguzuku.cs, minus the location correction to make it not as shit lmao
The two armourstands should theoretically always have the same distance to each other according to the code
Yea, but my guess is they're ticked at a large enough difference that it doesn't matter lmao
the length of the path (4.0) is visible by 0.1 - so that is not the issue either.
Current code to reflect the teleports https://paste.md-5.net/ifuhosanop.cs
try to add a very minute (like 0.001) amount ontop of start, end, start2, etc. respectively - that would factor out strange floating point operations
y coord I assume?
Fairly certain string has a compareTo function
that is basicallly useless for similarity comparision
K
comparing the similarity of two words is basically impossible without some big brain moment or hacky workarounds
just check char by char lol
Turns out I just had some bug with the ret of my code.
The way I mentioned works fine
Is it possible to use a custom jar with specialsource-maven-plugin? Build tools doesnt have the proper mappings that my jar has, how can i go about getting the proper mappings passed through the maven plugin?
Didn't work but it seems like the issue is the bump it gets from reaching either location
doesn't make much sense to me as both armour-stands should have that bump at the same point but it seems as if that wasn't the case
If you watch carefully https://www.youtube.com/watch?v=71qG38X3bcM, you can see it bump a bit once reaching either location
is cannot find a reasonable explaination for that behaviour though
do the armor stands have collision?
inb4 that's it lmao
That looks like a velocity push from collision
seems to happen even w/ entity.setCollidable(false);
i.e. using a 1.8 jar with specialsource? In that case no - not at all
try making the bottom armorstand finish a tick earlier
You need to have some kind of mappings at hand, otherwise it won't work
No its a 1.19.2 jar
Just a fork
If it is a fork of paper I'd use paperweight instead - at which point you'd have to ditch maven but a small price to pay for usability
Otherwise you can just hope that they didn't change too much about the mappings and use spigot mappings anyways
It'd would have the same setup as for spigot just transforming a different artifact (but using the same map)
longer video for the mentioned issue https://youtu.be/eDt83WerXYw
So you are saying just use reobfuscated jar instead of remapping it?
uh, alternatively you could use the mojmap jar yeah - but that would be dangerous in conjunction with different plugins
For some reason the lower one has a larger path and the upper one. but it shouldn't do it under any circumstances
csrg are probably not generated by forks of paper
although idk really
Only difference is the y coord but they go through the same animation cycle lmao
I have never worked with this outside of looking at it very briefly
At this point I'd just print out the distance difference each tick
csrg is basically some old mappings format similar to tiny iirc
?stash although, lemme check in an in-depth manner before I tell absolute stupidity
Yeah, they are basically .tiny mappings but just for classes (see https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/browse/mappings/bukkit-1.19.3-cl.csrg)
And they don't adhere to the tiny format before you insert a tinyv2 file into that arg
also noticed I didn't disable collision for both of them, and yea collision's not the issue lol
I generate random codes that I have to retrieve in a text file, the code works very well
but is there a cleaner way to do it?
optic
codes is HashSet<String>
Not too sure how I'd do that, given the current method used lol
var file = ...;
try(var writer = new FileWriter(file)) {
for(var code : codes) {
writer.write(code);
writer.write("\n");
}
}
getting it to stop a tick earlier, they're all in the same animation method. ig a boolean 🤷♂️
actually, it's not even tick based by y cord based so the best I could do is stop it a y coord sooner, but there'd still be the bump
ig abuse the bump for it to go down too
happens for both start & end locations kek
Just found an issue
what if my world is named world and I'm checking for world_*?
For some reason it thinks that world is similar
oh well now it just breaks it entirely, probably my end lmao
great it works, thanks
I'll worry about porting it to a library for now and releasing that, then it can be looked at better
File fileCodes = new File(pathToPluginFolder + "/codes-" + System.currentTimeMillis() + ".txt");
is there any way to get the path of the plugin folder (pathToPluginFolder) ?
that seems like a bad idea to make 1 file, in 1 folder
and probably have hundreds of them
what do you suggest?
create a folder in your data folder called "codes" or whatever you choose and store there
Your JavaPlugin class has a getDataFolder() method which refers to the plugins primary folder
the data file of the main world, or a data folder that I create at the root server folder?
doesnt that refer to the plugins data
not the plugins directory
What are you saying? XD
if i had a plugin called InsaneData or whatever getDataFolder would get the InsaneData folder not plugins folder
new File(getDataFolder() + "/codes-" + System.currentTimeMillis() + ".txt");
hahaha I can't find it
It will resolve to server/plugins/YourPluginName
yeah
getDataFolder() is a method on JavaPlugin
so it will be created in the folder of my plugin
yeah
you probably want to change it from making a new folder for each to use 1 folder and make a new text file there for each
I think we've all way overcomplicated this problem. The most elegant solution is very likely going to be to just animate the hover process on one armor-stand and then move all remaining lines relative to the first line. This way, the distance is guaranteed, no matter what.
okay so we're all used to very complicated stuff and miss the simple shit lmao
Good thing we've cleared that up lol
Holograms should have a Location no matter if it has lines or not. Thats just the default design.
Then every line is contained in the Hologram via composition and teleport/move should always
be propagated anyways.
hold on, I'll zip up the relevant classes lol
Not sure if I understand what you mean, but sure. One location, propagate moves to other lines. I'm pretty sure that's what I did there.
Well, did we? Did you manage to make it work in your project? Because that's the hardest part, xD.
no kek
hold plz lol
hmm, that'll require a fair bit of rewriting, I think.
Given the actual loc handling is (ignoring the boolean stuff, was an attempt from Ike): https://paste.md-5.net/wusoroceyo.rb
any ideas how to fix that?
I'd just use your first attempt but only apply it to the first armor stand of the list of lines. Then, iterate from 1 till end and add your offset to the head location each time. You can use that method exactly as it is, you just need to add moving the other armor-stands right after teleporting the head.
Ah, it'll only be a single subline but it should still work lol
I was talking about the general solution, but yes, in your case it would be enough to just pass in the single other entity and teleport that at the first one's offset y.
https://paste.md-5.net/ifeyebacit.rb
Something like this I guess, I think this was your first attempt
lets see if I can manage to impl it properly lmao
It should be add .1 both times actually, or subtract, depending on growth-direction
Here is an example ive made up just now
public interface IHologram {
Location getLocation();
void teleport(Location location);
void addLine(String line);
int size();
String getLine(int index);
void removeLine(int index);
}
public class SomeHologram implements IHologram {
private final List<HologramLine> hologramLines = new ArrayList<>();
private Location location;
@Override
public Location getLocation() {
return null;
}
@Override
public void teleport(Location location) {
Vector direction = location.toVector().subtract(this.location.toVector());
hologramLines.forEach(line -> line.teleport(line.getLocation().add(direction)));
}
@Override
public void addLine(String line) {
// Some stuff
}
@Override
public int size() {
return 0;
}
@Override
public String getLine(int index) {
return null;
}
@Override
public void removeLine(int index) {
// Some stuff
}
}
You never touch the lines externally. You should always just call your IHologram methods which
handle the specific functionality.
Thats a very decent design approach: Think about what you want the class to achieve and then
write an interface without any implementations.
tbf I did say I don't have a proper api impl'd lol
That's exactly what I've done, the only difference is that I was getting at solving the underlying logic problem and not throwing an OOP solution at optic. They're very likely not trying to create a complete hologram system, but just want to track two lines on eachother which have this hover effect.
People have been really indoctrinated with OOP, haha
Plus once working I can just rewrite it to be OOP kek
why
That's the thing. Always get to know your problem domain first, build a pice of shit, and then start polishing it. The architecture is not going to solve your math problem, xD.
just write it to be readable
I hope this is a big
sentence
It's already partly OOP. I just don't have the animations tasks and such split into separate files @lost matrix
I just want your lines to move properly... :( My god, what are we getting into here.
That has managed to make it so much worse
gonna see if it's a paper or base spigot issue at this point lmao
i dev against spigot though, reee (╯°□°)╯︵ ┻━┻
I just want to make some transistors flip in my pc, how hard can it be
Show me what you did real quick, I'm sure it's just a small issue.
I whish i could stop but im too "indoctrinated"
1:1 copy paste kek
Only difference for the rest is just
movementTask = new BukkitRunnable() {
@Override
public void run() {
applyToLoc(hologram.armorStand().getLocation(), start, end, hologram.armorStand(), hologram.getLineBelow());
}
}.runTaskTimer(plugin, 0, 1);
smh optic
Habit i kept from C#. Its a code standard at Microsoft.
bukkit scheduler better
someone can help me?
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
smh 7
Show the applyToLoc method please, I made a mistake there which you likely copied
Wait wrong command. Ive been away for too long
I'll most likely OOP the animation stuff specifically, that way animations can be cleanly added. They're currently just shoved into a single method lmao
you ahve
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Don't you start interface with I?
https://paste.md-5.net/dugixiwuso.rb
Is that making it any better?
I do
not normally
whats the point
i dont use it any differently from other classes
I never use I for interfaces or anything like that
when writing with it
public void addLineBelow(String line) {
ArmorStand entity = (ArmorStand) armorStand.getLocation().subtract(0, 0.25, 0).getWorld().spawnEntity(armorStand.getLocation(), EntityType.ARMOR_STAND);
entity.setGravity(false);
entity.setCanPickupItems(false);
entity.setCustomName(line);
entity.setCustomNameVisible(true);
entity.setCollidable(false);
// entity.setVisible(false);
lineBelow = entity;
}
it doesn’t tend to matter
Helps separate abstraction layers. But as stated before: Its an old habit. Microsoft still uses this standard.
guessing it's the way I'm just spawning it in now lmao
For example, every spigot class that you work with is an interface, but none are prefixed with I
yeah microsoft is an old habit
and besides, your IDE will already let you know what it is due to the icon
actually, might be the start location 🤔
When player eats GApple, how can I add into count ( of total health ) those yellow hearths?
You just don't understand what I was getting at. It does not help at all to write a clean architecture if the way you think about holograms is way off. It was completely evident from the way we (geol, optic and me) tried to solve the tracking issue that we've overcomplicated the situation and didn't think about the straight forward way of a head which just moves the remaining lines relative to it.
Once that works on optic's end, they can still improve the design. But why would you solve somebody's logic issue through OOP, if they literally write application specific software which always only has two lines. People don't learn anything about their mistake this way, if you're always just gonna hit them with "your architecture is wrong". Just fix the issue, then let them refactor themselves once they wrapped their head around it.
I think thats just the absorption effect
or w/e its called
You mean how you can get the amount of effective health of a player including hearts from the absorption effect?
As numeric value
yes
Also I'm pretty aware on how I can improve the architecture, but given the current one is broken I don't want a full rewrite to muddy the waters in terms of what could be wrong lol
Exactly... you're literally one millimeter apart from having it working, why start a rewrite now before having that little success which then motivates you to improve on it.
but yea, this is the current issue lol
declaration: package: org.bukkit.entity, interface: Damageable
tysm
I've made much more complex stuff than this in general, I've just never touched spigot entities lmao
1.8 btw
I can't find it in Damagable
Go dig in old forum posts then
?1.8
Too old! (Click the link to get the exact time)
Probably needs reflections in 1.8
What's the issue there? I'm kinda having a hard time spotting something. It seems a bit weird to subtract from the location that way, but I guess it works because the evaluation order first has to subtract, get the world, spawn the entity, and by then the parameter should be already affected. I'd just extract that to another line above, as it's really dense.
Is there a way to make it so that if a player jumps with multiple armor stands behind them that the first one will go up with the player then the rest will flow behind it and go up with a player down the line? Kind of like the origin realms balloons that are in a line like the train balloon. Here's the origin realms balloons. Is there a way to do this with inverse kinematics but only use it on the y axis and not all 3 axis?
intense
lmao
I mean tell me its not
very suspenseful ngl
Why is that so bouncy, lol
Sure. But there are several approaches to this. A naive approach would be to simply ray trace from the player
backwards and if it hits an armorstand you simply ray trace from the armorstand back and schedule a jump for
each armorstand with N * jumpDelta delay where N is the Nth hit armorstand/player.
Looks like gravity and collisions aren't off for both of them
they are off lmao
Are you sure?
managed to screw up the placement too, lemme clean up the hologram class real quick and I'll send that as well as the current code
entity.setGravity(false);
entity.setCanPickupItems(false);
entity.setCustomName(line);
entity.setCustomNameVisible(true);
entity.setCollidable(false);
For both of them, pretty sure
Btw i would still use a Location which is not bound to an object and then simply move every object relative to that location
Right now I'm using inverse kinematics for the x and z axis so the armor stands act like a snake, would it be easier to just implement the 3rd dimension which would be the y axis?
These will be player placed, so it'll have to be bound
Well you can apply inverse kinematics in only one dimension... simply lock the other two. I dont see a problem with that.
Wait do you want to additionally add the y axis or only use the y axis?
couldn't you make it separately from the other 2 axis?
Huh?
nevermind, I'm dumb. I think I know how I'll do it
@dry yacht These are the methods for both lines https://paste.md-5.net/tosuhuhoqe.cpp
and this is for the animation https://paste.md-5.net/uneqojepax.rb
Is that code for this @vagrant stratus?
Correct, it's the relevant code anyways
Would a sin curve be better for the up and down animation?
Couldn't tell you
I feel like the math would be a lot more compact and efficient imo
but if it works it works
Well I can't do math regardless kek
That's actually a big brain idea! :)
lmao, same. #stackOverflowOP
Not only that it's way easier, it would also be symmetrical by default and feel more natural.
it would be smoother as well I think
Well, that depends on your angle step size
No idea how to impl lmao
I don't see any calls of createEntity or addLineBelow, where are they? I'd also just use createEntity to assign lineBelow, the initial positions don't really matter as you teleport them instantly anyways
Those are called within the Hologram class & a different class which assigns the subline
works for a singular one, just need to get it to sync the subline too lol
You should probably add a parameter for the frequency of your wave.
With a too small values all armorstands will look like they oscilate with the same freq (bc you are looking at a small portion of the wave)
And a too high value will look completely random
Guys help pls.Why i ve got this error?
https://paste.md-5.net/gonusihewe.makefile
API: Infdev 20100618 Bukkit API (Ported Poseidon Project)
plugin code:
Main
https://paste.md-5.net/johazikege.java
Generator
https://paste.md-5.net/vunucaquzi.java
in my command to duplicate items, if I duplicate more than 27, the items do not drop to the ground
I have a thought : I check if the inventory is empty, if yes, instead of adding it to the inventory I drop the item on the ground
is there an easier way?
the addItem method of Inventory returns a Map which contains all items that could not be inserted
Are you sure the entity flags are set properly? :-:
System.out.println(armorStand.hasGravity() + " " + armorStand.isCollidable() + " | " + subLine.hasGravity() + " " + subLine.isCollidable()); in your applyToLoc could maybe provide more insight into that.
the problem is that at the moment it replaces me an item by another one
why I get NullPointerException while trying to add into an arryalist a custom serializable object?
if the object isnt serializable, I dont get the error
public static void giveOrDrop(Player player, ItemStack... items) {
World world = player.getWorld();
Location loc = player.getLocation();
player.getInventory().addItem(items).values().forEach(overflown -> world.dropItem(loc, overflown));
}
Makes no sense
to use this I have to store the items I created to be able to add them outside the for
How can I save items, via a HashSet?
wanna know whats cool
yeah, I am a little bit stupid
lol i just made that up ^^
But it looks like a decent util method
not the object is null, but the arraylist is
Then the arraylist variable contains a null value 🤷
Send some code and more details. This could be anything.
i solved it
That's just cursed tbh, xD
thx
It might be easier to provide the classes you used for your example at this point lmao
If it still doesn't work then idfk
https://paste.md-5.net/zisajaloqu.java
https://paste.md-5.net/gosutixotu.java
Take that with a grain of salt tho, xD
https://paste.md-5.net/vipadeqiku.cs
I didn't understand how to pass the second argument with ItemStack... items
thats an ItemStack[]
varargs. It means you can pass as many ItemStacks as you want. Either as an array or single items
actually how can I make my plugin to have a smaller size?
are you using maven?
yep
You dont need to unless you are shading in megabytes of dependencies
how big is it now
12mb
well we don't have many other obvious options at this point so worth a shot lol
:-:
I should not use HashSet<ItemStack> items = new HashSet<>(); so?
minimize from maven shade
When you shade half a repo into your plugin, xD
Which part of this sentence is a statement and which is a question?
I'm shading it only by using the run button of intellij idea
the what button
If this works @dry yacht then it's just a matter of rewriting to use those classes :p
Did you manually add any jars to your project?
no
Have you tried relogging btw? Sounds stupid, but for me the armorstands were stuck until I rejoined. Some stupid little issue you'd probably have to either know how to compensate or eat, xD
*artifacts so to speak
what do you run on that
a maven build
use package
I'm learning as I go along, I assume that you should declare an ItemStack[] rather than a HashSet?
ty
just minimize on the project that uses the lib
depends on the purpose. Both are fine.
yeah, how are you going to use the method sylfaen?
Processed annotations should not be shaded, as the compile-scope does.
Yea @dry yacht that works, so it looks like I'm gonna be rewriting my Hologram & Animation implementation lmao
I'm stupid, it's HashSet<ItemStack> and not HashSet<String> thanks for the help
Ok do you want to call the method with a HashSet of ItemStacks? Is that your plan?
Well, I'm sorry, but it's kinda hard for me to debug your issue without getting my hands on the whole system, and I fully understand that you don't want to share everything. I hope I could help you with this little starter! :)
transitive dependencies probably. That's why I don't trust the maven shade plugin to decide by itself and always specify all shaded artifacts myself. Opt-In rather than Opt-Out or AutoDetect.
Gonna lower the tick speed it takes to update, if it breaks then, then that'll be the issue in general lol
Good idea, let me know if that changed anything, actually
right
one moment
Run proguard for dead code elimination, lol
in the configuration of shade add <minimizeJar>
nope, I can update it every tick and it works. My implementation is just flawed as hell lmao
well that would reduce some of the size
That's such a hack, you're burying the actual cause that way...
maybe there is a better way?
looks like all I need to do now is rewrite the animation & hologram api to make use of the code you provided
In which case you can write a overload method:
public static void giveOrDrop(Player player, Collection<ItemStack> items) {
giveOrDrop(player, items.toArray(new ItemStack[0]));
}
public static void giveOrDrop(Player player, ItemStack... items) {
World world = player.getWorld();
Location loc = player.getLocation();
player.getInventory().addItem(items).values().forEach(overflown -> world.dropItem(loc, overflown));
}
Usage:
Player player = ...;
Set<ItemStack> someCoolItems = Set.of(new ItemStack(Material.STONE), new ItemStack(Material.DIAMOND));
TheUtilClass.giveOrDrop(player, someCoolItems);
What's this?
looks shady 
I thought you said that your jar gets bigger when you add your lib? Did I misunderstand you?
Ah, as usual, xD.
Could you try to explain that again real quick?
Oh
Add <scope>provided</scope> to all dependencies you dont want to shade
thank you very much, and in the initial case you gave, what should I have done to use it without an overload method?
Tbh, I'm not sure, but I don't think that this overrules the scope of transitive dependencies.
Is your lib standalone or do you need to shade it?
So you're shading it.
If its plural then you should 100% make it a standalone plugin.
What else do you have in your lib?
You must be shading a ton
lombok, jetbrains annotations, spigot api <- those should not be shaded
Have you had a look at the dependencies section of your IDE's maven panel yet? You should see all the mess you inherit there.
also lombok is an annotation processor. There is nothing to shade
In your lib: Add <scope>provided</scope> to at least the spigot api
Build your lib and tell me its size
You could also just decompile the jar and have a look at what's in there, xD
Alright now build your plugin which depends on your lib and show its size as well
Because your lib surely does not contribute 12mb to it
Ah @dry yacht can you make it work off of local coords real quick
public static Location getLocalCoord(double x, double y, double z, Location origin) {
Location arrival = origin.clone();
Vector dirX = new Location(arrival.getWorld(), 0, 0, 0, Location.normalizeYaw(arrival.getYaw() - 90), arrival.getPitch()).getDirection().normalize();
Vector dirY = new Location(arrival.getWorld(), 0, 0, 0, arrival.getYaw(), arrival.getPitch() - 90).getDirection().normalize();
Vector dirZ = arrival.getDirection().normalize();
return arrival.add(dirX.multiply(x)).add(dirY.multiply(y)).add(dirZ.multiply(z));
}
What's normal about that? 10KB + 69KB != 236KB. Something's off, :-:
Location currLoc = hologram.armorStand().getLocation();
Location start = Utils.getLocalCoord(0, 4, 0, currLoc);
Location end = Utils.getLocalCoord(0, 2, 0, currLoc);
Uhm, what?
What are local cords?
'a'.repeat(Integer.MAX_VALUE) at you for not just frickin decompiling that thing and checking out what's actually being shaded
What i dont understand is: Why make a whole Location and then just take out the direction Vector again?
Why not just create a direction vector to begin with...
Goes off of whatever location's passed
Could you just tell me what you are trying to achieve? Do you want to attach that moving thing to some other moving thing?
unsetting vs setting a permission to false?
unsetting would take default so could also be true still iirc
so setting it to false would not allow default?
shouldnt™️
errr well currently it's sort of just fucking off to space lmao
HoveringEntity hovering1 = new HoveringEntity(lines.get(0), startLoc.getY(), endLoc.getY());
Same with the other way around
in my case the max is currentY + 4 and the min is currentY-2
Wait a second, I'm going to change something up real quick. This solution I came up with is also pretty stupidly limited. Just a few little changes, brb
Yes, you want to track it to an entity, I guess, right?
In my case yes, it would be going off entity coords. But might as well allow both and I can shove this all into a clean public API
anyone knows how bundles show the items inside when hover it in the inventory?
Going off entity coords allows limiting to a specific radius around the entity itself
Wait so
attachment.setPermission(perm, true); // the permissible of this attachment will return true for perm
attachment.setPermission(perm, false); // the permissible of this attachment will return false for perm
attachment.unsetPermission(perm); // the permissible will return the default for perm or false if no default
```correct?
private static Vector vectorFromRotations(double pitch, double yaw) {
return new Vector(Math.sin(pitch) * Math.cos(yaw), Math.sin(pitch) * Math.sin(yaw), Math.cos(pitch));
}
public static Location getLocalCoord(double x, double y, double z, Location origin) {
Location arrival = origin.clone();
Vector dirX = vectorFromRotations(arrival.getPitch(), Location.normalizeYaw(arrival.getYaw() - 90));
Vector dirY = vectorFromRotations(arrival.getYaw(), arrival.getPitch() - 90);
Vector dirZ = arrival.getDirection().normalize();
return arrival.add(dirX.multiply(x)).add(dirY.multiply(y)).add(dirZ.multiply(z));
}
No need to create a bunch of location objects. The only question now is: What the heck is a local coord?
Entity coord +/- loc, global being world +/- loc
no clue, i normally just use plugin.yml stuff
if that mimics it yes
should
Are we talking about something along the lines of this? Not completely sure what you mean...
Locations in Spigot are always relative to the world space...
If you want local deltas then you should 100% use vectors
Pretty much, yea.
sorta just fucks off to space atm even though I'm trying to limit it to a small area above where it's placed, regardless of location
https://paste.md-5.net/ozihudolul.java
https://paste.md-5.net/jonilazeno.java
Hope that helps. You basically just track relative Y delta for the entity and then add that to the location you're tracking. That's the logic, doesn't really matter how you architect that on your side then.
e.g. the previous solution did currY + 4 (max Y it could go) & currY - 4 (minY it could go), so it worked regardless of actual placement
It's just that I'm having a really hard time wrapping my brain around the thoughts of people other than myself, xDD. I can always only provide a proof of concept, but hardly ever fix the stuff another person wrote, :-:
It's like so many layers deep already and I'm missing so many bits and pieces.
Communication is hard, haha
hence local, relying on the entities position for the coord limit instead of picking a random x,y,z
Have you had a look at that yet? You're free to choose your location now.
hey, my test server is on offline mode, but i got a premium account, and even buying the game i'm getting the wrong UUID when I join the server. How can I make so premium players get real UUID and cracked players get fake UUID? (i need the fake one for my test account)
I'll ask ChatGPT to explain global/local coords lmao
You cant
I think you mean relative coordinates, don't you? I just never heard global and local in that context, rather absolute and relative.
In Minecraft, coordinates are used to specify the position of an object in the game world. There are two types of coordinates: local and global.
A local coordinate system refers to the coordinate system of a specific object or entity, such as an Armor Stand. In the context of an Armor Stand, the origin (0,0,0) of its local coordinate system is located at its feet, and its x, y, and z axis extend outwards from its body. The position of any point on or within the Armor Stand can be described in terms of its local coordinates.
A global coordinate system, on the other hand, refers to the coordinate system of the entire Minecraft world. The origin (0,0,0) of the global coordinate system is located at the bottom-left corner of the world, and its x, y, and z axis extend to the right, up, and forward, respectively. The position of any object or entity in the Minecraft world, including an Armor Stand, can be described in terms of its global coordinates.
So, in summary, local coordinates specify the position of an object relative to itself, while global coordinates specify the position of an object relative to the entire game world.
@dry yacht @lost matrix
Pretty much, yea
lmao
This just happens to be how I found it kek
My lord, :-: When I hear local and global I think about analysis of functions, but not about coordinates relative to another point, haha
Ok but the Location object is always a global coordinate. No exceptions. Local coordinates are represented using Vectors.
at least is there an api to get a skin by player name?
Sure, Mojangs
but mojangs need an UUID
You can resolve the uuid from a players name using mojangs api
oh, didn't know that
thank you
proceeds to use Location anyways
Eh if it works 🤷
Just dont apply any design patterns or Black Bytes hunts you
That's also what the server does internally, I think. IIRC, the PacketLoginInStart also only provides a name.
👀
Already working on properly OOPing this lol
I think the server also just uses this API internally, because - IIRC - it also just gets the name string in PacketLoginInStart.
Just write it in a data-oriented, clean and concise way. If that involves standard OOP practises, it's good, but there's no need to force anything just because it's what's socially accepted.
You need to figure out in which ways your structure is limiting you, that's the only way you'll learn good architecture. I've seen so many big projects with spot on OOP practises which were still rotting under the hood... If OOP was the solution, modern computing wouldn't be the steaming pile of shit it actually is.
Oh trust me, the animations alone could probably be more OOP to allow extra expansion in that regard
they're currently all shoved in a single method and multiple BukkitRunnable's lmao
That's what prototyping looks like, 😂
And that's what I'm most likely gonna be OOPing lmao
Most likely AnimationTask, a manager or something to handle them, and then each animation just extends AnimationTask
ah yes so then its still shoved in runnables, it will just be harder to trace them all back
yeha fr
we need a new diagram, a thread diagram that shows at which point how many runnables deep you are in the code
If you see my code I'll be at least 96 lambdas deep with 7 runnables
@rough drift Are oyu the slimefun guy?
thank god
what would be be better to do for language stuff, make an enum with valid languages or accept any string and convert that to a valid language or default if not found
?paste
Guys, having issues with gson shading
Here is my pom: https://paste.md-5.net/meqiqusugi.xml
its not shading my version 🤔
already tried that
Also may I add your pom made me want to bleed my eyes out, cover them in acid and let them dry staring right at the sun
xD
it hurts
You should really use the intelij mc plugin
even got system scope stuff 
🤔
intellij has a plugin for mc
Its temp, im creating my own online repo
it's really fucking handy
mc you mean maven compiler or minecraft?
mvn install
generates the pom for you
mc minecraft
you shouldnt need to shade gson, spigot comes with a version
Intellij Minecraft Dev plugin or smt
ye
Also this
i need the latest version
2.10+
k
skill issue
any idea?
How do you expect to use your version if you dont relocate?
hard to explain, but i will try
In response to that btw, mobile discord not being intuitive again, xD
Yeah kind of messy
So. much. to. rewrite. lmao
do it quicker
Can't lol
do it slower then
