Commit Graph
2939 Commits
Author SHA1 Message Date
Silver_David 03202a8ab4 [1.19.x] Added RenderLevelStageEvent to replace RenderLevelLastEvent (#8820)
* Ported RenderLevelStageEvent from 1.18.2

* Updated to fix merge conflicts
2022-07-09 12:36:47 -04:00
Nicholas Smit 8a67be4afd [1.19.x] Fix door datagenerator (#8821)
* Fix door datagenerator

Fix datagenerator for door blocks. Successor to #8687, addresses comments made there about statement complexity.

* Fix extra space around parameter

Fix extra space before comma around a parameter.
2022-07-09 12:21:06 -04:00
Drullkus 4c1ab67f33 Create PieceBeardifierModifier to re-enable piecewise beardifier definitions (#8798) 2022-07-09 12:12:55 -04:00
Dennis C 7e06a2105f Allow blocks to provide a dynamic MaterialColor for display on maps (#8812) 2022-07-09 12:10:02 -04:00
Flemmli97andFlemmli97 4a0c8be742 [1.19.x] BiomeTags Fixes/Improvements (#8711)
* dimension specific tag fix

* remove forge:is_beach cause vanilla has it already

* remove forge tags for new 1.19 vanilla tags (savanna, beach, overworld, end)

Co-authored-by: Flemmli97 <Flemmli97@users.noreply.github.com>
2022-07-09 11:59:27 -04:00
Cyborgmas 0c030ee5e1 1.19 - Remove GlobalLootModifierSerializer and move to Codecs (#8721)
* convert GLM serializer class to codec

* cleanup

* GLM list needs to be sorted

* datagen

* simplify serialization

* fix test mods (oops)

* properly use suppliers for codec as they are registry obj
2022-07-09 11:51:41 -04:00
Random832 1134fac54c Implement item hooks for potions and enchantments (#8718)
* Implement item hooks for potions and enchantments

* code style fixes
2022-07-09 11:48:51 -04:00
Néstor Amador a98eeb9d08 Multiple tweaks and fixes to the recent changes in the client refactor PR (#8836)
* Add an easy way to get the NamedGuiOverlay from a vanilla overlay

* Fix static member ordering crash in UnitTextureAtlasSprite

* Allow boss bar rendering to be cancelled

* Make fluid container datagen use the new name
2022-07-09 11:20:55 -04:00
Jonathan Colmenares b558b132cd Add FogMode to ViewportEvent.RenderFog (#8825) 2022-07-09 11:20:40 -04:00
Sara Freimer c102633566 Provide additional context to the getFieldOfView event (#8830) 2022-07-09 11:20:29 -04:00
bdew cce002ad29 Pass renderType to IForgeBakedModel.useAmbientOcclusion (#8834) 2022-07-09 11:20:18 -04:00
Jonathan Coates c7c2478cb0 Handle modded packets on the network thread (#8703)
* Handle modded packets on the network thread

 - On the server we simply need to remove the call to
   ensureRunningOnSameThread.

 - On the client side, we now handle the packet at the very start of the
   call. We make sure we're running from a network thread to prevent
   calling the handling code twice.

   While this does mean we no longer call .release(), in practice this
   doesn't cause any leaks as ClientboundCustomPayloadPacket releases
   for us.

* Clarify behaviour a little in the documentation

* Javadoc formatting

* Add a helper method for handling packets on the main thread

Also rename the network thread one. Should make it clearer the expected
behaviour of the two, and make it clearer there's a potentially breaking
change.

* Add back consumer() methods

Also document EventNetworkChannel, to clarify the thread behaviour
there.

* Add since = "1.19" to deprecated annotations
2022-07-09 11:02:44 -04:00
Marc Hermans b70d99489b Cache resource listing calls in resource packs (#8829)
* Make the resource lookups cached.

* Include configurability and handle patch cleanup.

* Document and comment the cache manager.

* Make thread selection configurable.

* Implement a configurable loading mechanic that falls back to default behaviour when the config is not bound yet.

* Use boolean supplier and fix wildcard import.

* Clean up the VPR since this is more elegant.

* Clean up the VPR since this is more elegant.

* Address review comments.

* Address more review comments.

* Fix formatting on `getSource`

* Address comments by ichtt

* Adapt to pups requests.

* Stupid idea.

* Attempt this again with a copy on write list.

* Fix a concurrency and loading issue.

* Fix #8813
Checks if the paths are valid resource paths.

* Move the new methods on vanilla Patch.
2022-07-09 10:58:11 -04:00
Néstor Amador c3a91872fe Make texture atlas in StandaloneGeometryBakingContext configurable (#8831) 2022-07-09 10:08:43 -04:00
Néstor AmadorandDennis C 4d074f0a1e [1.19.X] Client code cleanup, updates, and other refactors (#8786)
* Revert "Allow safely registering RenderType predicates at any time (#8685)"

This reverts commit be7275443f.

* Renderable API refactors
- Rename "render values" to "context"
- Rename SimpleRenderable to CompositeRenderable to better reflect its use
- Remove IMultipartRenderValues since it doesn't have any real use
- Add extensive customization options to BakedModelRenderable

* ClientRegistry and MinecraftForgeClient refactors
- Add sprite loader manager and registration event
- Add spectator shader manager and registration event
- Add client tooltip factory manager and registration event
- Add recipe book manager and registration event
- Add key mapping registration event
- Remove ClientRegistry, as everything has been moved out of it
- Remove registration methods from MinecraftForgeClient, as they have dedicated events now

* Dimension special effects refactors
- Fold handlers into an extension class and remove public mutable fields
- Add dimension special effects manager and registration event

* HUD overlay refactors
- Rename to IGuiOverlay match vanilla (instead of Ingame)
- Add overlay manager and registration event
- Move vanilla overlays to a standalone enum

* Model loader refactors
- Rename IModelLoader to IGeometryLoader
- Add loader manager and registration event
- Fold all model events into one
- Move registration of additionally loaded models to an event
- Remove ForgeModelBakery and related classes as they served no purpose anymore

* Render properties refactors
- Rename all render properties to client extensions and relocate accordingly
- Move lookups to the respective interfaces

* Model data refactors
- Convert model data to a final class backed by an immutable map and document mutability requirements. This addresses several thread-safety issues in the current implementation which could result in race conditions
- Transfer ownership of the data manager to the client level. This addresses several issues that arise when multiple levels are used at once

* GUI and widget refactors
- Move all widgets to the correct package
- Rename GuiUtils and children to match vanilla naming

* New vertex pipeline API
- Move to vanilla's VertexConsumer
- Roll back recent PR making VertexConsumer format-aware. This is the opposite of what vanilla does, and should not be relevant with the updated lighting pipeline

* Lighting pipeline refactors
- Move to dedicated lighting package
- Separate flat and smooth lighters
- Convert from a vertex pipeline transformer to a pure vertex source (input is baked quads)

* Model geometry API refactors
- Rename IModelGeometry to IUnbakedGeometry
- Rename IModelConfiguration to IGeometryBakingContext
- Rename other elements to match vanilla naming
- Remove current changes to ModelState, as they do not belong there. Transforms should be specified through vanilla's system. ModelState is intended to transfer state from the blockstate JSON
- Remove multipart geometries and geometry parts. After some discussion, these should not be exposed. Instead, geometries should be baked with only the necessary parts enabled

* Make render types a first-class citizen in baked models
- Add named render types (block + entity + fabulous entity)
- Add named render type manager + registration event
- Make BakedModel aware of render types and transfer control over which ones are used to it instead of ItemBlockRenderTypes (fallback)
- (additional) Add concatenated list view. A wrapper for multiple lists that iterates through them in order without the cost of merging them. Useful for merging lists of baked quads

* General event refactors
- Several renames to either match vanilla or improve clarity
- Relocate client chat event dispatching out of common code

* Forge model type refactors
- Rename SeparatePerspectiveModel to SeparateTransformsModel
- Rename ItemModelMesherForge to ForgeItemModelShaper
- Rename DynamicBucketModel to DynamicFluidContainerModel
- Prefix all OBJ-related classes with "Obj" and decouple parsing from construction
- Extract ElementsModel from model loader registry
- Add EmptyModel (baked, unbaked and loader)
- Refactor CompositeModel to take over ItemMultiLayerBakedModel
- Remove FluidModel as it's not used and isn't compatible with the new fluid rendering in modern versions
- Move model loader registration to a proper event handler
- Update names of several JSON fields (backwards-compatible)
- Update datagens to match

* Miscellaneous changes and overlapping patches
- Dispatch all new registration events
- Convert ExtendedServerListData to a record
- Add/remove hooks from ForgeHooksClient as necessary

* Update test mods

* Fix VertexConsumerWrapper returning parent instead of itself

* Additional event cleanup pass

As discussed on Discord:
- Remove "@hidden" and "@see <callsite>" javadoc annotations from all client events and replace them with @ApiStatus.Internal annotation
- Make all events that shouldn't be fired directly into abstract classes with protected constructors
- Another styling pass, just in case (caught some missed classes)

* Add proper deprecation javadocs and de-dupe some vertex consumer code

* Replace sets of chunk render types with a faster BitSet-backed collection

This largely addresses potential performance concerns that using a plain HashSet might involve by making lookups and iteration as linear as they can likely be (aside from using a plain byte/int/long for bit storage). Further performance concerns related to the implementation may be addressed separately, as all the implementation details are hidden from the end user

* Requested changes

- Remove MinecraftForgeClient and move members to Minecraft, IForgeMinecraft and StencilManager
- Allow non-default elements to be passed into VertexConsumer and add support to derived classes
- Move array instantiation out of quad processing in lighting pipeline
- Fix flipped fluid container model
- Set default UV1 to the correct values in the remapping pipeline
- Minor documentation changes

* Add/update EXC entries and fix AT comment

* Add test mod as per Orion's request

* Additional requested changes

* Allow custom model types to request the particle texture to be loaded

* Even more requested changes

* Improve generics in ConcatenatedListView and add missing fallbacks

* Fix fluid render types being bound to the fluid and not its holder

* Remove non-contractual nullability in ChunkRenderTypeSet and add isEmpty

Additionally, introduce chunk render type checks in ItemBlockRenderTypes

Co-authored-by: Dennis C <xfacthd@gmx.de>
2022-07-07 18:34:51 -04:00
Paint_Ninja c2225ab1da Implement full support for IPv6 (#8742) 2022-07-01 15:38:53 -07:00
Dennis C bb03b1a7d1 Fix certain user-configured options being overwritten incorrectly due to validators. (#8780) 2022-06-28 13:23:35 -07:00
Dennis C be7275443f Allow safely registering RenderType predicates at any time (#8685) 2022-06-27 21:18:53 -07:00
Dennis C dc1c973684 Fix crash after loading error due to fluid texture gathering and config lookup (#8802) 2022-06-27 21:16:54 -07:00
Marc Hermans 06d568408c Remove the configuration option for handling empty tags in ingredients. (#8799)
Now empty tags are considered broken in all states.
2022-06-27 21:16:20 -07:00
Jonathan Coates 9b962c8ff0 Fire ChunkWatchEvents after sending packets (#8747) 2022-06-27 21:09:23 -07:00
Joseph B 58a5449c2f Add getter for correct BiomeSpecialEffectsBuilder to BiomeInfo$Builder (#8781) 2022-06-27 21:01:01 -07:00
Michael Bunting 702abe0665 Fix BlockToolModificationEvent missing cancelable annotation (#8778) 2022-06-27 20:59:47 -07:00
Sara Freimer 2070b77fd4 Fix ticking chunk tickets from forge's chunk manager not causing chunks to fully tick (#8775) 2022-06-27 20:58:57 -07:00
dhyces 17565c0ea2 Fix missed vanilla method overrides in ForgeRegistry (#8766) 2022-06-27 20:48:11 -07:00
Budschie 22668ad2c2 Add MinecraftServer reference to ServerTickEvent (#8765) 2022-06-27 20:45:35 -07:00
Dennis C 2ab3d9b8a3 Add callback after a BlockState was changed and the neighbors were updated (#8686) 2022-06-27 20:21:34 -07:00
Ketok d578d8f6df Add biome tag entries for 1.19 biomes (#8684) 2022-06-27 20:08:21 -07:00
eerussianguy fd61016a7e Make fishing rods use tool actions for relevant logic (#8681) 2022-06-27 20:07:51 -07:00
King Lemming 05240fecf7 Make Forge ConfigValues implement Supplier. (#8776) 2022-06-20 23:07:48 +01:00
cpw 7bb97dafda Add "send to mods in order" method to ModList and use it (#8759)
* Add "send to mods in order" method to ModList and use it in RegistryEvents and DataGen..
* Also preserve order in runAll
* Do better comparator thanks @pupnewfster
* postEvent as well.
2022-06-20 16:11:33 -04:00
Marc Hermans fa84c22662 Fix SP-Devtime world loading crash due to missing server configs (#8757) 2022-06-17 11:38:41 -07:00
sciwhiz12 2ae640b530 Remove ForgeWorldPreset and related code (#8756)
Vanilla has a working replacement.
2022-06-17 08:56:12 +01:00
sciwhiz12 4f95a20c5e Change ConfigValue#get() to throw if called before config loaded (#8236)
This prevents silent issues where a mod gets the value of the setting
before configs are loaded, which means the default value is always
returned.

As there may be situations where the getting the config setting before
configs are loaded is needed, and it is not preferable to hardcode the
default value, the original behavior is made available through #getRaw.

Implements and closes #7716

* Remove getRaw() method

This is effectively replaced with the expression `spec.isLoaded() ?
configValue.get() : configValue.getDefault()`.

* Remove forceSystemNanoTime config setting

As implemented, it never had any effect as any place where the config
value would be queried happens before the configs are loaded.
2022-06-17 08:31:45 +01:00
sciwhiz12 915d570b17 Fix EnumArgument to use enum names for suggestions (#8728)
Previously, the suggestions used the string representation of the enum
through Enum#toString, which can differ from the name of the enum as
required by Enum#valueOf, causing invalid suggestions (both in gui and
through the error message).
2022-06-15 14:15:32 -07:00
Marc Hermans 5979636ee5 Jar-In-Jar (#8715) 2022-06-15 12:27:47 -07:00
Silverminer007 5acfc6ae3c [1.19] Fix data-gen output path of custom data-pack registries (#8724) 2022-06-15 16:22:00 +01:00
KnightMiner eabba46595 [1.19] Add support for items to add enchantments without setting them in NBT (#8719) 2022-06-15 00:52:58 +01:00
Joseph B 683bf99fe4 [1.19.x] Add stock biome modifier types for adding features and spawns (#8697) 2022-06-15 00:39:03 +01:00
ChampionAsh5357 2a05c7c01d [1.19.x] Fluid API Overhaul (#8695) 2022-06-14 23:07:51 +01:00
Sara Freimer e386229b66 Replace StructureSpawnListGatherEvent with StructureModifiers (#8717) 2022-06-14 12:05:07 -07:00
Magnus Jensen 59b8ec5625 Use stack sensitive translation key by default for FluidAttributes. (#8707) 2022-06-14 10:18:27 -07:00
SizableShrimp 2818984f6c [1.19.x] Fix experimental confirmation screen (#8727)
Signed-off-by: SizableShrimp <sizableshrimp@sizableshrimp.me>
2022-06-13 17:20:50 +01:00
TelepathicGrunt db225ed04a Move is_mountain to forge's tag instead of vanilla's (#8726) 2022-06-13 02:39:04 +01:00
ChampionAsh5357 0ec4c34a34 [1.19.x] Add CommandBuildContext to Register Command Events (#8716) 2022-06-12 23:36:25 +01:00
cpw e16f54eebe Implement a simple feature system for Forge (#8670)
* Implement a simple feature system for Forge. Allows mods to demand certain features are available in the loading system. An example for java_version is provided, but not expected to be used widely. This is more targeted to properties of the display, such as GL version and glsl profile.

Requires https://github.com/MinecraftForge/ForgeSPI/pull/13 to be merged first in ForgeSPI, and the SPI to be updated appropriately in build.gradle files.

* rebase onto 1.19 and add in SPI update
2022-06-09 17:00:39 -04:00
cpw 27480c15fa displayTest option in mods.toml (#8656)
* displayTest option in mods.toml
* "MATCH_VERSION" (or none) is existing match version string behaviour
* "IGNORE_SERVER_VERSION" accepts anything and sends special SERVERONLY string
* "IGNORE_ALL_VERSION" accepts anything and sends an empty string
* "NONE" allows the mod to supply their own displaytest using the IExtensionPoint mechanism.


* Update display test with feedback and added the mods.toml discussion in mdk.
2022-06-09 16:39:00 -04:00
cpw df0dea59f3 Update forgeSPI to v5 (#8696) 2022-06-09 15:59:48 -04:00
gigaherz d7bc564512 Make IVertexConsumers such as the lighting pipeline, be aware of which format they are dealing with. (#8692)
Also fix Lighting pipeline ignoring the overlay coords from the block renderer.
2022-06-09 21:39:16 +02:00
AzureDoom 7c5e95222e Fixes setPos to syncPacketPositionCodec (#8702) 2022-06-09 11:40:21 -07:00