Skip to content

Instantly share code, notes, and snippets.

@apple502j
apple502j / dot-two-update.md
Last active April 17, 2022 04:04
1.18.2 update guide for Fabric modders

1.18.2 Update Info

Please contact apple502j for any corrections, suggestions etc! (available on Fabricord https://fabricmc.net/discuss/)

TLDR

Mods will be broken, especially if it adds new contents.

Major Changes

  • Registry modification/adding custom content to registry now requires Fabric API due to the addition of "frozen registry". Either add Fabric API or fabric-registry-sync-v0 as an dependency.
  • Tags and Registries Update. Tag is gone and you need TagKey. However, if you're just using isOf call with a vanilla tag, there should be no refactor. To understand TagKey and other new classes, I've prepared a separate TLDR document.
  • Several Fabric API modules removed, mostly deprecated ones. This includes Tag Extension API which has a separate migration guide. Unless you are using tag replacement stuff, vanilla code should be used.
@SheepTester
SheepTester / explainer.md
Created May 4, 2020 19:35
Change speed of Edpuzzle video

Edpuzzle aggressively reverts the playbackRate of a <video> element, so you can't simply change it to increase the speed. Thus, a more aggressive response is necessary to combat it.

Firstly, we get the <video> element:

video = document.querySelector('video')

Then, we get the setter function for the playbackRate property using Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'playbackRate').set. It is called with the <video> element as this and with speed as the new value. This way, the <video> element is properly notified of the speed change by simulating assigning a value to playBackRate directly (ie using =).

@aikar
aikar / ChunkStateFix.patch
Last active January 18, 2022 17:26
Fixes the dupe exploit caused by chunks being oversized more than the RegionFile format can support. Patch is licensed under MIT or Public Domain. Anyone (hopefully Mojang) is free to use it.
commit ba4afed44f76c2d0b8ba63439ecc28b6c2212d05
Author: Aikar <aikar@aikar.co>
Date: Fri Feb 15 01:08:19 2019 -0500
Allow Saving of Oversized Chunks
The Minecraft World Region File format has a hard cap of 1MB per chunk.
This is due to the fact that the header of the file format only allocates
a single byte for sector count, meaning a maximum of 256 sectors, at 4k per sector.
@caprica
caprica / SwtBrowserCanvas.java
Created October 8, 2013 19:57
Embed an SWT Webkit Browser component inside a Swing JPanel, with non-crashing clean-up.
/*
* This class is made available under the Apache License, Version 2.0.
*
* See http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Author: Mark Lee
*
* (C)2013 Caprica Software (http://www.capricasoftware.co.uk)
*/
@mike-neck
mike-neck / Main.java
Created July 1, 2013 04:01
Using JavaFX as Headless Browser
package org.mikeneck.jfx.js;
import javafx.application.Application;
import netscape.javascript.JSObject;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author : mike