Skip to content

Instantly share code, notes, and snippets.

View Su5eD's full-sized avatar

Su5eD Su5eD

View GitHub Profile
@LexManos
LexManos / LootTables.patch
Created May 7, 2016 18:16
First draft of modifications to Loot Tables for modder usage/modification.
diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch
new file mode 100644
index 0000000..31c3c53
--- /dev/null
+++ b/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch
@@ -0,0 +1,59 @@
+--- ../src-base/minecraft/net/minecraft/world/storage/loot/LootEntry.java
++++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootEntry.java
+@@ -18,15 +18,17 @@
+
@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"

@mbinna
mbinna / effective_modern_cmake.md
Last active July 19, 2024 02:18
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@simon04
simon04 / git.sh
Created January 14, 2020 07:16
Git merge/replace orphan branch into master
git checkout --orphan new-framework
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories master
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}"
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
@linuswillner
linuswillner / psa.md
Last active May 30, 2022 01:43
Public service announcement from The Coding Den staff about social engineering being utilised as an attack vector for server takeovers

Today, on the 27th of March 2021, The Coding Den was subjected to a social engineering attack that lead to a brief hostile takeover of the server before the situation was brought under control by staff. We are sharing this statement as a public service announcement on the methodology used in the scam and possible remediations to prevent it, in order to help other staff teams avoid becoming victims of it.

Methodology

The attack proliferates as follows:

  1. The attacker will look for a staff member who is presently offline. This will ensure that it appears as if the staff member's account was globally banned and forcefully booted offline.
  2. It is within the attacker's interest to choose a target with the highest possible privileges (to do the maximum amount of damage), meaning that they will likely prefer administrators over moderators and so forth.
  3. The attacker will create a new Discord account with the same name and profile picture as the target.
  4. The attacker will approach a staff member, claiming
@TheCurle
TheCurle / Info.md
Last active May 18, 2024 22:12
[ForgeGradle] Updating the old toolchains; a why, how, and where.

RetroGradle

RetroGradle is an initiative to update the older ForgeGradle toolchains (1.x to 2.3) and the Minecraft versions associated with them, to use the more modern ForgeGradles (3.x and 4.x).
To do that requires a lot of time and scripting, but nothing is "complex".

1.12

The update for 1.12 to the FG3 toolchain is the benchmark for how we're going to do the other versions.
The repo update itself can be found here. The largest change here is the build.gradle script. You'll notice that it looks almost identical to the 1.16.x buildscript, with a few minor differences.
Those being, the MCP version (we'll get to that), the run configs using legacydev.Main(Client/Server) rather than userdev.Main, and some other small adjustments to make 1.12 happy.

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@GizmoTheMoonPig
GizmoTheMoonPig / Materials.md
Last active April 19, 2024 00:36
Materials: where did they go?

Starting in 1.20, the Material class has completely disappeared and has been replaced with a series of properties that are chained to BlockBehavior.Properties.of. This list exists so you can easily figure out which propeties to use to replace the old materials.

Every Material here gives its default MapColor (previously known as MaterialColor), regardless of if it had one or not. It also defines which properties to use to replicate the exact behavior used previously.

The very bottom of this file defines the more complicated replacements to certain material properties.

  • AIR - No MapColor, replaceable
  • STRUCTURAL_AIR - No MapColor, replaceable
  • PORTAL - No MapColor, PushReaction.BLOCK
  • CLOTH_DECORATION - MapColor.WOOL, ignitedByLava

A small selection of changes that were done in NeoForge since it's creation. This is not all of them. Most changes can be seen in PRs and Commits on the NeoForged GitHub organization's repositories.


Mod Loader

  1. Multiple mod entry points allowed now. Can even specify an entry point to be client only for better client code separation.
    https://docs.neoforged.net/docs/concepts/sides#mod

  2. Capability refactor to split it into Data Attachment and Capabilities separately and cleaner.
    https://docs.neoforged.net/docs/datastorage/attachments
    https://docs.neoforged.net/docs/datastorage/capabilities

  3. Networking refactor to be simpler (ideally) to be used.https://docs.neoforged.net/docs/networking/