This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enchanment enum - NameSpacedKey | |
--- | |
PROTECTION_FIRE - fire_protection | |
DAMAGE_ALL - sharpness | |
ARROW_FIRE - flame | |
WATER_WORKER - aqua_affinity | |
ARROW_KNOCKBACK - punch | |
LOYALTY - loyalty | |
DEPTH_STRIDER - depth_strider | |
VANISHING_CURSE - vanishing_curse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Adjust to your personal needs and schedule on a cronjob running every minute by running "crontab -e" | |
#and adding "* * * * * bash /home/max/scr/backup.sh". Obviously adjust the path as needed | |
cryptFolder=/home/max/crypt/vault/ | |
#Highly recommend using a private repo here to avoid meta data extraction by third parties | |
[email protected]:Maxopoly/files.git | |
branch=master | |
#Adjust client name for each client so you can distinguish in the commit history who made a change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
StringBuilder sb = new StringBuilder(); | |
for (Material mat : Material.values()) { | |
if (mat.toString().contains("LEGACY")) { | |
continue; | |
} | |
sb.append(mat.toString()); | |
sb.append(","); | |
for (String part : mat.toString().split("_")) { | |
if (part.length() != 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String formatNumber(int i) { | |
boolean bigger = false; | |
StringBuilder sb = new StringBuilder(); | |
if (i >= 1000) { | |
int thousands = i / 1000; | |
i -= (thousands * 1000); | |
sb.append(formatNumber(thousands)); | |
sb.append(" thousand "); | |
bigger = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You probably want to do this in root to reduce the amount of sudos required | |
su - | |
#Install iptables if you haven't already | |
#Alternatively use packet manager of your choice | |
apt-get install iptables | |
#Allow all incoming traffic to begin with | |
iptables -P INPUT ACCEPT | |
#Clean out any existing input rules. You may also remove the "INPUT" argument and run only "iptables -F" to clear all chains. When doing so, make sure there are no rules in other chains that you still need (list via "iptables -L"), for example Oracle cloud servers will have preset rules, which should not be removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Script to automatically copy schematics from user home folders into the server folder. | |
#Useful, because it allows noobs to upload schematics on their own, you just need to set them up | |
#with an account, limit their permissions to their home folder and briefly explain Filezilla | |
#where to copy schematics to, edit this to fit your server | |
schematicFolder=/home/mc/server/plugins/WorldEdit/schematics/ | |
#users to copy schematics from, add/remove users you want to run this for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Sorting will automatically sort the retrieved entries chronologically for minecraft logs, | |
#because the output of zgrep will be prefixed with the name of the file, which starts with a timestamp | |
find -name \*.log.gz -print0 | xargs -0 zgrep "$1" | sort | |
grep "$1" latest.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Samplesize: 10 000 000 | |
Chances for the final prot level of a piece of armor after X orbs: | |
For 4 orbs 0: 0.1976008, 1: 0.5691199, 2: 0.2123788, 3: 0.0203932, 4: 5.073E-4, | |
For 5 orbs 0: 0.1317572, 1: 0.5401247, 2: 0.2836533, 3: 0.0422457, 4: 0.0022191, | |
For 6 orbs 0: 0.0877484, 1: 0.4942443, 2: 0.3420309, 3: 0.0702157, 4: 0.0057607, | |
For 7 orbs 0: 0.0586344, 1: 0.4410646, 2: 0.3861019, 3: 0.1025876, 4: 0.0116115, | |
For 8 orbs 0: 0.0389611, 1: 0.3874494, 2: 0.4166688, 3: 0.1368146, 4: 0.0201061, | |
For 9 orbs 0: 0.0260465, 1: 0.3355237, 2: 0.4352486, 3: 0.1717337, 4: 0.0314475, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Supplier; | |
public class CachedObject<T> { | |
private final Supplier<T> updateFunction; | |
private T cachedValue; | |
private boolean dirty = true; | |
public CachedObject(Supplier<T> updateFunction) { | |
this.updateFunction = updateFunction; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.maxopoly.WPCommon.model.areagrid; | |
public class AreaGrid <E extends AreaGridElement> implements AreaGridElement{ | |
private int x; | |
private int z; | |
private int elementSize; | |
private AreaGridElement [] [] elements; |
NewerOlder