#help-development
1 messages · Page 148 of 1
that looks cool. Is that a resourcepack? :D
Why is there double vip tho?
yeah just saw it when I made it larger
but the + is not symetric
Someone who can please explain me why that 2nd dependency doesn't want to resolve? Trying to import NMS for 2 hours now
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>NMSProject</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
<spigot.version>1.19.2-R0.1-SNAPSHOT</spigot.version>
</properties>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-nms</id>
<url>https://repo.codemc.io/repository/nms/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
looks off on the screenshot xD
true
twitch is missing the daker layer behind the text
I think you need to convert it to a normal array
i.e. Type[]
then you can pass it
yeah thats fine
yeah but its the only way afaik
no idea how i missed that, thanks
np
How those custom bars works?
Wait
texture pack
I meant another custom bars
texture offsetting using actionbars
how
negative width characters
usually the top bars are made with bossbars
then you do the rest with actionbars
just send a bunch of aligned characters
there are unicode characters for positive and negative X alignment
so like
<space.-20>text would make "text" appear 20 pixels to the left
thing is you can make a custom font that just renders a special chinese unicode character as any image
Which is how servers make custom guis
just set the image on the gui's title
noobs are all sleepin'
Idk you made that really overly complicated thing earlier 👀
You were poking at them I poked at you lol
Well they thought you wanted to make the block class itself contain a method for it or something iirk.
Are hex chat colors broken now or something? A method that worked perfectly before no longer works.
Had a chat color gradient generator, updated the plugin for 1.19.2 (from 1.18) and now it's just
yo
nah
this was always my own IP
i worked on embercore/emberrpg long before that server rolled around
emberrpg dates back to 2017 actually
i have a six figure TC package now, no way in hell would I ever go back to them
actually, I can build a 1.18 server and test this, because the plugin is cross compatible
but it seems like what's happening is that ChatColor.of is just building a string along the lines of §x§f§f§0§0§0§0 for pure red (#ff0000) and only the last color is registering - or in this case, it's supposed to be a gradient from black -> blue -> aqua and the second half of the blue section is being treated as its own color code
you still with your new company as well?
i'd hope so
java is...it's alright.
they're adding SIMD support now, which is wild
would actually make some of the work i'm doing a lot more efficient, too
i kinda want to just finish emberrpg because i have the free time to do it for now, and because i still feel like there's a lack of a genuinely flexible and comprehensive rpg plugins out there
though I guess part of the reason for that is that I still haven't found a particularly flexible serialization/deserialization API for Spigot; the one that Spigot has built in is pretty awful, tbh
i mean. i straight up wrote one and it works great, but obviously that's super under the radar even though it's open source
i don't expect anything i write to be popular lmao
hopefully no RPG-oriented minecraft servers since those seem to cause catastrophe 😔
but yeah it's because of this that i've been able to make rpg stuff as flexible as it is
nice, all the pet plugins rn are sus
been working on uhh
3d model stuff from blockbench files, actually
feel free to hit me up if you're implementing that
granted, all I have to do is name the fields in the data classes after the fields in the JSON for a blockbench model and the data loads itself
at the end of the day, though, it's still weirdly simple to pull the data in, and I wanted to make that accessible to more people, because rn the only plugin with any real 3d model integration is ModelEngine, and uh
that's not free
which sucks
that's what i meant, yeah, api
i'm not making any myself, just gonna use the demo ones from modelengine to test since they use the same file format
tips on making java code more optimized?
figure out what you need to optimize, first and foremost
don't spend 3 hours microoptimizing something with no overhead
first step is to profile your code
i think that's more about readability/etc.
and proper code structure
you can have very well structured code that runs slow as shit
like maybe you're unintentionally doing an O(n^3) operation somewhere
also a lot of java patterns suck ass
factories can shove it
not talking about universal patterns like MVC, those are solid
builders are fine too
factories are something else entirely
enterprise java level shit
i've looked extensively into what the point of a factory is and i just cannot find one that can't be addressed by just not writing shit code
but again, builders/etc. are used in other languages too
only java, and specifically enterprise java, seems to use the bullshit ones
anyway, offtopic from the original question, mb
learning basic DS/A goes a long way, but unless you're running into a specific issue with a piece of your code that you know is slowing something down, I'm not sure what other advice to give
feel free to ping me if you've got a specific question
👍
sure wish Java could use pointers, though
one question rq
im making a generator plugin ( drops an item above a block ) and im looping around 10k locations at a time. Im thinking of using more than 1 thread is there a way to do that?
nah
learn jdk history
and learn java
uh...
more details?
why are you going through so many locations?
look at your algorithm before you look at multithreading
well for maths and loops you can use a separate thread
simplest solutions first
but for dropping items you have to go back to the main thread
yeah
also yeah item spawns are sync thread
most of the mc is sync
anything that affects the game world belongs in sync, basically
but anything that doesn't need to be applied to the game world in real time can be computed async
like...I save data async so it doesn't lag the server if there are 3k people on lmao
i have no idea what you're doing with it
java can do this very quickly. make sure its async
i'm working on a format-agnostic data/config system that can be saved to remote SQL servers, but
I wanna see 3k players on 1 spigot server lol
just storing a string "0||0||0" then parsing it as a location
on one single server, obviously not lol
aka spiting the string
i don't think you need to store that on an SQL server
lmao
also
wait, why aren't you just using a regular config
even spigot config supports serializing vectors
but this is also a bad idea because you are loading chunks...up to 10k of them
I still don't know why you're going through 10k locations, either
what does this plugin do and why
okay so, you place generators then every x seconds i'll drop an item above that generator. Then you can sell that drop for money
and you can upgrade generators
you can store with , btw
true
to split later
that's fair actually, there's no real way to avoid doing that
however
I'll say this much
one task for every block goes wroooooooom
make sure you are not trying to access generators from unloaded chunks
fax
See, my sweat is all around
See, my t-shirth's never drought
Didn't know which, which way to turn
Code was cool but my P-C burnt
i make sure the chunk is loaded before it drops the item
There is actually. He only needs to generate the drops when the chunk is loaded. On unload save the timestamp to store how much items have to be generated on chunk load
10k operations isn't actually a whole lot either, I was worried you were doing something that was gonna scale super hard
oh I meant
he still needs to iterate over them to see if they're loaded or not
though if it really becomes a problem
i mean, im hoping 75 ish players. Which some will have 1k gens, some may have 50, others may have 5k
some kind of stateful cache would be helpful
e.g. maintain a set of generators in loaded chunks so you don't query unloaded ones
cache the loaded ones with chunk load and unload event ye
but yeah the timestamp thing is what I was going to suggest
i was thinking of calculating the amount of the type of generators then just drop x amount at the last generator
It's actually how Core Keeper handles automated drills/etc
instead of dropping on every block
yeah it's common for a lot of games with passive generators
because Core Keeper unloads the game world if you're not in those chunks, but drills will still process ore chunks, and the reason for this is actually that they do something similar - each drill stores damage while it's running, then applies that damage to the block in front of it when it loads again
so if you leave it alone for an hour, it effectively stores an hour's worth of damage, which then drops an assload of ores from the ore chunk
aye it's a solid idea, saves prcoessing time and prevents loading the world again for no reason
just make generators stack for each players
thinking of just doing this
private Map<UUID, Map<Material, List<Location>>> map = new HashMap<>();
Does anyone know how to get the item that was clicked in an InventoryClickEvent? event.getCurrentItem() and event.getCursor() are the two things I've tried so far
so instead of 1 drop player will have one extra generator
which drops 100 items
at a time
so you avoid having 9999 locations for each player
{
"tier": 1,
"material": "IRON_INGOT",
"location" {
"world": "world",
"chunk" {
"x": 50,
"z:" -32
},
"coordinate" {
"x": 12345,
"y": 12345,
"z": 12345
}
}
}
maybe this can help @quaint mantle
Also, from a gameplay perspective, you can probably get around this by making progressively more powerful tiers of generator instead
literally what i just mentioned
It's what Slimefun does - you just keep upgrading shit instead of making a bunch of new ones, unless you REALLY need extra power, etc.
so instead of like 9 solar generators, you just make the next tier up
oh you phrased it in a way that I did not understand at all lmao
I read it as "add more generators but only have one drop the items, then increase the item drop count based on how many generators are registered to that player"
very simple and good format
i'm just dumb
straightforward data formats 😤
sometimes
you can't avoid shitty unintelligible formats in my field, sadly
nah you're fine mate
the idea was good
easier to correct a miscommunication than fix a bad idea lmao
my boss and I do this thing where we approach a problem from similar angles but communicate those ideas in different ways and more than once we've ended up stopping dead for a second as we realize we've been saying the same thing for 15 minutes
honestly for other devs yeah
Does anyone know how to get the item that was clicked in an InventoryClickEvent? event.getCurrentItem() and event.getCursor() are the two things I've tried so far
today i used while loop to talk to my gf lmao
getCurrent returns clicked
returns air for me
getCursor returns item which is on cursor(which you are dragging or something)
I know
getCurrentItem returns the item in the slot that was clicked, but it only returns this value after you click
how could I possibly mess this up
no, it doesn't?
suggestions?
"Gets the ItemStack currently in the clicked slot."
public static void createGenerator(Player player, Location location) {
Material mat = location.getBlock().getType();
Map<Material, List<Location>> map = new Storage().map.get(player.getUniqueId());
List<Location> list = map.containsKey(mat) ? map.get(mat) : new ArrayList<>();
list.add(location);
map.put(mat, list);
}```
currently refers to after the event
@quaint mantle if you want to go the MySQL route this might work
CREATE TABLE Generators (
GeneratorId INT NOT NULL PRIMARY KEY,
Tier TINYINT NOT NULL,
Material VARCHAR(64) NOT NULL,
LocWorldName VARCHAR(128) NOT NULL,
LocChunkX INT NOT NULL,
LocChunkY INT NOT NULL,
LocCoordX INT NOT NULL,
LocCoordY INT NOT NULL,
LocCoordZ INT NOT NULL
);
okay
any performance things i should do?
and never refered
okay then I'll just double check I guess?
Bukkit.broadcastMessage(Objects.requireNonNull(event.getCurrentItem()).getType().toString()); not sure how this could lie to me
ok wait no you're right
?
oh I see
???
uhh, basically what we mentioned earlier
cache loaded chunks and only update the generators in those chunks
is this like a visual bug or smth
lmao
yeah, this'll do that
its just a function for the generator place
store a last-generated timestamp in each generator
then calculate how many items it should output based on its next update time
that way generators that have been unloaded for a while will still output the correct amount of items
Who is tagging me?
meow
whatever
hey guys how do i code scdehuler which scdehules after server restart + 5 nanosex. I had been wanting to store player's inventory lore and history to hashmap of primitive ints. So when scdehuler scdehules i run -Xmx128M and pass lore as args
also where is a way to increase tickrate to 21
omg i just attended to i'm using 1.4.6. Can anybody provide me MNS guide(ya know NBT)
also why do i keep getting Unsupported class file version(52.0) error when running need for speed mine crafted
umm and in the end why doesn't it work
nigAss().get().put(1, 228);
HashMap<Integer> mep = new HashSet<String>();
player.sendMessage().mep.get(4), 4);```
it's underlined with red and i have chinese intellij from my father and i forgot how to read it
pliz
everybody died?
@ev
@every
why
whynot

