Skip to content

Instantly share code, notes, and snippets.

View FreezePhoenix's full-sized avatar
😓
Probably working on stuff. Maybe coding. Definitely tired.

FreezePhoenix

😓
Probably working on stuff. Maybe coding. Definitely tired.
View GitHub Profile

Source:

public class Vec3d
implements Position {
    /**
     * The zero vector (0, 0, 0).
     */
    public static final Vec3d ZERO = new Vec3d(0.0, 0.0, 0.0);
    /**
     * The X coordinate of this vector.

Source:

public final class MathUtilities {
    private MathUtilities() {
    }
    
    public static double invsqrt(double d) {
        return 1 / Math.sqrt(d);
    }
}

Source:

public final class MathUtilities {
    private MathUtilities() {
    }

    public static int floor(double d) {
        return (int) Math.floor(d);
    }
package com.techteam.fabric.bettermod.mixin;
import com.techteam.fabric.bettermod.util.VectorUtils;
import jdk.incubator.vector.FloatVector;
import jdk.incubator.vector.IntVector;
import jdk.incubator.vector.VectorOperators;
import net.minecraft.util.math.Vector4f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
package com.techteam.fabric.bettermod.util;
import jdk.incubator.foreign.MemorySegment;
import jdk.incubator.vector.FloatVector;
import jdk.incubator.vector.IntVector;
import jdk.internal.misc.Unsafe;
import jdk.internal.vm.vector.VectorSupport;
import static jdk.internal.vm.vector.VectorSupport.*;
@FreezePhoenix
FreezePhoenix / sweepline.js
Created August 23, 2021 14:28
Implementation of Sweepline
function intersects(line_one, line_two) {
if(line_one.first.x == line_one.second.x) {
// line_one is vertical.
if(line_two.first.x == line_two.second.x) {
// line_two is also vertical? This isn't looking that good...
return line_two.first.x == line_one.first.x && line_one.first.y <= line_two.second.y && line_one.second.y >= line_two.first.y;
} else {
// line_two is horizontal.
return line_two.first.x <= line_one.first.x && line_two.second.x >= line_one.first.x && line_one.first.y <= line_two.first.y && line_one.second.y >= line_two.first.y;
}
game_log("---Script Start---");
//Put monsters you want to kill in here
//If your character has no target, it will travel to a spawn of the first monster in the list below.
let monster_targets = ["armadillo"],
state = "farm",
group = ["Wood", "Dirt"], // The group our character operates in. This generally forms a chain.
grey_list = [], // Characters we trust, but are willing to nullify if needed be (and are in PVP)
chain = [...group].reverse(), // How is the chain structured?
follow = group.indexOf(character.name) != 0, // Should we be following someone?
function rot13(str) {
var input = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var output = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm';
var index = x => input.indexOf(x);
var translate = x => index(x) > -1 ? output[index(x)] : x;
return str.split('').map(translate).join('');
}
navigator.getBattery().then(function(battery) {
function updateAllBatteryInfo(){
updateChargeInfo();
updateLevelInfo();
updateChargingInfo();
updateDischargingInfo();
}
updateAllBatteryInfo();
battery.addEventListener('chargingchange', function(){
const convertBase = (inputNumber, inputBase = 10, outputBase = 10) =>
parseInt(inputNumber, inputBase).toString(outputBase);