Skip to content

Instantly share code, notes, and snippets.

Clone of https://github.com/spoorn/SimpleBackup/blob/main/SUMMARY.md. Added as a gist for commenting support

Overview

Below, I'll summarize some of the technical aspects of this mod as I've learned a bit of tricks along the way which may be useful for anyone reading.

This Backup mod was built as a Minecraft Fabric mod which backs up the current world on the server at automatic intervals, with support for various formats, manual backups, and lots of configuration.

Though this is a Minecraft mod, the code here is general to file copying, backups, multi-threading, etc. As I was using the mod on my own server, the world folder became very large (~75 GB) so I had to find ways to optimize the backup logic. Here are my findings.

{
// Chance for mob to spawn with a bounty [1/value] [default = 300]
"bountyChance": 300,
// True if Bounty mobs should glow through walls permanently, else false [default = false]
"bountyMobPermanentGlow": true,
// Duration in seconds Bounty mobs should glow when they are first found if bountyMobPermanentGlow is false [default = 20]
"bountyMobGlowDuration": 40,
// Player's Bounty Hunter level increments at this value [default = 10]
"playerBountyHunterLevelIntervals": 10,
// Bonus health for Player per Bounty Hunter level [default = 2 (one heart)]
@spoorn
spoorn / betterend-stackoverflow
Created April 7, 2021 08:30
BetterEnd infinite recursion
This file has been truncated, but you can view the full file.
[01:24:51] [Render thread/INFO]: [net.minecraft.class_2966:method_12847:126]: ---- Minecraft Crash Report ----
// You're mean.
Time: 4/7/21 1:24 AM
Description: mouseClicked event handler
java.lang.StackOverflowError: mouseClicked event handler
at com.google.common.collect.Hashing.smearedHash(Hashing.java:50)
at com.google.common.collect.HashBiMap.get(HashBiMap.java:256)
at net.minecraft.class_2370.method_10223(class_2370.java:176)
@spoorn
spoorn / mermod-cosmeticarmors-conflict
Created April 7, 2021 07:34
Mermod conflict with Cosmetic Armors
[00:28:36] [main/WARN]: @Redirect conflict. Skipping cosmetic-armor.mixins.json:MixinCosmeticArmorVisibility->@Redirect::modifyVisibleArmor(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_1799; with priority 1000, already redirected by mermod.mixins.json:ArmorFeatureRendererMixin->@Redirect::getEquipped(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_1799; with priority 1000