Skip to content

Instantly share code, notes, and snippets.

// Much of this code was taken from EnderIO
// This should work for any IInventory or ISidedInventory
public int insert(ItemStack stack, TileEntity tile, ForgeDirection from) {
int numInserted = 0;
if(tile != null && tile instanceof IInventory && stack != null) {
int numToInsert = stack.stackSize;
int firstFreeSlot = -1;
int[] slots = getSlots(tile, from);
IInventory inv = getInventory((IInventory)tile);
@Mordenkainen
Mordenkainen / Regrowth Tips.md
Last active June 30, 2024 13:54
Regrowth Tips and Tricks

Picking A Place For Your First Base:

  • Near an Ocean is a must. The ocean is an easy source of food and usually has clay and red sand deposits around the shore. These easy to get early resources can speed progression quite a bit.
  • Try to be near a Witchery Wicker Man. The wheat you can get from the hay bales that make it up will provide enough bread to meet all of your food needs until you have been able to breed the plants needed for magical food. Also, these have a spawner under them. If it is a zombie spawner, it makes for a good source of zombie flesh for leather until you can breed cows, and if it is a skelly spawner the early bonemeal is a godsend.
  • Near a surface lava pool. This is actually a pretty important one. Fairly early on you will need a good amount of lava, and being able to get it without a lot of mining is nice.
  • Near a Witchery Henge (the stone rings) can also be helpful as they often have witch spawners and witches drop all sorts of items that can help progress faster (they also conta
@Mordenkainen
Mordenkainen / StuckInBed.md
Last active February 12, 2018 12:32
A description of the "Stuck in bed" bug, it's cause, and the fix that BedPatch uses

The Issue:
The "Stuck In Bed" bug is an issue that has existed in vanilla Minecraft since at least version 1.10.2. The primary symptom of the issue is that after teleporting a player may not be able to leave their bed the next time they sleep. The only vanilla way to deal with the issue when it happens is to exit the game. Some mods, like "Bed Bugs", have given players a better way to deal with the issue by allowing them to kick themselves back to the main menu when the issue happens, saving the player the time it takes to reload Minecraft which is particularly important with larger modpacks that may take a while to load. Unfortunately, due to mod interactions and other factors this sometimes causes the game to crash anyway.

The Cause:
When Minecraft decides a player should wake up it looks them up in the EntityTracker and sends them a signal that tells them to get out of bed. If a player can not be looked up in the EntityTracker, they will never get the signal that tells them to get out of bed.

The Ent