Skip to content

Instantly share code, notes, and snippets.

Beginner's Guide to PAYDAY 2 Modding

This guide details the installation of SuperBLT and VanillaHUD for PAYDAY 2.

I claim no responsibility for any damages caused by this guide!

Prerequisites

Taken from this YouTube video by Aar

The settings:

fov_desired 90
viewmodel_fov 70
tf_use_min_viewmodels 1
cl_interp 0.0325
cl_interp_ratio 1
@webcrawls
webcrawls / local.ts
Last active June 19, 2023 20:18
A Svelte store backed by the browser's localStorage. Supports custom serializer and deserializer functions.
export const localStore = <T = any>(key: string,
value: T,
deserializer: (value: string) => T = JSON.parse,
serializer: (value: T) => string = JSON.stringify): Writable<T> => {
const {subscribe, set: initialSet, update: initialUpdate} = writable<T>()
const loadValue = (): string | null => browser ? localStorage.getItem(key) : null
const saveValue = (value: string) => browser && localStorage.setItem(key, value)
const initialValue = loadValue()
@webcrawls
webcrawls / databaseSnippet.java
Created October 21, 2020 17:46
Database method using CompletableFutures
/**
* Fetches user data and constructs a {@link User} for the given UUID.
* Will create a new object if none exists.
*
* @param uuid UUID of player to get
*/
// JDBI is just a wrapper around JDBC, I use HikariCP. You can replace JDBI with the appropriate HikariCP methods :pog:
// This won't really be fit for your use case, the main takeaway here is the use of CompletableFuture
// Check the other file to see how I use it in my PlayerManager
@webcrawls
webcrawls / method.java
Created October 21, 2020 16:15
a helper method for the adventure text library
/**
* Serializes an adventure Component to a String, for use in methods which don't support components.
*
* @param component Component to serialize
* @return Formatted string
*/
public static String componentToString(Component component) {
return TextComponent.toLegacyText(BungeeComponentSerializer.get().serialize(component));
}
@webcrawls
webcrawls / README.md
Created August 26, 2020 03:37
Basic commands to manage a Minecraft server running on Ubuntu 18.04

Introduction

This guide assumes you are using Ubuntu 18.04 Server, you have screen installed, and that your server is already uploaded to the server.

This guide also assumes you have a server start script. You can find one here

Tools

Screen

@webcrawls
webcrawls / start.sh
Last active August 26, 2020 03:10
Start script for KingdomsLive (and probably any other Minecraft server)
while true
do
java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui
echo "Starting in 3..."
sleep 1
echo "Starting in 2..."
sleep 1
echo "Starting in 1..."
done