Skip to content

Instantly share code, notes, and snippets.

View hube12's full-sized avatar
💭
Currently working and handling side projects, contact me on Discord Neil#4879

Neil hube12

💭
Currently working and handling side projects, contact me on Discord Neil#4879
View GitHub Profile
@hube12
hube12 / getLootUntil.java
Created July 23, 2021 16:29
Get Loot until limit
public static List<BPos> getLootUntil(RegionStructure<?,?> structure, BPos center, TerrainGenerator terrainGenerator, ChunkRand chunkRand, Predicate<Item> itemPredicate, int limit){
Generator.GeneratorFactory<?> factory = Generators.get(structure.getClass());
Generator structureGenerator = factory.create(terrainGenerator.getVersion());
if(structureGenerator.getPossibleLootItems().stream().noneMatch(itemPredicate)) {
return null;
}
int chunkInRegion = structure.getSpacing();
int regionSize = chunkInRegion * 16;
SpiralIterator<RPos> spiralIterator = new SpiralIterator<>(
new RPos(center.toRegionPos(regionSize).getX(), center.toRegionPos(regionSize).getZ(), regionSize),
@hube12
hube12 / 1.16.java
Last active August 17, 2022 20:54
1.16 salts
Bootstrap.register();
Registry.BIOME.stream().forEach(
biome -> {
System.out.printf("__________________________________\n");
System.out.printf("BIOME: " + Registry.BIOME.getKey(biome).getPath() + "\n");
for (GenerationStage.Decoration stage : GenerationStage.Decoration.values()) {
System.out.printf("STAGE: " + stage.name() + "\n");
int i = 0;
if (stage==GenerationStage.Decoration.SURFACE_STRUCTURES){
for (Structure<?> s:biome.structures.keySet()){
@hube12
hube12 / 1.15.java
Last active July 17, 2021 16:14
1.15 salts
public static void main(String[] args) {
Bootstrap.register();
Registry.BIOME.stream().forEach(
biome -> {
System.out.printf("__________________________________\n");
System.out.printf("BIOME: " + Registry.BIOME.getKey(biome).getPath() + "\n");
for (GenerationStage.Decoration stage : GenerationStage.Decoration.values()) {
System.out.printf("STAGE: " + stage.name() + "\n");
int i = 0;
for (ConfiguredFeature<?, ?> configuredfeature : biome.features.get(stage)) {
@hube12
hube12 / 1.14.java
Last active July 17, 2021 16:13
1.14 salts
public static void main(String[] args) {
Bootstrap.register();
Registry.BIOME.stream().forEach(
biome -> {
System.out.printf("__________________________________\n");
System.out.printf("BIOME: " + Registry.BIOME.getKey(biome).getPath() + "\n");
for (GenerationStage.Decoration stage : GenerationStage.Decoration.values()) {
System.out.printf("STAGE: " + stage.name() + "\n");
int i = 0;
for (ConfiguredFeature<?> configuredfeature : biome.features.get(stage)) {
@hube12
hube12 / 1.13.java
Last active July 17, 2021 15:48
1.13 salts
public static void main(String[] args) {
Bootstrap.register();
IRegistry.BIOME.stream().forEach(
biome -> {
System.out.printf("__________________________________\n");
System.out.printf("BIOME: "+IRegistry.BIOME.getKey(biome).getPath()+"\n");
for(GenerationStage.Decoration stage : GenerationStage.Decoration.values()) {
System.out.printf("STAGE: "+stage.name()+"\n");
int i = 0;
for(CompositeFeature<?, ?> compositefeature : biome.features.get(stage)) {
@hube12
hube12 / LootHelperFunction.java
Last active July 16, 2021 19:57
simple Loot search function in java use hube12:SEED:master-snapshot
package kaptainwutax.featureutils;
import kaptainwutax.biomeutils.source.BiomeSource;
import kaptainwutax.featureutils.loot.ILoot;
import kaptainwutax.featureutils.loot.item.Item;
import kaptainwutax.featureutils.loot.item.Items;
import kaptainwutax.featureutils.structure.BuriedTreasure;
import kaptainwutax.featureutils.structure.DesertPyramid;
import kaptainwutax.featureutils.structure.RegionStructure;
import kaptainwutax.featureutils.structure.Shipwreck;
@hube12
hube12 / SaltMixin.java
Created June 9, 2021 00:23
1.17 decorators, features and structures salts
package net.fabricmc.example.mixin;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.ChunkRegion;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.ChunkRandom;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.StructureAccessor;
import json
import sys
import urllib.request as req
from pathlib import Path
from urllib.error import HTTPError, URLError
import hashlib
import shutil
assert sys.version_info >= (3, 7)
@hube12
hube12 / ron.rs
Last active March 11, 2021 16:34
// [dependencies]
// ron = "0.6.4"
// serde = { version = "1.0.60", features = ["serde_derive"] }
use serde::{Serialize, Serializer, Deserialize, Deserializer};
use std::collections::HashMap;
fn option_remove_serialize<S,T:Serialize>(x: &Option<T>, s: S) -> Result<S::Ok, S::Error> where S: Serializer {
x.as_ref().unwrap().serialize(s)
}
package com.seedfinding.neil.mixin;
import net.minecraft.client.gui.screen.PresetsScreen;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;