Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/28/20 in all areas

  1. TIL DataParameter's are DataManagers.... Seriously, this is just a giant thread of you messing up basic java systems, not listening to people who are trying to help you, and having no idea what you're doing...
    2 points
  2. A PR was just opened that should fix this: https://github.com/MinecraftForge/MinecraftForge/pull/7446 Keep an eye on that, and we'll let you know when the fix is pulled. Thanks to 7
    1 point
  3. Personally, I would say that in this case it would be appropriate to add a hook for the eating event if there isn't already one, as editing food behaviors seems like quite a common feature. You can submit a PR to the Forge repo on GitHub with an adequate solution.
    1 point
  4. There may be a primer for 1.15 -> 1.16.1; however, in the current state of 1.16.2 onwards and with the release of 1.16.4 coming soon, I doubt you will be able to find one. Not many people understand the new system of world generation through data driven systems, so a primer will probably not be out for a while. However, since I'm not a fan of leaving any post unanswered, I'll try and take a basic stab at it. - Blocks have been abstracted even more (AbstractBlock). You'll find that the properties have been turned into functions of some kind to allow for even fewer blocks. For example, the blockstate can control how much light is emitted using a ToIntFunction. Also, for a tool to be required to mine a block, the setRequiresTool parameter must be set. - Block properties no longer have an interface IProperty. It has been relegated to just Property now. - Item properties have also been removed and isolated from the Item class. They are handled within ItemModelProperties and can be registered using the appropriately named methods there. - Rendering methods now take a MatrixStack parameter to correctly orientated it on the screen. If you find any unmapped methods, you will most likely need to stick a MatrixStack variable somewhere within there, nothing else. - Server reload listeners are added via AddReloadListenerEvent. Client reload listeners should still be handled either within your mod constructor or FMLConstructModEvent for better thread-safety. - DeferredWorkQueue is now officially deprecated. You should use the enqueueWork method provided in all parallel dispatch events. - Entities store attributes within GlobalEntityTypeAttributes. If your entity does not have a registered attribute within here, then it will most likely error. For reference, this is not thread-safe. - Models now take in a RenderType to define what layer they will render within. By default, they use a no cull cutout layer. - Every mods.toml must have a license entry. Otherwise, your mod will error and crash. - LazyOptionals have a few changes as defined in 33.0.21. LazyOptionals map to LazyOptionals now using lazyMap. map returns a regular Optional. Note that this Optional will throw an error if the map function somehow results in a null entry. filter also returns an Optional now. Finally, a new method called resolve has been added to convert to an Optional directly. - ExistingFileHelper is now required within tag providers. Existing mod resources can be attached using '--existing-mod <modid>' as of 35.1.3. - Finally, I will mention world generation. Currently, all of world gen has been delegated to a data driven system. This is a mixed point for some users. Currently, forge is working on a more dynamic system to allow all of world generation to be handled within JSON files; however, that is not completely possible yet. Therefore, there are a few workarounds to handle this via BiomeLoadingEvent. Here, you can add configured features and structures to already existing biomes along with some other details I'll let you explore for yourself. - Creating biomes can either be done one of two ways. You can either create one using BiomeMaker for the Biome builder itself in some fashion and register it using the RegistryEvent or you can initialize a dummy biome and create it via JSON. To get your biome to spawn in the world, this is still handled within BiomeManager instead taking a RegistryKey (a concatenation of the registry and the object name). To set it as a spawn biome, that is handled when you build the biome itself. - Features have been changed in an interesting way. Instead of having a Feature with a single Placement, features can now have multiple placements. This means a placement can determine the amount, the height, the spread, etc. The way placements are handled are similar to a stack. The first placement you attach will be the last to execute if you need an example. Therefore, when creating a ConfiguredFeature, things like a count placement should be handled as the last chained method. There are a few helper methods within that makes it easier to generate count placements, although they will most likely remain unmapped until the next mappings push. Cyborgmas pointed out something with registering these entries that non-registered ones causes an issue with the codec, so they should be handled and registered probably within your common setup or at the very earliest after placements have been registered. - If possible, you should try to create all your world generation edits within JSON files to better prepare yourself for when the system comes out of the experimental phase. However, that is currently optional until everything updates. Hopefully I covered the gist of the changes from 1.15 -> 1.16.3. There are definitely many more that I've missed such as background music or the brain system within entities. However, those topics are best explained in greater detail with more specific questions. Same goes for the information I missed within world generation JSONs. Good luck on your updates!
    1 point
  5. Not really no. Because there are other ways to damage an item and all of them are ignored in creative. It happens here, in ItemStack#damageItem: if (!entityIn.world.isRemote && (!(entityIn instanceof PlayerEntity) || !((PlayerEntity)entityIn).abilities.isCreativeMode)) { If the player is in creative, the interior block (which actually applies the damage) is not run.
    1 point
  6. Forge Version: 34.1.0 Minecraft Version: 1.16.3 Downloads: Changelog: (Direct) Installer: (AdFocus) (Direct) MDK: (AdFocus) (Direct) Intro: Hello everyone, it's finally that time. A recommended 1.16 build is here. We had to wait longer then I wanted to because there were a lot of problems with the initial 1.16 release from Mojang, enough that it was obvious that a .1/.2 was needed. So we waited for Mojang to stabilize the 1.16 branch, out came .1, .2, and .3. Each one same with its own surprises, the main one we have to mention is 1.16.2's major re-write to biomes. Allowing them to now be data driven. This is a very powerful thing that moves Minecraft to a more flexible state, but it also meant all our old hooks had to be re-designed. Every Minecraft version moves towards a better engine, but unfortunately that means we have to work with the interim steps. So if there are any issues modders face with Biomes/Worlds now being mostly data driven, speak up an expect a few iterations of the tools Forge provides you for these things. But remember, now that we are in a Recommended Build it means Forge will stay stable API wise for the rest of the 1.16 lifecycle. Mod License: There has always been little skirmishes about what license a particular mod is released under. To try and help address that, we have now made it mandatory that mods specify a "license" value in their mods.toml. That is the text file containing metadata about the mod, such as version, name, author, etc. This is a simple text entry, it can be anything the modder wishes as long as it is present. The MDK ships with it filled in for you with "All Rights Reserved" which is the default copyright stance in almost every jurisdiction. I highly encourage modders to take a moment and think about how they want their mod to be used, modified, and distributed. And then pick a license that properly expresses their wishes. If you want a open source license https://choosealicense.com/ can help you pick. However, it is your mod, so whatever license you want is fine. Please do not take this as a push to one style or another. Simple as a reminder to choose something and let your users know. Support: With this being released, it officially triggers our support policies as described in the LTS post. This means that 1.14 is now EOL. It can still be used and developed for. It just means that we no longer provide active support for it. And we encourage all users/modders to update to a more modern version. Changelog: New: New model loading system with improved performance and functionality. Reorganized mod loading to increase loading speeds and better integrate with vanilla threading. New armor knockback resistance hooks Added custom item integration with Piglin trades. Added support for items to have pumpkin-enderman like behavior. Added build system verification tools. Added event for controlling data/asset reloading. Added hook to add modded Raid members. Added a dedicated event for registering commands. Added Mixin to the installer. Added event for entities leaving the world. Added IModBusEvent marker interface to all events that are fired on the ModEventBus vs the main Forge bus. Added mandatory (1.16.2+) license field in mods.toml Added support for modded elytra-like items. Added hook to allow Biomes to specify edges better. Added hook to allow better block control over tool-block interactions. Added hook for manipulating whether a fluid can create a source block. Added an EntitySizeEvent instead of EntityHeightEvent Added user friendly exceptions when config loading fails Added particle culling, which should increase performance by not rendering particles that are not on screen. Added better datagen validation for tags. Added dataprovider for global loot modifiers Added scaffolding movement hook Added support for custom tag types Added BiomeLoadingEvent, that allows for mods to edit biomes. Fixes: Fixed caching issue with mod manifest files. Improves starting times. Fixed vanilla models not correctly deferring to Forge's system. Fixed early load GUI showing when running data generators Fixed block update issues related to reverting with BlockSnapshot Fixed locate command patch. Fixed block drops not working in some cases. Fixed villager trades having non-applicable enchants Fixed tooltip rendering issues Fixed sneaking while swimming Fixed harvest level and harvest tool Fixed screen tooltip not displaying Fixed creative screen arrows Fixed attribute registration on modded entities Fixed block render types not being applied to block items Fixed swimming speed being too slow Fixed break speed event having null position Fixed tag issue when connect to vanilla server Fixed some classes being unsafe in concurrent loading Fixed capability data being null in player clone event Fixed double chests updating issues Fixed language parsing Fixed datagen crashing due to tags Fixed client chat received event not having the sender UUID Fixed loading screen color and text to match new Mojang Studio's colors. Fixed improper handling of baked lighting in forge light pipeline Fixed getQuads not having model data Fixed tooltip render events not having matrixstacks Fixed multi-layer item rendering Fixed stencil support initialization Fixed swap offhand keybinds not working in GUI Fixed null checks missing in ForgeIngameGUI Fixed incorrect keybind names Fixed LivingEquipmentChangeEvent not being posted Fixed canRepair not being true by default Fixed race condition for DeferredRegister with custom registries Fixed client world capabilities not being collected Fixed TagEmptyCondition using client tags and not server Fixed ExtendedButton using narrator text Fixed LivingJumpEvent for players on horses Fixed duplicate mod files from mod file scan causing objects to load twice. Fixed model & blockstate datagen inconsistencies Fixed datapacks being not loaded correctly in the Datapack menu screen Fixed soundloadevent being posted on the wrong bus Fixed chunkdataevents using different data tags Fixed patch for PlayerSetSpawnEvent Fixed custom burnable blocks. Fixed modded overworld biomes not generating Fixed ClimberPathNavigator spinning when mob width is small Fixed SleepingTimeCheckEvent not being fired in initial sleep test Fixed biome generation error Fixed cats not having the AnimalTameEvent fired Fixed rail rotations Fixed errors being hidden by mods not being shutdown Fixed rendertickevent using wrong partial ticks when game is paused Fixed missing outdated notification in the main menu “mod” button Fixed debug world not generating modded blocks Fixed hoes and new 1.16 blocks not having proper harvest levels Fixed dry farmland being destroyed even with crops into it Fixed handling of the ModelRegistryEvent Fixed InvalidModFileException not saying which mod was invalid Fixed the client rejecting the server, because of missing tags. Fixed config iteration order Fixed logging issues with pack.png loading for mod datapacks Fixed DelegatingResourcePack performance Fixed LazyOptional not being clear which operations were actually lazy. Fixed the HighlightEntity Event not being fired Fixed minor bugs with bamboos, enchantments, and conduits Fixed RenderNameplateEvent not having partial ticks Fixed duplicate tag wrappers causing a crash Fixed custom teleporters crashing Fixed zip paths crashes. Fixed modloading crash reports with QOL tweaks Fixed crashed with tile entities with no collision boxes Fixed forge tooltip util. Fixed model to baked model inconsistencies. Fixed json biomes not setting a registry name correctly. Fixed forge GuiUtils not using MatrixStacks Fixed fluid filling sounds Fixed some inner biome fields not being accessible Fixed world rendering potentially causing a crash Fixed CommandEvent’s result not being used Fixed container items being consumed in brewing stands Fixed forge light pipeline causing block offsets twice Fixed ToggleableKeyBinding’s differences with vanilla Fixed issues with custom tag types and optional tags. Fixed some inner biome fields still being immutable. Fixed grass disappearing when forge config alwaysSetupTerrainOffThread was true
    1 point
  7. I can't, for the life of me, find the way vanilla blocks drop their inventory when they are destroyed, nor can I find a forum post that explains it. do I add something to the blocks "onPlayerDestroy" method? do I do something in the container class? [SOLUTION]------------------------------------------------------------------------------------------------ add this to your block class @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state.hasTileEntity() && state.getBlock() != newState.getBlock()) { // drops everything in the inventory worldIn.getTileEntity(pos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { for (int i = 0; i < h.getSlots(); i++) { spawnAsEntity(worldIn, pos, h.getStackInSlot(i)); } }); worldIn.removeTileEntity(pos); } }
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.