#help-development
1 messages ยท Page 1418 of 1
how, snow is client side
yeah I would need to change the biome for each chunk loaded
I think it would be best doing it via packets no?
I wouldn't but its up to you
so you would just change each chunks biome type?
what do you mean by set x weather type?
well that is what I am saying
ye for snow but dont do it for rain and stuff
well it has to be global weather so I would have to do that for rain too in deserts and snowy biomes
you're not moving
the entity you are riding is
oh right there is head movement
is it all the same listener or different for each stand
thats strange
looks like a bug
how could I string together some TranslatableComponent() and output it to the player's Actionbar?
String hud = new TranslatableComponent("space.100") + Stamina.getStamina(player) + new TranslatableComponent("space.-80") + Mana.getMana(player) + new TranslatableComponent("space.80");
something like this
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, hud)
i dont believe this would work
ComponentBuilder
I'd need ComponentBuilder right
lol
u beat me to it
I think I just have to read up on ComponentBuilder docs or something
cuz it kinda confuses me on how I'd string it together and append it in the way I want
i might just be overcomplicating it
I have no idea
hey guys so I found this class that I need to modify the weather like I want
https://github.com/jacky8399/FakeSnow/blob/master/src/main/java/com/jacky8399/fakesnow/NMSUtils.java
Make regions snow without snow layers piling up. Contribute to jacky8399/FakeSnow development by creating an account on GitHub.
but I am pretty sure the mappings are for 1.16, what would be the 1.15 ones?
Huh I was going to do something like that, good to see it's still possible
take a look at the output in buildtools
look at the comments in the class
try and see if the variables in the 1.15 class exists
if not, try to find whatever the variable was originally called
if it doesn't exist or just completely different, you may have to just rewrite it
In that case, yeah then it's likely there will be a lot of changes
I did it back in like 1.10? by just changing the biome array in the map chunk packet
without bungee in general or without bungee's api?
is there an event that fires whenever the crafting grid is updated, even if it doesnt form a valid item?
PrepareItemCraftEvent
oh that fires even if its just random items in the grid?
I think so
you're right ๐
bye
you can use plugin channels
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
how do you use sounds?
or
p.playSound(p.getLocation(), Sound.ENDERDRAGON_WINGS, );
```what doI put as the third value
what do the javadocs say
declaration: package: org.bukkit.entity, interface: Player
Trying to get the vanilla ender dragon boss bar, however I'm having trouble finding where I can grab the object from. I don't see in the docs where there's an event to grab it from, nor do I see it on the World object, just a bit confused with how to interact with an existing one.
declaration: package: org.bukkit.boss, interface: BossBar
to modify the vanilla boss bar, you'd probably have to interact with the ender dragon itself https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EnderDragon.html
Boss#getBossBar
So to get the ender dragon object I only see one event and its EnderDragonChangePhaseEvent, however according to the docs it only fires when it switches phases. I dont think I can rely on this.
i mean, World has getEnderDragonBattle...
So I noticed you could remove it from both the EnderDragonBattle object and the EnderDragon object so I tried both.
if (event.getPlayer().getWorld().getEnderDragonBattle() != null) {
System.out.println("Player Now in The End");
event.getPlayer().getWorld().getEnderDragonBattle().getBossBar().removeAll();
event.getPlayer().getWorld().getEnderDragonBattle().getEnderDragon().getBossBar().removeAll();
}```
However, the second returns a NPE, but the bar is still there lol.
(is it even possible to remove the bossbar from bosses?)
(I'd hope) :/
Mmmm... I think the issue may be that I'm tying this to the playerJoinEvent which fires before the world checks if the ender dragon is there
[05:35:37 INFO]: Player Joined
[05:35:37 INFO]: Player Now in The End
[05:35:37 INFO]: + Patrity Connected
[05:35:37 INFO]: Patrity[/xxx:38871] logged in with entity id 215 at ([world_the_end]4.529872263298235, 73.0, 20.523585212879755)
[05:35:38 INFO]: Scanning for legacy world dragon fight...
[05:35:38 INFO]: Found that the dragon has not yet been killed in this world.
๐ซ
since when could you declare arrays like int[] arr = {1,2,3,4};??????
wtf
am i dumb
always o.o
int[] arr = new int[]{1,2,3,4};
like a list lol
like that
You don't.
send husky pic
send noodles
when you have both the dog pfp and selfie pfp
read info there
Trying to understand Minecraft code ItemBow.java - what is the integer i that is passed in?
public void a(ItemStack itemstack, World world, EntityLiving entityliving, int i)
what method is that
@quaint mantle hey can u help with this
You got a reply from md_5 himself on your post
wait rlly
oh yeah
but idk what other plugin
bungee
or spigot
wait probably bungee
but still
does anyone have any idea why when I send a playerinfopacket with inside an entity with a skin to a target player if the target is still joining it spawns the npc without rendering the skin?
are you sending the packet to all players?
Is there a way to break blocks as the player without using NMS? Looked at EcoEnchant's source to get an example of how it handles the different block breaking enchants such as blast mining or dynamite but it uses NMS stuff such as BlockPosition or weirdy nms/bukkit libraries such as org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer.
Spigot alternatives?
inb4 the obvious block.setType(Material.AIR)
how is org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer a weird library
is there a way to let tabcompleter show only stuff that contains that what you already typed, like with vanilla commands
its a minecraft version specific one
anyway you can spawn the block break particles at the block and increase it's stage every x ticks & eventually set the block to air
thats a pretty good option ngl
just determine the breaking speed by the hardness of the block
is there a programmatic way to do this or will I have to make a large enum/config file listing these
nah you don't have to do that
pretty sure Block#getBlockPower() is the hardness though I don't know for sure.
mine's currently just showing every completion always
always assumed that was redstone power
heko
help
if the literal creator of spigotmc gives you a suggestion but you don't take that suggestion it's up to you my dude @torn oyster
Is the listener registered
are you on 1.8
yes
ur fucked
nothing that can help you
I use 1.8 too and can't cancel this event either.
Give me 0.2 seconds and I'll show you what I use
funny question
any way of getting an entity, using #setVelocity or similar physics, through blocks?
no teleports?
@torn oyster is your plugin a bungee plugin or just a spigot plugin
wait what do u use then
PlayerLoginEvent will work
u cant cancel that
You can kick the player immediately upon joining
I actually put my login handling shit on a bungee plugin
oh right
but they dont connect
send ur code
@EventHandler
public void prePlayerJoin(AsyncPlayerPreLoginEvent e) {
String name = e.getName();
UUID uuid = e.getUniqueId();
if (Bukkit.getOnlinePlayers().size() >= MinigameManager.getMinigameManager().getCurrentMinigame().getMaxPlayers()) {
e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "full");
}
}```
idk what else to send
assuming you're sending them back
hmm
so they are in fact kicked for 'full' right
yea
but where is your command
/send is an in-built bungeecord command
it sends them to a server
You could make use of Plugin Messages
what
im trying to make the bungeecord /send command fail when i e.disallow
on spigot
the send won't fail as bungee has succesfully connected them, the fact that you cancel their login doesnt mean the bungee failed
Connecting happens before login in
and you're using the login event
so yes they are properly connected
the way I did this is set a redis variable to the max amount of players & checking that on the other server to see if a player is allowed to join or not
i have a custom full thingy tho
cuz i want admins to be able to join and spectate
and i will also cancel the event if the minigame is running
try {
Jedis jedisResource = BlitzSG.getInstance().getJedisPool().getResource();
String canJoin = jedisResource.get("canJoin");
jedisResource.close();
if (Boolean.parseBoolean(canJoin) == false) {
p.sendMessage(ChatColor.RED + "No games available at the moment!");
return;
}
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("hub");
p.sendPluginMessage(BlitzSG.getInstance(), "BungeeCord", out.toByteArray());
} catch (Exception e) {
e.printStackTrace();
p.sendMessage(ChatColor.RED + "No games available at the moment! " + ChatColor.GRAY + "(e)");
}``` This is what I had for this
this was for when you clicked a sign
but you need redis which you probably don't have if you've never done anything with it
yeah it's in the hub
what is redis
it's another server
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
is there not a way to see how many food points a material will restore?
Sadly not in the api I think
oof
private static final Map<Material, Integer> points = new EnumMap<>(Material.class);
static {
points.put(Material.APPLE, 4);
points.put(Material.BAKED_POTATO, 5);
points.put(Material.BEETROOT, 1);
points.put(Material.BEETROOT_SOUP, 8);
points.put(Material.BREAD, 5);
points.put(Material.CARROT, 3);
points.put(Material.CHORUS_FRUIT, 4);
points.put(Material.COOKED_CHICKEN, 6);
points.put(Material.COOKED_COD, 5);
points.put(Material.COOKED_MUTTON, 6);
points.put(Material.COOKED_RABBIT, 5);
points.put(Material.COOKED_SALMON, 6);
points.put(Material.COOKIE, 2);
points.put(Material.DRIED_KELP, 1);
points.put(Material.ENCHANTED_GOLDEN_APPLE, 4);
points.put(Material.GOLDEN_APPLE, 4);
points.put(Material.GOLDEN_CARROT, 6);
points.put(Material.HONEY_BOTTLE, 6);
points.put(Material.MELON_SLICE, 2);
points.put(Material.MUSHROOM_STEW, 6);
points.put(Material.POISONOUS_POTATO, 2);
points.put(Material.POTATO, 1);
points.put(Material.PUFFERFISH, 1);
points.put(Material.PUMPKIN_PIE, 8);
points.put(Material.RABBIT_STEW, 10);
points.put(Material.BEEF, 3);
points.put(Material.CHICKEN, 2);
points.put(Material.COD, 2);
points.put(Material.MUTTON, 2);
points.put(Material.PORKCHOP, 3);
points.put(Material.RABBIT, 3);
points.put(Material.SALMON, 2);
points.put(Material.ROTTEN_FLESH, 4);
points.put(Material.SPIDER_EYE, 2);
points.put(Material.COOKED_BEEF, 8);
points.put(Material.SUSPICIOUS_STEW, 6);
points.put(Material.SWEET_BERRIES, 2);
points.put(Material.TROPICAL_FISH, 1);
}
well just finished writing that up ๐
tyty
๐ ๐ ๐
good thing I don't care about saturation
hoooo boy
now can i set die max durability
any help?
?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.
Hey, Is there a way to clear the player's inventory but only keep one specifc thing?
clear the inventory and then add the one specific thing
Alright thanks
can i actually do this?
people told me it would break my code
so i would like to know
which database is the most efficient to use?
@kind coral what's configManager?
and Hasler it depends on the data and how much of it usually
i use a custom lib to handle my config.
assuming you coded it properly it shouldn't break it afaik
its not my lib, its made by another developer its very useful and it makes me code stuff 10x faster lul
should be fine then
pog works fine
how would i get the age of a crop, i've been trying with BlockData but nothing 1.16.5
@SuppressWarnings("unchecked")
public static void giveWinnerInventory(Player p) throws IOException {
YamlConfiguration c = YamlConfiguration.loadConfiguration(new File(path, p.getName()+"winnerInventory.yml"));
ItemStack[] content = ((ArrayList<ItemStack>) c.get("inventory.armor")).toArray(new ItemStack[0]);
if (p.getInventory().firstEmpty() == -1) {
for (ItemStack i : content) {
p.getWorld().dropItemNaturally(p.getLocation(), new ItemStack(i));
}
} else {
p.getInventory().addItem(content);
}
content = ((ArrayList<ItemStack>) c.get("inventory.content")).toArray(new ItemStack[0]);
if (p.getInventory().firstEmpty() == -1) {
for (ItemStack i : content) {
p.getWorld().dropItemNaturally(p.getLocation(), new ItemStack(i));
}
} else {
p.getInventory().addItem(content);
}
Bukkit.broadcastMessage("LOADED INVENTORY");
}
and then i use the method, i get an error bc of the:
ItemStack[] content = ((ArrayList<ItemStack>) c.get("inventory.armor")).toArray(new ItemStack[0]);
And i dont know what to do now..
AnyBody can help?
can anyone help me set a world border
BlockData and getting CropState but is deprecated
@empty oyster you should be able to just do (ItemStack[]) c.get("inventory.content")
@kind coral could I see your code?
Ageable ageable = (Ageable)e.getClickedBlock().getBlockData();
oh i just closed intellij i need to go to my aunt's house to build some stuff, btw
BlockData data = e.getClickedBlock().getData();
CropState state = (Crops) data.getState();
i did something like that fromw hat i remember
@timid rose you can use World#getBorder and reference the WorldBorder javadocs
declaration: package: org.bukkit, interface: WorldBorder
gotcha, use Ageable when you get back, should fix it
How can I set a block at a location to water
@candid galleon not working :/
Yes, I am
The npc spawn without skin
can u send ur full code
@vast quest setType(Material.WATER)
only if I send the packet while the player is joining. If i just send a packet when the player is already joined it spawns the npc with the skin
thanks
ofc
I was wondering if it should be WATER_BUCKET or LEGACY_WATER
neither
yeah
?paste
public static void giveWinnerInventory(Player p) throws IOException {
}
YamlConfiguration c = YamlConfiguration.loadConfiguration(new File(path, "winnerInventory.yml"));
ItemStack[] content = (ItemStack[]) c.get("inventory.armor");
p.getInventory().setArmorContents(content);
content = (ItemStack[]) c.get("inventory.content");
p.getInventory().setContents(content);
Bukkit.broadcastMessage("loaded INVENTORY");
This is also not working ;/
: ItemStack[] content = (ItemStack[]) c.get("inventory.armor");
what do you mean by "not working"
what game version
don't watch line 8
1.16R3
@candid galleon i got the same error for : ItemStack[] content = (ItemStack[]) c.get("inventory.armor");
what's the error?
at de.daniellainand.utils.SaveYML_LoadYML.giveWinnerInventory(SaveYML_LoadYML.java:24) ~[?:?]
huh okay
so cast it to arraylist then
and then on a separate line convert to array
ok i try it
#CrashTheBot xd
@quaint mantle ?
hi
...
I'd give the citizens plugin code a look
i've tried. But from what I saw they create a fake player properly registered as entity into the server
I think that it is not bugged bc the server take care of it.
I've already made the plugin. I would prefer not mess up
what does the plugin do
register a player actions and make the npc do the same actions
so a replay system basically
yes
how functional is it right now
80%. There is the skin problem and I need to to make an another thing.
The skins load.
Sometimes they just don't load. Only the player is joining
Hey, is there any single way to do it so If you quit while you're in a specifc arraylist you won't get removed?
yes
I would try with uuid or OfflinePlayer
why?
idk i'm considering using a similair system but in 1.8
Saw an API on github for it but idk how useful that'll be
Just duels/FFA fight replays
save the last 2 minutes of gameplay before the anticheat bans a player so you can later verify etc
I think that would be a good feature
If there is an api that does it for you
just make a setting to enable and disable that function
I think it replays everything on the server, not just your specific players
oh
I need that for a school project XD
dyno bad
Hi, i'm using ExacteChoice to creatin custom recipe with custom items inside it but it don't reconize it :
in my hold plugin it work fine but here not
if i use intellij auto correction it set me this but it work one time in two
some craft work and other not for any reason
and when i try to print result and ingredient it show me correctly but the craft ingame don't work
wanna kill my self
and this one work...
it doesn't send "test", anybody know why?
does the flie exist?
Yeah yaml has sections too
I don't think a json file would be good for 100 quests ๐
??
In that case it makes even more sense
to use json
instead of yaml cause of objects
what? A file is a lot more simplier
in my project yes
JSON is just text
in my plugin folder no
well then thats why
well it's supposed to create it
Then you should invert the if
the file is correct, it's simply not creating it
then.. create it
if I specify "location1.yml", it works
it doesnt
configFile.createFile()
thats what Im tyring to figure out...
would that create a blank file?
yes
no can do
lmao why
also, consider trying out paths
because I need to have a template
then you just inject your template
that will require even more work, my original question is why it's not creating it unless if I specify "location1.yml", not "How can I do this in a different way", I have my own reasons for doing how I am, but since ya'll don't know what I'm trying to do, ya'll won't understand why
you have to make the file
just do mkdirs() then first
to create the directories
then create an empty file
using createFile()
You are checking file.exists
And then creating it
If the file doesnโt exist, file.exists will be false
And it wonโt be created
is there a way to let tabcompleter show only stuff that contains that what you already typed, like with vanilla commands
StringUtils.copyPartialMatches
I'd recommend using the Commodore library by Lucko
thx
On today's issue of long class name daily: EnderDragonEnderFireballBombardmentConfig
this isn't the worst one, it's just the third one I've written today lol
I think EnderFireballConfig would be more apt
oggleProximityChatCommandConfigurationManagerInformationPaths.java
EliteMobDamagedByPlayerAntiExploitListener.java
it's not the only fireball
it's not the only entity whose name contains "ender"
hell it's not even the only fireball power for this specific multiphased boss fight
use packages
I am using packages
use them better
send a ss of your hierarchy
ToggleProximityChatCommandListener.java
probably make a package for each entity
powers.premade.enderdragon
powers.premade.ghast
weeeeee
etc.
what you need is more packages
split these into a subpackage named config, you can then drop the Config suffix on each of them
first off that would just become insanely annoying to navigate in the project hierarchy and secondly it wouldn't really fix the reason why I am using this nomenclature which is just ease to access using intellij's double shift search feature
split all of the enderdragon ones into a sub sub package of enderdragon and you can drop the enderdragon prefix for them
intellij is really good at picking out verbose methods and class names
and there's not really a tangible downside to it
these class names are needlessly verbose and you're practically using prefixes and suffixes like attack and config in place of where you should normally use package names
if that makes it harder to navigate then what's the point
leverage the fact that it is fine for multiple classes to have the same name if they are in different packages
it won't be harder to navigate; things will be categorized instead of being in one enermous fucking list in a single package
I literally just said why I make them verbose instead of doing multiple packages
I never actually browse packages for any reason
unless I genuinely forget how I made a thing 3 years ago
you having to use search to find your classes is a symptom of your project structure sucking ass
consider the possibility that someone else might work on the same project in the future
no, double tapping shift and typing in a few letters to access a class is faster than any package hierarchy
they won't know every class by name
they will be going by the project structure in finding things
I literally do it on projects where I have 3 classes just because I don't have to take my hands off of my keyboard
they will expect things to be logically placed and grouped together
as is the convention
they are grouped together, I just don't have immense depth in packages
these are all configuration files and they are all functionally the same thing
they aren't grouped together enough if you have a massive shitlist like that
the powers are subdivided in packages
Does anyone know how to add a "breakstage" to a block? Like if you're mining it
you'll have to fuck with the protocol for that
like texture?
define add
basicly yeah
like change the block breacking texture to the next stage?
Yes or setting one to the block
i don't remember there being anything in the api for that, you'll need to jump through some protocol hoops
4 example your shooting an arrow and it hits a block and then it will be in a breakstage
oof yikers
maybe you have some next gen package system that allows you to access a specific class out of 772 total project files faster than the two seconds it takes me to double tap shift and type in two keywords but I just don't function like that
my code returning the stacktrace of mysql:
[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
but i dont find erro on the code
?paste
unless you have a class with the same name in each of those 772 project packages, you can just look at the match list and open the right one
how do you think imports work?
I would literally have 20 fireballs at this stage
ever imported bukkit.Block?
or more
of course, but you wouldn't be calling them all just fireball
I certainly haven't
the paste md5 is off?
huh
the issue is you have been calling them not just fireball too verbosely
Paste is up fine
use like hatebin then
yeah
hatebin best bin
if it works better to me than the other way around I just don't see what the downside is
that sounds like someone refusing to follow convention because they're too used to doing the contrary
which is fine if you're working on it alone or if it's a convention in your team
but it won't stop me from calling it dogshit when I see it
[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
this stacktrace
I can literally prove the opposite
all you're proving is that it's not even a convention on your end, now it's just you being inconsistent with whether you use packages or not
or maybe I am being consistent as like I said before they are grouped by function
config files are all functionally just config files
on paste md5
your distinction of function is arbitrary
so is yours, but this is my project
i can send the code on pastebin?
and it's dog shit
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
sorry for bin
if you want to go and subdivide dozens of identical 6 lined classes into different packages to make it harder to browse in general that's on you
if you have dozens of identical 6 lined classes you are probably doing something wrong to begin with
yeah, I am allowing people to customize features identically across all powers
a war crime, I know
that doesn't require an identical class for each and every thing
ever heard of oop
imagine if we had to write a new class for every single thing we wanted
I've finally found the reason. Apparently for a short period of time after the playerJoinEvent the playerConnection var isn't initialized yet.
bukkit ๐
sure, let me know how you would minimize that
i would minimize it by leveraging on oop
really now
hard to say without seeing your project
i having the stacktrack
[10:28:37 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='e508f17b-0fd6-390c-a930-e02dfcfa6356'' at line 1
this stacktrace```
but i dont find the erro on my code
https://pastebin.com/Eiivbn1E
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
as a rule of thumb the fields are different on every class, the only one that tends to remain the same is isEnabled, though at times it's good to be able to turn that off for experimental features
well you misspelt key on like 28
but I would probably have each boss or whatever you have hold a config of generic type and only access specific paths through it, possibly using config path objects declared in the impl of that boss to manage which paths are used
Can someone code a minecraft one-player-sleep(but 50% not one) plugin with a backdoor in it. It is a server with just friends and im doing it as a prank. please dm me if you can :)
you realize that this is a power, not a boss right
no.
oh, its missplace
bosses just have a list of which powers they want
then just replace boss with power
after correction
stills the erro
same stacktrace
Those kind of requests garner bans
I don't do SQL so someone else would have to help you
@worldly ingot ref above message about creating a plugin with a backdoor; #help-development message
oh sorry
dont worry, thx
that class already generates config files, sets defaults, registers itself to the plugin and allows users to customize it from the get-go, I fail to imagine a more oop way of doing this
anyway I have to get back to working
not having to declare and write a new class for literally every new thing
anyone makes SQL?
I could run this from a method if I wanted to, but this is a far more modular solution which is easier to write, maintain and document
does anyone know how mineskin works?
i disagree
i've made my point, you either don't agree or refuse to listen, either way this is just going in circles
i don't do skins
๐ฆ
This statement is wrong. Notice the ( before UUID ps = MySQLConnect.getConnection().prepareStatement("CREATE TABLE IF NOT EXIST " + MySQLConnect.table + "(UUID VARCHAR(100),NAME VARCHAR(100),POINTS INT(100),PRIMARY KEY (UUID)");
You have no corresponding close
im learning sql right now
its so bad to work lol
now, the table has created
but
same stack
Needs a space before WHERE getConnection().prepareStatement("SELECT * FROM " + MySQLConnect.table + "WHERE UUID=?");
Same here, needs a space before WHERE PreparedStatement statemant = MySQLConnect.getConnection().prepareStatement("SELECT * FROM " + MySQLConnect.table + "WHERE UUID=?");
how well supported is the blast furnace?
can you add recipes to it the same way as with a normal furnace
and can you intercept smelting output
if you want to directly view, edit, create, modify etc a SQLite database highly recommend DB Browser SQLite
For a remote SQL database navicat is really good but I think its premium
literally just fork harbor or smtn and add in a secret command that grants you op
iirc I last used heidisql for navigating remote sql databases
it worked "fine"
and I don't remember pirating it so it's probably freeware
navicat was premium but GTXHosting had a perpetual license key for all users regardless if you keep them as a host or drop them
lol
that is a long ass username
@EventHandler
public void ChunkLoadEvent(final ChunkLoadEvent event) {
if (event.getChunk().isLoaded())
}```
does this condition arrive if a chunk is new, or has never been generated, or does it mean that there is already someone on that chunk?
That event fires for ANY chunk being loaded, old or new
There is a populate event that fires for new chunks too
but in the case even if a player is present in this chunk?
iirc the chunk load event also has a method for checking whether it's loaded for the first time
i don't know in the library im using there is this method later i see docs
what
what is the name of Enchantment table material ?
ENCHANTING_TABLE
Thank you
Hello, should i put @\EventHandler on each event function, or one is enough?
sorry for the ping.
Yes each
the annotation annotates a method as an event handler
only methods that are annotated as such are called by the bukkit event system
Yep got it
is there a way to get the player's current breath level? (the bubbles on the HUD when theyre underwater)
all my searching so far shows its clientsided, but in vanilla you can get a breathlevel scoreboard so it should be somehow possible, right?
thank you
@wraith rapids btw from yesterday, the skulls have started to behave 100% normally today again lol
How can I modify the tab player list?
anyone here are using XSeries ?
@EventHandler
public void ChunkLoadEvent(final ChunkLoadEvent event) {
final Chunk chunk = event.getChunk();
for(Entity entity : chunk.getEntities()) {
if(!(entity instanceof ArmorStand)) return;
final ArmorStand armor = (ArmorStand) entity;
final String name = armor.getCustomName();
Bukkit.broadcastMessage(name);
// if(name == null || (!name.startsWith("loot"))) return;
// final String[] str = name.split(":");
// LootManager.getLootByName(str[1]).ifPresent
// (e -> LootManager.spawnLoot(e.getLocation(), e.getItem(), e.getName()));
// Bukkit.broadcastMessage("ยงaThe armor deleted");
}
}```
i never used this event and ''broadcastmessage'' is dont calling
i reiterate; return exits the method
if you hit any entity that isn't an armorstand, the entire execution terminates
what is reitairate?
repeat
then your for loop exits entirely
why? you were just told to use continue
use continue
hm
continue skips one iteration of the loop
break skips the entire loop
return skips the entire method
ok thanks
does not continue to work ..
@EventHandler
public void ChunkLoadEvent(final ChunkLoadEvent event) {
final Chunk chunk = event.getChunk();
for(Entity entity : chunk.getEntities()) {
if (entity instanceof ArmorStand) {
final ArmorStand armor = (ArmorStand) entity;
final String name = armor.getCustomName();
Bukkit.broadcastMessage(name);
}
}
}```
yes, that works as well
but generally continue is preferred
makes it more readable
how are you testing it
that doesn't load the chunk
the chunk is already loaded
you need to go out of the server's view-distance
that will unload the chunk
once you return, the chunk will be loaded
it's not a Chunk Enter Event, it's a Chunk Load Event
aaah ok
now whatโs making me scared is about how Iโm going to save a set of identities in one location
save entities?
i would tell you to use the chunk pdc but you're a 1.8 plebian
I know it's a bit of a stupid question but, I needed to make a class to extend a module but I don't know how I would activate that file/class from my main file? Sorry and Thankyou! ๐
is it possible to access the plugin on the waterfalls to the plugin on the spigot?
No.
waterfall != spigot nor Bungee, but you are looking for Plugin messaging channels
It would have to transfer data over PMCs or something like Redis
waterfall is to bungee as paper is to spigot
the real winner's choice is velocity though
Velocity is a great experience
i pray that the chat related protocol is decently optimized and doesn't just hammer the components into json or something
because holy shit do some of these components get big
is there anwyay I can cancel the farmland breaking by entitys?
Ik how to make it with player but on EntityInteractEvent there is not seem to be a getAction
wouldnt getblock trigger air?
Wait
canceling that would just make the entity not move there
kinda doubt that's how it works
Idk it just makes sense that it would cancel the move there
maybe from a player's perspective
but i don't see a reliable way of doing that in the code under the hood
the event is fired when the block is about to be changed, which means the entity is already on that block
and I wouldn't expect cancelling the event to teleport the entity backwards
Idk imma try to cancel it ig
it would not move the entity, it would stop the block change is all.
farmland is not destroyed by walking on it. Only by jumping
i'm successfully grabbing soil blocks in a radius, but how would i check if there's a crop on top of them or not?
Check the location above against the crop tag
and after the comparison proceeds to be false
do i just set the block to wheat?
or
bc i wanna 'regen' crops
cast to Ageable
then you set the age
^
blocks themselves never implement anything
Block is just a dummy holder object for a Location
and to check blockdata?
? so im still getting the block?
o
need a 1.8 alternative
getBlockData doesn't exist
good luck then
im trying to build my plugin
i click on the folder > proportys > but theres no jjava build thing
i have buildtool;s downloaded
So many things wrong, You need to follow a tutorial
proportys
make sure to chnage' the proportys
tnx
i certainly hope the protocol doesn't send chat messages as json
look at this shit
um
ew
I really hope thats not sent as is over the network
same
however, I'm 100% certain it is
:despair:
I recently had to make a change to GroupManager as it was blowing up the bungee chat buffer if it listed too many permissions at once.
buffer was supposed ot be able to take 15k characters or something like that
I had to limit my send to 2k characters or once sent it exceeded that 15k
yeah I'm working on like a public exchange box plugin and the index listings are probably going to get pretty huge component wise
each of the item names is actually a hover component that'll hold all of the item data
it's going to fucking explode with shulker boxes I bet
yep
i'm sending it all as a single component because otherwise it shifts around a little on the client before being fully rendered
In my day we had to optimise every single bit that went over the network as it all cost money. These days, its all libraries and don;t give a shit mentality..
same with all other development tbh
prime example is that every desktop application is based on electron these days
same in web development, and everywhere else
nobody gives a shit if it doesn't work properly or is super inefficient as long as you can churn out as much results as possible in x time
yep
The trouble is, these days no one is taught about network traffic and optimization
its all hidden and devs just send whatever they fancy
who can afford to optimize anyway when in the end all of the extra effort you spend on making things good just comes out of your paycheck in the form of new paying projects you could've spent that time on instead
giving up is a good option
yes, over 5 years ago
what the hell
anyway
ok
but itโs the most popular version whatโs wrong with them ๐ฉ
it's not
Lol not even close
only like 8% of servers are 1.8
8% are on 1.8
Supporting a version from 5 years ago is hard ๐ญ
its more fun to have all the new features for spigot to enjoy
fine
1.8 is ancient, buried, dead, and shit
get with the times and put your autoclicker on the shelf
this should be biblically published
ok one more thing, with maven dependency on 1.16 i realised that i canโt use nms
is there an other dependency for that?
Run BuildTools and switch spigot-api to spigot
you can't use nms with any of the api maven dependencies
you need to add the project itself as a dependency
that is, replace the spigot-api dependency with spigot
ok
but that artifact is not distributed publicly so you'll have to build it locally with buildtools
too much work when you can just include the jar as dependency but anyway
Maven is neat
including the jar as a dependency means you'll be losing out on all the benefits of a dependency manager
which are?
transitive dependencies, for example
if the thing you depend on depends on something else, you will have to manually hunt down that jar and inport it as well
just a day or two ago a guy came here for help because his ide-imported spigot jar didn't include the bungee chatcolors
you will also need to manually redownload and reimport new versions of all your dependencies every time they update
you also can't deploy anything automatically or run any proper build scripts
you also lose out on stuff like filtered resources
it's very ghetto
but yes, it's very easy
it just comes at a cost
sure
Is it possible to play noteblocks for everyone using bukkit 1.8.8 lol
spigot 1.8.8
I mean, technically yes
is it there in their api or wut
If you want to do it for everyone, you would have to loop thru every online player
So a noteblock affects just one player?
and then there is the Player#playSound()
hello, is it possible to set players' spawn when typing / lobby, I have a bungeecord server.
plugin: Lobbysystem - bungeecord.
Does the spectator mode trigger the MoveEvent ?
yes
Ok nice thanks ^^
๐๐
hey guys im trying to add custom ore generation on top of the default world using blockpopulators. How can i get the default worldgenerator?
so that i can add it on tom?
how can i go from this to like
aqua affinity 1
blast protection 3
and just a list enchant
Use translatable text components
what
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yo does someone know a good way to completely leave pitch and yaw untouched when tping a player
I tried getting pitch and yaw from old loc
and then tping him and setting the pitch and yaw
but with constant teleporting it still looks jittery
i teleport the player everytime he clicks a certain thing
the issue isn't that the pitch or yaw changes
the issue is that you copy the pitch and yaw at the time when your code runs
and then teleport the player
however, before the server can inform the player that the player has been teleported
the player has already moved
because of latency
which makes it jittery
to make it smooth, you will have to do it in a way that sends a player a relational move packet, like /minecraft:tp does
so with packets_
where instead of telling the player to move to absolute location X and point at absolute pitch and yaw Y and Z, the server tells the player to change their location by a relative dX and a relative pitch and yaw of dY and dZ
you could look into the under-the-hood of the minecraft:tp command and see what logic that invokes
the bukkit teleport methods are absolute
well, does the command still look jittery to you
yeah, you will have to call whatever code that command calls
build spigot sources locally
a decompiled jar
and then look at the sources
cant i just use jdgui?
or decompile the jar, but that will probably give you cancer
and decompile spigot
i have no idea how to that lol
with build tools
there's some parameter you pass to it and it shits out the sources
currently looking into the spigot jar
Okay i dont know exavtly where is it located
but ill search a bit
CommandTeleport in net.minecraft.server
I can see that this sht is absolutely crazy lmao
understandable but
Damn thats some crazy stuff
most people who need to work with nms view the properly mapped sources, that have the proper names and shit for everything
the md69 mappings used in splรถgget are incomplete and inconsistent and kinda trash
everything starts making much more sense once shit actually has proper names
yeah thats true tbh
the block physics are defined by number 2 and 4
if im right
but yea i see that there he sets the headrotation
with some kind of variable
on the server side yes
what's important is what goes out to the player
because player movement is client-side
the client doesn't give a shit about what the server has set its head rotation to
i rly dont see what he exactly does here
too much variables
and some stuff ive never used personally
It gets
the navigation
and plays with the head rotation
((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit
probably this
well the variables
are problaly
I bet this wont rly help me
I saw this line
but tried to like dig more in
you'll probably want to ask someone who fucks more with nms
one of the core developers of paper will probably know more of what's going on
they do help people frequently on their discord
unlike here
where the only people who answer any fucking questions are the regulars
maybe i should extend the
nms class
and try smthing with that
The CommandTeleport
hey guys is there a way of setting the wool's color ?
except using
ItemStack item = new ItemStack(Material.WOOL, 1, (byte)5);
like setting the color later
use a version that isn't 5 years old
nobody knows?
.setData or whatever you ancient fucks called it
i don't remember, it's been half a decade
never
1. private FileConfiguration configuration;
2. public void save(Plugin plugin, String name) {
3. try {
4. file = new File(plugin.getDataFolder(), name);
5. configuration.save(file);
6. } catch (IOException e) {
7. e.printStackTrace();
8. }
9. }
I use this function to save my custom YAML files. When calling the function I get a NullPointerExeption error on line 5. Any ideas?
NPE means that you are calling a method on some variable or field that does not have a value
that is, the variable's value is null
it does not point at an object, it is a null-pointer
^
In your case configuration is null
you have declared a field named configuration, but you have never assigned any object to it
the field is empty
you need to create or obtain an instance of FileConfiguration somehow, and then put that instance into the field
Hello, do you know how to prevent a server from loading any worlds on start?
So do i need to doconfiguration = YamlConfiguration.loadConfiguration(file);
either that, or doing the same in the constructor of this class
ok, thanks
you probably want to load the configuration from the file when this object is constructed
then remember the file and the name, and when the save and load methods are called, load/save from the correct file
Maybe i should just set some broken world as default (or different version)
Why do you want that
((EntityPlayer)entity).playerConnection.a(d0, d1, d2, f, f1, set, PlayerTeleportEvent.TeleportCause.COMMAND);
this code is usable
And no I there's no good way to do it
but
iirc it's pretty difficult to get the server not to load worlds on startup
to start one of many servers fast
my teleportcause is the plugin
and ill need to use it under tp event
right?
since thats using .getto variables
.getto methods*
dunno
well idk ill try
well yeah but looking like things is the important part
if it looks like a duck and behaves like a duck, it's probably a duck
Many people here sometimes recommend editing the server jar. Does that mean I need to open the server code, make the changes and sometimes merge this version with official updates?
I've never seen anyone recommend editing the server jar
but sometimes its is necessary
very rarely
at least when I ask some questions here I often get such answer
If you wish for something to be added to the API you can make a pull request.
you're probably asking for something that is borderline impossible, or misunderstanding the answer
In addition, I wanted to ask, how can I keep worlds' folders NOT in the same place with the server main files?
uhh
i'm not sure if that's possible anymore
there used to be a setting called world container, which was a path to a directory where your worlds were
like in a subfolder
but i think that was nuked in 1.16.2 somehow
symlink
i'm sure it stopped working and blew up, but i'm not sure if it was ever fixed
and also, I got the problem of right click on air without an item in hand not registering by PlayerInteractEvent and etc. Is that normal?
package index
iirc it fires, but is cancelled by default
or if it doesn't fire at all, it's just because it's not possible to detect clicks on air with an empty hand
because the client doesn't send any interact packets
This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.
yes, I mean this
and can I use packets to somehow make client think something in hand but not to show it
but I don't think it's possible
no
No need, just annotate to not ignore cancelled event
I mean idk whether the event fires or not
I didn't think of checking canceled ones
event handlers by default do not ignore cancelled events
which imo is a major oversight
too many times have I ran into plugins doing dumb shit by listening to events that are cancelled and doing shit despite them being cancelled
and how can I send info about adding item to someones inventory (hotbar) without anybody else getting this packet?
imo if something is cancelled it should be treated as if it didn't happen
Ah you meant that
by the plugins and the server alike
ignore my comment
unless the item in hand changes, noone but the player should get the packet iirc
Teams collisions-rule do not work, any idea?
I tried learning random packets, but finished only with NullPointerException on the client side))
They work fine
Mhhh I tested with a spigot server without plugins (I first though it was plugin's fault) and team do not change collisions between players
how are you setting collision on teh team?
How can I store some data in an item to identify it later? By NBT tags?