Wait wait wait I have a better one

is there a better way of doing this?
public List<String> splitLore(String lore) {
List<String> list = new ArrayList<>();
String[] strings = lore.replace("||", "@@").split("@@");
for (String string : strings) {
list.add(string);
}
return list;
}```
what is this
converts
oh i see
lore: 'lore of generator, split the lore by ||' this to a lore
why can't u split by ||
doesn't work
but convert || to @@
idk why
well just store by comma
so you have less code
@quaint mantle btw help me with my questions
abov
return new List<String>(lore.replace("||", "@@").split("@@"));
i'm sure you can do smth like this
or return Stream.of(ore.replace("||", "@@").split("@@")).toList();
If your list can be immutable, you can use Arrays.asList
return Stream.of(lore.replace("||", "@@").split("@@")).collect(Collectors.toList());```?
cant
jdk issue
just split by "\\|\\|"
BTW why are you first replacing with @@ then splitting by @@
regex i think
| is a logical operator of regex
java counts | as a special character
Escape it?
\\|
ye that's why it worked here xD
discord sucks with \\
indeed
.
what kind of cosplay are you doing here?
99% of guys asking for help here
that's not accurate
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
You forgot the part where you give 0 details about the problems and are just like -> Here's an error, pls help
the chinese intellij from my father killed me lmao
ez
Watch New Clip on GTA V - https://youtu.be/PsYzSVOKAJE
Türkler nerde hani? Bi takip edin Instagram adresimi : https://www.instagram.com/ensart7/
Join Discord: https://discord.gg/HzuvVNE
Please click advertisements for me Help
Thanks for like and comments
i forgot to add bad english
I selled my wife 💀
Makes perfect sense to me
rip
public void loadGenerator(String gen_name) {
new BukkitRunnable() {
@Override
public void run() {
json.setPathPrefix("storage." + gen_name + ".");
String name = json.getString("name");
Material genType = Material.matchMaterial(json.getString("type"));
ItemStack generator = new ItemStack(genType);
ItemMeta genMeta = generator.getItemMeta();
genMeta.setDisplayName(name);
genMeta.setLore(splitLore(json.getString("lore")));
generator.setItemMeta(genMeta);
Material nextGenerator = Material.matchMaterial(json.getString("next_generator.type"));
String dropName = json.getString("dropped_item.name");
Material dropType = Material.matchMaterial(json.getString("dropped_item.type"));
ItemStack drop = new ItemStack(dropType);
ItemMeta dropMeta = drop.getItemMeta();
dropMeta.setDisplayName(dropName);
dropMeta.setLore(splitLore(json.getString("dropped_item.lore")));
drop.setItemMeta(dropMeta);
if (name == null) return;
if (genType == null) return;
if (generator == null) return;
if (nextGenerator == null) return;
if (dropName == null) return;
if (dropType == null) return;
if (drop == null) return;
generator_names.add(json.getString("name"));
generator_material.put(gen_name, genType);
generator_itemstack.put(genType, generator);
generator_nextMaterial.put(genType, nextGenerator);
generator_drop.put(genType, drop);
}
}.runTaskAsynchronously(GenCorePlus2.plugin);
}``` can i do this?
yeah i can
nvm
im dumb
saved now
final version
if (name == null) return;
if (genType == null) return;
if (generator == null) return;
if (nextGenerator == null) return;
if (dropName == null) return;
if (dropType == null) return;
if (drop == null) return;
bro just do ||
here
umm just smaller
I would count that as personal preference. I feel like it's easier to read the way he did it
well ik what || is
just a joke
but i'd rather do this
don't take this seriously
btw got inspired by Unsupported class version (52.0)
it's really common
everyday at least one guy asks what is this error
True that. Idk why people can't use google before jumping in here
offtop but
today my gf played Freddi Fish
which i installed for her
nice experience
after forcing her to create a character in modded skyrim
: )
10/10 recommended by me
basic logic
which does not persist on 99% noobs here
what's new in your life guys
It's probably a little late already :D
better way of doing this or nah?
public dropItem() {
new BukkitRunnable() {
@Override
public void run() {
Iterator<? extends Player> players = Bukkit.getOnlinePlayers().iterator();
while (players.hasNext()) {
Map<UUID, Map<Material, List<Location>>> map = new Storage().map;
for (Map.Entry<Material, List<Location>> entry : map.get(players.next().getUniqueId()).entrySet()) {
List<Location> list = entry.getValue();
Material mat = entry.getKey();
ItemStack item = new loadGenerators().generator_drop.get(mat);
Bukkit.getScheduler().runTask(GenCorePlus2.plugin, new Runnable() {
@Override
public void run() {
Item i = list.get(list.size()).getWorld().dropItemNaturally(list.get(list.size()), item);
i.setVelocity(new Vector());
}
});
}
}
}
}.runTaskTimerAsynchronously(GenCorePlus2.plugin, 20, 20);
}```
100x better than my first one
lmao
Why the iterator instead of a simple foreach loop?
for (Player player : Bukkit.getOnlinePlayers())
Bukkit.getOnlinePlayers().stream().map(p -> p.getUniqueId()).forEach(uuid -> {
var map = new Storage().map;
for (var entry : map.get(uuid).entrySet()) {
var list = entry.getValue();
Material mat = entry.getKey();
ItemStack item = new loadGenerators().generator_drop.get(mat);
Bukkit.getScheduler().runTask(GenCorePlus2.plugin, new Runnable() {
@Override
public void run() {
Item i = list.get(list.size()).getWorld().dropItemNaturally(list.get(list.size()), item);
i.setVelocity(null);
}
});
}```
or that
just use iterator when have concurrent modification
okay
public dropItem() {
new BukkitRunnable() {
@Override
public void run() {
Bukkit.getOnlinePlayers().forEach(player -> {
Map<UUID, Map<Material, List<Location>>> map = new Storage().map;
for (Map.Entry<Material, List<Location>> entry : map.get(player.getUniqueId()).entrySet()) {
List<Location> list = entry.getValue();
Material mat = entry.getKey();
ItemStack item = new loadGenerators().generator_drop.get(mat);
Location loc = list.get(list.size() - 1).clone().add(0,0.5,0);
Bukkit.getScheduler().runTask(GenCorePlus2.plugin, new Runnable() {
@Override
public void run() {
Item i = loc.getWorld().dropItemNaturally(loc, item);
i.setVelocity(new Vector());
}
});
}
});
}
}.runTaskTimerAsynchronously(GenCorePlus2.plugin, 20, 20);
}``` like this?
.
it's added in java 9
var is in java
tf!?!?!?!??!
wait, im using java 17 doe
and pattern matching
so many cool things since j8
and much more
i c
optimized it even more
list.get(list.size())
shouldn't it be list.size() - 1
otherwise you get ArrayIndexOutOfBoundsError
if (entity instanceof Player player) {
player.sendMessage();
}```
so you don't need to cast and declare a variable on a new line
even works out of if body
if (!(entity instanceof Player player)) return;
player.sendMessage();```
I have been using this feature and it has been ❤️ ❤️
pattern matching
@EventHandler
public void onGeneratorPlace(BlockPlaceEvent e) {
Material mat = e.getBlock().getType();
Player plr = e.getPlayer();
Collection<Material> list = new loadGenerators().generator_material.values();
if (list.contains(mat)) {
GenCore.createGenerator(plr, e.getBlock().getLocation());
}
}```
im sorry
switch(phrase) {
case "Hi" -> dieFromCringe();
case "Hello", "Good morning" -> greetBack(speaker);
}```
what do you think of this new switch
you don't need to use break; anymore
looks fine
except
var list = new loadGenerators().generator_material.values();
hehe
Imagine writing
List<HashMap<String, HashMap<Integer, Function<UUID, Location>>>> list = inst.getList();
instead of var
ikr 😔
Imagine using such a terrible List of hashmaps instead of writing good code to avoid it 
list of hashmaps of Strings and Functions of UUIDs and locations
ikr, couldn't be me
at all

mike help me
.
hey guys how do i code scdehuler which
Didn't realize it was a joke till line 4.
pseudocoders language
silence
imagineee
Does anyone know if there's any way to cancel an event in an async thread? I know events can't be cancelled after any delay, however I was wondering if there's any workaround to cancelling an event inside an async thread (with no delay before it)
No
So I ran BuildTools so I could get the server software as well as the api
What is the difference between these files, aside from the shaded one having a substantially larger file size:
spigot-api-1.19.2-R0.1-SNAPSHOT.jar
spigot-api-1.19.2-R0.1-SNAPSHOT-shaded.jar
I... should probably make a SpigotMC forum account ._.
wait nvm. read the docs roxie 🤦♀️
Sadly it doesn’t include a pair of sick sunglasses
petition for them to add sunglases to them
Fr
stop static abusing 😡😡
Just extend "Bukkit" okay
Where is he static abusing ?
How could I calculate an Estimated Time value in a Queue Plug-in?
How can I save data in any block? Like say a string inside of stone or something
Is there a way to do this without another plugin
https://github.com/JEFF-Media-GbR/CustomBlockData
see the code in the src
You can shade that
Id rather write my own code for it, less plugin bulk and make it so I can learn more
when i use static functions outside of my command executer class it doesnt appear/work in minecraft
Olivo!!! Could you help me, please?
How could I calculate an Estimated Time value in a Queue Plug-in?
That lib is quite small
Anyways use the Chunk PDC for storing your data I guess
Haven't really looked at how Alex did it
but the static variabes work fine
Save the time it took for previous and then take the average
Yeah he just wraps chunk pdc
Send code
?paste
public final class Main extends JavaPlugin {
public static Player Wolf;
public static List<Player> InGameP;
public static MainGame Main;
public static Boolean GameStarted;
public SpookyPlugin(MainGame Main) {
this.Main = Main;
}
@Override
public void onEnable() {
getCommand("wolf").setExecutor(new StartGame());
getLogger().info("Test of difference");
GameStarted = false;
}
}
Oh my that’s some static abuse
sorry im new to java
dw i have experience in other languages
public class StartGame implements CommandExecutor {
Random rand = new Random();
public void Start() {
SpookyPlugin.Wolf = null;
List<Player> players = Objects.requireNonNull(Bukkit.getWorld("world")).getPlayers();
int randomInt = rand.nextInt(players.size());
SpookyPlugin.Wolf = players.get(randomInt);
SpookyPlugin.InGameP = players;
SpookyPlugin.GameStarted = true;
SpookyPlugin.Doit();
}
}
Experience with any Object oriented languages? Because that's not how you're supposed to work with objects. Adding static to everything is a bad idea
yeah but its been a while
How can I bot my bungeecord hosted on the computer to test my queue plug-in?
I know there is some JUnit plugin to test minecraft servers. iirc there is also one for bungee. But I don't remember correctly the name
?main
If you use 4 basic of java u can suddenly understand the OOP(static abuser talks)
n make the boolean lowercase
I mean dont use Wrappers
And don't add a constructor to that main class
And remove the uppercase of those variables
Modulo 60
bump
@green prism
That probably won't work well for your Bungee though
Set the Bungeecord to offline mode and use Mineflayer
I have no expertise/experience in NodeJS
I would like to have the player enter, do the /queue join test command, and then once it enters exit... I don't know how easy that would be hahaha
And I want to test with multiple players
Easiest way : find friends to do it 😂
Well, I would gladly do, find me someone who will give me 1 hour of their time with 3 open launchers and exit and re-enter every time I restart to fix a bug.
just get 3 alts smh
Hahaha I would like to remind you of something:
- I need 2 open 1.19 servers (at least)
- One bungeecord server
- 2 open minecraft 1.19
- IntelliJ
My computer is dying, despite having 32GB of ram lmao
I'd also say it's the CPU
Sometimes
I can run the same things as you with only 16gb of ram in my system
i can run intellij, minecraft and a server
if i run another mc client my computer dies
Time to grab your phone
lol
My Samsung A51 can run 1.19 at around 40 FPS
cant say ive tested what mine can do
It's hard for my pc hahaa
Are you sponsored by Samsung
i remember i installed povjav but never did anything
I wish
That’s java edition at 40 fps?
Which launcher could I use for a third minecraft 1.19
its windows 11 causing your issues
multi mc is a good one
What’s wrong with the vanilla launcher
only one .minecraft
You can change the .minecraft folder
i could use essentials because they have separate mod files but mc launcher is just slow as hell
still havent figured out why 1.19 takes like 5 minutes to boot but 1.18.1 takes a minute
Probably that integrated graphics card you have 
leave my computer alone
Or, I could have the bots come out after 10 to 15 seconds with a nice runnable and when they come in they are put directly into the queue
Sounds like the first step to a robot takeover
i am surprised you didnt say about my mods
custom model data probably
Does it move
or its the shit lunar client 3d stuff
If it doesn’t move it’s just a simple model
Just a simple 3D model then
With custom model data
if you can set nbt tag via a plugin, it is technically all resource pack
neither of these are working
@EventHandler
public void onPotion(PotionSplashEvent e) {
MinigameManager mm = MinigameManager.get();
if (e.getEntity().getShooter() != null && e.getEntity().getShooter() instanceof Player p) {
if (!mm.isInMinigame(p)) return;
Minigame throwerMinigame = mm.getMinigame(p);
for (Entity entity : e.getAffectedEntities()) {
if (entity instanceof Player attacked) {
if (!mm.isInMinigame(attacked)) continue;
if (throwerMinigame.equals(mm.getMinigame(attacked))) {
if (throwerMinigame.getMinigamePlayer(p).getTeam() ==
throwerMinigame.getMinigamePlayer(attacked).getTeam()) { // getTeam() is enum
e.setCancelled(true);
}
}
}
}
}
}
@EventHandler
public void onPotion(PlayerItemConsumeEvent e) {
MinigameManager mm = MinigameManager.get();
if (mm.isInMinigame(e.getPlayer())) {
if (e.getItem().getItemMeta() instanceof PotionMeta) {
e.getItem().setAmount(e.getItem().getAmount() - 1);
}
}
}```
1st is meant to disable splashign teammates with poison
any errors?
It’s probably just one armorstand tbh
How do you make texture of a model
block bench is the common one people use
It does not worked for me
do you have the minecraft plugin
it's cool what spigot can do
did you implement them in the main class?
For the bottom one you probably need a 1 tick delay
Then just remove a single glass bottle from the inv
yes
pick a minecraft item, mostly used is a pumpkin and create the model
create one
the event gets called twice
once for offhand and once for main
check if it is the main hand being called before you do anything in the event
that doesnt entirely work i think
they return different types
check using
if (e.getHand() == EquipmentSlot.HAND)
try that
https://dacaly.does-shit.design/d509d8e8 i changed the project sdk and it did thaqt
can I get a block out of inventory click event
the material is shared between items and blocks
you should just be able to get the material of the item stack
Imma guess
oh
oh yeah
nah hiz isnt the item in the inventory right
its the template item
the item you check against
hes right
someone help me ples server crashes when I run this code
first of all use a switch statement
"that looks like something @remote swallow would code" - @young knoll
what
its a joke that @young knoll would say
so, hiz or h1z is the variable holding your 'example item' right
its what you use to check if they have the correct item in their hand
where is h1z even set
you need to get the item held by the player e.getItem() and use its amount
Oh gosh hiz and h1z
i didnt even notice that
yea
Painful variable names
i just noticed
?
rename them to something descriptive, will probably help
nah that reaction was to the other guy
o
can someone help me please
https://paste.md-5.net/teficusipo.java my server crashes when I right click
I prefer to name my variables mixes of I and l to keep things exciting
use a switch statement instead
a
what is that
try with else if not a load if ifs
switch (number) {
case 0 -> { /* code */ }
case 1 -> { /* code */ }
}
``` its basically a very fast if statement
but with constants
so the compiler can jump to it
switch is better tho
immediately
ok
yeah
so your speed item is the example item
it always has amount one
you need to use the e.getItem().getAmount()
yes it is
you fucked up your jdk dependencies
yes
like this?
switch (number) {
case 1:
code
break;
case 2:
code
break;
}
o ok
can also use enhanced switch to avoid using break;
is that a real thing that works
with the correct spacing ofc
thats only for newer java versions
yeah
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
who cares about old java
i do
no its a default method in JavaPlugin
1.8 bgest
nah
yes
shouldnt expect much (or any) support if you develop for 1.8
it gets the main class im pretty sure
would be commonly used for di
It gets the plugin who’s main class is the one provided
No plugin has JavaPlugin as their main class
no
ItemStack itemInHand = e.getItem();
if (itemInHand.getAmount() >= 1) {
itemInHand.setAmount(itemInHand.getAmount() - 1);
}
no
whats the difference
It looks nicer
It's "enchanted switch"
and you dont have to do break shit
Also no break
It can also be used as a return statement
this was really annoying
very glad they enchanced it
String message = switch (errorCode) {
case 404:
yield "Not found!";
case 500:
yield "Internal server error!";
default:
throw new IllegalArgumentException("Unexpected value: " + errorCode);
};
Fancy
coming to spigot soon™️, MineErrors™️ by @young knoll
or do
return switch (err) {
case 404 -> "Not found";
case 500 -> "Internal Server Error!";
default -> null;
}
np
glad yoiu get it now
you'll be in the future when you use intellij
yeah and I never remember how to write them, so I just do it the old way and let IJ auto change it
Lol
Hi a question getfinaldamage include strength and armor or only the armor because im recalculating everything for doing lightning without removing the items
I will start using vs code just to spite you
nah
use npp
Should be after taking all modifiers into account
What you mean then calculate even strength or not?
Is possible by making setdamage(event.getfinaldamage() + 4.0)
Totaly not making them usable
is there not an event for player swing?
Kinda ig
There’s also the animation event
Ooo
Seems like exactly what I need
but I just realised this could be altered client side
No
pretty sure there client side
Entity models are hardcoded
they are
you could do stuff w armor stands, tho it will take a LOT of effort and will probably not be efficient
How can I create a placeholder in a bungeecord plug-in?
Is it the normal path?
Like for spigot ones
How i can put an enchant higher then possible like unbreaking vanilla max 3 but i want it to 4 fixed
should i use citizens for npcs?
unsafe enchant
How would I go about making a custom crafting table? I could just iterate over a list and check each item but that would get slower and slower as I add more recipes, or I could use a tree but that would require A LOT of ram
Just how many recipes are you planning on adding...?
I mean, I guess like 500-3000?
so that would already be a memory hog
You could instead of storing recipes, store a matrix of characters.
Come up with a standard scheme for your items, maybe use unsigned shorts or something and then hash the entire recipe.
Cos like theres just a lot of stuff that can be done yk
Then it's as simple as checking against the other hashes
Must faster than a bunch of if statements in a for loop, you could use java's built in hash checking.
like if a recipe requires 20 of an item if they put 25 items it should also work
so i cant do an exact check
What you could do is instead of using a hashmap<recipe, result> you could do a HashMap<recipe, validator<result>> sort of thing.
That way you are only executing the validator on recipes that include those items, and the validator gets the final say as to what is crafted and how much.
Or if anything is even crafted at all.
Ohhh
So at the first stage i'd just look for the same kind of item
and after that the validator would decide if the amoutns are valid
Yeah, something like that. It can probably be very versatile if implemented correctly.
alrighttt got it
Another potential optimization could be grouping, like all recipes that include x item between y amounts are grouped together, and then whenever you need to check what item is being crafted you would only be checking against items in that group specifically.
Also, if you don't really feel like optimizing the recipe search, you could try to push the search into an asynchronous operation and then display the result to the player after a match is found.
Hmm, I think imma go with the hashmap and validator, that should be fast enough
https://sourceb.in/FG5qutEuIV the attack result negative like -3 with strength 2 any solution?
Console return Damage:-3.32739987373352264.0, Normal Damage: -3.3273998737335226
okay the implementation was too simple im scared-
well you need to make a potioneffect
new PotionEffect()
yeah cuz thasts not a thying
you need to do new PotionEffect()
declaration: package: org.bukkit.potion, class: PotionEffect
PotionEffectType.INCREASE_DAMAGE
how do i check if a player is in a 125 125 -125 | 100 100 100 block region?
give
cringe
ty
force player to use a texture pack
and edit this in the texture pack
remove achievement
add achievement
idk
just search it up
You can send toast notifications
Without a resource pack
Oddly specific but it requires you to create an advancement, send it and remove it
Or use CrazyAdvancementsAPI
Which is better to store itemstack? ArrayList or Collection?
Collection is a very broad term
that can define any type of collection
From lists, to sets
etc
ehh arrows aren't really visible if you zoom
grr
here's a white-background version
Hello,
for some reason i am getting NoClassDefFoundError in this code for net/minecraft/world/entity/player/Player, but I am not using this class anywhere in my code. The player class below is org.bukkit.entity.Player
public class NpcCommand extends YCommand{
@Override
public void run(CommandSender sender, String[] args) {
if (sender instanceof Player p){
NPC npc = new NPC(p.getLocation(), "Test");
npc.sendPacket(p);
}
}
}
your npc class imports that class
it doesn't
either that or you accidentally left it on your imports
ehh paper's api has more stuff
I'd just use the fancy api at this point
Either this or you start messing with nms
yeah you're running java 8
CrazyAdvancementAPI is made for a newer version
java 17
BungeeCord.getInstance().getPlayer(playername);
Can I get offline & online player with this?
whats return type?
ProxiedPlayer?
?tryitandsee
?tas
ProxiedPlayer is an online player afaict
just use mojang's api or something
mans probably just doing name<->uuid
what
woke up
where are noobs
show me
Which is better to store my stuff? case or crate
im noob
im noob
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
actually throw your inventory to List of Players check it's lore and pass via redis to mysql
I have a feeling that problem doesnt exist for you anymore 🙂
my first plugin compiled with JavaScript compiler
I'm not using mysql
ah yyes
I used Skript to turn it back to Java
My first plugin was sold to some idiot
Well then pass to nosql batadase
i just went to library to get a book of c++ but they hadnt one and i took c instead lmfao
i'm sure gonna optimize ur pc to the point you don't need to throw it out of the window
Help how can I throw this away without feeling guilty
throw it at your professors face
nice finger pic
too shy to show full hand
too shy to show bed
too shy to show
show feed pics pls
Take ur house down with it
yes
I got mf mosquito bite in my wrist
then u publish it to the server where you have 2 players
i made my database impl work in first try
i made my own transistor in first try
Actually invented own electricity cables
and discovered own electricity theory
y'all mfs gonna end up like a friend of mine
mans posted a whatsapp status celebrating 3 months relationship with his vodka bottle
mine can have friends
lmfao
full of mf hello kitty stickers
that was me
I have a bunch of itemstacks in my pocket now
I got a creeper in my desk
i'm too shy to show what i have in my pocket
basically just lazy to get up from the bed
thats alot of dirty friends
Busta Rhymes
dang we got full hand now
i'm a full-itemstack developer
are they client-sided
weak
stopped on making it attack nearby hostiles
and making it go back to player after call
one thing that annoys the shit out of me
and flying back to owner when distance is too big
and idk how to fix
is that my graphs in grafana just like to delete themselves
nvm found it
got this working
I dont think im static abusing at all
you might not be static abusing but damn doesn't that code look hideous
Fax
Stop static abusing
mans about to tattoo code on his forehead
I aint static abusing
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
NullPointerException: returned value is null;
@quaint mantle ?learnjava
your statement returned false
Bro, i do know java
I ain't static abusing
And many people have said i haven't been
let limpeex troll
Hi, i create ability, but i need to create cooldown. I dont know how. Please help
https://cdn.discordapp.com/attachments/872931466370228235/1023238112886923305/unknown.png
your is null cuz girlsThatLikeMeList.isEmpty() == true
micros
ah
?learn java
could be
it's like when you run code in a for loop, it runs faster the more it's executed
until a certain point
this is a weird while loop with tons of trig
ah
bit big
ah so you just increase by about 0.1 or so until you find one
no
oh?
I use method 3
on my own custom maps lib
ohh
Basically you do up to 6 iterations
1 for each block
and if you have a frame on the block you're going through
Please ?learn java
then you make another iteration where the distance is between currentLocation and frameHitboxLocation
with some math to counter what I see as "lens distortion"
but even that isn't really necessary
let me see if I can optimize this even further
as I'm doing a "getFrameAtPixel" call that might not be necessary as I already calculate the pixel
like 5% better, but not really relevant
im sorry for the 600fps
?
?
?
hi guys can someone help me?
?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!
help
if(plugin.getConfig().getBoolean("anvil." + pl + ".true")) {```
i dont think you want to check for Player::toString in the path
as thats what + does essentially
probably wanna use players uuid
ah wait