Skip to content

Instantly share code, notes, and snippets.

View UpcraftLP's full-sized avatar

Up UpcraftLP

View GitHub Profile
@kennytv
kennytv / readme.md
Last active May 8, 2024 06:32
Signed Chat and Chat Types

Signed chat

This gist intends on clearing up some of the misinformation surrounding signed chat/the reporting feature Mojang has added to Minecraft 1.19.1. Here you can find both technical information as well as a general explanation of how these work.

Profile keys

After joining a server, clients now send a profile key used for verifying a message's authenticity. This key and thus the whole signing process is optional, but by default, servers enforce secure profiles for clients to send chat messages. Whenever the player sends a chat message and has a key associated, the message will be signed using their own private key, which the server then verifies using the public key sent after join. Assuming signature, timestamp, and message contents line up, the message goes through.

On the other end, clients can also require all broadcasted player messages to be signed, disregarding the ones without sender verified signatures.

Message signatures

@comp500
comp500 / fabricserversidemods.md
Last active April 15, 2024 20:13
Useful Fabric server side mods

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.

@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.
This has been copied from the original DropBox file which can be found here: https://www.dropbox.com/s/hejjfkpyohs9zmn/Why%20MCreator%20sucks.txt?dl=0
This file is written by the MinecraftForums user jcm2606. I welcome anyone to link to this file whenever they respond to an MCreator thread, as I will be doing.
Okay, so if you're reading this, you've either decided to use MCreator, support it or are uneducated as to why MCreator sucks. Or are just curious as to what I wrote for it. Either way. So, why did I write an entire text file? Because I cannot be bothered writing the reasons why you should not use MCreator over and over. This also goes for other generators that make modding as simple as a "click a button" process.
Just a rundown of what I'm going to be talking about (partly for me writing this):
- Limitations on what you can do
- Over-simplifies code
- Allows for crappy, generic mods
@Barteks2x
Barteks2x / 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
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;
@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 / {

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.

@DeflatedPickle
DeflatedPickle / MinecraftEnergyTypes.md
Last active June 10, 2024 11:00
A simple table for Minecraft energy types and a matrix for conversion rates.

Minecraft Energy Types


Energy Name Abbreviation Original Mod Version
Anima AM Anima-Mundi 1.11.2
Blutricity BE (NO) Redpower 1.6.4
Charge RP (NO)/Fz? Factorization 1.7.10
Crystal Flux CF Actually Additions 1.12