Skip to content

Instantly share code, notes, and snippets.

View HeathLoganCampbell's full-sized avatar
🐧

Heath L Campbell HeathLoganCampbell

🐧
View GitHub Profile
@HeathLoganCampbell
HeathLoganCampbell / Void world in minecraft spigot 1.17
Created October 10, 2021 05:20
Void world in minecraft spigot 1.17
#Minecraft server properties
#Sun Oct 10 18:18:53 NZDT 2021
enable-jmx-monitoring=false
rcon.port=25575
enable-command-block=false
gamemode=survival
enable-query=false
generator-settings={"lakes"\:false,"features"\:false,"layers"\:[{"block"\:"minecraft\:air","height"\:1}],"structures"\:{"structures"\:{}}}
level-name=world
motd=A Minecraft Server
@HeathLoganCampbell
HeathLoganCampbell / !Extra info.md
Last active March 13, 2024 08:05
A weekend project to allow minecraft worlds to be saved in a mysql database, mysql worlds. This was done on top of Paper 1.17 on fa53a1a7f

SkyPaper

Uploading and download Minecraft worlds from mysql

The idea was to be able to upload worlds to a database so that we could have multiple servers upload and download them at will to enable load balancing for servers such as skyblock as the demands of scalable 1.17 servers grow while the performance falls version to version.

The important idea here was to see if it was possible to upload worlds to a database, which the answer is yes :D. but this even works better for skyblock servers as they are mostly air, which allowed us to do a small optimization. which is when a chunk is empty, we don't have it, as generating empty chunks is cheap as chips, but storing them has about 500B of overhead. so it ends up taking longer to fetch them from the database, then just generate them.

@HeathLoganCampbell
HeathLoganCampbell / pulumi C# mongodb and mexpres on ecs
Last active October 16, 2023 10:17
Using Pulumi C# creating an AWS ECS cluster that stands up MongoDB and Mongo express
namespace Main.Infra
{
using System;
using System.Text.Json;
using Pulumi;
using Pulumi.Aws.ServiceDiscovery;
using Awsx = Pulumi.Awsx;
using Aws = Pulumi.Aws;
@HeathLoganCampbell
HeathLoganCampbell / fishingHook.java
Last active January 27, 2024 13:20
Spawn fishing hook / fishing bob / fishing line without a fishing rod using protocollib
// Spawn fishing hook / fishing bob / fishing line without a fishing rod using protocollib
// Learnings:
// The hook bobbing on the water is done client side.
// fishing hook will just sink thru lava
private void spawnEntity(Location location, Vector vector, EntityType type, int shooterId) {
int entityId = 10000;
PacketContainer packet = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);
packet.getIntegers().write(0, entityId);
@HeathLoganCampbell
HeathLoganCampbell / CustomItemsPlugin.java
Last active January 29, 2024 12:40
Disguise items to players via packet, basically have under the hood item seperate for what each player sees. this means you can customize each item for each viewer
package net.skyblock.realm.customitems;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.StructureModifier;