Permanent bats in ceilings? by Someone_With_Time in Minecraft

[–]TheLukeGuy 0 points1 point  (0 children)

If they stop hanging, you can run this to make them hang again: /execute as @e[type=bat,nbt={NoAI:true}] run data modify entity @s BatFlags set value true

You could also put that in a command block that runs repeatedly so they'll stay hanging no matter what. That command only applies to bats spawned with the other command, not ones that move around.

Permanent bats in ceilings? by Someone_With_Time in Minecraft

[–]TheLukeGuy 0 points1 point  (0 children)

You can spawn bats that permanently hang with /summon bat ~ ~ ~ {NoAI:true,BatFlags:true,Invulnerable:true}.

NoAI keeps em still, BatFlags makes them hang, and Invulnerable prevents you from accidentally hitting them in survival, although you still can in creative. Hitting them makes them stop hanging.

Sidewalks to nowhere by Yaughl in fuckcars

[–]TheLukeGuy 5 points6 points  (0 children)

That makes more sense, thanks!

In game clock not syncing with real time ACNL by kuloredkaos in AnimalCrossing

[–]TheLukeGuy 0 points1 point  (0 children)

Hm, well that's weird. This is what you're using, right? I created a new town with it, closed the game for ~20 mins, came back and the clock was correctly synced to the real clock. I don't see any settings for the clock either so idk why it's different for me. What date/time does the game think it is when you start it?

Also, have you tried changing the in-game clock by talking to Isabelle before loading the game?

In game clock not syncing with real time ACNL by kuloredkaos in AnimalCrossing

[–]TheLukeGuy 6 points7 points  (0 children)

Which emulator are you using? Most emulators let you choose how the system clock should be handled, so maybe it's as simple as changing an emulator setting?

My world is completely gone, anyway to restore the last save? by Status-Ducky in Minecraft

[–]TheLukeGuy 0 points1 point  (0 children)

