#help-archived
1 messages · Page 196 of 1
He barely understands java. You will confuse him with kotlin for sure
public static void a() {
YamlConfiguration config = YamlConfiguration.loadConfiguration(new File("blablabla.yml"));
List<ChatFormat> formats = config.getKeys(false).stream()
.map(config::getConfigurationSection)
.map(section -> new ChatFormat(
section.getInt("priority"),
section.getString("permission"),
section.getString("format")
))
.sorted(ChatFormat::compareTo)
.collect(Collectors.toList());
ChatFormat format = null;
for (ChatFormat cf : formats) {
if (p.hasPermission(cf.permission)) {
format = cf;
break;
}
}
}
private static class ChatFormat implements Comparable<ChatFormat> {
final int priority;
final String permission;
final String format;
private ChatFormat(int priority, String permission, String format) {
this.priority = priority;
this.permission = permission;
this.format = format;
}
@Override
public int compareTo(ChatFormat o) {
return Integer.compare(o.priority, priority);
}
}
bruh code is so ugly comparing to Kotlin
Some kotlin code can also be ugly, but i agree kotlin code looks nice when done properly.
well compare the code above with that
class ChatFormat(private val priority: Int, val permission: String, val format: String) : Comparable<ChatFormat> {
override fun compareTo(other: ChatFormat): Int = other.priority.compareTo(priority)
}
fun main() {
val yaml = YamlConfiguration.loadConfiguration(File("blablabla.yml"))
val formats = yaml.getKeys(false).map { s -> yaml.getConfigurationSection(s) }.map { s ->
ChatFormat(s.getInt("priority"), s.getString("permission"), s.getString("format"))
}.sorted()
val p = org.bukkit.Bukkit.getPlayer("id")
val format = formats.find { p.hasPermission(it.permission) }
}
Java itself is so ugly
D:
xDark do you think i should publish this poison plugin for everyone?
@spring arch your spigot name is the same from discord right?
i'm not registered on spigot
how so
hi everyone i am creating a mine plugin for a prison but i have a problem with a plugin event
it doesn't make any sense to me as well, and I'm curious that nobody noticed it until now
did you set correct potion effect type?
whats up marc
i don't think that's an issue with spigot
it is
can you show what potion effect type you set?
dude read the JIRA issue lmao
Where is the jria
because that code fails lol
you have your custom potion right?
Viper is dum probably.
uh
@sturdy oar can you print the whole reference to a potion type?
like println(potionEffectType)
it's not enum
It an enum
what
it is ya
huh
If this is Enum this is just impossible. Enum is the safest singleton stuff
Wut
public abstract class PotionEffectType
extends Object
Well still the poison can be compared with ==
Then this is static instances
so print the reference for god sake
can someone hastebin that class
Try with . equals
lol
it does not matter
Ok later i add more info to the JIRA
as far as bukkit is not dumb and does not create new types each time
jira idk if u did enough debugging bc ur probably gonna have to show more than that
such as like said above print out potioneffecttype, uh
lol nevermind thats it
hi guys i would have a problem with a plugin event and the methods i used don't work
Sure one second tho i'm eating 😩
@floral isle just ask the question
?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.
@sturdy oar Why not just reverse engineer and figure our yourself?
@frigid ember I don't have time to fix spigot weirdnesses myself
was md_5 drunk
static PotionEffectType BAD_OMEN
oof.
huh
nice documentation i guess
Check the sounds enum @spring arch it's full of memes
lmao i think its bc bad omen literally makes it so raids happen in your area or smthn
there is not description for it at all
doesnt it
As you can see there is an equals method not coming from Object, you should try it TheViperShow
print out potioneffecttype.poison.tostring
whats the event for generating a chest
can you print identity hashcode
19
@hollow thorn you mean placing down a chest? lol
They both have hashcode 19
What is the hell
erm opening a naturally generated one
Like as much as im dumb
I don't think I'm that much
To not be able to compare a poison type
in this plugin i have a holograms and in a specifed region the hologram count the broken blocks and i have implemented the Event Of TokenEnchant Plugin TEblockExplodeEvent but when i use the enchants of TE for example Explosive or Excavation the hologram don't count the blocks broken by tokenEnchant
That's a custom event by another plugin, if it doesn't work contact the author
It's not a spigot event
Yes , although I tested on 1.15.2 with same results
yes but this event are used in plugin like MineResetLite PrisonMines and JetsPrisonMines and it work
@sturdy oar
then your code is wrong
^
i show the method i use for count the blocks
?paste
@EventHandler public void onBreak(final TEBlockExplodeEvent e) {
final Block b = e.getBlock();
if (this.contains(b) && this.wasAlreadyBroken(b)) {
this.brokenBlocks.add(b);
this.lastSecond.add(b);
new MineUpdateEvent(this).call();
}
}
@frigid ember is an Event in my plugin
Oh
I've looked hhow potion effect event is called, and everything should be ok
¯_(ツ)_/¯
public static PotionEffect toBukkit(MobEffect effect) {
PotionEffectType type = PotionEffectType.getById(MobEffectList.getId(effect.getMobEffect()));
int amp = effect.getAmplifier();
int duration = effect.getDuration();
boolean ambient = effect.isAmbient();
boolean particles = effect.isShowParticles();
return new PotionEffect(type, duration, amp, ambient, particles);
}
@frigid ember No i mean a method compatible with TokenEnchant Event
this is another method from my code
@EventHandler public void onBreak(final BlockExplodeEvent e) {
final Block b = e.getBlock();
if (this.contains(b) && this.wasAlreadyBroken(b)) {
this.brokenBlocks.add(b);
this.lastSecond.add(b);
new MineUpdateEvent(this).call();
if (this instanceof HologramCompatible) {
final HologramCompatible hc = (HologramCompatible) this;
hc.updateHolograms();
}
}
}
@EventHandler public void onBreak(final EntityExplodeEvent e) {
for (final Block b : e.blockList()) {
if (this.contains(b) && this.wasAlreadyBroken(b)) {
this.brokenBlocks.add(b);
this.lastSecond.add(b);
new MineUpdateEvent(this).call();
if (this instanceof HologramCompatible) {
final HologramCompatible hc = (HologramCompatible) this;
hc.softHologramUpdate();
}
}
}
}
is there supposed to be ! before wasAlreadyBroken?
i find this method on internet and i have adapted for my plugin
Yes
What
Yeah I'm developing on 1.15.2 and 1.16.1 the same thing happened
I can't try right now
how do i get if a chest has a loot table
Does anyone know how to make a skull in an inventory in 1.12, I keep getting steve skins.. I have tried setOwner, setOwningPlayer, NMS, NBT, But none of them work...
it was done thourgh reflections..
Hmm, I am not that great with reflections, could you give me an example?
1.12
@sturdy oar Before 1.14, you'd have to use
Object#equalsrather than the==operator.
@frigid ember yeah it's pretty weird
So it's just safer to use .equals() always ?
But did .equals() work for you
Tbh you don't always need NMS
Spigot has texture API
With SkullMeta
Thanks a lot 🙂
Even if you set the skin of a skull you are not guaranteed to get a texture on it. The mojang api only allows a certain amount of texture calls per minute
The mojang api only allows a certain amount of texture calls per minute
I can cache it though
Thats true you can save the texture as base64 for example
u know how bungeenpcs has the mirror skin feature?
is it possible to do with citizens?
Isnt PotionEffectType just a Enum? So internally equals is just ==
yeah and that's dumb tho
they should fix it so == works
Like everywhere else
It didn't
I'll try again
Oh nvm PotionEffectType is a class.
Means you never use ==
Yeah but the fields should be constant
for chests do i have to update there inventory or can i just set it in .getInventory
@frigid ember Hmm it's still not really working... All of the skulls are still showing up as skulls, this is my current code:
if you get the inventory and change the elements the chest is also updated. The chest just links to the inventory.
ItemStack craftItem = CraftItemStack.asCraftCopy(new ItemStack(Material.SKULL_ITEM, 1, (byte) 3));
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------", ChatColor.GOLD + "Health" + ChatColor.GRAY + ": " + ChatColor.WHITE + Math.round(Bukkit.getPlayer(pl.getName()).getHealth()), ChatColor.GOLD + "Kills" + ChatColor.GRAY + ": " + ChatColor.WHITE + p.getSesionKills() ,ChatColor.GOLD + "Kit" + ChatColor.GRAY + ": " + ChatColor.WHITE +( p.getSelectedKit()== null ? "Default" : p.getSelectedKit().getKit()), "", ChatColor.GREEN + "Click to Spectate", ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------"));
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', AssembleBoard.getChatMeta(pl.getUniqueId(), ChatMetaType.SUFFIX)) + pl.getName());
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
String[] a = SkullCreator.getFromName(pl.getName());
profile.getProperties().put("textures", new Property("textures", a[0], a[1]));
try {
Field field;
field = meta.getClass().getDeclaredField("profile");
field.setAccessible(true);
field.set(meta, profile);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
craftItem.setItemMeta(meta);```
[08:44:38 INFO]: [global] XR1JOUCLHz7c6lZHhq7o2l7GmE8OZttX7GBle+P2o2Bn70j0jIpacwN2G/ja6DUzC9lee6eBL3MpE1RuianV7qGZJNXHuu7Lho7bMUEtEvZacQfEGv7QcGer3+3F+69hI01sJsr6UsIVk4TdibyK/br7l1jK6JrL5MS+/GvJjs+ybn+qBTx8hvkIyQwEMqnz9MmGeuGrkI0L5Q9J4TOU+IENLWE6tQt6sCNBDDwe6QnBvN8fmeDQE5tUZQ+VqZtwpfHvj3t7chHhHZQA0JrxGnEWJGZOebftQS/SBKMOMJcgjo+ScdHCksDZfduD4F0GuVAjiUNYl6h/oG0sxo5957rky/EK+NcJlmv6ONyq91FZtIvid55BQGqr3IY+nj7QSrPaPxi+bnoDAo7B75qt3/ukMrfaUsaXfEUHbskyR843KCyEkqnLVwiERViaJRZJGRRTWoK5A/3uySv5UpEVzIFj3k6nSPLw/cVOAFkMDnXs1OxLSTsfruK0eo/vMX0QY9kvs+5IZOrrBCbuLM2LsZ1VjijEFSOZiW3l5/lf/PgDhhU15EWWOKpOAwX6jKPvemSpeN1stEIO1iqYnyeX83dram52XZnonVcZUdGwkVqfeGQp6t4OtVgiTtwVPGoD1rsuLDmlzl7HR5djdX0eQeet9h9+8mA/bTzPzuCAzAs= [08:44:40 INFO]: [global] ewogICJ0aW1lc3RhbXAiIDogMTU5NTU5NDY1NDIxMywKICAicHJvZmlsZUlkIiA6ICJjMDg2MGU0ZWQ3OWM0YzY0YTg3NDZkNmM2M2JlZWE1NCIsCiAgInByb2ZpbGVOYW1lIiA6ICJQYXJhc2pvcnMiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmVmMDFiNzU1ZTE5NGRlMzMyYTY3NGM4M2RlOWNkZTA5ODg1NzFiZDA1NGFkNzg4YmQ3NTE5NzRhZTJkZGE4ZiIKICAgIH0KICB9Cn0=
if(cache.containsKey(name)) return cache.get(name);
try {
URL url_0 = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
InputStreamReader reader_0 = new InputStreamReader(url_0.openStream());
String uuid = new JsonParser().parse(reader_0).getAsJsonObject().get("id").getAsString();
URL url_1 = new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid + "?unsigned=false");
InputStreamReader reader_1 = new InputStreamReader(url_1.openStream());
JsonObject textureProperty = new JsonParser().parse(reader_1).getAsJsonObject().get("properties").getAsJsonArray().get(0).getAsJsonObject();
String texture = textureProperty.get("value").getAsString();
String signature = textureProperty.get("signature").getAsString();
cache.put(name, new String[] {texture,signature});
return new String[]{texture, signature};
} catch (IOException e) {
System.err.println("Could not get skin data from session servers!");
e.printStackTrace();
return null;
}
^ The code I used to fetch it
I just use SkullMeta#setOwner and it works for me
Ye, that works for me on 1.8, but certainly not on 1.12
Player pl = Bukkit.getPlayer(p.getName());
Hmm true.. but then just get it of the game profile, will that work?
Does SkullMeta#setOwningPlayer work?
Yes
It's not working....
I fetched the gameprofile with this line: GameProfile profile = ((CraftPlayer)pl).getProfile();
ItemStack craftItem = CraftItemStack.asCraftCopy(new ItemStack(Material.SKULL_ITEM, 1, (byte) 3));
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------", ChatColor.GOLD + "Health" + ChatColor.GRAY + ": " + ChatColor.WHITE + Math.round(Bukkit.getPlayer(pl.getName()).getHealth()), ChatColor.GOLD + "Kills" + ChatColor.GRAY + ": " + ChatColor.WHITE + p.getSesionKills() ,ChatColor.GOLD + "Kit" + ChatColor.GRAY + ": " + ChatColor.WHITE +( p.getSelectedKit()== null ? "Default" : p.getSelectedKit().getKit()), "", ChatColor.GREEN + "Click to Spectate", ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------"));
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', AssembleBoard.getChatMeta(pl.getUniqueId(), ChatMetaType.SUFFIX)) + pl.getName());
GameProfile profile = ((CraftPlayer)pl).getProfile();
try {
Field field;
field = meta.getClass().getDeclaredField("profile");
field.setAccessible(true);
field.set(meta, profile);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
craftItem.setItemMeta(meta);```
what is this
how do i add to a config? I want multiple strings under one category
Hmm
maybe i can use an array?
ItemStack craftItem = CraftItemStack.asCraftCopy(new ItemStack(Material.SKULL_ITEM, 1, (byte) 3));
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------", ChatColor.GOLD + "Health" + ChatColor.GRAY + ": " + ChatColor.WHITE + Math.round(Bukkit.getPlayer(pl.getName()).getHealth()), ChatColor.GOLD + "Kills" + ChatColor.GRAY + ": " + ChatColor.WHITE + p.getSesionKills() ,ChatColor.GOLD + "Kit" + ChatColor.GRAY + ": " + ChatColor.WHITE +( p.getSelectedKit()== null ? "Default" : p.getSelectedKit().getKit()), "", ChatColor.GREEN + "Click to Spectate", ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------"));
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', AssembleBoard.getChatMeta(pl.getUniqueId(), ChatMetaType.SUFFIX)) + pl.getName());
GameProfile profile = ((CraftPlayer)pl).getProfile();
try {
Field field;
field = meta.getClass().getDeclaredField("profile");
field.setAccessible(true);
field.set(meta, profile);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
craftItem.setItemMeta(meta);```
@safe knot Change meta.getClass().getDeclaredField to SkullMeta.class.getDeclaredField
how do i add to a config? I want multiple strings under one category
@dusky sigil You can use a list
I tried that
also im getting a null
@dusky sigil Is there any errors?
well
yeah
im getting a null
List<String> FactionNames;
FactionNames.add(args[1]);
this.getConfig().set("faction.list", FactionNames);
saveConfig();
try {
cfg.save(file);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}```
trying to do it this way
ignore there being no methods
im defining everything afterwards
well not afterwards
I tested that and it should be working unless your server isn't configurated correctly or you're being rate limited by Mojang's API.
I can't be rate limited as I tested that and cached it with each new name. All skins are showing properly (apart from GUI's) and BungeeCord and ip-forwarding is enabled.
but you get the idea
ILikeToCode?
because cfg generates a config
do you know how to control mobs using protocollib?
I have a separate config.yml
that is in no way linked to this one
oh i need to do new arraylist?
@dapper gate I am getting NoSuchFieldException: profile
@dapper gate I am getting NoSuchFieldException: profile
@safe knot try CraftMetaSkull.class
@frigid ember thanks
try CraftMetaSkull.class
Okay
@dapper gate CraftSkull exists, but CraftMetaSkull doesn't..
So... What should I do then?
he isn't even being toxic lmao
as you say
I used SkullMeta myself to try setOwningPlayer and setOwner, but those both didn't work
And I am on 1.12 so CraftSkullMeta doesn't exist
because it's CraftMetaSkull
CraftMetaSkull is the implementation of the interface.
CraftMetaSkull is the one with the fields and shit.
CraftMetaSkull is the one that holds the profile
CraftMetaSkull is the one you need to use.
I'm too lazy to check, just do it properly.
use Paper which exposes the API you need
I use tacospigot, it's a fork of Paper
PlayerProfile exists and I have tried it, but didn't work either
It exists
I'm using 1.12
dude stop talking things you don't know
what the fuck
I would like, ehm update.
no?
Also it is a fair response.
and what's next?
Why not?
it's a fork
Just go to latest version, stop staying on outdated shit versions.
fork which is better than original, yeah
you are totally right dude
1.12.2 paper
public void setPlayerProfile(@Nullable PlayerProfile profile) {
this.profile = profile == null ? null : CraftPlayerProfile.asAuthlibCopy(profile);
}
@dapper gate That would literally make no difference since
CraftMetaSkullimplementsSkullMeta. They'd both return the same class.
https://imgur.com/a/OR11cZ4 lul
tons of people sit on versions 1.12.2 because 1.13+ sucks in terms of performance
and only Paper fixes these issues
no you are
just showing you that you can't get fields that doens't exist in a interface class
thats just how reflection works
this channel is a shit show
yeah because there are tons of people who are trying to advice something, but they don't know if it's gonna help or not
¯_(ツ)_/¯
dude
meta.getClass() will return CraftMetaSkull
not SkullMeta
that's not how it works
SkullMeta is an interface and something needs to IMPLEMENT IT
for fuck sake
it's like you started learning bukkit before learning the language itself
what's wrong with people
Okay, but the question stays and why we started this whole conversation, how to do it properly?
what are you trying to do?
Use skulls in a GUI of existing players
yes and what's the problem
None of the methods I have tried, have rendered the skin at all
setPlayerProfile included
@frigid ember CraftSkulleMeta.getClass will not return the interface it is implementing.
ItemStack craftItem = CraftItemStack.asCraftCopy(new ItemStack(Material.SKULL_ITEM, 1, (byte) 3));
try {
// Field field;
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------", ChatColor.GOLD + "Health" + ChatColor.GRAY + ": " + ChatColor.WHITE + Math.round(Bukkit.getPlayer(pl.getName()).getHealth()), ChatColor.GOLD + "Kills" + ChatColor.GRAY + ": " + ChatColor.WHITE + p.getSesionKills() ,ChatColor.GOLD + "Kit" + ChatColor.GRAY + ": " + ChatColor.WHITE +( p.getSelectedKit()== null ? "Default" : p.getSelectedKit().getKit()), "", ChatColor.GREEN + "Click to Spectate", ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "--------------------"));
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', AssembleBoard.getChatMeta(pl.getUniqueId(), ChatMetaType.SUFFIX)) + pl.getName());
PlayerProfile profile = ((CraftPlayer)pl).getPlayerProfile();
meta.setPlayerProfile(profile);
craftItem.setItemMeta(meta);
// field = meta.getClass().getDeclaredField("profile");
// field.setAccessible(true);
// field.set(meta, profile);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}```
Yes thats the interface, whats so special about it?
firstly
you don't need to cast to CraftPlayer
secondly, are you running behind bungeecord?
Oh, i thought you were saying to use the interface.
secondly, are you running behind bungeecord?
Ye
are you using paper?
It does make a difference since interface does not have fields btw.
did you enable bungeecord mode in paper.yml?
this ofc doesnt work
Atleast that one doesn't.
did you enable bungeecord mode in paper.yml?
What does that exist?!
Yes
bungee-online-mode: true
This you mean?
You shouldn't stay here on spigot then, a lot of users are like this.
Sure
everyone on spigot thinks they're the best developer ever
I am. In fact the best developer ever.
i don't mind lol
i don't really care what people say about me on the internet
can't say the same about you tho
https://i.imgur.com/zKobytB.png
class org.bukkit.craftbukkit.v1_16_R1.inventory.CraftMetaSkull
The meta.getClass is the correct thing to do
alright so im printing a ArrayList and it works great but the problem is there its all surrounded by [name, name2] and i dont want that
Should I make a plugin and upload it to Spigot, how do you license them?
Like usual.
Wdym @bold anchor?
And this message came up
Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
@dusky sigil String.join(", ", list)
Is it because I am running bungeecord?
@spring arch much appriciated
All of my plugins are new
@spring arch ^
All my plugins are new
Yes but they use legacy materials
Thats why i posted my message
It's fine
Ok
Doesn't matter how new they are it shows up anyway with some
@safe knot can u show in game?
One of them didn't specify api-version in their plugin.yml
Because of how they are programmed
Ehh you mean Broadcast or ..?
@bold anchor wdym "like normal"?
nah just the skull in game
Like how you would license anything?
Where it's working properly or isn't?
Okay
yes
vehicle.addPassenger(player)
but what will vehicle point to
Can't keep up! Is the server overloaded? Running 6405ms or 128 ticks behind
And minecarts, etc are also vehicles
@agile gyro you got a lag machine or some shit?
This usually happens right?
@safe knot alright can u uh print it's NBT?
No
No, I just started the server
xDark, minecarts are also vehicles
How much memory?
1 gb for each bungeecord server
vehicle instanceof Boat?
Huh each Bungeecord???
You mean each server?
The spigot servers running under bungeecord
1Gb for a minecraft server is not enought.
Yeah IDC about bungee how much ram do they have
if (vehicle instanceof Boat) vehicle.setPassenger(player)
1gb
And yeah you need at least 4 for spigot on 1.14+
oh ok
just 'vehicle'
the bungee server can run on a gb but if you got 1.12+ server you should opt at 3-4 gb min
@spring arch [09:41:21 INFO]: [global] {SkullOwner:{Id:"327e74e5-e88f-435f-8236-7aa19376525e",Properties:{textures:[{Signature:"YWRsysijscldGTw7IhquUfW8yDb/q3wlkIeY6TjfkGR8cQy7H//xpJ8zC7tx/Gs8v7wKeZSACaxUPzye8D/jbNe23bjWJYvTXV0rtgFgak2pnRRlQ79Qe43cSEyCAfccmN/ZFAjfq+UoNr2Y7nQ4+bDxsHHVbRPqwUVHwfcuLh+p7t1ZdxwwDqTnUPrmDKCus+iLhfsJ//SSKiqZ1+42e5CvgeRTXOzkI6zgdbPvyo+Cmb6Iu7ZgFguNYxSu0AzosVBMlRhpc8p9ABg4n3aEEpaQko6cin4rwl4RTycPwXiEB/EAFuwwxMk/SjC+koNaKIfeQ0E6Erl/efaCxsVYjanN0LFkb03cRRCHJXFbvAi0Sma3/C+Wp64FMZ0J/3bvTGNmRbQWkuaCZ6Lf4C8sCkOTXPdch3nCHl69vuoTqI7eJbVFeJN3tcRhs/QmDjE/9DgxKkucxCBUSgpVipEI8NdvFOVLvkI03fsTlPWGG1T5OAzJjkg3kyR5zALX2uyDtMrtWeS/L77kGmOoLtybkkhQb3rQEtI9s0Z0ZpRhzd23EcHlflwKRh8OeweUaTkDOclC7IPdZp4hL4P0XNUmaTHunIRydfmcN+UPS294GTJmQ8cYur1sSY94nOgRc1cQz+LSB1mPU5A3TxAJ9li76/sP9SM0lNX8eavRDY7+RzY=",Value:"ewogICJ0aW1lc3RhbXAiIDogMTU5NTU5MzU4MjQyOSwKICAicHJvZmlsZUlkIiA6ICIzMjdlNzRlNWU4OGY0MzVmODIzNjdhYTE5Mzc2NTI1ZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJGbGVyYWtsIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzZmMTAwMjE3YTUzMzEwMjZkZTk2NjFjNjM2MmVjOTEyNmExNTExMWE2ZGJlZmQ5OGU2ODU2OWJiZGI5ZGI4OTIiCiAgICB9CiAgfQp9"}]},Name:"Flerakl"},display:{Lore:["--------------------","Health: 20","Kills: 0","Kit: Default","","Click to Spectate","--------------------"],Name:"Flerakl"}}
@safe knot if you are still looking
CraftItemStack.asNMSCopy().save(NBTTagCompound()).toString()
CraftItemStack.asNMSCopy().save(NBTTagCompound()).toString()
Yea I used that
@EventHandler
public void onPlayerMobInteract(PlayerInteractEntityEvent e) {
if (e.getRightClicked() instanceof Horse) {
Player pl = e.getPlayer();
Entity ent = e.getRightClicked();
Vehicle vehicle = (Vehicle) e.getRightClicked();
ent.setPassenger(pl);
if (vehicle instanceof Boat) {
vehicle.setPassenger(pl);
}
}
}```
look
if a player clicks a horse
he needs to be spawned into a horse&&boat
sounds weird
ikr
Ye, I used labymod which didn't used logs, so had to use forge
Works fine for me.
ItemStack craftItem = new org.bukkit.inventory.ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
try {
// Field field;
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setPlayerProfile(entityplayer.getBukkitEntity().getPlayerProfile());
craftItem.setItemMeta(meta);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
entityplayer.getBukkitEntity().getInventory().addItem(craftItem);
No not the player inventory but an other inv
Hmm
server.postToMainThread(() -> {
ItemStack craftItem = CraftItemStack.asCraftCopy(new org.bukkit.inventory.ItemStack(Material.SKULL_ITEM, 1, (byte) 3));
SkullMeta meta = (SkullMeta) craftItem.getItemMeta();
meta.setPlayerProfile(p.getPlayerProfile());
craftItem.setItemMeta(meta);
Inventory inv = p.getServer().createInventory(null, 9);
inv.addItem(craftItem);
p.openInventory(inv);
});
And try to add a lore and a different displayname..
🤔
And are you using bungeecord or ..?
is that paper? 😂
paper rocks.
OMG, xDark I found the issue.
i doubt spigot has any of the gameprofile instances public
Thanks for helping.
why does everyone come here with paper issues don't they have their own discord?
Welp, the way the GUI worked is that it saved only the enchantments, durability,displayname,lores and amount and not the other data...
It's not a paper issue.
paper doesn't rock
It does :)
scizor
Async lightning engine? Paper.
Better performance? Paper
More stuff exposed to the API? Paper
More contributors? Paper
terrible looking forums
i'm not encouraging anyone
it's peoples own choice on what to use
how did you setup your workspace
you were supposed to open maven project
you don't have to
Spigot-API is just an open API, Spigot-Server includes a work with internal's server stuff
yep
no it depends on what you are doing
so for example
you're adding a method to Player class
Player is an interface and it has an implementation, so you will need to also do changes in Spigot-Server
if you only touch API that is not depend on Spigot-Server, you are fine
yeah he did exactly what i said
[10:09:31] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[10:09:32] [main/INFO]: Reloading ResourceManager: Default, bukkit
[10:09:32] [Worker-Main-4/INFO]: Loaded 7 recipes
[10:09:34] [Server thread/INFO]: Starting minecraft server version 1.16.1
[10:09:34] [Server thread/INFO]: Loading properties
[10:09:34] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-beb7d47-145921e (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
[10:09:34] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: null
at net.minecraft.server.v1_16_R1.JsonList.load(JsonList.java:164) ~[server.jar:git-Spigot-beb7d47-145921e]
at net.minecraft.server.v1_16_R1.DedicatedPlayerList.y(SourceFile:95) ~[server.jar:git-Spigot-beb7d47-145921e]
at net.minecraft.server.v1_16_R1.DedicatedPlayerList.<init>(SourceFile:22) ~[server.jar:git-Spigot-beb7d47-145921e]
at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:147) ~[server.jar:git-Spigot-beb7d47-145921e]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:810) ~[server.jar:git-Spigot-beb7d47-145921e]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[server.jar:git-Spigot-beb7d47-145921e]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
[10:09:34] [Server thread/ERROR]: This crash report has been saved to: /home/container/./crash-reports/crash-2020-07-24_10.09.34-server.txt
[10:09:34] [Server thread/INFO]: Stopping server
[10:09:34] [Server thread/INFO]: Saving worlds
that is my latest.log file
how do I fix that
delete bans file or repair it manually
so delete banned-players.json or banned-ips.json
Either
Hey, I have an issue running spigot on Ubuntu server 20.04 with openjdk version 11.0.8. When using the "stop" command to close the server, it freezes for a long time (10/15 ish seconds) on: [14:20:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld before it goes through to either finish the save, or crash with this error: https://pastebin.com/7qMDyWx6
I have found no relating circumstances to when it goes through without error and when it doesn't.
your fs responds too slow
fs?
file system
hmm okay, yea that'd make sense
It waits for world save to complete, but save itself is stuck on java.base@11.0.8/sun.nio.ch.FileDispatcherImpl.pwrite0(Native Method)
i have a prison server and i want to reset, how would i reset the inventories and locations of players?
ah I see
how's that possible though? it's a newly generated world, and my pc has run multiple servers before
@woven raft Just delete the player files
where are those located?
in the world directory
inside your main world folder
rd /s /q playerdata for win
rm -rf playerdata for unix
i deleted all the playerdata but it didnt work
Alright, I'll try that out, thanks a lot @spring arch. Been pulling my hair out for quite a bit now.
stop server -> delete files -> start server
nvm i deleted from the wrong world folder
Hi
I complied a spigot jar using bulidtools
And I tried starting my server
After a few min
This happened
What happened?
?paste
You cannot upload a file to this chat
paste full error
It shows the error
dont upload the jar
post it in the hastebin tho
Hi. Why does the crash happen?
https://pastebin.com/sRQDyiRF
Fork
Then go on the SSSpigot discord lul
smh is it another shitmarket fork
Yes I know. He is not online, I decided to ask here.
Dude dont upload the jar.
25$ ew
no it's just a meme i don't even know what that is, just gave a random price
we do not support any kind of illegally redistributed software here
its 18$
Are you laughing? And it really boosts TPS a lot. 😀
Spigot 1.16.1 is crashing
Are you laughing? And it really boosts TPS a lot. 😀
@high wadi sure
@agile gyro Your server runs with 1024mb memory. Thats why it crashes
Oh really?
probably
So I need more ram on the server?
@high wadi You're also leaking your players IP addresses.
@frigid ember What's the big deal?
nothing, yeah
As i told you before. 1gb is not enought to run a minecraft server. Get at least 3 gb
oh no ips scary 😪
2 is fine if you dont use plugins
Ok, thanks
😆
I have to get a new server then
My server only has 4 gb of ram shared across 6 servers
https://www.spigotmc.org/resources/bungeechatapi.38379/
this plugin is bad , not open-source, and doesn't even support your version
don't use it
be aware i can ddos you with my 0.01kb internet lmao
Bungeecord said it won't run without it
😯
TheUnreal then only run one single server. You cant even run 2 servers on that machine.
any kangarko plugin is
but if you need it and it works, i guess keep it
i'm not blocking you
I was running multiverse instead of bungeecord before
huh
Thats how I got many world
say what now
If you have 4 gb of ram you should just throw bungeecord in the trash and run on single server and handle everything per world
oh i got it nevermind
https://www.spigotmc.org/resources/bungeechatapi.38379/
this plugin is bad , not open-source, and doesn't even support your version
I guess its open source 😄
But I needed a plugin to work on one world and not in the other
get per world plugins
I guess its open source 😄
@sinful spire Yes but there are better alternatives tbh. Also it says 1.16.1 is not supported? Very confusing and misleading resource page
1.16.1 is very laggy and resource demanding
you'll need powerful servers
if you need lot of players
u probably just have a bad cpu i can run a mc server on 1gb fine but havent tried with a lot like viper says
1gb can support like 10 players w like 5 plugins probably
lol
depending on how intensive the plugin is
yeah anti cheats use packets im pretty sure
which isnt really helping you
depends on how bad is the anticheat done
having an anticheat doesn't always mean you're adding intense load to the server
But, it's werid
Spartan 🤣
not a lot but it still adds to the issue sometimes
1.8.8 is not 1.16.1
Hi there, is there a way for me to set the Player#hasPlayedBefore() to false? I would need this to debug an issue which occurs only with players joining for the first time. Removing the player from the usercache.json did not work.
Removing playerdata would remove all players inventories
it would remove the playerdata of a single player if you were to delete the json that starts with their uuid
Remove server
and yeah... thats the point of never playing before..
it would remove the playerdata of a single player if you were to delete the json that starts with their uuid
@bronze acorn The problem is, I have multiple worlds... Would removing them from each world'splayerdatawork?
You should create your own config to manager if player has played before
You only need to delete it from the main worlds directory
Thank you!
Hello! I want to spawn NPCs with skins and I was able to do it with NMS though lots of people suggest that it's unstable and I should use something else, I've tried looking around for tutorials on spawning entities with skins without using NMS though haven't found any, would anyone know a solution for it?
Oh ok
Citizens, but it's kinda a mess
Ok
Hello! I want to spawn NPCs with skins and I was able to do it with NMS though lots of people suggest that it's unstable and I should use something else, I've tried looking around for tutorials on spawning entities with skins without using NMS though haven't found any, would anyone know a solution for it?
@wheat summit yes
ProtocolLib
is technically not NMS
If you can spawn your own npcs dont use citizens. Its awfull.
Ok
remember if you make an nms entity you cant use actual events such as playerinteractentityevent
Would something like this work? https://www.spigotmc.org/threads/creating-npcs.130439/#post-1384536
What would be the best way to create an NPC like on Hypixel.net (yes, I reference him a lot. I look up to his coders)? I want the NPC to have a name,...
you have to listen for packets
your can if you do it right
To get a NMS class ^]
protocollib has a packetlistener which is easy
Last time I did also make an NMS entity it was quite easy to interact with ^
yeah protocollib is legendary
you can do the same thing with players
yeah
but there are some rocks you would have to deal with
packettype.play.client.entity_use i think??
Ok thanks, a problem I also have with NMS is it only seems to be usable with Spigot and I'm running a Multi-Server network
i have an event that gets called like a tick after that packetlistener triggers
I just forgot to say that it doesn't seem to work with Spigot
make sure your server jar is tacospigot
no ilike actually its not stressful at all
surprisingly
and did you conpile with tacospigot
man you got javadocs memorized 👀
use the same jar youre using for your server
dont use taco for your server and paper for your plugin
oh damn ilike
xd
use the same spigot dependency
as your server
👁👄👁
doc basically: Why cant i put a stone into a household mixer if i can put it in a concrete mixer
Would anyone know how to get NMS to work with Spigot then? Everytime I've tried it, Spigot seems to crash for some reason, would I have to switch to CraftBukkit?
Really? Oh
It was from a while ago
oh that page took 10 years to load lol
Though if I added the CraftBukkit dependency, the code would only work on CraftBukkit and not Spigot, isn't CraftBukkit in Spigot?
Spigot is much more stable
👁👄👁
EntityPlayer fake = new EntityPlayer(MinecraftServer.getServer(), world, profile, new PlayerInteractManager(world));
NetworkManager networkManager = new NetworkManager(EnumProtocolDirection.SERVERBOUND);
fake.playerConnection = new PlayerConnection(MinecraftServer.getServer(), networkManager, fake);
world.addEnity(fake);
Though what do you mean? I have ran build tools
¯_(ツ)_/¯
Yeah
no
its added to your maven repository or smthn like that
did you read buildtools guide?
all u have to do is add the dependency into your pom.xml if you're using maven
Ok, what's the dependency of it?
All I have was
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
For the main Spigot APi
replace it with spigot
That doesn't work though
wtf
Maven local repository?
did you run build tools
do you need to import NMS or API? i don't understand
btw dont listen to anything TheoBuzz (German Branch) sais. He is just trolling hard.
NMS
mvn install:install-file -Dfile=path-to-nms-jar \ -DgroupId=your. groupId \ -DartifactId=your-artifactId \ -Dversion=version \ -Dpackaging=jar \ -DlocalRepositoryPath=path-to-specific-local-repo
in your external libraries do you see spigot added
it's not lol
No
do you use system scope smh
just run build tools and it will install the jar with NMS
vioer
viper
did you install 1.8.8
did you specify the version
when doing buildtools
or did you just run it lol
I did specify the bounds
when people try to say something smart but fail
not viper but yeah
It's the Artifact ID it doesn't show
im out i don't even know what are you all doing
If you want to use nms
-> run buildtools on your pc and build the version you need -> this installs everything inside your maven repo automatically
-> then you can just import the spigot artifact instead of the spigot-api artifact in your maven repo
@wheat summit did you run buildtools?
i did
alright
are you using windows?
the BuildTools.jar
Yes
ok goto %userprofile%
@grim halo How would I import the Spigot Artifact? Sorry for the ping!
it's basically a directory of your user
it shouldve looked like
java -jar BuildTools.jar --rev 1.8.8
Yes I did that
dude can you read actually helpful messages
idk why u have to do all this extra stuff it always just works after buildtools
can you go to your user directory
lmao
I would think it would work
hold on flaming
Do I need to do something like put the NMS .jar idf there is one under a libs folder and add it as a dependency that way?
nvm
dude can u read messages
I am...
flaming no unless you're not using maven you'd have to manually add it
you can always use what I just told you 🤷♂️ it works and it's the proper way
I am using Maven
dude i ask you to go to your user dir
flaming you probably dont have maven added to your env variables if thats even a thing
and you tell me that you use maven
No I doubt I do actually
flaming if u want to do what darks doing go to C:/Users/youruserhere
finally
so did you go to your user directory?
Yes
Ok
found it?
Yes
go to repository
Ok
Weird, I do see them...
ok
minecraft-server and just spigot
1.8.8
so go to spigot
Yep
None
and nothing else?
and where is a jar
The .jar.lastUpdated
No idea what you guys are doing but i just ran BuildTools and replaced the spigot-api artifact with spigot. Just works...
That'
but if he is doing everything right and there is no installed jar
s what I tried...
then he is doing something wrong
I don't think Maven is an environmental variable
you don't need an env variable
Oh
IDEA does everything for you
maybe check your maven system variable
I would think so...
just like for gradle
flaming
Yes but buildtoold does not know that. It needs a set m2 home
i dont think you have to specify
a repository
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
that's all you need
so im doing this - cfg.set("members", membercount + ""); (membercount is 1, int) and if i do this int MemberCount = cfg.getInt("members"); sender.sendMessage("Members on the faction " + args[1] + ":" + MemberCount); and it says 0!
of course with the formatting
the config does say one
<dependencies>
<!-- Required Dependencies -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```
well buildtools guide does not say anything about any env variables
that would be all you need
@dusky sigil
you're setting a string it looks like
dontt add ""
did you press reimport
I am yes
at the bottom
FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);```
there should be a console open
i already created a file named that
@dusky sigil
@bronze acorn gives an error
/f info <faction name> than it brings you the member count
ah ok
@dusky sigil are you saving the file
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.20</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Sorry that's a bit big ^
remove the repository
@spring arch file itself is looking good
no point of it anymore
oh
it does not matter
thats what i said 😔
Still not working
or it is 🤔
No
is spigot red?
the heck lol
What do you mean?
just pass int?
just yeah
Usually dependencies work fine for me
not a string
Ok
is there a spigot-1.8.8 jar in there
cfg.set("members", membercount + ""); (this is a different cfg) this is how i set the membercount
what do i change?
remove the + ""
remove + ""
lol
Looks like it
yeah that makes sense thanks
Wait nevermind
try running buildtools again flaming
- "" is equal to Integer.toString(membercount)
I'm not sure
There is a Spigot Folder
everytime you compile buildtools the spigot-<version>.jar
no
in the same directory
as buildtools
Ok
no subdirectories
And add a PAUSE on the end of your batch file so you can read what went wrong if the buildtools fails
there will always be a spigot-<version>.jar after you finish running buildtools
yeah
or you can just do in a gitbash client (assuming u have git bash)
actually
in a normal cmd prompt
I did use gotbash
java -jar BuildTools.jar --rev 1.8.8 PAUSE
Gitbash*
pause will be passed as an argument
you dont need to use pause if you execute something from command line
create a build.bat file
and put that in there
yeah
ignore everything about pause
just open the git bash and do java -jar BuildTools.jar --rev 1.8.8
after its done it should tell you build success i believe??
?
Just saying that I'm doing it
aight
What are premium plugin placeholders used for?
probably for other plugins that support placeholders...
If we are speaking of PAPI placeholders
thank you
it-it explains it
Spigot placeholders are super useful anti-piracy variables, injected into your plugin upon download.
This means Spigot can track and observe unmodified premium plugins.
You can protect yourself with obfuscation or individual class integrity protection.
Since Spigot replaces these variables in all classes and it tampers with classes in general, JAR Signing or JAR Integrity Protection (for example with obfuscators like Stringer) is only possible when the obfuscator is properly configured.
Now as you may or may not know, Spigot injects its own anti-piracy using these variables, and it's used as a deterrent to inexperienced plugin leaks. The more experienced however, know that anything is crackable, and you should keep this in mind.```
e.e
how can I use them though?
"how to use them"
