Skip to content

Instantly share code, notes, and snippets.

View UpcraftLP's full-sized avatar

Up UpcraftLP

View GitHub Profile
@HyCraftHD
HyCraftHD / Nginx.conf
Last active July 3, 2018 01:22
Simple Mavenserver
#Config for repo
server {
include snippets/base.cfg; # Basic SSL and listening handling
server_name repo.domain.name;
root /var/www/repo/;
autoindex on;
location / {
@Gavintime
Gavintime / tips.txt
Last active August 15, 2019 15:48
Minecraft Useful Vanilla Tips
BLOCK/ITEM MECHANICS
Cauldrons filled with Water can be used to remove Dye from Leather Armor and Shulker Boxes. They can also remove the top layer from Banners.
Block inventory names can be changed by renaming them with an Anvil before placing them down.
Closing a Trap Door your standing under will force you to crawl which allows you to go into one block tall areas.
Ender Chests can be used as an Obsidian storage block since breaking them drops eight Obsidian.
Grindstones can be used to remove non curse enchantments from items, giving players Experience in return.
Bamboo can be auto farmed and used as a renewable fuel source.
Lanterns emit slightly more light than Torches.
A Nether Portal can be any size between 4x5 and 23x23.
When using Bone Meal on Dirt, Coarse Dirt, Sand, Red Sand, or Gravel underwater, Coral will generate in place of some of the Seagrass. However this only works in Warm Ocean Biomes.
package com.unascribed.chipper;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL43.*;
import static org.lwjgl.system.MemoryUtil.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

Brains, Schedules and Activities: An overview of the new 1.14 AI system

In 1.14, villagers use an AI system completely independent from the old Goal system. However, this system can be used by any LivingEntity. This document aims at explaining the basics of that more advanced AI.

Every living entity now has a Brain. A brain uses memories and sensors to perform tasks and activities.

Memories

Memories are a way to save arbitrary data for use by tasks.

With the release of Forge 14.23.2.2638, a proper way to render items with GL was implemented. Using this system is much simpler than the old system, which required a TileEntity, and does not allow access to the ItemStack.

Using TileEntityItemStackRenderer

TileEntityItemStackRenderer allows you to render your item using public void renderByItem(ItemStack itemStackIn).
There is an overload that takes partialTicks as a parameter, but it is never called in vanilla.

In order to use a TEISR, the Item must first satisfy the condition that its model returns true for IBakedModel#isBuiltInRenderer. Once that returns true, the Item's TEISR will be accessed for rendering. If it does not have one, it will use the default TileEntityItemStackRenderer.instance. For an example IBakedModel to use, see below.

@Choonster
Choonster / ModelLoadingProcess.md
Last active January 15, 2021 11:20
A description of the model loading process in Minecraft Forge 1.9-1.12.1

In this document, I use strings in the format "foo:bar" to represent ResourceLocations with domain foo and path bar. I also use [square brackets] for placeholders.

The Model Loading Process

Blocks

On startup and whenever the resources are reloaded (in ModelLoader#setupModelRegistry), Minecraft iterates through every registered Block (in ModelLoader#loadBlocks) and asks its custom IStateMapper (or DefaultStateMapper if none has been registered) to create a mapping between every valid IBlockState of the Block and the ModelResourceLocation for that state (with the domain and path pointing to a blockstates file and the variant to a variant within that file). It then attempts to load these models.

DefaultStateMapper looks for the blockstates file with the Block's registry name (i.e. assets/[modid]/blockstates/[name].json) and serialises each property and value of the IBlockState to create the variant name that the model is loaded from (e.g. "enabled=true,type=foobar"

@Niko-sk2x
Niko-sk2x / 1.13-Worldgen.md
Last active September 4, 2022 14:06
MC 1.13 Worldgen

Overview of changes

  • net.minecraftforge.fml.common.IWorldGenerator -> net.minecraft.world.gen.feature.Feature
    • No longer needed. I think it should be removed by forge, as it has been superseded by vanilla functionality. See below.
  • net.minecraft.world.gen.feature.WorldGenerator -> net.minecraft.world.gen.feature.Feature
    • This would also be the most common replacement of Forge's IWorldGenerator. This should be the solution for anything smaller than a chunk.
    • Except the 8 blocks offset. This is not a thing anymore. Population now works just like any normal person would expect.
    • Position of features is controlled by instances of net.minecraft.world.gen.placement.BasePlacement instead of by the feature itself.
  • net.minecraft.world.gen.MapGenBase -> net.minecraft.world.gen.carver.IWorldCarver
  • This is now finally exposed to mods in a useful way. As it was mostly hidden from modders before, not eveyone may know what it is, so it will be explained later. Generates caves a
@bonii-xx
bonii-xx / ToolMaterials
Last active October 15, 2023 17:31
Tinkers' Construct IMC
/* This first part adds Seared Stone as a material. Toolparts and tool graphics are created automatically by color */
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("Id", 50); // Unique material ID. Reseved IDs: 0-40 Tinker, 41-45 Iguana Tinker Tweaks, 100-200 ExtraTiC
tag.setString("Name", "Seared Stone"); // Unique material name
tag.setInteger("HarvestLevel", 3); // diamond level
tag.setInteger("Durability", 100);
tag.setInteger("MiningSpeed", 100);
tag.setInteger("Attack", 0); // optional
tag.setFloat("HandleModifier", 0.1f);
tag.setInteger("Reinforced", 0); // optional
@comp500
comp500 / fabricserversidemods.md
Last active September 3, 2024 03:23
Useful Fabric server side mods
@apangin
apangin / HotSpot JVM intrinsics
Last active February 26, 2025 11:43
HotSpot JVM intrinsics
_hashCode java/lang/Object.hashCode()I
_getClass java/lang/Object.getClass()Ljava/lang/Class;
_clone java/lang/Object.clone()Ljava/lang/Object;
_dabs java/lang/Math.abs(D)D
_dsin java/lang/Math.sin(D)D
_dcos java/lang/Math.cos(D)D
_dtan java/lang/Math.tan(D)D
_datan2 java/lang/Math.atan2(DD)D
_dsqrt java/lang/Math.sqrt(D)D
_dlog java/lang/Math.log(D)D