Commit Graph
2407 Commits
Author SHA1 Message Date
sciwhiz12 b4feee8046 [1.17.x Omnibus] Fix typos and javadocs across code base (#8144) 2021-11-25 13:09:56 -08:00
AterAnimAvis df8954869a Fix /forge setdimension command arguments not parsing/suggesting correctly. 2021-11-25 12:27:26 -08:00
Harley O'Connor 28dd76ebbf Changed control flow of post mouse events to allow listening to events handled by vanilla. (#8133) 2021-11-25 12:03:05 -08:00
sciwhiz12 b639bcb5c7 Deprecate durability bar methods in Item extension (#8214)
To retain compatibility with existing mods, the vanilla methods redirect
to the extension methods for now.

Users should now use and override the vanilla methods as directed in
the javadocs of the now-deprecated methods, as the extension methods
will be removed in the future.

Fixes #8201
2021-11-25 20:09:40 +01:00
sciwhiz12 7538cf5501 Reorder image tooltip component to match vanilla (#8213)
Fixes #8212
2021-11-25 19:58:55 +01:00
Robert Kämpf ebe375dac0 Deprecate net.minecraftforge.common.util.Constants and inner classes to encourage usage of vanilla constants (#8140) 2021-11-23 16:47:43 -08:00
SuperMartijn642 4a2572d545 [1.17.x] Change expected type of LootTable fields to arrays (#8194)
#8184 reverted some LootTable patches, including the types of fields `f_79023_` and `f_79024_`. However, `ForgeLootTableProvider` still expects a list, however the type of the fields is an array now.
This PR changes the expected type in `ForgeLootTableProvider` to an array as well.
2021-11-21 10:26:31 -08:00
MelanX 55db597baa Apply window resizing to all gui layers (#8207) 2021-11-21 13:28:56 +01:00
Minecraftschurli c24d05173f [1.17.x] make ScrollPanel better usable by modders (#8179) 2021-11-20 16:54:12 +01:00
ichttt a784bdb0d0 Remove the remnants of the selective reload listener (#8072) 2021-11-09 14:30:45 -08:00
Alex O'Neill 1dc421e6a4 Add BiomeDictionary#hasType(String) (#8157) 2021-10-20 12:10:13 -07:00
Silver_David e431bb1caa Add "forge:enchanting_materials" tag in place of Lapis in the Enchanting Table (#8149) 2021-10-20 12:08:53 -07:00
ChampionAsh5357 8bd517ca91 Fix Breaking waterlogged blocks occasionally displays air for a frame Closes #7253 (#8128) 2021-10-20 12:01:48 -07:00
ChampionAsh5357 1e040c9f1f Fix Behavior With Unknown Items in Recipes (#8105) 2021-10-20 11:56:23 -07:00
ChampionAsh5357 827ca83cfd Add entity source to PotionAddedEvent (#8147) 2021-10-14 20:13:18 -07:00
Dipo e9f8acd191 Add helper methods to generate blockstate and models for button, pressure plate, sign to BlockStateProvider/ModelProvider (#8139) 2021-10-14 20:11:20 -07:00
Unbekannt1998 4acafcccfd Make AdvancementProvider extensible by modders (#8120) 2021-10-14 20:00:18 -07:00
Take Weiland 6a25c99097 Tooltip event rewrite (#8038)
Redesigns the tooltip events, and adds a feature where mods can register factories for ClientTooltipComponents, which are used for custom rendering in tooltips. The old events are maintained for binary compatibility.
2021-10-11 20:37:14 +02:00
Dennis C 95be0d87d9 Add ForgeSpawnEggItem to lazily handle EntityTypes (#8044) 2021-10-07 23:50:18 -07:00
Dennis C 6125ec3bc8 Reimplement IForgeBlockEntity#onLoad() hook (#7946) 2021-10-07 13:31:56 -07:00
gigaherz 9944a8252a Implement GUI Stacking feature. (#8130)
You can now use `mc.pushGuiLayer` and `mc.popGuiLayer` to manage the layers.
mc.setScreen behaves such that if called with a non-null screen it replaces the entire stack, and if called with null it closes the entire stack.
2021-10-04 19:15:56 -07:00
gigaherz fd544dd414 Add ability for people to add custom pack finders (RepositorySources) (#8121)
Added AddPackFindersEvent which lets you add additional resource/data pack sources to the game.
Added PathResourcePack as a utility to allow easy providing of a subfolder in a mod as a resource pack.
2021-10-04 15:10:05 -07:00
Take Weiland c00777e6ea Added EntityEvent.EnteringSection event to replace EnteringChunk event. (#8078) 2021-10-04 14:43:07 -07:00
sciwhiz12 79272361f0 Re-implement linear filtering text render types (#8052)
* Re-implement linear filtering text render types

Implements and closes #7996
2021-10-03 20:05:19 +02:00
LexManos 96303f6570 Capability rework to get rid of @CapabilityInject and use CapabilityToken as the identifier, deprecated old system for removal in 1.18. (#8116) 2021-09-30 22:54:23 -07:00
Rikka0_0小六花 cd67762bee [1.17.x] implements canConnectRedstone(), Redstone dust now defers to the blockstate for determining connectivity (#8014) 2021-09-27 12:26:17 -07:00
sciwhiz12 be1698bb15 Move ItemStack#forgeInit call earlier to allow earlier capability queries (#8096) 2021-09-19 16:35:55 -07:00
sciwhiz12 b2dbe9de51 Fix inverted hooks for PermissionsChangedEvent (#8089)
Because IEventBus#post returns true on cancellation and the patched-in
hooks inverts the return of the ForgeHooks method, if the player
whose permission level is being changed is online and the event is not
cancelled, the permission change _is_ cancelled.

The fix is inverting the patched-in hooks and the default return value
of the ForgeHooks method, so that the permission change is cancelled
only if the player is online, the event is fired, and the event is cancelled.

Fixes #8088
2021-09-18 14:58:27 -07:00
Marc Hermans 30a33f5c3e Support Lazy capabilities on itemstacks, for better ItemStack copy performance. (#7945) 2021-09-17 11:23:12 -07:00
gigaherz b01a217f45 Fix EntityJoinWorldEvent not firing as expected: (#8033)
- Fix entities loaded from disk not getting the event.
- Fix vehicles with passengers getting the event twice.
2021-09-16 17:11:04 -07:00
ichttt 804f390064 Remove old Log4j thread cache invalidation (#8068) 2021-09-16 16:37:16 -07:00
sciwhiz12 b7379953d5 Add new tool action for shield blocking, replacing IForgeItem#isShield (#8055) 2021-09-08 13:14:47 -07:00
sciwhiz12 9d7f5dd32a Add workaround for pairs of ' being stripped (#8050)
Fixes #7396, where if a translated string with balanced pairs of single
quote characters passes through ForgeI18n, the quotes are stripped
because of ExtendedMessageFormat. This is most notable in languages
where `'` is used frequently, like Canadian French from the bug report.

Note that unbalanced pairs cause an IllegalArgumentException in
ExtendedMessageFormat, which means the message is not affected.
2021-09-08 11:36:00 -07:00
sciwhiz12 049ed79e7b Re-add missing patch for IForgeItem#getEquipmentSlot (#8041) 2021-09-08 11:20:12 -07:00
Mysticdrew 675bf8bde2 Added PlayerPermissionChangedEvent(#8023) 2021-09-08 10:39:27 -07:00
sciwhiz12 dcfbc08504 Patch ModSorter to include forge mod in forgeAndMC list (#8043) 2021-09-01 07:26:29 -07:00
Sara Freimer 19f470ee8c Fix GuiUtils#drawContinuousTexturedBox making assumptions about what shader is currently active, and fix buttons and header not showing on LoadingErrorScreen (#8022) 2021-08-31 17:51:42 +02:00
iTitus a96d078a7a Fix ScrollPanel render calls and usage (#8012) 2021-08-31 16:57:08 +02:00
sciwhiz12 b375da6962 Fix all layers of ItemLayerModel being fullbright (#8039)
Fixes #8007
2021-08-31 11:33:27 +02:00
Cyborgmas d17f10d80c Cleanup Tag Loading, this migrates thins to more of a vanilla style. (#7898) 2021-08-30 14:58:30 -07:00
cech12 a336e443f7 Add Shears ToolActions (#7997)
Make shear interactions extend to subclasses
Add Shears actions for beehive harvesting, pumpkin carving and trip wire disarming
2021-08-30 13:42:37 -07:00
Cyborgmas 95c0aa1e98 Minor resource pack related fixes (#7884) 2021-08-23 10:52:17 -07:00
LexManos 559b801cc4 Fix misaligned patch causing monsters to not spawn in nether fortresses correctly. 2021-08-21 18:30:13 -07:00
Take Weiland aa97ddad8b Add RegisterCapabilitiesEvent (#8021) 2021-08-20 12:38:43 -07:00
Commoble d612dc3a6d Move static ITEM_TIER_ORDERING_JSON resourcelocation declaration from anonymous class into outer class to work around eclipse compiler error. (#8018) 2021-08-19 14:31:05 -07:00
SizableShrimp 9165d4c3a1 Fix entities not spawning in structures (#8020)
This affects swamp huts, pillager outposts, ocean monuments, and nether fortresses
2021-08-18 22:44:26 -07:00
Commoble 12d0f96fc2 Add support for forge's "remove" list to tag datagenerators (#7911) 2021-08-18 13:49:29 -07:00
Sirttas bec9d6f534 Add hook to allow items to customize the attack sweep range. (#7981) 2021-08-18 13:05:19 -07:00
David Quintana 10b51f257f Redesign the tool system to rely on the new vanilla tags. (#7970)
Changed:
- ToolType is replaced with ToolAction, which can selectively represent which actions are supported by an item.
- Added a canPerformAction method to query ToolActions.
- Renamed canHarvestBlock to isCorrectToolForDrops to match vanilla.
- Added TierSortingRegistry, which can be used to add custom tiers and supports sorting between vanilla or with other mods.

How to use:

For the breaking system there's 2 methods:
- getDestroySpeed decides if an item *can* mine the block fast. Override if you have multiple tags or your item isn't a DiggerItem.
- isCorrectToolForDrops decides if an item will get drops. Returning false will also slow down mining, regardless of getDestroySpeed. Override if you have type-dependant tiers or your item isn't a DiggerItem.

For the tier system mods can just call `TierSortingRegistry.registerTier(tier, "name", List.of(lesser tiers), List.of(better tiers));` to register their tiers.
There's helper methods to query tiers such as TierSortingRegsitry.isCorrectTierForDrops.

The ToolActions solve 2 problems:
1. distinguishing which kind of digger an item can be
2. querying if the item can perform specific secondary actions.
Any item can override `canPerformAction` to customize which actions it performs.
2021-08-10 15:45:08 -07:00
LexManos 52d7df06da Fixed reference to registryAccess in dimension fix, and marked for removal in next MC version. Closes #7961 2021-08-10 13:10:50 -07:00