├── README.md ├── dev_pins.md ├── eclipse.md ├── eventhandler-alt.png ├── eventhandler.png ├── idea.md ├── index.md ├── pages ├── block │ └── opaque_normal_full_cube.md ├── command │ └── check_permission_level.md ├── devenv_and_general │ ├── adding_dependencies.md │ ├── check_devenv.md │ ├── customizing_forge_gradle_2.md │ ├── git.md │ └── live_class_reloading.md ├── entity │ ├── ai_tasks.md │ ├── mob_oredict_drops.md │ ├── nbt_tricks.md │ └── spawning_mobs.md ├── existingfilehelper.md ├── fluid │ └── fluids_1.12.2.md ├── item │ └── check_oredict.md ├── list_of_vanilla_codecs.md ├── rendering │ ├── basic-item.md │ ├── custom-modelloader.md │ └── registering-entity-renderer.md └── tips │ └── neighbor_caching.md └── version_info.md /README.md: -------------------------------------------------------------------------------- 1 | # Modding-Resources 2 | This repo contains a many resources that can be used when creating Minecraft Mods and other software. If you would like to contribute to this repo or have us include one of your resources, please open an issue or pull request. You can also get in touch with us on [Discord](https://discord.tophatcat.dev). 3 | 4 | If you are trying to find our index page, please click [here](https://github.com/MinecraftModDevelopment/Modding-Resources/blob/master/index.md). 5 | -------------------------------------------------------------------------------- /dev_pins.md: -------------------------------------------------------------------------------- 1 | ### How to make code blocks with syntax highlighting: 2 | \```java 3 | CODE HERE 4 | \``` 5 | Full formatting guide here https://support.discordapp.com/hc/en-us/articles/210298617 6 | 7 | 8 | 9 | ### 1.13 Changes/Primer 10 | https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a 11 | 12 | ### List of mod ideas 13 | https://docs.google.com/document/d/10EDeU8_gGPBNcmZg_m9QTCuiRee-Ifw8dNWUTlGqWlg/ 14 | 15 | ### Mod Tutorials/Guides 16 | https://darkhax.net/tag/mc-mod-tutorial?MMDDevPins 17 | 18 | https://wiki.mcjty.eu/modding/index.php?title=Main_Page - 1.10.2/1.11/1.12 Documentation 19 | 20 | https://github.com/McJty/ModTutorials/ - 1.8.9/1.9.4/1.10.2/1.11/1.12 21 | 22 | https://shadowfacts.net/tutorials/forge-modding-112/ - 1.10.2/1.11.2/1.12 23 | 24 | https://github.com/Shadows-of-Fire/How2Mod/blob/master/Instructions.txt/ 25 | 26 | https://github.com/TheGreyGhost/MinecraftByExample/ 1.8.9/1.10.2/1.11.2 27 | 28 | [https://bedrockminer.jimdo.com/modding-tutorials](https://web.archive.org/web/20170629194638/https://bedrockminer.jimdo.com/modding-tutorials) 1.7.10/1.8.9 29 | 30 | [http://www.wuppy29.com/minecraft/modding-tutorials/forge-modding/](https://web.archive.org/web/20181007042911/http://www.wuppy29.com/minecraft/modding-tutorials/forge-modding/) 1.3.2/1.4/1.5.1/1.6/1.7.10/1.8.9 31 | 32 | ### Java for complete beginners 33 | https://www.youtube.com/playlist?list=PL9DF6E4B45C36D411 34 | 35 | https://docs.oracle.com/javase/tutorial/java/concepts/ 36 | 37 | https://docs.oracle.com/javase/tutorial/java/javaOO/ 38 | 39 | https://docs.oracle.com/javase/tutorial/java/nutsandbolts/ 40 | 41 | The Oracle docs can be technical at times, if you're an absolute beginner, you might find something like CodeAcademy to be more helpful. 42 | 43 | ### Useful Gradle settings for Minecraft 44 | 45 | Where things go: 46 | The block itself goes in the minecraft block. 47 | The respective vars get defined in your gradle.properties, I suggest NOT putting the ones starting mc_ in your per project gradle.properties, do it in your user gradle.properties instead (That's the one in ~/.gradle on linux, or %userprofile%/.gradle on windows). 48 | 49 | What it does: 50 | 1) Lets you define how much RAM is given to the client or server when they're run with gradlew runClient/runServer. 51 | 2) Lets you enter your username/password and/or UUID when in dev mode. 52 | 3) Adds "nogui" when running runServer (Comment out/remove if not wanted). 53 | 54 | 55 | ```gradle 56 | if (project.hasProperty('mc_username')) { 57 | clientRunArgs += ['--username', project.mc_username] 58 | if (project.hasProperty('mc_password')) { 59 | clientRunArgs += ['--password', project.mc_password] 60 | } 61 | } 62 | if (project.hasProperty('mc_uuid')) { 63 | clientRunArgs += ['--uuid', project.mc_uuid] 64 | } 65 | 66 | // disable server gui 67 | serverRunArgs += 'nogui' 68 | 69 | // skip the screen to confirm that you want to load a world with missing registry entries 70 | serverJvmArgs += '-Dfml.doNotBackup=true' 71 | clientJvmArgs += '-Dfml.doNotBackup=true' 72 | 73 | // skip having to confirm on server 74 | serverJvmArgs += '-Dfml.queryResult=confirm' 75 | 76 | //skip jansi warnings in the log 77 | serverJvmArgs += '-Dlog4j.skipJansi=true' 78 | clientJvmArgs += '-Dlog4j.skipJansi=true' 79 | 80 | if (project.hasProperty('client_args')) { 81 | clientJvmArgs += project.client_args 82 | } 83 | if (project.hasProperty('server_args')) { 84 | serverJvmArgs += project.server_args 85 | } 86 | ``` 87 | 88 | ### Argument to remove "Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream" 89 | ```gradle 90 | -Dlog4j.skipJansi=true 91 | ``` 92 | 93 | ### CurseForge 94 | endpoint 95 | ```gradle 96 | repositories { 97 | maven { 98 | //fallback for almost everything, this is CurseForge :P 99 | name = "CurseForge" 100 | url = "https://minecraft.curseforge.com/api/maven/" 101 | } 102 | } 103 | 104 | . . . 105 | 106 | dependencies { 107 | deobfCompile "::" 108 | } 109 | ``` 110 | 111 | ### Adding Dependencies to your @Mod annotation 112 | Adding Dependencies to your @Mod annotation is as simple as setting the dependencies field to this: 113 | dependencies="required-after:forge@[minVersion,maxVersion)" 114 | 115 | Multiple dependencies are separated using ;, min and max version are optional. [, ] = included, (,) = excluded versions. you can also leave the min or max fields empty or omit the whole version range. 116 | keywords 117 | after = load this mod after the one specified, if present 118 | before = load this mod before the one specified, if present. 119 | 120 | Keywords can be prefixed with required-, which will force the specified modid to be present. 121 | 122 | For more info on the version ranges see https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402 123 | 124 | ### Version ranges 125 | Format used in version ranges strings (for dependencies for example) 126 | https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html 127 | 128 | ### Example buildscript for using Forge's ContainedDeps system 129 | https://github.com/JamiesWhiteShirt/clothesline/blob/master/build.gradle 130 | 131 | ### Item Rendering with GL 132 | 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. 133 | 134 | [More information and implementation here](https://gist.github.com/Shadows-of-Fire/aadd7a27d7df1c2f43eb226ea3b2dcdd) 135 | 136 | ### Git basics 137 | ###### Basic challenges to learn Git 138 | https://try.github.io/levels/1/challenges/1 139 | 140 | ###### Git clients 141 | Easy for new users 142 | [Github Desktop](https://desktop.github.com/) 143 | 144 | Mid-ranged 145 | [Sourcetree](https://www.sourcetreeapp.com/) 146 | 147 | Semi-advanced 148 | [GitKraken](https://www.gitkraken.com) 149 | 150 | 151 | ###### Using Git 152 | To clone an entire repo. 153 | ``git clone https://github.com/user/repo.git`` 154 | 155 | To find the clone url for a repo look for this green button on Github then click it and copy the link provided. 156 | ![alt text](https://cdn.discordapp.com/attachments/197165501741400064/401824959556747264/Screenshot_2018-01-13_19-48-03.png) 157 | 158 | To clone a repo with a certain branch. 159 | ``git clone -b branchName https://github.com/user/repo.git`` 160 | 161 | To stage all changes. 162 | ``git add *`` 163 | 164 | To stage some changes. 165 | ``git add ifItsInAFolder/file.txt`` 166 | 167 | To commit changes to the local repo with a message. 168 | ``git commit -m "Here is a nice message"`` 169 | 170 | To push all changes to github. 171 | ``git push`` 172 | 173 | ###### Removing sensitive data from your git repo 174 | https://help.github.com/articles/remove-sensitive-data/ 175 | 176 | ### MinecraftForge documentation 177 | https://mcforge.readthedocs.io/en/latest/ 178 | 179 | 180 | Note that version and jarname needed for the `deobfCompile` relies on the jarname being in the format: `modid-mcversion-modversion.jar`. This is not always the case, meaning that it can be difficult to figure out the correct infomation to add. There is a tool that figures out this infomation for you: 181 | https://github.com/Wyn-Price/CurseForge-Maven-Helper/ 182 | ### A way to check if you are running in a dev environment 183 | ```java 184 | public static boolean isDevEnv() { 185 | return (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); 186 | } 187 | ``` 188 | 189 | ### Tool to help work out Curseforge's Maven. 190 | Works out dependencies and gives you what to put in your build.gradle 191 | Wyn-Price's client side tool [releases](https://github.com/Wyn-Price/CurseForge-Maven-Helper/releases/latest) [source](https://github.com/Wyn-Price/CurseForge-Maven-Helper/) 192 | Darkhax's FireFox extension [releases](https://addons.mozilla.org/en-US/firefox/addon/bettercf) 193 | 194 | ### Setting up a modding env. in Intellij 195 | https://streamable.com/hlxy0 196 | 197 | ### Why you should never use OpenGL directly or GlStateManager.pushAttrib/popAttrib 198 | https://gist.github.com/JamiesWhiteShirt/ff2521936a83ebc10fd6893e206a6770 199 | 200 | ### Updating gradle version to 4.9 201 | ```gradlew wrapper --gradle-version 4.9``` 202 | 203 | ### Means of integration with other mods 204 | https://gist.github.com/strikerrocker/873f81e686f391662f39b83efee136ff 205 | 206 | ### Converting lang from <1.13 to 1.13. 207 | https://github.com/ichttt/MCLang2Json 208 | `marco@invader ~ % sed -Ee '1i {' -e '$a }' -e 's|^tile\.|block.|g;s|\.name=|=|g;s|["\]|\\\0|g;s|^([^=]*)?=(.*)$| "\1": "\2",|g;$ s|,$||g' 209 | some.key=abc;',\ 238"";'2 ` 210 | 211 | result 212 | `{ 213 | "some.key": "abc;',\\ 238\"\";'2" 214 | }` 215 | 216 | ### Why does't my Event Handler Work!!?? 217 | https://cdn.discordapp.com/attachments/179315645005955072/475010493824892948/unknown.png 218 | 219 | ## Registering using @ObjectHolder annotation on class 220 | ```java 221 | @GameRegistry.ObjectHolder(WingsMod.ID) 222 | public final class WingsItems { 223 | private WingsItems() {} 224 | 225 | public static final Item FAIRY_DUST = Items.AIR; 226 | 227 | public static final Item AMETHYST = Items.AIR; 228 | 229 | public static final Item BAT_BLOOD = Items.AIR; 230 | ``` 231 | Those field names are the registry names 232 | ObjectHolder on class has forge looks at fields for reference types that are a registry type 233 | 234 | ### Tool doing remappings 235 | https://github.com/MinecraftForge/Remapper 236 | 237 | ### 1.12 snapshots to stable remappings 238 | https://gist.github.com/strikerrocker/1e31558b35dc65c49fb56fddca9fcf5d 239 | 240 | ### Using the debugger 241 | Intellij: 242 | https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html 243 | https://www.jetbrains.com/help/idea/debugging-code.html 244 | 245 | Eclipse: 246 | http://www.vogella.com/tutorials/EclipseDebugging/article.html 247 | https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php 248 | 249 | ### Querying MCP mappings and its history 250 | If you need to query MCP names or their history, or help give a name to something that has not been named yet, you may want to use the bot they have in this server. Read their readme and use !help to learn more (and keep the bot spam in the dedicated channel.) -- https://discord.gg/h4whGT9 251 | 252 | ### MCP mapping tools 253 | http://mcp.thiakil.com/index.html 254 | 255 | http://bspk.rs/MC/MCPMappingViewer/index.html 256 | 257 | ### Minecraft dev IDEA plugin 258 | https://plugins.jetbrains.com/plugin/8327/ 259 | 260 | Heads up: an update changed the default inspection settings to disable the Minecraft Forge inspections. If you somehow reset your settings then you will lose the inspections. If you use these inspections, you can enable them by going to Settings > Editor > Inspections, then finding the Minecraft Forge group and enabling the ones you were using. 261 | 262 | ### Java naming conventions 263 | http://www.oracle.com/technetwork/java/codeconventions-135099.html 264 | 265 | ### Minecraft energy types conversion rates 266 | https://gist.github.com/DeflatedPickle/403e1eb0bb0bed7f2509142e63630726/ 267 | 268 | ### Live class reloading 269 | Use live class reloading to avoid having to restart the game for most changes in your code. Start the game with a debugger, make your changes, save, then (depending on your IDE) 270 | 271 | Intellij: Click the button left to the launch configurations (Build Project). You will be prompted to reload classes. Accept. 272 | 273 | Eclipse: Your IDE is likely configured to build automatically, all you have to do is save. If not, select Project -> Build All. 274 | 275 | For live resource reloading, build your project first, then press F3+T in-game. 276 | 277 | ### Gradle generation of forge javadocs 278 | http://maven.thiakil.com/forge-1.12-javadoc/ 279 | 280 | ### Minecraft Annotations 281 | https://github.com/mezz/MinecraftAnnotations/ 282 | 283 | ### Example of how to register a data fixer 284 | to migrate your tile entity to a new ID, in case you have registered it in the wrong domain and are seeing the error now: https://github.com/TeamTwilight/twilightforest/blob/3d141a2bfb312e1d4292ab1ebc21880703945ff7/src/main/java/twilightforest/TwilightForestMod.java#L134-L196 285 | 286 | ### ObjectHolders and registry class 287 | Simple explanation and exemple of an object holder and registry class 288 | https://gist.github.com/TehNut/dad98543d72d9338d780a24e087e9c7e/ 289 | 290 | ### Information on the vanilla debug profiler 291 | https://redd.it/5mxn51/ 292 | 293 | ### Why are 32 x 32 textures bad? 294 | https://latmod.com/moddingtutorials/non-16x-textures/ 295 | 296 | ### Smelting JSON Recipe 1.12 297 | Allows you to use JSONs for smelting recipes on 1.12 298 | The JSONs follow the exact same format as vanilla 1.13 ones. 299 | https://gist.github.com/Bluexin/c4960cf81b7720afbda0b1fbcfdd0450 300 | 301 | ### Naming assets 302 | names in mod assets *MUST* be in lower case 303 | 304 | ### Recipe conditions 305 | Great resource for all forms of recipe json conditions 306 | https://github.com/Vazkii/Botania/tree/master/src/main/resources/assets/botania/recipes 307 | 308 | ### Ore Dict match 309 | ```java 310 | public static boolean oreDictMatches(ItemStack stack1, ItemStack stack2){ 311 | if (OreDictionary.itemMatches(stack1, stack2, true)){ 312 | return true; 313 | } 314 | else { 315 | int[] oreIds = OreDictionary.getOreIDs(stack1); 316 | for (int i = 0; i < oreIds.length; i ++){ 317 | if (OreDictionary.containsMatch(true, OreDictionary.getOres(OreDictionary.getOreName(oreIds[i])), stack2)){ 318 | return true; 319 | } 320 | } 321 | } 322 | return false; 323 | } 324 | ``` 325 | 326 | ### @SideOnly annotation 327 | Gist that glosses over a lot of the @SideOnly annotation system. 328 | https://gist.github.com/TehNut/4e7b60e0a43c39a709b8b59ae48cb493 329 | 330 | ### Converting exported Techne models to other formats 331 | https://gist.github.com/ljfa-ag/cd137f5c741a0cfb0ead 332 | 333 | ### Forge info by version 334 | ![](https://github.com/MinecraftModDevelopment/Modding-Resources/raw/master/Version%20Info.png) 335 | 336 | ### Bitshifting tutorial 337 | http://latmod.com/tutorials/bitshifting/ 338 | 339 | ### JSon linter 340 | http://jsonlint.com/ 341 | 342 | ### JEI Discord to ask questions 343 | https://discord.gg/EevEdSG 344 | 345 | ### Recipe creation/conversion tools 346 | ###### Vanilla recipe generation tool (replace the items with the mods own) 347 | https://crafting.thedestruc7i0n.ca/ 348 | 349 | ###### Converting old recipe code into json 350 | https://gist.github.com/williewillus/a1a899ce5b0f0ba099078d46ae3dae6e 351 | 352 | ### Lang to Json converter 353 | https://tterrag.com/lang2json/ 354 | 355 | ### Condition factories registered from JSON 356 | https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/test/resources/assets/crafting_system_test/recipes/_factories.json#L8-L10 357 | 358 | ### Getting a fluid texture 359 | ```java 360 | TextureAtlasSprite texture = ModelLoader.defaultTextureGetter().apply(fluid.getFluid().getFlowing(fluid)); 361 | ``` 362 | 363 | ### Preventing specific entities from interacting with your fluid 364 | ```java 365 | public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) { 366 | //In this example, prevents Players from interacting with the fluid 367 | return !(entity instanceof EntityPlayer); 368 | } 369 | ``` 370 | You can override this method in your Fluid's Block class to make it so that specific entites don't interact with your fluid. The above example makes it so that players do not interact with the fluid, but other entities will continue to do so. You may need additional checks to ensure that other entities are actually inside the fluid, because the example above as written will always return true for entites other than the player, even if they are not actually inside the fluid. 371 | 372 | ### Preventing remote movement on entities 373 | set "PreventRemoteMovement" to true on the entity data, i.e. make `item.getEntityData().getBoolean("PreventRemoteMovement")`return true, and magnets should not grab things from your plates. That was agreed upon somewhere in a github issue on ImmEng, and is supported by most mods with magnets 374 | 375 | ### 1.11 to 1.12 class name changes 376 | https://github.com/ModCoderPack/MCPBot-Issues/wiki/1.11.0-to-1.12.0-migration 377 | 378 | ### Mob stuff 379 | ###### AI Task 380 | The red task will run when the entity#getAttackTarget != null. And as long as the target is null, the green tasks will run in order to set an attack target. 381 | so if you want to set a target, you add a target task. But if you want to modify how they attack or add a task to move somewhere, you add a task. 382 | 383 | ![alt text](https://cdn.discordapp.com/attachments/179315645005955072/399651904428310528/tasks.png) 384 | 385 | ###### Summoning mobs 386 | ```java 387 | public static void summonMobsOnBreakBlock(EntityMob mob, int loop, World worldIn, BlockPos pos) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { 388 | 389 | 390 | for (int i = 0; i < loop; i++) { 391 | mob=mob.getClass().getConstructor(World.class).newInstance(worldIn); 392 | mob.setPosition(pos.getX(), pos.getY(), pos.getZ()); 393 | mob.setAlwaysRenderNameTag(true); 394 | worldIn.spawnEntityInWorld(mob); 395 | } 396 | 397 | } 398 | ``` 399 | 400 | ###### Mob ore drop 401 | ```java 402 | public class MobOreDrops { 403 | 404 | @SubscribeEvent 405 | public void onEntityDrop(LivingDropsEvent event) { 406 | if(event.entityLiving instanceof EntityCreature) { 407 | Random r = new Random(); 408 | List ores = OreDictionary.getOres("oreIron"); 409 | if (ores == null || ores.size() <= 0) { return; } 410 | Item oreItem = (Item) ores.get(0).getItem(); 411 | event.entityLiving.dropItem(oreItem, r.nextInt(2)); 412 | } 413 | } 414 | 415 | } 416 | ``` 417 | 418 | ### .gitignores for everything 419 | https://www.gitignore.io/ 420 | 421 | ### Useful ASM coremodding ressources 422 | https://www.youtube.com/watch?v=FgaxnpD-DC4/ 423 | 424 | https://www.youtube.com/watch?v=75_rJYLj5AU/ 425 | 426 | *NOT FOR BEGINNERS!!!* 427 | 428 | ### Polygon function 429 | https://stackoverflow.com/questions/8721406/how-to-determine-if-a-point-is-inside-a-2d-convex-polygon#8721483 430 | 431 | #Checking a command sender permission level 432 | ```java 433 | sender.canUseCommand(3, this.getName()) 434 | ``` 435 | You can also override `getRequiredPermissionLevel` if you want to set the permission required to run the command 436 | 437 | ### Animations in resource packs 438 | http://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack#Animation_Properties 439 | 440 | ### Rendering a basic block 441 | http://pastebin.com/N1YRRcm7 442 | 443 | ### isOpaqueCube, isNormalCube, isFullCube ? 444 | isOpaqueCube - should be false if your block isn't a full 1x1x1 cube or has transparent/cutout texture, otherwise your blocks surroundings will look bad 445 | 446 | isNormalCube - you don't need to override that. Calls isFullCube. 447 | 448 | isFullCube - same thing really, but it handles game logic like suffocation, pushing you out of blocks, and also other render stuff like lighting 449 | 450 | basically, these method names (isBlockNormalCube, isNormalCube, isFullCube, isFullBlock, isOpaqueCube) are confusing. Just override these two and you should be fine 451 | 452 | ### OpenGL11 Rendering Tutorial 453 | http://www.glprogramming.com/red/index.html 454 | 455 | ### Neighbor block caching for stuff like context-sensitive render states 456 | ```java 457 | public final class NeighborCache { 458 | private final Map cache = new HashMap<>(); 459 | 460 | private final BlockPos origin; 461 | private final Function computer; 462 | 463 | public NeighborCache(BlockPos origin, Function generator) { 464 | this.origin = origin.toImmutable(); 465 | this.computer = pos -> generator.apply(this.origin.add(pos)); 466 | } 467 | 468 | public NeighborCache(Function generator) { 469 | this(BlockPos.ORIGIN, generator); 470 | } 471 | 472 | public T get(BlockPos offset) { 473 | return cache.computeIfAbsent(offset, computer); 474 | } 475 | 476 | public T get(int x, int y, int z) { 477 | return get(new BlockPos(x, y, z)); 478 | } 479 | 480 | public T get(EnumFacing offset) { 481 | return get(BlockPos.ORIGIN.offset(offset)); 482 | } 483 | 484 | public T get(EnumFacing offset1, EnumFacing offset2) { 485 | return get(BlockPos.ORIGIN.offset(offset1).offset(offset2)); 486 | } 487 | 488 | public T get(EnumFacing offset1, EnumFacing offset2, EnumFacing offset3) { 489 | return get(BlockPos.ORIGIN.offset(offset1).offset(offset2).offset(offset3)); 490 | } 491 | } 492 | ``` 493 | Usage: 494 | ```java 495 | NeighborCache stateCache = new NeighborCache<>(pos, world::getBlockState); 496 | NeighborCache tileCache = new NeighborCache<>(pos, world::getTileEntity); 497 | ``` 498 | ### Rendering Handler registry 499 | ```java 500 | RenderingRegistry.registerEntityRenderingHandler(GolemBase.class, RenderGolem::new); 501 | ``` 502 | ### Models 1.7.2 503 | http://jabelarminecraft.blogspot.com/p/complex-entity-models-including.html 504 | 505 | ### Basic Item Model 506 | ```json 507 | { 508 | "parent": "item/generated", 509 | "textures": { 510 | "layer0": "modid:items/texture_name" 511 | } 512 | } 513 | ``` 514 | ### Troubleshooting Block and Item Rendering 515 | http://greyminecraftcoder.blogspot.co.uk/2015/03/troubleshooting-block-and-item-rendering.html 516 | 517 | ### Making a flying armor 518 | http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2678865-help-how-to-apply-flight-to-an-armor-in-eclipse-1 519 | more concise but you need to know more Java: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2650028-trying-to-make-an-item-that-allows-flight#c7 520 | 521 | ### Coding practice 522 | https://www.hackerrank.com/ 523 | 524 | ### Troubleshooting Eclipse development with other mods 525 | https://github.com/MinecraftForge/ForgeGradle/issues/519#issuecomment-423849322 526 | 527 | ### Collection of Useful Gradle Scripts 528 | https://github.com/MinecraftModDevelopment/Gradle-Collection 529 | 530 | ### Version Support Coverage by Author 531 | https://docs.google.com/spreadsheets/d/1gQY1EzYwOXpfehluqujwh_32regA798RHmdlgG6rdKU/edit#gid=0 532 | 533 | ### Curse Profit Calculator 534 | https://cobalt.darkhax.net/curse-profit-calc/ 535 | 536 | ### Curse Author Statistics (Modmuss's CurseTracker) 537 | https://cursetracker.modmuss50.me/ 538 | -------------------------------------------------------------------------------- /eclipse.md: -------------------------------------------------------------------------------- 1 | | Version | Name | Minimum Java | Maximum Java | Buildship (Bundled) | Buildship (Supported) | Notes | 2 | |---------|----------|--------------|----------------|-----------------------|-----------------------|-------| 3 | | [1.0](https://archive.eclipse.org/eclipse/downloads/drops/R-1.0-200111070001/) | | 1.3 | 1.6? | None | None | Note #1 | 4 | | [2.0.2](https://archive.eclipse.org/eclipse/downloads/drops/R-2.0.2-200211071448/) | | 1.3 | 1.6? | None | None | [2.0.2.1 patch for windows](https://archive.eclipse.org/eclipse/downloads/drops/P-2.0.2.1-200301091014/), crash on newer than Java 1.4.1, Note #1 | 5 | | [2.1.3](https://archive.eclipse.org/eclipse/downloads/drops/R-2.1.3-200403101828/) | | 1.3 | 1.6? | None | None | Note #1 | 6 | | [3.0.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.0.2-200503110845/) | | 1.4.1 | 1.6? | None | None | Note #1 | 7 | | [3.1.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.1.2-200601181600/) | | 1.4.2 | 1.6? | None | None | Note #1 | 8 | | [3.2.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/) | | 1.4.2 | 1.6? | None | None | | 9 | | [3.3.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/) | Europa | 1.4.2 | 1.6 | None | None | | 10 | | [3.4.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/) | Ganymede | 1.4.2 | 1.6 | None | None | | 11 | | [3.5.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/) | Galileo | 1.4.2 | 1.6 | None | None | | 12 | | [3.6.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/) | Helios | 1.5 | 1.7 | None | 1.x | First to support Marketplace Client & BuildShip| 13 | | [3.7.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/) | Indigo | 1.5 | 1.7 | None | 1.x | | 14 | | [3.8.2](https://archive.eclipse.org/eclipse/downloads/drops/R-3.8.2-201301310800/) | Juno | 1.5 | 1.7 | None | 1.x | | 15 | | [4.0](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.0-201007271520/) | | 1.5? | 1.7 | None | 1.x? | | 16 | | [4.1.2](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.1.2-201202230900/) | | 1.5? | 1.7 | None | 1.x? | | 17 | | [4.2.2](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.2-201302041200/) | Juno | 1.5 | 1.7 | None | 1.x, 2.x | First version available on the eclipse-installer | 18 | | [4.3.2](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.3.2-201402211700/) | Kepler | 1.6 | 1.7 (1.8 with patch)| None | 1.x, 2.x, 3.x | Has [optional Java 8 support patch](https://archive.eclipse.org/eclipse/downloads/drops4/P20140317-1600/) | 19 | | [4.4.1](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.4.1-201409250400/) | Luna | 1.6 | 1.8 | None | 1.x, 2.x, 3.x | | 20 | | [4.5.2](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.5.2-201602121500/) | Mars | 1.7 | 1.8 | None | 1.x, 2.x, 3.x | | 21 | | [4.6.3](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.6.3-201703010400/) | Neon | 1.8 | 1.8 | 1.0.21 | 1.x, 2.x, 3.x | | 22 | | [4.7.3a](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.7.3a-201803300640/) | Oxygen | 1.8 | 10 | 2.2.1 | 2.x, 3.x | | 23 | | [4.8](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.8-201806110500/) | Photon | 1.8 | 10 | 2.2.1 | 2.x, 3.x | | 24 | | [4.9](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/) | 2018-09 | 1.8 | 10 | 2.2.1 | 2.x, 3.x | Last build with 32 bit support | 25 | | [4.10](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/) | 2018-12 | 1.8 | 11 | 3.0.0 | 3.x | | 26 | | [4.11](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.11-201903070500/) | 2019-03 | 1.8 | 11 | 3.0.1 | 3.x | | 27 | | [4.12](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.12-201906051800/) | 2019-06 | 1.8 | 12 | 3.1.0 | 3.x | | 28 | | [4.13](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.13-201909161045/) | 2019-09 | 1.8 | 12 | 3.1.2 | 3.x | | 29 | | [4.14](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.14-201912100610/) | 2919-12 | 1.8 | 13 | 3.1.3 | 3.x | | 30 | | [4.15](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.15-202003050155/) | 2020-03 | 1.8 | 13 | 3.1.3 | 3.x | | 31 | | [4.16](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.16-202006040540/) | 2020-06 | 1.8 | 14 | 3.1.4 | 3.x | | 32 | | [4.17](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.17-202009021800/) | 2020-09 | 11 | 14 | 3.1.4 | 3.x | | 33 | | [4.18](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/) | 2020-12 | 11 | 15 | 3.1.4 | 3.x | | 34 | | [4.19](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.19-202103031800/) | 2021-03 | 11 | 15 | 3.1.5 | 3.x | | 35 | | [4.20](https://archive.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/) | 2021-06 | 11 | 16 | 3.1.5 | 3.x | | 36 | | [4.21](https://download.eclipse.org/eclipse/downloads/drops4/S-4.21M1-202107090030/) | 2021-09 | 11 | 16 | 3.1.5 | 3.x | | 37 | 38 | |BuildShip Version | Minimum Gradle | Maximum Gradle | 39 | |------------------|----------------|----------------| 40 | | 1.0.21 | 1.0 | ??? | 41 | | 2.2.2 | ??? | ??? | 42 | | 3.1.5 | ??? | ??? | 43 | 44 | - [Buildship Installation instructions](https://github.com/eclipse/buildship/blob/master/docs/user/Installation.md#installing-from-eclipseorg-update-site) 45 | - [Marketplace Client](https://www.eclipse.org/mpc/) 46 | 47 | - [eclipse.ini](https://wiki.eclipse.org/Eclipse.ini) 48 | - [FAQ How do I run Eclipse?](https://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F) 49 | - [FAQ How do I increase the heap size available to Eclipse?](https://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F) 50 | - [FAQ How do I increase the permgen size available to Eclipse?](https://wiki.eclipse.org/FAQ_How_do_I_increase_the_permgen_size_available_to_Eclipse%3F) 51 | 52 | - Note #1: Must be started with -vm to work on 64 bit, or newer java (upto 8.x) 53 | -------------------------------------------------------------------------------- /eventhandler-alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftModDevelopment/Modding-Resources/e8fabc90d8f7a115b2a9d47935ad25c801b90b65/eventhandler-alt.png -------------------------------------------------------------------------------- /eventhandler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftModDevelopment/Modding-Resources/e8fabc90d8f7a115b2a9d47935ad25c801b90b65/eventhandler.png -------------------------------------------------------------------------------- /idea.md: -------------------------------------------------------------------------------- 1 | # Information on Jetbrains IDEA 2 | ## IDEA Ultimate 2021.1.3 (Last with 32 Bit support) 3 | ### Linux 4 | - [tar.gz](https://download.jetbrains.com/idea/ideaIU-2021.1.3.tar.gz) 5 | - [without JBR (tar.gz)](https://download.jetbrains.com/idea/ideaIU-2021.1.3-no-jbr.tar.gz) 6 | ### Windows 7 | - [exe](https://download.jetbrains.com/idea/ideaIU-2021.1.3.exe) 8 | - [zip](https://download.jetbrains.com/idea/ideaIU-2021.1.3.win.zip) 9 | ### macos 10 | - [dmg](https://download.jetbrains.com/idea/ideaIU-2021.1.3.dmg) 11 | - [Apple Silicon (dmg)](https://download.jetbrains.com/idea/ideaIU-2021.1.3-aarch64.dmg) 12 | 13 | ## IDEA Community 2021.1.3 (Last with 32 Bit support) 14 | ### Linux 15 | - [tar.gz](https://download.jetbrains.com/idea/ideaIC-2021.1.3.tar.gz) 16 | - [without JBR (tar.gz)](https://download.jetbrains.com/idea/ideaIC-2021.1.3-no-jbr.tar.gz) 17 | ### Windows 18 | - [exe](https://download.jetbrains.com/idea/ideaIC-2021.1.3.exe) 19 | - [zip](https://download.jetbrains.com/idea/ideaIC-2021.1.3.win.zip) 20 | ### macos 21 | - [dmg](https://download.jetbrains.com/idea/ideaIC-2021.1.3.dmg) 22 | - [Apple Silicon (dmg)](https://download.jetbrains.com/idea/ideaIC-2021.1.3-aarch64.dmg) 23 | 24 | ## Notes 25 | - [End of Support for 32-bit Operating Systems in IntelliJ-based IDEs](https://blog.jetbrains.com/idea/2021/04/end-of-support-for-32-bit-operating-systems-in-intellij-based-ides/) 26 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | # Resource Index 2 | 3 | This page serves as a central index for the various resources we share and provide. 4 | 5 | ## Community Wiki/Guides 6 | - [**Forge Community Wiki**](https://forge.gemwire.uk/wiki/Main_Page) 7 | - [**Custom Dimensions Guide by Commoble**](https://gist.github.com/Commoble/ac7d7b57c9cbbfcae310c4ab110c3cc0) 8 | - [A Barebones Example Mod for Structure Generation](https://github.com/TelepathicGrunt/StructureTutorialMod) 9 | - [1.14/1.15 Modding Guide (Very Limited Information but Still Good)](https://learn2forgemod.weebly.com/) 10 | - [Mixin Documentation](https://github.com/SpongePowered/Mixin/wiki) 11 | - [An Overview on All World Generation](https://www.youtube.com/watch?v=Tk9zuL-cpoY) 12 | - [An in depth document on how layers work as a whole](http://mc-server.xoft.cz/docs/Generator.html) 13 | - [A research paper on GenLayers](https://github.com/Cubitect/cubiomes/blob/master/LayerSummary.pdf) 14 | 15 | ## Tutorials 16 | - [**Darkhax's Tutorials**](https://darkhax.net/tag/mc-mod-tutorial?MMDDevPins) - 1.8/1.9/1.10/1.11/1.12 17 | - [**McJty's Tutorials**](https://wiki.mcjty.eu/modding/index.php?title=Main_Page) - 1.10/1.11/1.12/1.14/1.15/1.16/1.17 18 | - [**ShadowFacts's Tutorials**](https://shadowfacts.net/tutorials/forge-modding-112/) - 1.10/1.11/1.12 19 | - [**The Grey Ghost's Minecraft By Example**](https://github.com/TheGreyGhost/MinecraftByExample/) - 1.8/1.10/1.11/1.12/1.14/1.15/1.16 20 | - [**Bedrock Miner's Tutorials (Archived)**](https://web.archive.org/web/20170629194638/https://bedrockminer.jimdo.com/modding-tutorials) - 1.7/1.8 21 | - [**Wuppy's Tutorials (Archived)**](https://web.archive.org/web/20181007042911/http://www.wuppy29.com/minecraft/modding-tutorials/forge-modding/) - 1.3/1.4/1.5/1.6/1.7/1.8 22 | - [**Forge's Old Wiki (Archived)**](https://web.archive.org/web/20160302194303/http://www.minecraftforge.net/wiki/Main_Page) - 1.3/1.4/1.5/1.6/1.7 23 | - [**Forge's Official Docs (Latest)**](https://mcforge.readthedocs.io/en/latest/) 24 | - [**Forge's Official Docs (1.12.x)**](https://mcforge.readthedocs.io/en/1.12.x/) 25 | - [**Forge's Official Docs (1.13.x)**](https://mcforge.readthedocs.io/en/1.13.x/) 26 | - [**Forge's Official Docs (1.14.x)**](https://mcforge.readthedocs.io/en/1.14.x/) 27 | - [**Forge's Official Docs (1.15.x)**](https://mcforge.readthedocs.io/en/1.15.x/) 28 | - [**Forge's Official Docs (1.16.x)**](https://mcforge.readthedocs.io/en/1.16.x/) 29 | - **VikeStep's ASM Guide** - [Part 1](https://www.youtube.com/watch?v=FgaxnpD-DC4) - [Part 2](https://www.youtube.com/watch?v=75_rJYLj5AU) 30 | 31 | ## Helpful world-gen tools and resources 32 | 33 | This website allows you to generate many types of datapacks files (including everything worldgen related) so you don't have to manually type out json configuration for everything. 34 | https://misode.github.io/ 35 | 36 | This website (Snowcapped) lets you interact with biome layouts and splines: 37 | https://snowcapped.jacobsjo.eu/ 38 | 39 | Snowcapped wiki: 40 | https://github.com/jacobsjo/snowcapped/wiki 41 | 42 | This website lets you edit density functions visually so you can see how density functions connect 43 | https://df-editor.jacobsjo.eu/1_19/ 44 | 45 | This Github repository has all of the default worldgen files 46 | https://github.com/misode/mcmeta/tree/data-json 47 | 48 | Helpful tutorials 49 | This video explains how 1.18 terrain generation is done in a nutshell: 50 | https://www.youtube.com/watch?v=CSa5O6knuwI 51 | 52 | This video explains how to add new dimensions in 1.18.2 (use https://misode.github.io/ to generate files for 1.19): 53 | https://www.youtube.com/watch?v=7x4orazkO_s 54 | 55 | This guide explains how to add single piece structures into worldgen: 56 | https://misode.github.io/guides/adding-custom-structures/ 57 | 58 | Another guide for making structures: 59 | https://gist.github.com/GentlemanRevvnar/98a8f191f46d28f63592672022c41497 60 | 61 | This guide explains the basics of the noise router: 62 | https://misode.github.io/guides/noise-router/ 63 | 64 | This guide explains how placed features work and all of their configurations: 65 | https://misode.github.io/guides/placed-features/ 66 | 67 | Forge Biome Modifiers: 68 | https://forge.gemwire.uk/wiki/Biome_Modifiers#Builtin_Biome_Modifier_Types 69 | 70 | 2 tutorial on how to make worldgen structures: 71 | https://github.com/TelepathicGrunt/StructureTutorialMod/ 72 | https://misode.github.io/guides/adding-custom-structures/ 73 | 74 | ## Articles and Resources 75 | - [Forge Class Remapper](https://github.com/SizableShrimp/Forge-Class-Remapper) - The Forge Class Remapper is a tool used in order to update class names from 1.16.5 (MCP class names) to 1.17+ Mojang mappings. 76 | - [**List of Mod Ideas**](https://docs.google.com/document/d/10EDeU8_gGPBNcmZg_m9QTCuiRee-Ifw8dNWUTlGqWlg/edit) - A giant list of mod ideas you may use in your projects. 77 | - [**Java for Complete Beginners**](https://www.youtube.com/playlist?list=PL9DF6E4B45C36D411) - A playlist of videos on YouTube that will teach you how to develop in Java. This is a very beginner friendly resource. 78 | - [**Oracle's Java Tutorials**](https://docs.oracle.com/javase/tutorial/) - These docs can be very technical, and are not friendly to new developers. 79 | - [**Oracle's Naming Conventions**](https://www.oracle.com/technetwork/java/codeconventions-135099.html) 80 | - [**How to use ObjectHolders**](https://gist.github.com/TehNut/dad98543d72d9338d780a24e087e9c7e/) - A guide on object holders, and how to effectively use them. 81 | - [**Why Does Side Only Exist?**](https://gist.github.com/TehNut/4e7b60e0a43c39a709b8b59ae48cb493) - An overview of what the SideOnly annotation is, and why it exists. 82 | - [**Why 32x Textures are Bad**](https://latmod.com/moddingtutorials/non-16x-textures/) - A technical breakdown of why 32x textures should be avoided. 83 | - [**Vanilla's Built In Profiler**](https://www.reddit.com/r/feedthebeast/comments/5mxn51/vanilla_has_an_built_in_profiler_that_not_a_lot/?st=jvpsruh4&sh=bb7c1846) - Vanilla Minecraft has it's own debug profiler. This post explains what it is, and how to use it. 84 | - [**Energy Conversion Rates**](https://gist.github.com/DeflatedPickle/403e1eb0bb0bed7f2509142e63630726/) - A table of energy conversion rates, such as RF to Joules. 85 | - [**1.13 Changes & Primer**](https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a) - A break down of all the changes in 1.13, and how to adapt to them. 86 | - [**Maven Version Ranges**](https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html) - Format used in version range strings, for dependencies. 87 | - [**Bitshifting Tutorial**](https://latmod.com/tutorials/bitshifting/) - What bitshifting is, and how it works. 88 | - [**OpenGL11 Rendering Tutorial**](http://www.glprogramming.com/red/index.html) - A technical tutorial for OpenGL 11. 89 | - [**Polygon Point Functions**](https://web.archive.org/web/20161108113341/https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html) - An archive of some documentation on doing polygon point calculations. 90 | - [**Animated Texture Format**](https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack#Animation_Properties) - Documentation on the animated texture format. 91 | - [**Forge Recipe Factory Example**](https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/test/resources/assets/crafting_system_test/recipes/_factories.json) - An example of how to add new recipe factories to forge. 92 | - [**Forge Gradle Info by Version**](https://github.com/MinecraftModDevelopment/Modding-Resources/blob/master/version_info.md) - A list of forge gradle versions and relevant usage info. 93 | - [**Forge 1.12.2 (2768) JavaDocs**](http://maven.thiakil.com/forge-1.12-javadoc/) - The Forge 1.12.2 (version 2768) Javadocs. 94 | - [**Forge 1.12.2 (2847) JavaDocs**](https://democat3457.github.io/ForgeDocs/1.12/index.html) - The Forge 1.12.2 (version 2847) Javadocs. 95 | - [**Why Doesn't My Event Handler Work!!??**](https://raw.githubusercontent.com/MinecraftModDevelopment/Modding-Resources/master/eventhandler.png) - A simple flow chart explaining how event handlers work. 96 | - [**Removing Sensitive Data From Git**](https://help.github.com/en/articles/removing-sensitive-data-from-a-repository) - How to remove sensitive data from your git repo. 97 | - [**Learning Git**](https://try.github.io/) - A collection of resources to learn git. 98 | - [**Forge's contained deps example**](https://github.com/JamiesWhiteShirt/clothesline/blob/master/build.gradle) - An example script that uses contained dependencies. 99 | - [**Troubleshooting Json Models**](https://greyminecraftcoder.blogspot.com/2015/03/troubleshooting-block-and-item-rendering.html) - How to debug broken Json models. 100 | - [**Old (1.7.2) Models**](https://jabelarminecraft.blogspot.com/p/complex-entity-models-including.html) - Documentation on the old way of doing models. 101 | - [**IntelliJ Debugging**](https://www.jetbrains.com/help/idea/debugging-code.html) - How to debug with the IntelliJ IDE. 102 | - [**Eclipse Debugging**](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) - How to debug with the Eclipse IDE. 103 | - [**Why you should never use OpenGL directly, or GlStateManager.pushAttrib/popAttrib**](https://gist.github.com/JamiesWhiteShirt/ff2521936a83ebc10fd6893e206a6770) - A breakdown on why you should always use the GlStateManager instead of OpenGL directly. Also covers why push/pop attrib is broken. 104 | - [**Common 1.12 Mapping Changes**](https://gist.github.com/strikerrocker/1e31558b35dc65c49fb56fddca9fcf5d) - Some of the more common methods that have been remapped/changes in 1.12. 105 | - [**Mod Dependencies**](https://gist.github.com/strikerrocker/873f81e686f391662f39b83efee136ff) - How to load other mods into your dev environment as build dependencies. 106 | - [**Good Practices in MC Modding**](https://wiki.modded-mc.com/books/general-info/page/good-practices-in-minecraft-modding) - Some general practices that are advisable to avoid problems and make your code readable. 107 | 108 | ## General Tools 109 | - [**Thiakil's MCP Mapping Viewer**](http://mcp.thiakil.com/index.html) - Lets you quickly search for info on MCP and SRG mapping names. 110 | - [**Bspkrs's MCP Mapping Viewer (Issue Tracker, you need to copmpile it now days)**](https://github.com/bspkrs/MCPMappingViewer/issues/31) - Lets you search through MCP mappings locally. 111 | - [**SheDaniel's Mapping and Dependency Tools**](https://linkie.shedaniel.me/mappings) Provides tools to get dependency versions for the different API's and mapping tools for porting mods/converting mappings. 112 | - [**Minecraft IDEA Plugin**](https://plugins.jetbrains.com/plugin/8327/) - Adds specialized support for Minecraft in IDEA. This is not required, but usually recommended. 113 | - [**Techne Model Conversion**](https://gist.github.com/ljfa-ag/cd137f5c741a0cfb0ead) - A pearl script for converting techne models to other model formats. 114 | - [**JsonLint**](http://jsonlint.com/) - A linter for Json. Let's you validate and format json files. 115 | - [**Lang2Json**](https://tterrag.com/lang2json/) - Converts old .lang files to the new json format. 116 | - [**Curse Profit Calculator**](https://cobalt.darkhax.net/curse-profit-calc/) - Allows you to quickly calculate curse profit by project over a period of time. Comes with several ways to export the data. 117 | - [**Author Version Coverage Sheet**](https://docs.google.com/spreadsheets/d/1gQY1EzYwOXpfehluqujwh_32regA798RHmdlgG6rdKU/edit#gid=0) - A google sheet which can be used to visualize all versions a mod author does/doesn't support with their mods. This is especially useful when tracking your progress updating to newer versions. 118 | - [**Gradle Collection**](https://github.com/MinecraftModDevelopment/Gradle-Collection) - A collection of gradle scripts that can be imported and used in your buildscripts. 119 | - [**GitIgnoreIO**](https://www.gitignore.io/) - A database of various .gitignore entries. 120 | - [**Code Recipe to Json Recipe**](https://gist.github.com/williewillus/a1a899ce5b0f0ba099078d46ae3dae6e) - A class to convert old code recipes to new json based ones. 121 | - [**Minecraft Recipe Generator**](https://crafting.thedestruc7i0n.ca/) - A tool for building new recipes in the vanilla json format. 122 | - [**Coding Practice**](https://www.hackerrank.com/) - A place to practice your coding skills. 123 | - [**Json Smelting Recipes**](https://gist.github.com/Bluexin/c4960cf81b7720afbda0b1fbcfdd0450) - Allows 1.13+ style json smelting recipes to be used on 1.12 and below. 124 | - [**Minecraft Anntations**](https://github.com/mezz/MinecraftAnnotations/) - External fix for null/nonnull annotations. 125 | - [**BetterCF**](https://addons.mozilla.org/en-US/firefox/addon/bettercf) - A FireFox extension which adds several useful utilities to CurseForge, such as in browser maven info for Curse files. 126 | - [**CurseForge Maven Helper**](https://github.com/Wyn-Price/CurseForge-Maven-Helper/releases/latest) - A client side app by Wyn Price, which can generate maven info from a CurseForge file. 127 | - [**OBJ Transformer**](https://www.dropbox.com/s/j4ho6oj5khru0o3/OBJ%20Transformer.jar?dl=1) - A simple program to transform 1.12.2 blockstate to 1.15 json model file for the new OBJ system 128 | 129 | ### Git Clients 130 | - [**GitKraken**](https://www.gitkraken.com/) - A somewhat advanced git client. 131 | - [**GitHub Client**](https://desktop.github.com/) - Easy for beginners. 132 | - [**SourceTreeApp**](https://www.sourcetreeapp.com/) - A mid ranged git client. 133 | - [**TortoiseGit**](https://tortoisegit.org/) - A relatively minimalistic windows interface for Git. 134 | 135 | ## Open Source Mods 136 | - [**Botania**](https://github.com/Vazkii/Botania) - A very good place to learn about almost all aspects of the game. 137 | 138 | ## Discord Resources 139 | - [**Discord Markdown Formatting**](https://support.discordapp.com/hc/en-us/articles/210298617) - A basic guide on how to use Markdown on Discord. 140 | -------------------------------------------------------------------------------- /pages/block/opaque_normal_full_cube.md: -------------------------------------------------------------------------------- 1 | ### Opaque, Normal, and Full cubes. 2 | 3 | The block class has several methods for describing what type of cube the block is. These methods are not very descriptive, and are generally considered to be poorly named. Here is a general breakdown explaining these methods, and when you should use them. 4 | 5 | - `isOpaqueCube` - Used to describe if your block lets light through it. This should be true if your block isn't a perfect 1x1x1 cube, or if you have transparent or translucent pixels in the texture. If your block makes the faces of nearby blocks see through, you likely forgot to set this to false. 6 | - `isFullCube` - Used to describe if the block is a full cube. This is used by game logic for things like collision, suffocation, and lighting. 7 | - `isNormalCube` - This one is a bit all over the place. Some say it is a duplicate of isFullCube, however it is used for some parts of game logic. For example, it is used to determine if water mobs can spawn inside of it, or if comparators can pull a redstone signal from it. -------------------------------------------------------------------------------- /pages/command/check_permission_level.md: -------------------------------------------------------------------------------- 1 | ### Checking a command sender's permission level 2 | 3 | ```java 4 | sender.canUseCommand(3, this.getName()) 5 | ``` 6 | You can also override `getRequiredPermissionLevel` if you want to set the permission required to run the command -------------------------------------------------------------------------------- /pages/devenv_and_general/adding_dependencies.md: -------------------------------------------------------------------------------- 1 | ### Adding Dependencies to your @Mod annotation (1.12 and below) 2 | 3 | Adding Dependencies to your @Mod annotation is as simple as setting the dependencies field to this: 4 | dependencies="required-after:forge@[minVersion,maxVersion)" 5 | 6 | multiple dependencies are separated using ;, min and max version are optional. [, ] = included, (,) = excluded versions. you can also leave the min or max fields empty or omit the whole version range. 7 | keywords 8 | after = load this mod after the one specified, if present 9 | before = load this mod before the one specified, if present. 10 | 11 | keywords can be prefixed with required-, which will force the specified modid to be present. 12 | 13 | for more info on the version ranges see https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402 14 | 15 | ### Adding Dependencies to your mods.toml (1.13 and above) 16 | 17 | You can declare dependencies on other mods in your `mods.toml`. Each dependency is headed by a `[[dependencies.]]`, where `` should be the modid of the mod that requires the dependency (in most cases, you only have one mod in your `mods.toml`) 18 | 19 | The following are the properties which can be present under each `[[dependencies.]]` header. 20 | 21 | | Property | Default Value | Description | 22 | |:--------------:|:-------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 23 | | `modId` | **mandatory** | The modid of the dependency. | 24 | | `mandatory` | **mandatory** | A boolean value, whether to stop the game from loading if this dependency does not exist. | 25 | | `versionRange` | `""` | The acceptable version range of the dependency, expressed as a [Maven version spec][version_spec]. An empty string is an unbounded version range, which matches any version. | 26 | | `ordering` | `"NONE"` | The order in which this mod must load relative to this dependency. The valid values are `BEFORE` (mod must load before dependency), `AFTER` (must load after), and `NONE` (does not care about order). | 27 | | `side` | `"BOTH"` | The physical side in which this dependency must be present. The valid values are `CLIENT` (present on the client), `SERVER` (present on the dedicated server), and `BOTH` (present on both sides). | 28 | 29 | An example dependency for the mod `alchemia`, for the mod with id `bookcase`, which is mandatory, server-side-only, and only accepts versions equal to and above `1.0` and below `2.0`: 30 | 31 | ```toml 32 | [[dependencies.alchemia]] 33 | modId="bookcase" 34 | mandatory=true 35 | versionRange="[1.0,2.0)" 36 | ordering="NONE" 37 | side="SERVER" 38 | ``` 39 | 40 | [version_spec]: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html -------------------------------------------------------------------------------- /pages/devenv_and_general/check_devenv.md: -------------------------------------------------------------------------------- 1 | ### A way to check if you are running in a dev environment 2 | 3 | ```java 4 | public static boolean isDevEnv() { 5 | return (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /pages/devenv_and_general/customizing_forge_gradle_2.md: -------------------------------------------------------------------------------- 1 | ### Gradle settings for minecraft 2 | 3 | Where things go: 4 | The block itself goes in the minecraft block. 5 | the respective vars get defined in your gradle.properties, I suggest NOT putting the ones starting mc_ in your per project gradle.properties, do it in your user gradle.properties instead (That's the one in .gradle). 6 | 7 | What it does: 8 | 1) Lets you define how much ram is given to the client or server when they're run with gradlew runClient/runServer. 9 | 2) Lets you enter your username/password and/or UUID when in dev mode. 10 | 3) Adds "nogui" when running runServer (Comment out/remove if not wanted). 11 | 12 | 13 | ```gradle 14 | if (project.hasProperty('mc_username')) { 15 | clientRunArgs += ['--username', project.mc_username] 16 | if (project.hasProperty('mc_password')) { 17 | clientRunArgs += ['--password', project.mc_password] 18 | } 19 | } 20 | if (project.hasProperty('mc_uuid')) { 21 | clientRunArgs += ['--uuid', project.mc_uuid] 22 | } 23 | 24 | // disable server gui 25 | serverRunArgs += 'nogui' 26 | 27 | // skip the screen to confirm that you want to load a world with missing registry entries 28 | serverJvmArgs += '-Dfml.doNotBackup=true' 29 | clientJvmArgs += '-Dfml.doNotBackup=true' 30 | 31 | // skip having to confirm on server 32 | serverJvmArgs += '-Dfml.queryResult=confirm' 33 | 34 | //skip jansi warnings in the log 35 | serverJvmArgs += '-Dlog4j.skipJansi=true' 36 | clientJvmArgs += '-Dlog4j.skipJansi=true' 37 | 38 | if (project.hasProperty('client_args')) { 39 | clientJvmArgs += project.client_args 40 | } 41 | if (project.hasProperty('server_args')) { 42 | serverJvmArgs += project.server_args 43 | } 44 | ``` 45 | 46 | ### Argument to remove "Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream" 47 | ```gradle 48 | -Dlog4j.skipJansi=true 49 | ``` 50 | 51 | ### Updating gradle version to 4.9 52 | ```gradlew wrapper --gradle-version 4.9``` 53 | 54 | ### CurseForge 55 | endpoint 56 | ```Gradle 57 | repositories { 58 | maven { 59 | //fallback for almost everything, this is CurseForge :P 60 | name = "CurseForge" 61 | url = "https://minecraft.curseforge.com/api/maven/" 62 | } 63 | } 64 | 65 | . . . 66 | 67 | dependencies { 68 | deobfCompile "::" 69 | } 70 | ``` -------------------------------------------------------------------------------- /pages/devenv_and_general/git.md: -------------------------------------------------------------------------------- 1 | ### Git basics 2 | 3 | To clone an entire repo: 4 | ``git clone https://github.com/user/repo.git`` 5 | 6 | To find the clone url for a repo look for this green button on Github then click it and copy the link provided. 7 | ![alt text](https://cdn.discordapp.com/attachments/197165501741400064/401824959556747264/Screenshot_2018-01-13_19-48-03.png) 8 | 9 | To clone a repo with a certain branch. 10 | ``git clone -b branchName https://github.com/user/repo.git`` 11 | 12 | To stage all changes. 13 | ``git add *`` 14 | 15 | To stage some changes. 16 | ``git add ifItsInAFolder/file.txt`` 17 | 18 | To commit changes to the local repo with a message. 19 | ``git commit -m "Here is a nice message"`` 20 | 21 | To push all changes to github. 22 | ``git push`` -------------------------------------------------------------------------------- /pages/devenv_and_general/live_class_reloading.md: -------------------------------------------------------------------------------- 1 | # Live class reloading 2 | You can use live class reloading to avoid having to restart the game for code changes to be applied. This is generally done by running the game with a debugger. Changes you make will be applied to the running game once you save the game. 3 | 4 | Please keep in mind, class reloading does have some limits to it. You can not create new classes, new fields, or new methods. You also can not change the signature of a field or method. Also keep in mind that code changes are not retroactively applied. For example if you change something in your `preInit` method, changes to that method will not be applied because it is already finished executing. The ideal example of live reloading is something like rendering, where the render method is being called every frame. 5 | 6 | Intellij: Click the button left to the launch configurations (Build Project). You will be prompted to reload classes. Accept. 7 | 8 | Eclipse: Your IDE is likely configured to build automatically, all you have to do is save. If not, select Project -> Build All. 9 | 10 | For live resource reloading, build your project first, then press F3+T in-game. -------------------------------------------------------------------------------- /pages/entity/ai_tasks.md: -------------------------------------------------------------------------------- 1 | ### AI Tasks 2 | ```java 3 | class MyEntity extends Entity { 4 | @Override 5 | protected void initEntityAI() { 6 | //This will run when this.attackTarget != null. 7 | tasks.addTask(4, new EntityAIAttackMelee(this, 1.2d, false)); 8 | 9 | /* 10 | * When this.attackTarget == null, these tasks will run to find a target. 11 | * So add a task to targetTasks to change how targeting is done. 12 | */ 13 | targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); 14 | targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); 15 | } 16 | } 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /pages/entity/mob_oredict_drops.md: -------------------------------------------------------------------------------- 1 | ### Mob ore drop 2 | ```java 3 | public class MobOreDrops { 4 | 5 | @SubscribeEvent 6 | public void onEntityDrop(LivingDropsEvent event) { 7 | if(event.entityLiving instanceof EntityCreature) { 8 | Random r = new Random(); 9 | List ores = OreDictionary.getOres("oreIron"); 10 | if (ores == null || ores.size() <= 0) { return; } 11 | Item oreItem = (Item) ores.get(0).getItem(); 12 | event.entityLiving.dropItem(oreItem, r.nextInt(2)); 13 | } 14 | } 15 | 16 | } 17 | ``` -------------------------------------------------------------------------------- /pages/entity/nbt_tricks.md: -------------------------------------------------------------------------------- 1 | ### Preventing remote movement on entities 2 | set "PreventRemoteMovement" to true on the entity data, i.e. make `item.getEntityData().getBoolean("PreventRemoteMovement")`return true, and magnets should not grab things from your plates. That was agreed upon somewhere in a github issue on ImmEng, and is supported by most mods with magnets -------------------------------------------------------------------------------- /pages/entity/spawning_mobs.md: -------------------------------------------------------------------------------- 1 | # Spawning Mobs & Entities 2 | This document covers the basics of how to spawn a mob or entity into the game. 3 | 4 | ## 1.12.2 5 | 6 | When spawning a mob it is very important to use the existing helper methods within the game. These methods are patched by Forge and other mods to allow various events and effects to trigger. The correct method for this is `ItemMonsterPlacer#spawnCreature`, which is used by mob spawner blocks, dispensers, spawn eggs, and some portal blocks. The following example shows how a custom item can spawn an entity when it is clicked. 7 | 8 | ```java 9 | public ActionResult onItemRightClick (World world, EntityPlayer player, EnumHand hand) { 10 | 11 | // Get the itemstack that is being clicked. This is needed later on. 12 | ItemStack stack = player.getHeldItem(hand); 13 | 14 | // Check if this is happening on the client or the server. 15 | // Spawning entities on the client can result in ghost entities. 16 | if (!world.isRemote) { 17 | 18 | // Spawn the zombie on top of the player entity. This will fire all the events. 19 | ItemMonsterPlacer.spawnCreature(world, EntityList.getKey(EntityZombie.class), player.posX, player.posY, player.posZ); 20 | } 21 | 22 | // Tell the game that the item was used successfully. 23 | return new ActionResult<>(EnumActionResult.SUCCESS, stack); 24 | } 25 | ``` 26 | 27 | In some situatiosn you may also want to change properties of the entity when it is spawned. This can be done by using the return result from the `ItemMonsterPlacer#spawnCreature` method and setting the properties there. Keep in mind that this method is nullable, meaning if the entity fails to respawn the result will be null. 28 | 29 | ```java 30 | public ActionResult onItemRightClick (World world, EntityPlayer player, EnumHand hand) { 31 | 32 | // Get the itemstack that is being clicked. This is needed later on. 33 | ItemStack stack = player.getHeldItem(hand); 34 | 35 | // Check if this is happening on the client or the server. 36 | // Spawning entities on the client can result in ghost entities. 37 | if (!world.isRemote) { 38 | 39 | // Spawn the zombie on top of the player entity. This will fire all the events. 40 | Entity spawnedEntity = ItemMonsterPlacer.spawnCreature(world, EntityList.getKey(EntityZombie.class), player.posX, player.posY, player.posZ); 41 | 42 | // Check if the entity spawned properly. 43 | if (spawnedEntity != null) { 44 | 45 | // Give the entity a custom name tag. 46 | spawnedEntity.setCustomNameTag("Some Zombie"); 47 | } 48 | } 49 | 50 | // Tell the game that the item was used successfully. 51 | return new ActionResult<>(EnumActionResult.SUCCESS, stack); 52 | } 53 | ``` 54 | 55 | The above code is only for spawning mobs. This means that the entity spawned must be registered with the spawn egg registry. In some situations you may want to spawn an entity that is not a mob, like a fireball. There are no special methods for this so you can spawn the mob into the world as you would regularly. 56 | 57 | ```java 58 | // Check if this is happening on the client or the server. 59 | // Spawning entities on the client can result in ghost entities. 60 | public ActionResult onItemRightClick (World world, EntityPlayer player, EnumHand hand) { 61 | 62 | // Get the itemstack that is being clicked. This is needed later on. 63 | ItemStack stack = player.getHeldItem(hand); 64 | 65 | if (!world.isRemote) { 66 | 67 | // Create a new fireball entity. We set the shooter entity and the acceleration. 68 | EntityFireball fireball = new EntitySmallFireball(world, player, 0f, 1f, 0f); 69 | 70 | // Set the position of the fireball to above the player. 71 | fireball.setPositionAndRotation(player.posX, player.posX + player.eyeHeight + 1, player.posZ, player.prevRotationYawHead, player.rotationPitch); 72 | 73 | // Spawn the entity into the world. 74 | world.spawnEntity(fireball); 75 | } 76 | 77 | // Tell the game that the item was used successfully. 78 | return new ActionResult<>(EnumActionResult.SUCCESS, stack); 79 | } 80 | ``` 81 | -------------------------------------------------------------------------------- /pages/existingfilehelper.md: -------------------------------------------------------------------------------- 1 | # `ExistingFileHelper` 2 | --- 3 | 4 | To be able to validate pre-existing resources when generating data, Forge uses a helper class to determine if a file exists in a specified location. This helper class consists of five methods, two of which are for public use, and one which is visible for testing purposes. 5 | 6 | Method | Description 7 | :---: | --- 8 | `getManager` | Gets the current resource manager to search for whether it's from client assets or sever datapacks. 9 | `getLocation` | Constructs the location of the file. It takes in a base to get the actual simple location, a prefix to get a subfolder the location might exist in, and a suffix to determine the file extension. 10 | `exists` | Determines whether a file exists in the given pack type (assets or data). 11 | `getResource` | Used for testing whether the resource is available to grab. If not, throws an exception. 12 | `isEnabled` | Returns true if validation is enabled. 13 | 14 | The only ones that should be used by default are `exists` and `isEnabled`. A reference to the helper can be grabbed from the `GatherDataEvent`. 15 | 16 | ## Attaching Resources 17 | --- 18 | 19 | Resources can be attached through the args in the data block of `build.gradle`. Here's a snipped of it's default configuration. 20 | 21 | ```gradle 22 | data { 23 | workingDirectory project.file('run') 24 | 25 | property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' 26 | 27 | property 'forge.logging.console.level', 'debug' 28 | 29 | args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') 30 | 31 | mods { 32 | examplemod { 33 | source sourceSets.main 34 | } 35 | } 36 | } 37 | ``` 38 | 39 | To be able to grab resources from your acutal mod resources, you can do simply by adding `--existing` with the file location of your resources folder (usually `src/main/resources`) like so: 40 | 41 | ```gradle 42 | args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), --existing, file('src/main/resources/') 43 | ``` 44 | 45 | You can add more existing file locations by simply repeating the process with the location of other resources you would like to consider. 46 | 47 | ### Attaching Generated Resources 48 | 49 | If you would like to consider the generated resources without moving them, that can be arranged by simply adding it in to the main resources `srcDirs` like so: 50 | 51 | ```gradle 52 | sourceSets { 53 | main.resources.srcDirs += 'src/generated/resources' 54 | } 55 | ``` 56 | 57 | > Note: This will need to match up with the exact location of the output provided in the arguments of the data block. 58 | 59 | ## Attaching Modded Resources (35.1.3+) 60 | 61 | To add modded resources to your workspace, you can append `--existing-mod ` to the end of the args within the data block like so: 62 | 63 | ```gradle 64 | args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), --existing, file('src/main/resources/'), --existing-mod, 'dependencymod' 65 | ``` 66 | 67 | If you do not specify Forge resources, they will be added by default. 68 | 69 | ## Attaching Forge Resources Prior to 35.1.3 70 | 71 | Forge resources are also not attached by default. However, there is a slight issue to to this due to a cyclical dependency. If the dependences are called after the minecraft block, then the minecraft block won't exist when it tries to add the argument. On the other handle, if the dependencies are called first, the minecraft block will not have been constructed yet. 72 | 73 | To get around this until Forge decides to patch it, a bit of hacky gradle will be used via `project.afterEvaluate`. First, we will grab the args for the data block and add another existing parameter to it. We will then grab the minecraft configuration and find the forge resources. We will need to grab the first instance of the value as each `existing` option is bound to a string and not a list. That is queued afterwards. 74 | 75 | This block should be added after the dependency and minecraft blocks: 76 | 77 | ```gradle 78 | project.afterEvaluate { 79 | minecraft.runs.data.args('--existing', configurations.minecraft.asPath.split(":").toList().find { it.contains("forge") }.split(";")[0]) 80 | } 81 | ``` 82 | 83 | Now rerun your gradle dependencies and the regen the runs and you should be able to use yours and Forge's resources in your data providers. 84 | -------------------------------------------------------------------------------- /pages/fluid/fluids_1.12.2.md: -------------------------------------------------------------------------------- 1 | ### Getting a fluid texture 2 | ```java 3 | TextureAtlasSprite texture = ModelLoader.defaultTextureGetter().apply(fluid.getFluid().getFlowing(fluid)); 4 | ``` 5 | 6 | ### Preventing specific entities from interacting with your fluid 7 | ```java 8 | public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) { 9 | //In this example, prevents Players from interacting with the fluid 10 | return !(entity instanceof EntityPlayer); 11 | } 12 | ``` 13 | You can override this method in your Fluid's Block class to make it so that specific entites don't interact with your fluid. The above example makes it so that players do not interact with the fluid, but other entities will continue to do so. You may need additional checks to ensure that other entities are actually inside the fluid, because the example above as written will always return true for entites other than the player, even if they are not actually inside the fluid. 14 | -------------------------------------------------------------------------------- /pages/item/check_oredict.md: -------------------------------------------------------------------------------- 1 | ### Check for OreDict match 2 | ```java 3 | public static boolean oreDictMatches(ItemStack stack1, ItemStack stack2){ 4 | if (OreDictionary.itemMatches(stack1, stack2, true)){ 5 | return true; 6 | } 7 | else { 8 | int[] oreIds = OreDictionary.getOreIDs(stack1); 9 | for (int i = 0; i < oreIds.length; i ++){ 10 | if (OreDictionary.containsMatch(true, OreDictionary.getOres(OreDictionary.getOreName(oreIds[i])), stack2)){ 11 | return true; 12 | } 13 | } 14 | } 15 | return false; 16 | } 17 | ``` -------------------------------------------------------------------------------- /pages/list_of_vanilla_codecs.md: -------------------------------------------------------------------------------- 1 | This is an incomplete list of known DataFixerUpper Codecs and functions to create Codecs added to Minecraft as of MCP version snapshot 20200723-1.16.1 2 | 3 | | Object | Codec | Notes | 4 | | ------------- | ------------- | ------------- | 5 | | Boolean | com.mojang.serialization.Codec.BOOL | DFU Default Codec | 6 | | Byte | com.mojang.serialization.Codec.BYTE | DFU Default Codec | 7 | | Short | com.mojang.serialization.Codec.SHORT | DFU Default Codec | 8 | | Integer | com.mojang.serialization.Codec.INT | DFU Default Codec | 9 | | Long | com.mojang.serialization.Codec.LONG | DFU Default Codec | 10 | | Float | com.mojang.serialization.Codec.FLOAT | DFU Default Codec | 11 | | Double | com.mojang.serialization.Codec.DOUBLE | DFU Default Codec | 12 | | String | com.mojang.serialization.Codec.STRING | DFU Default Codec | 13 | | ByteBuffer | com.mojang.serialization.Codec.BYTE_BUFFER | DFU Default Codec | 14 | | IntStream | com.mojang.serialization.Codec.INT_STREAM | DFU Default Codec | 15 | | LongStream | com.mojang.serialization.Codec.LONG_STREAM | DFU Default Codec | 16 | | Dynamic | com.mojang.serialization.Codec.PASSTHROUGH | DFU Default Codec | 17 | | IntStream | com.mojang.serialization.Codec.INT_STREAM | DFU Default Codec | 18 | | Unit | com.mojang.serialization.Codec.EMPTY | DFU Default Codec | 19 | | Property | net.minecraft.state.func_241492_e_() | | 20 | | WeightedList | net.minecraft.util.WeightedList.func_234002_a_(Codec p_234002_0_) | | 21 | | WeightedList.Entry | net.minecraft.util.WeightedList.Entry.func_234008_a_(final Codec p_234008_0_) | | 22 | | PointOfInterest | net.minecraft.village.PointOfInterest.func_234150_a_(Runnable p_234150_0_) | | 23 | | PointOfInterestData | net.minecraft.util.PointOfInterestData.func_234158_a_(Runnable p_234158_0_) | | 24 | | BlockPos | net.minecraft.util.math.BlockPos.field_239578_a_ | | 25 | | Vector3i | net.minecraft.util.math.vector.Vector3i.field_239781_c_ | | 26 | | Registry | net.minecraft.util.registry.Registry | Vanilla Registries implement Codec interface so can be directly used as one. | 27 | -------------------------------------------------------------------------------- /pages/rendering/basic-item.md: -------------------------------------------------------------------------------- 1 | Basic item model: 2 | ```json 3 | { 4 | "parent": "item/generated", 5 | "textures": { 6 | "layer0": "modid:items/texture_name" 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /pages/rendering/custom-modelloader.md: -------------------------------------------------------------------------------- 1 | ``` 2 | package net.trentv.gasesframework.client; 3 | 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.Collection; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | 10 | import org.lwjgl.util.vector.Vector3f; 11 | 12 | import com.google.common.base.Function; 13 | 14 | import net.minecraft.client.renderer.block.model.BakedQuad; 15 | import net.minecraft.client.renderer.block.model.BlockFaceUV; 16 | import net.minecraft.client.renderer.block.model.BlockPartFace; 17 | import net.minecraft.client.renderer.block.model.FaceBakery; 18 | import net.minecraft.client.renderer.block.model.IBakedModel; 19 | import net.minecraft.client.renderer.block.model.ItemCameraTransforms; 20 | import net.minecraft.client.renderer.block.model.ItemOverrideList; 21 | import net.minecraft.client.renderer.block.model.ModelRotation; 22 | import net.minecraft.client.renderer.block.model.SimpleBakedModel; 23 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 24 | import net.minecraft.client.renderer.vertex.VertexFormat; 25 | import net.minecraft.util.EnumFacing; 26 | import net.minecraft.util.ResourceLocation; 27 | import net.minecraftforge.client.model.IModel; 28 | import net.minecraftforge.common.model.IModelState; 29 | import net.trentv.gasesframework.GasesFramework; 30 | 31 | public class ModelBlockGas implements IModel 32 | { 33 | private FaceBakery bakery = new FaceBakery(); 34 | private ResourceLocation texture = new ResourceLocation(GasesFramework.MODID, "block/gas_default"); 35 | 36 | @Override 37 | public Collection getDependencies() 38 | { 39 | return new ArrayList(); 40 | } 41 | 42 | @Override 43 | public Collection getTextures() 44 | { 45 | ArrayList a = new ArrayList(); 46 | a.add(texture); 47 | return a; 48 | } 49 | 50 | @Override 51 | public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) 52 | { 53 | //facings in D-U-N-S-W-E order 54 | List allQuads = Arrays.asList( 55 | getQuad(new Vector3f(0,0,0), new Vector3f(16,0 ,16), EnumFacing.DOWN, bakedTextureGetter), //DOWN 56 | getQuad(new Vector3f(0,0,0), new Vector3f(16,16,16), EnumFacing.UP, bakedTextureGetter), //UP 57 | getQuad(new Vector3f(0,0,0), new Vector3f(16,16,16), EnumFacing.NORTH, bakedTextureGetter), //NORTH 58 | getQuad(new Vector3f(0,0,0), new Vector3f(16,16,16), EnumFacing.SOUTH, bakedTextureGetter), //SOUTH 59 | getQuad(new Vector3f(0,0,0), new Vector3f(16,16,16), EnumFacing.WEST, bakedTextureGetter), //WEST 60 | getQuad(new Vector3f(0,0,0), new Vector3f(16,16,16), EnumFacing.EAST, bakedTextureGetter) //EAST 61 | ); 62 | HashMap> faceQuads = new HashMap>(); 63 | for(int i = 0; i < EnumFacing.values().length; i++) 64 | { 65 | faceQuads.put(EnumFacing.VALUES[i], Arrays.asList(allQuads.get(i))); 66 | } 67 | SimpleBakedModel newModel = new SimpleBakedModel(allQuads, faceQuads, true, true, bakedTextureGetter.apply(texture), ItemCameraTransforms.DEFAULT, ItemOverrideList.NONE); 68 | return newModel; 69 | } 70 | 71 | private BakedQuad getQuad(Vector3f from, Vector3f to, EnumFacing direction, Function bakedTextureGetter) 72 | { 73 | return bakery.makeBakedQuad(from, to, new BlockPartFace(null, 0, texture.toString(), new BlockFaceUV(new float[]{0,0,16,16}, 0)), 74 | bakedTextureGetter.apply(texture), direction, ModelRotation.X0_Y0, null, true, true); 75 | } 76 | 77 | @Override 78 | public IModelState getDefaultState() 79 | { 80 | return null; 81 | } 82 | } 83 | 84 | 85 | 86 | 87 | package net.trentv.gasesframework.client; 88 | 89 | import java.util.Arrays; 90 | import java.util.List; 91 | 92 | import net.minecraft.client.resources.IResourceManager; 93 | import net.minecraft.util.ResourceLocation; 94 | import net.minecraftforge.client.model.ICustomModelLoader; 95 | import net.minecraftforge.client.model.IModel; 96 | import net.trentv.gasesframework.GasesFramework; 97 | 98 | public class IGasesModelLoader implements ICustomModelLoader 99 | { 100 | 101 | @Override 102 | public void onResourceManagerReload(IResourceManager resourceManager) 103 | { 104 | 105 | } 106 | 107 | @Override 108 | public boolean accepts(ResourceLocation modelLocation) 109 | { 110 | List path = Arrays.asList("gas_smoke"); 111 | if(modelLocation.getResourceDomain().equals(GasesFramework.MODID)) 112 | { 113 | if(path.contains(modelLocation.getResourcePath())) 114 | { 115 | return true; 116 | } 117 | } 118 | return false; 119 | } 120 | 121 | @Override 122 | public IModel loadModel(ResourceLocation modelLocation) throws Exception 123 | { 124 | if(modelLocation.getResourceDomain().equals(GasesFramework.MODID)) 125 | { 126 | if(modelLocation.getResourcePath().contains("gas_")) 127 | { 128 | return new ModelBlockGas(); 129 | } 130 | } 131 | return null; 132 | } 133 | } 134 | ``` 135 | In your registerRenderers clientproxy: 136 | ``` 137 | ModelLoaderRegistry.registerLoader(new IGasesModelLoader()); 138 | ``` -------------------------------------------------------------------------------- /pages/rendering/registering-entity-renderer.md: -------------------------------------------------------------------------------- 1 | ### Rendering Handler registry 2 | ```java 3 | RenderingRegistry.registerEntityRenderingHandler(GolemBase.class, RenderGolem::new); 4 | ``` -------------------------------------------------------------------------------- /pages/tips/neighbor_caching.md: -------------------------------------------------------------------------------- 1 | ### Neighbor block caching for stuff like context-sensitive render states 2 | 3 | ```java 4 | public final class NeighborCache { 5 | private final Map cache = new HashMap<>(); 6 | 7 | private final BlockPos origin; 8 | private final Function computer; 9 | 10 | public NeighborCache(BlockPos origin, Function generator) { 11 | this.origin = origin.toImmutable(); 12 | this.computer = pos -> generator.apply(this.origin.add(pos)); 13 | } 14 | 15 | public NeighborCache(Function generator) { 16 | this(BlockPos.ORIGIN, generator); 17 | } 18 | 19 | public T get(BlockPos offset) { 20 | return cache.computeIfAbsent(offset, computer); 21 | } 22 | 23 | public T get(int x, int y, int z) { 24 | return get(new BlockPos(x, y, z)); 25 | } 26 | 27 | public T get(EnumFacing offset) { 28 | return get(BlockPos.ORIGIN.offset(offset)); 29 | } 30 | 31 | public T get(EnumFacing offset1, EnumFacing offset2) { 32 | return get(BlockPos.ORIGIN.offset(offset1).offset(offset2)); 33 | } 34 | 35 | public T get(EnumFacing offset1, EnumFacing offset2, EnumFacing offset3) { 36 | return get(BlockPos.ORIGIN.offset(offset1).offset(offset2).offset(offset3)); 37 | } 38 | } 39 | ``` 40 | 41 | Usage: 42 | 43 | ```java 44 | NeighborCache stateCache = new NeighborCache<>(pos, world::getBlockState); 45 | NeighborCache tileCache = new NeighborCache<>(pos, world::getTileEntity); 46 | ``` 47 | -------------------------------------------------------------------------------- /version_info.md: -------------------------------------------------------------------------------- 1 | | Minecraft | Forge | Gradle Default | Gradle Maximum | ForgeGradle | Mappings Default | Mappings Latest | MCP | Java Minimum | Java Maximum | Promotion | Notes | 2 | | --------- | ------------------- | -------------- | -------------- | ------------ | ----------------- | -------------------- | ---- | ------------ | ------------ | ----------- | ----- | 3 | | 1.6.4 | 9.11.1.964 | 1.8 | 2.8 | 1.0-SNAPSHOT | N/A | N/A | 8.11 | 6 | 8 | | Requires Java 7 to setupDecompWorkspace | 4 | | 1.6.4 | 9.11.1.965 | N/A | N/A | N/A | N/A | N/A | 8.11 | 6 | 8 | | Use Scala 1.10.2, Patch Failures | 5 | | 1.6.4 | 9.11.1.1345 | N/A | N/A | N/A | N/A | N/A | 8.11 | 6 | 8 | RB,LB | Use Scala 1.10.2, Patch Failures | 6 | | 1.7.2 | 10.12.0.1047 | 1.10 | 1.12 | 1.1-SNAPSHOT | N/A | N/A | 9.03 | 6 | 8 | | Requires Java 7 to setupDecompWorkspace
(which will fail due to hunks 8 & 9 of `net/minecraft/world/gen/structure/StructureVillagePieces.java.patch` not applying),
Last 1.7.2 version for FG1.1, no log4j mitigation | 7 | | 1.7.2 | 10.12.2.1161-mc172 | 1.12 | 2.14.1 | 1.2-SNAPSHOT | N/A | N/A | 9.03 | 6 | 8 | RB,LB | no log4j mitigation | 8 | | 1.7.10 | | N/A | N/A | | N/A | stable_8 | 9.08 | 6 | 8 | Mappings | | 9 | | 1.7.10 | | N/A | N/A | | N/A | stable_9 | 9.08 | 6 | 8 | Mappings | | 10 | | 1.7.10 | | N/A | N/A | | N/A | stable_10 | 9.08 | 6 | 8 | Mappings | | 11 | | 1.7.10 | | N/A | N/A | | N/A | stable_11 | 9.08 | 6 | 8 | Mappings | | 12 | | 1.7.10 | 10.13.4.1614-1.7.10 | 2.0 | 4.4.1 | 1.2-SNAPSHOT | Unspecified | stable_12 | 9.08 | 6 | 8 | RB,LB | no log4j mitigation | 13 | | 1.8 | | N/A | N/A | | N/A | stable_15 | 9.10 | 6 | 8 | Mappings | | 14 | | 1.8 | | N/A | N/A | | N/A | stable_16 | 9.10 | 6 | 8 | Mappings | | 15 | | 1.8 | | N/A | N/A | | N/A | stable_17 | 9.10 | 6 | 8 | Mappings | | 16 | | 1.8 | 11.14.3.1502 | 2.0 | 4.4.1 | 1.2-SNAPSHOT | snapshot_20141130 | stable_18 | 9.10 | 6 | 8 | | Last 1.8 version for FG1.2 & Seperate FML, no log4j mitigation | 17 | | 1.8 | | N/A | 2.7 | 2.0.0 | | | 9.10 | 6 | 8 | ForgeGradle | | 18 | | 1.8 | | N/A | 2.7 | 2.0.1 | | | 9.10 | 6 | 8 | ForgeGradle | | 19 | | 1.8 | | N/A | 2.8 | 2.0.2 | | | 9.10 | 6 | 8 | ForgeGradle | | 20 | | 1.8 | 11.14.4.1563 | 2.7 | 4.9 | 2.0-SNAPSHOT | snapshot_20141130 | stable_18 | 9.10 | 6 | 8 | RB | add `-x getFernFlower` to gradle command when running setupDecompWorkspace
needs fernflower-fixed.jar in `.gradle\caches\minecraft`, no log4j mitigation | 21 | | 1.8 | 11.14.4.1577 | 2.7 | 4.9 | 2.0-SNAPSHOT | snapshot_20141130 | stable_18 | 9.10 | 6 | 8 | LB | add `-x getFernFlower` to gradle command when running setupDecompWorkspace
needs fernflower-fixed.jar in `.gradle\caches\minecraft`, no log4j mitigation | 22 | | 1.8.8 | 11.15.0.1655 | 2.7 | 4.9 | 2.1-SNAPSHOT | snapshot_20151122 | stable_20 | 9.18 | 6 | 8 | LB | No 1.8.8 RB, no log4j mitigation | 23 | | 1.8.9 | 11.15.1.2318-1.8.9 | 2.7 | 4.9 | 2.1-SNAPSHOT | stable_20 | stable_22 | 9.19 | 6 | 8 | RB,LB | no log4j mitigation | 24 | | 1.9 | 12.16.1.1887 | 2.7 | 4.9 | 2.1-SNAPSHOT | snapshot_20160312 | stable_24 | 9.24 | 6 | 8 | RB | no log4j mitigation | 25 | | 1.9 | 12.16.1.1938-1.9.0 | 2.7 | 4.9 | 2.1-SNAPSHOT | snapshot_20160312 | stable_24 | 9.24 | 6 | 8 | LB | no log4j mitigation | 26 | | 1.9.4 | 12.17.0.2317-1.9.4 | 2.7 | 4.9 | 2.2-SNAPSHOT | snapshot_20160518 | stable_26 | 9.28 | 6 | 8 | RB,LB | no log4j mitigation | 27 | | 1.10 | 12.18.0.2000-1.10.0 | 2.7 | 4.9 | 2.2-SNAPSHOT | snapshot_20160518 | stable_26 | 9.31 | 6 | 8 | LB | No 1.10 RB, no log4j mitigation | 28 | | 1.10.2 | 12.18.3.2511 | 2.14 | 4.9 | 2.2-SNAPSHOT | snapshot_20161111 | stable_29 | 9.31 | 6 | 8 | RB,LB | no log4j mitigation | 29 | | 1.11 | | | | | | stable_31 | 9.35 | 6 | 8 | Mappings | | 30 | | 1.11 | 13.19.1.2189 | 2.14 | 4.9 | 2.2-SNAPSHOT | snapshot_20161111 | stable_32 | 9.35 | 6 | 8 | RB | no log4j mitigation | 31 | | 1.11 | 13.19.1.2199 | 2.14 | 4.9 | 2.2-SNAPSHOT | snapshot_20161220 | stable_32 | 9.35 | 6 | 8 | LB | no log4j mitigation | 32 | | 1.11.2 | 13.20.1.2588 | 2.14 | 4.9 | 2.2-SNAPSHOT | snapshot_20161220 | stable_32 | 9.37 | 6 | 8 | RB,LB | no log4j mitigation | 33 | | 1.12 | 14.21.1.2387 | 2.14 | 4.9 | 2.3-SNAPSHOT | snapshot_20170624 | stable_39 | 9.40 | 8 | 8 | RB | no log4j mitigation | 34 | | 1.12 | 14.21.1.2443 | 2.14 | 4.9 | 2.3-SNAPSHOT | snapshot_20170624 | stable_39 | 9.40 | 8 | 8 | LB | no log4j mitigation | 35 | | 1.12.1 | 14.22.1.2478 | 2.14 | 4.9 | 2.3-SNAPSHOT | snapshot_20170624 | stable_39 | 9.41 | 8 | 8 | RB | no log4j mitigation | 36 | | 1.12.1 | 14.22.1.2485 | 2.14 | 4.9 | 2.3-SNAPSHOT | snapshot_20170624 | stable_39 | 9.41 | 8 | 8 | LB | no log4j mitigation | 37 | | 1.12.2 | 14.23.5.2847 | 2.14 | 4.9 | 2.3-SNAPSHOT | snapshot_20171003 | stable_39 | 9.42 | 8 | 8 | Last FG2 | no log4j mitigation | 38 | | 1.12.2 | 14.23.5.2859 | 2.14 | 5.6.4 | 3.+/4.1.+ | snapshot_20171003 | stable_39 | 20200226 | 8 | 8 | RB | | 39 | | 1.12.2 | 14.23.5.2860 | 2.14 | 5.6.4 | 3.+/4.1.+ | snapshot_20171003 | stable_39 | 20200226 | 8 | 8 | LB | | 40 | | 1.13 | | 4.9 | 5.6.4 | 3.+ | | stable_43 | | 8 | 8 | | | 41 | | 1.13.1 | | 4.9 | 5.6.4 | 3.+ | | stable_45 | | 8 | 8 | | | 42 | | 1.13.2 | 25.0.223 | 4.9 | 5.6.4 | 3.+ | snapshot_20180921-1.13 | stable_47 | 20190213 | 8 | 8 | LB | | 43 | | 1.14 | | 4.9 | 5.6.4 | 3.+ | | stable_49 | | 8 | 8 | | | 44 | | 1.14.1 | | 4.9 | 5.6.4 | 3.+ | | stable_51 | | 8 | 8 | | | 45 | | 1.14.2 | 26.0.63 | 4.9 | 5.6.4 | 3.+ | snapshot_20190621-1.14.2 | stable_53 | 20190603 | 8 | 8 | LB | no log4j mitigation | 46 | | 1.14.3 | 27.0.60 | 4.9 | 5.6.4 | 3.+ | snapshot_20190719-1.14.3 | stable_56 | 20190624 | 8 | 8 | LB | no log4j mitigation | 47 | | 1.14.4 | 28.2.26 | 4.9 | 5.6.4 | 3.+ | snapshot_20190719-1.14.3 | official_1.14.4
MCP: stable_58 | 20190829 | 8 | 8 | RB,LB | | 48 | | 1.15 | 29.0.4 | 4.9 | 5.6.4 | 3.+ | snapshot_20190719-1.14.3 | official_1.15
MCP: stable_60 | 20191212 | 8 | 8 | LB | no log4j mitigation | 49 | | 1.15.1 | 30.0.51 | 4.9 | 5.6.4 | 3.+ | snapshot_20190719-1.14.3 | official_1.15.1
MCP: snapshot_20201118-1.15.1 | 20191217 | 8 | 8 | LB | no log4j mitigation | 50 | | 1.15.2 | 31.2.57 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20200514-1.15.1 | official_1.15.2
MCP: snapshot_20201118-1.15.1 | 20200515 | 8 | 8 | RB,LB | | 51 | | 1.16.1 | 32.0.108 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20200514-1.16 | official_1.16.1
MCP: snapshot_20200820-1.16.1 | 20200625 | 8 | 8 | LB | Newer mappings available at [Dogforce Games](https://www.dogforce-games.com/maven/de/oceanlabs/mcp/mcp_snapshot/), no log4j mitigation | 52 | | 1.16.2 | 33.0.61 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20200514-1.16 | official_1.16.2
MCP: snapshot_20200916-1.16.2 | 20200812 | 8 | 8 | LB | Newer mappings available at [Dogforce Games](https://www.dogforce-games.com/maven/de/oceanlabs/mcp/mcp_snapshot/), no log4j mitigation | 53 | | 1.16.3 | 34.1.0 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20200514-1.16 | official_1.16.3
MCP: snapshot_20201028-1.16.3 | 20200911 | 8 | 8 | RB | no log4j mitigation | 54 | | 1.16.3 | 34.1.42 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20201028-1.16.3 | official_1.16.3
MCP: snapshot_20201028-1.16.3 | 20201025 | 8 | 8 | LB | no log4j mitigation | 55 | | 1.16.4 | 35.1.4 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20201028-1.16.3 | official_1.16.4
MCP: snapshot_20210309-1.16.4 | 20201102 | 8 | 8 | RB | no log4j mitigation | 56 | | 1.16.4 | 35.1.37 | 4.10.3 | 5.6.4 | 3.+ | snapshot_20201028-1.16.3 | official_1.16.4
MCP: snapshot_20210309-1.16.4 | 20201102 | 8 | 8 | LB | no log4j mitigation | 57 | | 1.16.5 | 36.0.46 | 4.10.3 | 5.6.4 | 3.+ | official_1.16.5 | official_1.16.5
MCP: 20210309-1.16.5
Parchment: 2021.10.17 | 20210115 | 8 | 8 | Last FG3 | no log4j mitigation | 58 | | 1.16.5 | 36.1.16 | 6.8.1 | 6.9.2 | 4.1.+ | official_1.16.5 | official_1.16.5
MCP: 20210309-1.16.5
Parchment: 2021.10.17 | 20210115 | 8 | 8 | | no log4j mitigation | 59 | | 1.16.5 | 36.1.65 | 6.9 | 6.9.2 | 4.1.+ | official_1.16.5 | official_1.16.5
MCP: 20210309-1.16.5
Parchment: 2021.10.17 | 20210115 | 8 | 8 | Last FG4 | no log4j mitigation | 60 | | 1.16.5 | 36.2.20 | 7.1.1 | 7.2 | 5.1.+ | official_1.16.5 | official_1.16.5
MCP: 20210309-1.16.5
Parchment: 2021.10.17 | 20210115 | 8 | 8 | RB | | 61 | | 1.16.5 | 36.2.23 | 7.1.1 | 7.2 | 5.1.+ | official_1.16.5 | official_1.16.5
MCP: 20210309-1.16.5
Parchment: 2021.10.17 | 20210115 | 8 | 8 | LB | | 62 | | 1.17.1 | 37.0.59 | 7.2 | 7.2 | 5.1.+ | official_1.17.1 | official_1.17.1
Parchment: 2021.12.12 | 20210706 | 16 | 16 | | First release of 1.17.1 which supports Mixins natively, no log4j mitigation | 63 | | 1.17.1 | 37.1.1 | 7.2 | 7.2 | 5.1.+ | official_1.17.1 | official_1.17.1
Parchment: 2021.12.12 | 20210706 | 16 | 16 | RB,LB | | 64 | | 1.18 | 38.0.17 | 7.3 | 7.3.3 | 5.1.+ | official_1.18 | official_1.18
Parchment: 2022.01.23 | 20211130 | 17 | 17 | LB | | 65 | | 1.18.1 | 39.0.59 | 7.3 | 7.3.3 | 5.1.+ | official_1.18.1 | official_1.18.1
Parchment: 2022.01.23 | 20211210 | 17 | 17 | LB | | 66 | --------------------------------------------------------------------------------