Skip to content

Instantly share code, notes, and snippets.

View HeathLoganCampbell's full-sized avatar
🐧

Heath L Campbell HeathLoganCampbell

🐧
View GitHub Profile
@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;
@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 / 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 / !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 / 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 / Download gitlab artifacts
Last active September 25, 2021 07:35
Download gitlab artifacts via curl
curl -L --header "PRIVATE-TOKEN: <Personal token>" "https://gitlab.com/api/v4/projects/Team%2FSubTeam%2FRepo/jobs/artifacts/<Branch>/download?job=<job>" -o artifacts.zip
@HeathLoganCampbell
HeathLoganCampbell / RandomlyGeneratedIRDNumbers.txt
Created July 28, 2021 13:28
Randomly Generated Validate IRD Numbers
049895810
128844961
011476376
012543999
109681687
089249848
120246569
118069331
134586273
079482609
@HeathLoganCampbell
HeathLoganCampbell / CommandBase.java
Created April 18, 2020 14:54
A slightly even more useful command CoI DI system. Converting commands to easier to use code and not having to deal with arg lengths and constantly converting
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class CommandBase
{
private CommandFramework parent;
@HeathLoganCampbell
HeathLoganCampbell / CommandBase.java
Created April 18, 2020 14:53
A slightly even more useful command CoI DI system.
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class CommandBase
{
private CommandFramework parent;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Bootleg IoC DI command system