Skip to content

Instantly share code, notes, and snippets.

buildscript {
repositories {
jcenter()
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://plugins.gradle.org/m2' }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore
deleted: .gradle/4.10.3/fileChanges/last-build.bin
deleted: .gradle/4.10.3/fileContent/annotation-processors.bin
deleted: .gradle/4.10.3/fileContent/fileContent.lock
deleted: .gradle/4.10.3/fileHashes/fileHashes.bin
root.setOnScroll((ScrollEvent event) -> {
Task task = new Task() {
@Override protected Void call() throws Exception {
Platform.runLater(()->{
System.out.println(index);
if(event.getDeltaY()==-40.0){
index ++;
int cachedSize = addons.size();
for(Addon adn:CurseAPIWrapper.searchAddons("", GameVersion.STABLE, Section.MODS, 1, index))
addons.add(adn);
java.lang.NullPointerException: The validated object is null
at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
at net.minecraft.util.registry.RegistrySimple.putObject(RegistrySimple.java:42)
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:194)
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28)
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:132)
at net.minecraft.client.Minecraft.init(Minecraft.java:560)
at net.minecraft.client.Minecraft.run(Minecraft.java:422)
at net.minecraft.client.main.Main.main(Main.java:118)
if(Input.isButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE)) {
double x, y = 0, z;
float x0 = camera.getRotation().getX();
float y0 = camera.getRotation().getY();
x0 = (float) (x0-(360*Math.floor(x0/360)));
y0 = (float) (y0-(360*Math.floor(y0/360)));
//0=0, 90=1, 180 = 0, 270=-1
public void update() {
newMouseX = Input.getMouseX();
newMouseY = Input.getMouseY();
float x = (float) Math.sin(Math.toRadians(rotation.getY())) * moveSpeed;
float z = (float) Math.cos(Math.toRadians(rotation.getY())) * moveSpeed;
if (Input.isKeyDown(GLFW.GLFW_KEY_A)) position = Vector3f.add(position, new Vector3f(-z, 0, x));
if (Input.isKeyDown(GLFW.GLFW_KEY_D)) position = Vector3f.add(position, new Vector3f(z, 0, -x));
if (Input.isKeyDown(GLFW.GLFW_KEY_W)) position = Vector3f.add(position, new Vector3f(-x, 0, -z));
package opecraft.util;
import opecraft.blocks.Block;
import opecraft.blocks.BlockAir;
import opecraft.blocks.BlockSide;
import opecraft.blocks.BlockWater;
import opecraft.data.Chunk;
import opecraft.data.ChunkMesh;
import opecraft.data.Vertex;
import org.joml.Vector2f;
Vector3i end = new Vector3i((int) floor(rayPos.x), (int) floor(rayPos.y), (int) floor(rayPos.z));
float dToPX = (float) (end.x-floor(end.x));
float dToPY = (float) (end.y-floor(end.y));
float dToPZ = (float) (end.z-floor(end.z));
float dToNX = abs(1-dToPX);
float dToNY = abs(1-dToPY);
float dToNZ = abs(1-dToPZ);
BlockSide side;
while (!close)
{
double now = System.nanoTime();
int updateCount = 0;
if (!paused)
{
while( now - lastUpdateTime > TIME_BETWEEN_UPDATES && updateCount < MAX_UPDATES_BEFORE_RENDER )
{
update();
public class GUIMesh {
ArrayList<Vertex> verts = new ArrayList<>();
ArrayList<Integer> inds = new ArrayList<>();
private int vaoID, pboID, iboID, tboID;
public GUIMesh() {
}