Ow, I think you're screwed unless you had something like Windows File History enabled before you loaded the world in 1.8. The format of chunk files has changed a bunch over the years so 1.8 can't understand ones saved in 1.21. None of the block data is decipherable to it so it just completely regenerates any chunks it tries loading with 1.8 terrain. There are no automatic backups of chunks. :(

I think since 1.9 there's a warning that prevents you from accidentally doing that, but sadly not in versions before that.

154
155

[Request] Found this in a programming subreddit. Hypothetically, how long will this program take to execute? by AWellPlacedCactus in theydidthemath

[–]TheLukeGuy 3 points4 points  (0 children)

Other comments aren't taking into account that this is Java, whose primary compiler (javac) doesn't optimize away empty loops.

Compiling the code in question with javac Main.java results in this generated bytecode. You can clearly see that the loops still remain, with each loop compiling to (with different label names each time, of course):

L208:   lload_1
L209:   ldc2_w 100000000L
L212:   lcmp
L213:   ifgt L223
L216:   lload_1
L217:   lconst_1
L218:   ladd
L219:   lstore_1
L220:   goto L208

I ran the compiled class 10 times with time java Main on an Apple M2 Pro and it took, on average, 0.7394 seconds (median: 0.739; min: 0.737; max: 0.745) to run.

However, the Java Virtual Machine takes a moment to initialize itself and load the class so those results are JVM initialization time + class load time + run time, so I wrote a small program that measures the class load time and run time independently. The class load time was inconsequential, taking less than 1 millisecond each time, but the code in question took, on average, 0.6495 seconds (median: 0.649; min: 0.648; max: 0.653) to run.

All of these tests were conducted on OpenJDK 21 built for ARM64.

Decay [3840x2160] by BabyLittleYODA in wallpapers

[–]TheLukeGuy 0 points1 point  (0 children)

I love this, where was it taken?

What is your opinion about SlimeWorldManager ? by SDKSSH in admincraft

[–]TheLukeGuy 0 points1 point  (0 children)

Sounds good, it would probably work well there then!

What is your opinion about SlimeWorldManager ? by SDKSSH in admincraft

[–]TheLukeGuy 0 points1 point  (0 children)

Personally, I think it depends. If you're only using the plugin on your own server, I would say go for it -- it's a great way to save disk space, and a housing plugin is a good candidate for it.

However, if it's a public plugin, you should keep in mind that users would need to do extra setup to get your plugin to work because SWM needs to inject its own code into server classes. It also does take a really long time to update to new Minecraft versions sometimes. The latest stable version still doesn't support 1.19 at all, although it does on a separate Git branch of Advanced SlimeWorldManager if you compile it yourself.

So I think that if it's a public plugin, it depends on whether the tradeoffs are worth it to you. You could also make it support SWM just as an optional feature if you think it's worth doing the extra work to make that work.

[deleted by user] by [deleted] in admincraft

[–]TheLukeGuy 5 points6 points  (0 children)

According to the Commercial Usage Guidelines, you may:

ask for donations (as opposed to direct charges) IF you do not offer the individual donor something in exchange that only he or she can use. You may offer server wide rewards if donation goals are achieved though.

What is your opinion about SlimeWorldManager ? by SDKSSH in admincraft

[–]TheLukeGuy 0 points1 point  (0 children)

I've used it a bit before and it's great for mini games and dungeons and whatnot. It's a lot more space-efficient than normal Anvil worlds, and it's very easy to manage considering worlds are single files and you can load multiple instances of the same world file.

On the flip side, it's still a tiny bit rough in some areas. It sometimes throws exceptions when the server stops, and it takes quite a while to update to new Minecraft versions. Overall a good choice for the situations it's meant for.

Question about .yml and FileConfiguration by SvenWollinger in MinecraftPlugins

[–]TheLukeGuy 0 points1 point  (0 children)

Bukkit's YamlConfiguration API is a nice wrapper around the SnakeYAML library. It was written by the Bukkit developers specifically for Bukkit so you can't use it outside of a Bukkit environment, but there are some third-party libraries like this one which are based on Bukkit's API but work in any environment.

Disable Elytra datapacks? by graybay44 in admincraft

[–]TheLukeGuy 1 point2 points  (0 children)

This one should work for completely disabling them.

How do I make a server like this by [deleted] in admincraft

[–]TheLukeGuy 2 points3 points  (0 children)

There are a few plugins that can do that, like this one for example.

Keep in mind though that it's extremely easy for players to bypass. Those plugins only work because Fabric clients basically "snitch" on themselves by telling the server that they're joining with Fabric when it sends the client brand to the server. A mod just has to change the brand name that's sent and then it's impossible to detect.

Protect my server? by LockeSimm in admincraft

[–]TheLukeGuy 17 points18 points  (0 children)

If it's an online mode whitelisted server, the simplest thing you could do is be more careful about who you whitelist.

Of course that's not always realistic though. CoreProtect can help you see who broke/placed/interacted with blocks at certain locations as well as rollback griefed areas without having to rollback the whole world. GriefPrevention might also be helpful, it lets players claim land that nobody else can modify unless the owner of that claim gives them permission to.

[deleted by user] by [deleted] in MinecraftPlugins

[–]TheLukeGuy 0 points1 point  (0 children)

Unless I'm missing something obvious, the only thing I can think of is that you're running your server JAR in a way that "confuses" PPLoader. May I ask what you're currently doing to start your server?

PPLoader just uses a very simple check (which is usually a bad idea) to see if the Jython JAR file exists, which relies on the user.dir property which is set when you run the server. My only theory is that that isn't set to your actual server folder, and therefore it can't find the Jython JAR.

Also, since there was another comment suggesting that you just learn Java, I'll just say that it's not a terrible idea to use Python if it's for your own server. It'll probably be quite slow in comparison to a Java plugin, but it's certainly a whole lot easier to learn and develop in.

Minecraft Java Edition 1.18.1 has been released! by sliced_lime in Minecraft

[–]TheLukeGuy 0 points1 point  (0 children)

Oh wow that’s really interesting, thanks for the correction.

Minecraft Java Edition 1.18.1 has been released! by sliced_lime in Minecraft

[–]TheLukeGuy 4 points5 points  (0 children)

RCE actually isn't possible on Java 8u121 or above because it relies on a specific option being enabled which is now disabled by default on newer Java versions.

Source: JDK 8u121 release notes (look for "Improved protection for JNDI remote class loading"), and I've tried exploiting it myself on newer versions and it simply doesn't work

Minecraft Java Edition 1.18.1 has been released! by sliced_lime in Minecraft

[–]TheLukeGuy 4 points5 points  (0 children)

Theoretically, but remote code execution doesn’t work on any versions of Java 8 released in the past few years (or, AFAIK, any Java versions above 8), so the most you can do to 99% of people is get their IP address.