Skip to content

Instantly share code, notes, and snippets.

View MWHunter's full-sized avatar

DefineOutside MWHunter

View GitHub Profile
[17:18:22] [Server thread/INFO]: [dynmap] Loading dynmap v3.0-beta-3-160
[17:18:22] [Server thread/INFO]: [dynmap] version=git-Spigot-6dbf995-364b6fb (MC: 1.14 Pre-Release 5)
[17:18:22] [Server thread/ERROR]: [dynmap] Unable to find method getById for net.minecraft.server.v1_14_R1.Block
[17:18:22] [Server thread/ERROR]: [dynmap] Unable to find method a for net.minecraft.server.v1_14_R1.BiomeBase
[17:18:22] [Server thread/ERROR]: [dynmap] Unable to find field y for net.minecraft.server.v1_14_R1.BiomeBase
[17:18:22] [Server thread/INFO]: [dynmap] Unload queue not found - default to unload all chunks
[17:18:22] [Server thread/INFO]: [dynmap] inhabitedTicks field not found - inhabited shader not functional
[17:18:22] [Server thread/ERROR]: [dynmap] Unable to find method b for net.minecraft.server.v1_14_R1.WorldBorder
[17:18:22] [Server thread/ERROR]: Error initializing dynmap - bukkit version incompatible! initializing dynmap v3.0-beta-3-160 (Is it up to date?)
java.lang.IllegalArgumentException: Error initializi
transient HashMap<String, Team> internalToTeamName = new HashMap<>();
public void addObjective(String objectiveName, String displayedName, Integer priority) { // Do not repeat a priority, max prefix size is 64. On 1.12 or more outdated clients, max is 16.
Scoreboard playerScoreboard = getBukkitPlayer().getScoreboard();
Objective obj = playerScoreboard.getObjective(DisplaySlot.SIDEBAR);
String teamName = blankLines.get(priority);
String internalTeamName = getPlayerUUID().toString().replace("-", "").substring(0, 12) + priority;
Team team = playerScoreboard.getTeam(internalTeamName);
@MWHunter
MWHunter / pathfinding.java
Created January 13, 2021 23:56
Game Labs pathfinding.
public static byte tickCount = 0x00; // Because we only care about modulus 16, overflows/underflows have no effect on values.
public static List<Node> pathFindToNode(Player player, int targetX, int targetZ) {
Chunk chunk = player.getChunk();
// TODO: Search for the floor, make it so we don't check above or below high limit
// TODO: Search a hashset of materials we can go through instead of relying on bukkit's method
PriorityQueue<Node> openList = new PriorityQueue<>((a, b) -> (int) (a.f - b.f));
HashSet<Node> closedList = new HashSet<>(); // contains is o(1) for hashSet on average
openList.add(new Node(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(), null));
@MWHunter
MWHunter / gist:0a9862597d29e23ba606fd5c44774945
Created April 3, 2021 18:06
MWHunter/DefineOutside's public key
AAAAB3NzaC1yc2EAAAABJQAAAQEAlvwTDjoJsLV2Q1coVDsjTNv9Qh6Zmh6xB8pn
HIqmYfTnMZPaQimQAkcutF8aNabCJEZ0XzAHks/hZ1JuucSfxNnX3F9ZWaQXEqpP
+RlZgSb1VQYzI8CWgjOq5RWniAg9wTgnRgkpscsHUkzPA+7fYE9btMx4o2aiiakP
SXEDUOtyofM7k/Q5EJNMaQOpc06WMQXFmjMY19n/y5tSLF7JHfIjoR9jycrPErwN
y8uEXyz2yrvkkBIl3uRgw38j485SQn+rOgeyW2DeS+7/x47bydGUDKmltqYpvs4r
aX2kxNGoppfNG3F+FEMVWYVzMa4Cl4ae2RldkKhrl9WEIMfzkw==
@MWHunter
MWHunter / gist:a88c2588d47f12a9d4182d30f52a60f4
Last active July 21, 2024 17:43
Open source anticheats
Freppp:
- VulcanLite - https://github.com/freppp/VulcanLite
- ThotPatrol - https://github.com/freppp/ThotPatrol
Tecnio:
- Hades - https://github.com/Tecnio/Hades
- AntiHaxorman - https://github.com/Tecnio/AntiHaxerman
- Medusa - https://github.com/Tecnio/Medusa-Lite
package net.optifine.util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Matrix4f;
public class MathUtils {
public static final float PI = (float)Math.PI;
public static final float PI2 = (float)Math.PI * 2;
public static final float PId2 = 1.5707964f;
@MWHunter
MWHunter / gist:b16a21045e591488354733a768b804f4
Created April 25, 2021 22:40
Global palette ID -> BlockData script for Minecraft 1.13+
@Override
public void onEnable() {
StringBuilder allBlocks = new StringBuilder();
// Plugin startup logic
World bukkitWorld = Bukkit.getWorlds().get(0);
net.minecraft.server.v1_15_R1.World nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
net.minecraft.server.v1_15_R1.Chunk nmsChunk = nmsWorld.getChunkAt(0, 0);
net.minecraft.server.v1_15_R1.BlockPosition pos = new net.minecraft.server.v1_15_R1.BlockPosition(0, 0, 0);
@MWHunter
MWHunter / tickendevent.java
Last active August 19, 2021 21:45
Server tick end event
public class TickEndEvent implements Initable {
static Class<?> tickEnd = null;
static {
try {
if (ServerVersion.getVersion().isOlderThanOrEquals(ServerVersion.v_1_8_8)) {
tickEnd = NMSUtils.getNMSClass("IUpdatePlayerListBox");
} else if (ServerVersion.getVersion().isOlderThanOrEquals(ServerVersion.v_1_13_2)) {
tickEnd = NMSUtils.getNMSClass("ITickable");
} else {
@MWHunter
MWHunter / gist:0d01482be355a73c6b76ff66901a4969
Created October 18, 2021 20:49
Quick java program to wrap a minecraft server and run it anywhere java can be compiled an ran, such as repl.it
import java.io.*;
import java.lang.ProcessBuilder.Redirect;
import java.net.URL;
import java.util.Scanner;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
Scanner userInput = new Scanner(System.in);
import java.io.*;
import java.lang.ProcessBuilder.Redirect;
import java.net.URL;
import java.util.Scanner;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
Scanner userInput = new Scanner(System.in);