Compare commits

...
236 Commits
Author SHA1 Message Date
LexManos f54998a6b7 1.16.4 Initial Update 2020-11-02 10:42:45 -08:00
LexManos 7d00d015f3 Fix Biomes not properly copying over ids loaded from the save to the new Dynamic Registry. 2020-11-01 20:30:38 -08:00
David Quintana fed7beab89 Introduce custom loader additions to the model data generators. (#7450)
Currently implemented loaders:
* OBJ
* Composite
* Multi-layer
* Item layers (vanilla item/generated but with fullbright texture support)
* Bucket
* Separate Perspective
2020-11-02 02:09:49 +01:00
cpw cf3e9d1e0c actually rollback on error in registry events.
Signed-off-by: cpw <[email protected]>
2020-11-01 19:51:56 -05:00
cpw 749c9063af Fix config parse failure causing crash in building exception message. fixes #7438
Signed-off-by: cpw <[email protected]>
2020-11-01 17:09:00 -05:00
Tobias Hotz 1af6632a29 Auto-detect ansi support for log4j2
move to fml.loading subpackage

Add license header
2020-11-01 17:03:12 -05:00
cpw 7e79243bca Return client resources even if no data pack found on server. Closes #6225 (Pull request)
Signed-off-by: cpw <[email protected]>
2020-11-01 17:02:56 -05:00
cpw 36f9c804d9 Update modlauncher. fixes #7452
Signed-off-by: cpw <[email protected]>
2020-11-01 16:05:02 -05:00
malte0811 06fe9ccda0 Fix (NonNull)Lazy.Concurrent using a global lock (#7403)
* Fix Lazy.Concurrent using a global lock, thus preventing multiple threads from resolving independent Lazy's at the same time
* Use Lazy with an added null check to implement NonNullLazy
2020-10-29 18:09:20 +01:00
David Quintana 53eedb0f10 Update forge mappings to 20201028-1.16.3 (#7435) 2020-10-29 01:11:57 +01:00
Alex O'Neill 6e0e67b14d Fix breaking changes from the Biome rename PR #7434 (#7439) 2020-10-27 09:00:53 -07:00
sciwhiz12 22f7f4649b Reimplement nametag distance attribute, fix attribute translation keys (#7387) 2020-10-26 16:52:36 -07:00
Alex O'Neill 8a77681574 Fix data pack biomes failing to load in SingleBiomeProvider (#7434) 2020-10-26 15:06:53 -07:00
cpw 6982c5dd56 Add in proper handling of equals and hashcode for modjar urls. Fixes very slow loading on windows.
Signed-off-by: cpw <[email protected]>
2020-10-26 18:00:14 -04:00
cpw 7205c30ece Force 8.0.5 ML
Signed-off-by: cpw <[email protected]>
2020-10-26 08:51:05 -04:00
cpw 80baad974e Restore FingerprintViolationEvent with appropriate THIS IS F*CKING DEAD DELET WARNINGS.
Also, notify in UI if using legacy JDK without capability to read out security data from mod jars.

Signed-off-by: cpw <[email protected]>
2020-10-26 07:31:49 -04:00
cpw ae160cad12 Add signature reporting for mods, using new signature capture from ModLauncher. Need to figure out
how to reflect Minecraft's JAR signatures into here.

Signed-off-by: cpw <[email protected]>
2020-10-25 22:26:16 -04:00
cpw 6ff6277efa Rollback registries to vanilla state if something happens during loading, so subsequent activities can still run and not generate false reports..
Signed-off-by: cpw <[email protected]>
2020-10-25 11:33:43 -04:00
LexManos 74f9ef838a Fix mcp_snapshot mapping issue causing unneeded patches. Closes #7424 2020-10-20 12:32:19 -07:00
David Quintana 395f89c973 Fix resource leak in the OBJ loader. 2020-10-20 13:24:12 +02:00
SilverDavid 8536521b7b Fix issue with ITeleporter allowing easier use of vanilla logic. (#7317) 2020-10-16 12:09:53 -07:00
Richard Freimer b1659300e0 Adds tag support for Enchantments, Potions, and TileEntityTypes (#7379) 2020-10-15 12:45:25 -07:00
LexManos 93226bbcff Resuscitate BiomeDictionary using RegistryKeys instead of biome references. 2020-10-15 12:43:18 -07:00
Ocelot 51fa230e7b Add event for player changing game mode (#7355) 2020-10-15 10:15:06 -07:00
cpw 5f292895cb Fix RCON multipacket responses not actually understanding UTF8.
Signed-off-by: cpw <[email protected]>
2020-10-12 14:10:57 -04:00
cpw 9cfe741cea Fix RCON not sending newlines in output for multiline. Fixes https://bugs.mojang.com/browse/MC-7569, a very old bug that is really annoying if you use RCON.
Signed-off-by: cpw <[email protected]>
2020-10-11 21:48:55 -04:00
ChampionAsh5357 bed38d4253 Fix Texture Presence String (#7408) 2020-10-10 09:45:18 -07:00
LexManos 37f226eda5 Fix typo causing potential error in vine growth. Closes #7406
Sort missing registry dumps by name, making it easier to read.
2020-10-09 12:56:26 -07:00
David Quintana 59b4affbe7 Fixed conditional advancement loading when using the "advancements" array.
Added automatic generation of conditional advancements from the criteria in the conditional recipe entries.
Added advancement name calculation from the recipe ID.
2020-10-09 15:47:32 +02:00
Flanks255 5477a36656 Additions to the mdk build.gradle to accommodate datagens. (#7398) 2020-10-08 14:03:41 -07:00
DaemonUmbra 5648336893 Added Basic Class-Level SAS Capability to checkSAS, added Vector4f to SAS (#7385) 2020-10-08 14:02:48 -07:00
Richard Freimer f5b53d5d10 Add hooks to allow modification of structures spawn lists (#7344) 2020-10-07 13:04:03 -07:00
Richard Freimer 10448c1ac9 Add back patches to Screen allowing for item tooltips to be auto wrapped again (#7378)
Only deals with the methods receiving an ItemStack or ITextComponent(s), the methods that take IReorderingProcessor(s) are left alone.
2020-10-06 21:38:27 +02:00
Mumfrey 5243275db2 Bump mixin version to 0.8.2 2020-10-05 15:34:07 +01:00
cpw 3041c2022b Add in extra debug logging
Signed-off-by: cpw <[email protected]>
2020-10-04 17:45:28 -04:00
cpw 09be003d61 Remove redundant call to CrashReport generator - Vanilla is doing a crashreport for itself at startup now.
Add a UUID into crashreport that is also logged in all channels at crash report generation time. This will allow to associate crash reports and the logs.

Signed-off-by: cpw <[email protected]>
2020-10-04 16:40:38 -04:00
cpw 3fe5ddd68f Fix doc README and answer lex's question
Signed-off-by: cpw <[email protected]>
2020-10-04 15:50:58 -04:00
cpw 935cb6782d Modify how ModLoadingStage handles dispatch to Registry Events. Stops the objectholder spam and generally improves performance on larger packs.
Signed-off-by: cpw <[email protected]>
2020-10-04 15:50:15 -04:00
DaemonUmbra 9b421b54a7 Added "Bukkit Plugin" to InvalidModIdentifier (#7384) 2020-10-02 16:40:06 -07:00
Richard Freimer 6e23030595 Fix vanilla Campfire smoke bug. MC-201374 (#7381) 2020-10-02 16:34:17 -07:00
sciwhiz12 78d69db79e Fix toggleable keybindings still being active while in GUI Fixes #7370 (#7373) 2020-10-02 16:28:21 -07:00
Max Becker 9177ac1b2e Fix modded EntityClassifications not being useable in the codec. (#7337) 2020-10-02 15:06:48 -07:00
cech12 248d207dbc Support effective materials of vanilla AxeItem (#7351) 2020-09-28 11:01:59 -07:00
LexManos 03082c361a Prep new RB. 2020-09-23 23:48:57 -07:00
ichttt 65372e3123 Fix grass disappearing when alwaysSetupTerrainOffThread is true (#7291) 2020-09-23 23:43:07 -07:00
Alex O'Neill 0f923fa51f Accessors for inspecting and removal of biome generation settings. Fixed carvers still being immutable. (#7339) 2020-09-23 23:39:25 -07:00
LexManos d1e3567c6b Revive BiomeManager and BiomeLayer hooks. 2020-09-23 23:35:40 -07:00
Richard Freimer af75547d37 Fix a few minor issues with custom tag types and fix OptionalNamedTags (#7316) 2020-09-23 20:12:11 -07:00
Take Weiland 37be3aff2d Fix ToggleableKeyBinding differences to vanilla. (#7338) 2020-09-23 15:10:01 -07:00
Take Weiland b9b17d8331 Fix forge light pipeline applying block offsets twice (#7323) 2020-09-23 14:34:38 -07:00
Yunus 2a433a5c8c Updated build badge versions to 1.16.3 in readme (#7325) 2020-09-23 14:25:59 -07:00
ichttt e344fd08a5 Add a better license error screen (#7350) 2020-09-23 14:16:36 -07:00
Tyler Hancock 0484f695fb Fixed container item being consumed in brewing stand. #7307 (#7314) 2020-09-22 12:14:08 -07:00
sciwhiz12 e55bd86dff Fix parse results of CommandEvent being disregarded (#7303) 2020-09-22 12:06:01 -07:00
Nightenom b1247df4dc [1.16] Fix possible crash when using rendering regionCache (#7207) 2020-09-22 11:58:19 -07:00
Alex O'Neill 91dda36b08 [1.16] Reimplement ICloudRenderHandler, ISkyRenderHandler and IWeatherRenderHandler (#6994) 2020-09-22 11:41:07 -07:00
Alex O'Neill ac19d1bf2b Make Biome.Climate and BiomeAmbiance fields accessible (#7336) 2020-09-17 17:57:58 -07:00
cpw e0e0302ece Use mixin 0.8.1. Should fix problems with mixin not working properly with latest modlauncher.
Signed-off-by: cpw <[email protected]>
2020-09-17 16:41:46 -04:00
Sebastian Hartte 6eb3e20abb Sets the empty/fill sounds for vanilla fluids.
Use Fluid's fillSound rather than emptySound when filling buckets.
2020-09-15 22:06:17 +02:00
Cyborgmas 738491c25d Add MatrixStack-aware alternatives to the methods in GuiUtils (#7127) 2020-09-15 21:46:58 +02:00
Justin Wiblin 2686b7a9ab Fix json biomes not setting registry name correctly for the BiomeLoadingEvent. (#7329) 2020-09-15 09:51:45 -07:00
David Quintana 4b93e3a224 Fix inconsistencies in how the values from the model are passed into the baked model.
This puts them in line with vanilla, as intended.
2020-09-15 16:17:57 +02:00
Yunus 873c490470 Reimplemented drawHoveringText (#7268) 2020-09-15 15:22:50 +02:00
LexManos 11e3281b3f New BiomeLoadingEvent that allows modders to edit biomes as they are being deserialized. 2020-09-14 17:43:01 -07:00
LexManos ce6c664acd Bump MCP version for lambda issue. 2020-09-11 08:55:13 -07:00
LexManos c75eb9e7cf 1.16.3 Update
Also included a bunch of warning cleanups.
2020-09-10 12:01:45 -07:00
Redstone_Dubstep 2353cd982a Fix tile entities being replaced when not needed. (#7318) 2020-09-10 11:54:48 -07:00
malte0811 dbcf8bd075 Fix exception when getting rendering box for tile entities with no collision boxes. (#7301) 2020-09-10 11:02:06 -07:00
cpw 9f3141ea16 More crash reporting tweaks. Don't crash when trying to show warnings. Also, put the exception name in the error screen on the second line!
Signed-off-by: cpw <[email protected]>
2020-09-09 19:04:19 -04:00
Take Weiland c382527ba2 Fix Minecart speed cap on rail being initialized to 0 (#7315) 2020-09-09 10:09:00 -07:00
Richard Freimer 45f8dc5245 Add support for custom tag types (#7289) 2020-09-08 19:10:36 -07:00
cpw 43391c009c More crash report tweaks. Put a button to open the generated crash report on the error screen, tweak formatting of crash report, and add the enhanced stack trace data (transformers et al)
Signed-off-by: cpw <[email protected]>
2020-09-08 20:05:45 -04:00
ChampionAsh5357 15733a18e4 New hook for better custom scaffolding movement (#7261) 2020-09-08 14:00:09 -07:00
Cyborgmas f68344cd7c Fixed crash with zip paths (#7300) 2020-09-08 13:47:39 -07:00
mrp-v2 e421ea164c Fix custom teleporters NPE (#7296) 2020-09-08 13:29:07 -07:00
Cyborgmas 178e3d244a Prevent duplicate wrapper tags from crashing (#7283) 2020-09-08 13:25:23 -07:00
Tschipp bd5e107628 Add partialTicks to RenderNameplateEvent (#7277) 2020-09-08 13:24:02 -07:00
NoahBeech a477671c03 Fixing logic in getCurrentRailPosition to correctly identify the rail… (#7276) 2020-09-08 13:23:18 -07:00
Edwin Mindcraft 887bc37209 [1.16.x] Fixes for Bamboo, Enchantments and Conduits, small adjustments to bring some patches closer to the vanilla code. (#7239) 2020-09-08 13:03:36 -07:00
sciwhiz12 47f05a4fcd Bump resource pack version to 6 (#7299) 2020-09-08 13:02:28 -07:00
sciwhiz12 47ba5b7a89 Remove dead ForgeHooks.canToolHarvestBlock function. (#7262) 2020-09-08 13:01:26 -07:00
ChampionAsh5357 05480843cd Re-implement DrawHighlightEvent$HighlightEntity Firing (#7233) 2020-09-08 12:50:06 -07:00
ichttt 0e1ed8c936 Reimplement FarmlandWaterManager (#7213) 2020-09-08 12:25:48 -07:00
Cyborgmas edf41bda19 Add dataprovider for Global Loot Modifiers (#6960) 2020-09-08 12:11:08 -07:00
ichttt 051416b823 Fix crash when dumping crash report for an exception that has a null cause (#7308) 2020-09-08 12:00:55 -07:00
cpw 84fe2cbcc4 Tweak crash report dump to visit all the causes up to the top.
Signed-off-by: cpw <[email protected]>
2020-09-06 21:29:21 -04:00
cpw 4ff0d246ce Fix ExplodedDirectoryLocator visiting non-existent paths. Closes #7203
Also, bump modlauncher to 7.0.1 to fix resources.

Signed-off-by: cpw <[email protected]>
2020-09-06 19:38:58 -04:00
cpw 9051021474 Fix some potential issues in crash dumping during mod loading
Signed-off-by: cpw <[email protected]>
2020-09-06 18:07:53 -04:00
cpw cc473be332 Park the polling thread for a bit, if we're not the one driving the task list forwards. This allows for the actual driver to work on low cpu count machines.
Signed-off-by: cpw <[email protected]>
2020-09-06 17:55:03 -04:00
cpw b1f73a0760 Use new enumeration mechanism in ModLauncher, to allow getResources to work. This enables serviceloader-in-mods, and other stuff that might need to visit multiple mod jars. Also, tweaked the visitor code slightly, may result in a trivial performance change. Closing #7302 as it's not really relevant any more.
Signed-off-by: cpw <[email protected]>
2020-09-06 17:54:05 -04:00
cpw de03eb6e3c Fix compiler issue in eclipse properly
Signed-off-by: cpw <[email protected]>
2020-09-03 12:09:29 -04:00
sciwhiz12 bef8c2da3d Fix crash caused by previous commit (#7298) 2020-09-03 08:40:40 -04:00
LexManos 3820d1b66f Dirty casting hacks to fix eclipse compiler inference issue. I'm sorry cpw. 2020-09-02 21:15:16 -07:00
tterrag 7dbae7ea4a Fix broken ExistingFileHelper import
Add licenses to some new files
2020-09-02 23:37:46 -04:00
tterrag be5885155c Add validation via resources for tag providers (#7271)
BREAKING CHANGE: Moved ExistingFileHelper to common package
Remove various workarounds from forge tag providers
2020-09-02 23:18:22 -04:00
cpw 5dac065994 Move the "modloading" thread activity onto _our_ worker pool. It turns out that the vanilla worker pool can deadlock during stitching if it's insufficiently large, if modloader "waitForTransition" is also a worker member of that pool.
Closes #7293 (to reproduce issue easily, modify Util.func_240979_a_ and change the values in the MathHelper.clamp call). I've verified that 3 and below for "max" cause the problem. (I didn't test a whole range of values, just sufficient to reproduce problem and verify fix). Note that setting it to zero (and using the "direct executor" that's inaccessible in normal operation) works as well with this fix.

Signed-off-by: cpw <[email protected]>
2020-09-01 14:36:02 -04:00
cpw 1d7db95539 Fix missed debugging code. Read the config from the config.
Signed-off-by: cpw <[email protected]>
2020-08-31 22:26:53 -04:00
cpw de24783152 Fix up slight registry change and other 1.16.2 stuffs.
Signed-off-by: cpw <[email protected]>
2020-08-31 21:30:53 -04:00
cpw bfeec0c7bd Merge branch '1.16.1' into 1.16.x
# Conflicts:
#	patches/minecraft/net/minecraft/client/Minecraft.java.patch
#	patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch
#	src/main/java/net/minecraftforge/fml/client/ClientModLoader.java
#	src/main/java/net/minecraftforge/registries/GameData.java
2020-08-31 21:15:56 -04:00
cpw 2e42340dfa Fix up all the things. Removed SidedProvider because it served no real purpose anymore.
Signed-off-by: cpw <[email protected]>
2020-08-31 21:00:44 -04:00
cpw 16b82bb97b Merge branch '1.16.x' into 1.16.1
# Conflicts:
#	src/main/java/net/minecraftforge/fml/ModList.java
#	src/main/java/net/minecraftforge/fml/client/ClientModLoader.java
2020-08-30 21:44:51 -04:00
cpw d76ee4edd7 Redo event dispatch, removes a bunch of nonsense, and tries to integrate with the vanilla CF system where possible
Signed-off-by: cpw <[email protected]>
2020-08-30 21:39:06 -04:00
ichttt cf09f3eeb9 Add particle culling (#6981) 2020-08-30 16:05:16 -07:00
LexManos d8eaeabf3c Wrap vanilla's 'default' biome registry in ForgeRegistry.
This should allow registering mod dimensions like in 1.16.1, while the data driven system is fleshed out.
2020-08-26 09:49:41 -07:00
David Quintana 600e68cace Clarify in the LazyOptional which methods carry the lazyness over to the returned value and which don't. (#6750)
For consistency, this meant making a few changes:
- Renamed the existing lazy mapping method to lazyMap, to indicate that it doesn't run the mapping immediately.
- Added a new implementation of map(), which returns Optional<T>, and resolves the value in the process.
- Changed filter() to return Optional, since there's no way to filter lazily.
- Added a new method resolve(), which helps convert the custom LazyOptional class into a standard Optional, for use
with library methods that expect Optional<T>.

* Update License headers.
2020-08-25 03:11:28 +02:00
sciwhiz12 625cd746ef Add user-friendly exceptions when config loading fails (#7214) 2020-08-21 14:27:12 -07:00
Max Becker fc000fe913 Replace EntityHeight event with EntitySize event (#6858) 2020-08-21 11:53:37 -07:00
Davide Albiero e3db429763 [1.16] ForgeEventFactory#canCreateFluidSource reintroduced (#7181) 2020-08-21 11:37:43 -07:00
Cyborgmas e803006360 Cleanup and expand Forge tags (#7004) 2020-08-21 11:30:21 -07:00
sciwhiz12 07ffc890e5 Fix modproperties property in mods.toml causing exception (#7192) 2020-08-21 11:25:40 -07:00
Philip T 5a20705f05 Log info about server list warning (#7209)
Make it easier to figure out what mods are missing or have to be marked as client/server side only.
2020-08-21 11:15:44 -07:00
mcenderdragon aaa1deeef2 Fix ItemStack#isDamageable is not calling Item#isDamagable (#7221) 2020-08-21 11:06:38 -07:00
Take Weiland 50197b1fa5 Improve performance and cleanup code for DelegatingResourcePack (#7228) 2020-08-21 10:48:48 -07:00
Cyborgmas 797791c2af Fix small logging issues with loading pack.png for mods (#7265) 2020-08-21 10:24:49 -07:00
Take Weiland c2de232703 Fix config iteration order (#7230) 2020-08-21 10:23:20 -07:00
LexManos 9118c3dd24 Cleanup Forge's build script, fix some unneeded patches.
Add checkExcscheckAll tasks.
2020-08-21 02:47:04 -07:00
ChampionAsh5357 c6d512afe8 Readding DifficultyChangeEvent hooks (#7240) 2020-08-20 21:35:09 -07:00
malte0811 5037adede9 Improve startup time by caching the manifest data for mod jars (#7256) 2020-08-20 21:29:02 -07:00
Yunus a5aca97e31 Removed HarvestDropsEvent (#7193) 2020-08-18 22:47:38 -07:00
Cyborgmas edca0c7293 Remove forge optional tags in favor of Vanilla's new system. (#7246) 2020-08-18 22:22:34 -07:00
LexManos 132cc3659d New method for creating modded tag references, fix connecting to vanilla servers. 2020-08-14 12:04:55 -07:00
LexManos 680c4062f4 Fix creating nether portals. 2020-08-14 12:04:17 -07:00
sean e1efab0452 Print mod file name on InvalidModFileException (#7241) 2020-08-13 19:16:53 -07:00
Yunus bd428de4fa Updated MDK and README for 1.16.2 (#7243) 2020-08-13 12:22:58 -07:00
Cyborgmas 978b3c7fb1 Fix server connection, misapplied patch (#7245) 2020-08-13 12:22:17 -07:00
LexManos fe43088c96 Initial 1.16.2 Update 2020-08-13 00:35:08 -07:00
David Quintana a3c4ffd2c1 Fix ModelRegistryEvent firing every time resources reload instead of just once. 2020-08-09 22:04:44 +02:00
David Quintana a8e68328c4 Move ModelRegistryEvent invocation to when the model loading is about to start.
Freeze the ModelLoaderRegistry right after this event happens, just before model loading actually begins.
This means ModelRegistryEvent is now the correct place to register loaders, as it was intended.
This is a slight breaking change, but any mod that used FMLClientSetupEvent before will need to be updated regardless due to the existing race condition.
2020-08-08 03:00:15 +02:00
Take Weiland 8bad5b1f13 Fix wrong BlockState param passed into canSustainPlant from FarmlandBlock (#7212) 2020-08-03 17:19:12 -07:00
sciwhiz12 54b4089afd Add harvest levels for hoes and new 1.16 blocks for pickaxes Fixes #7187 (#7189) 2020-08-03 17:06:36 -07:00
sciwhiz12 493608e1b5 Fix debug world not generating modded blocks (#6926) 2020-08-03 17:00:31 -07:00
ChampionAsh5357 0984777c98 New IForgeBlock#getToolModifiedState hook allow better control over tools interacting with blocks. (#7176) 2020-08-03 16:49:26 -07:00
Xerousso 97a2b9a448 Added new hook to allow Biomes to control their Edge biomes (#7000) 2020-08-03 16:21:13 -07:00
brandon3055 399bc6c9c3 Add support for custom elytra (#7202) 2020-08-03 15:55:10 -07:00
Take Weiland 20702456ac Re-introduce "outdated" notification on Mods button in main menu (#7123) 2020-08-03 15:11:06 -07:00
sciwhiz12 b4a6d186de Fix RenderTickEvent using wrong partial ticks value when game is paused. Fixes #6991 (#7208) 2020-08-03 11:53:21 -07:00
tterrag 8f9e52c260 Implement forge IBakedModel methods in vanilla wrapper models 2020-07-29 23:10:40 -04:00
LexManos e62805f1d7 Fix another case of swallowed errors not shutting down mods. 2020-07-28 16:44:29 -07:00
cpw ff752ab14b Revert "Properly shutdown FMLModContainer's event bus when an error in a lifecycle event is detected."
This reverts commit 30bad1e2

Signed-off-by: cpw <[email protected]>
2020-07-28 19:17:35 -04:00
cpw 19a38f5cb9 Revert "Shut down all other mod handlers if the loading cycle errors. This prevents other mods from throwing errors and being blamed for initial cause. This is a temporary hack until cpw re-writes the mod event dispatcher."
This reverts commit 7592bbe8

Signed-off-by: cpw <[email protected]>
2020-07-28 19:17:29 -04:00
LexManos 7592bbe87e Shut down all other mod handlers if the loading cycle errors.
This prevents other mods from throwing errors and being blamed for initial cause.
This is a temporary hack until cpw re-writes the mod event dispatcher.
2020-07-28 14:39:53 -07:00
LexManos 30bad1e26d Properly shutdown FMLModContainer's event bus when an error in a lifecycle event is detected. 2020-07-28 12:01:15 -07:00
LexManos 5104824a1b Enable EventBus type check during ForgeDev, and add IModBusEvent marker to ModelRegistryEvent. 2020-07-28 10:24:52 -07:00
LexManos 4ffcdaa6da Make license toml entry optional during 1.16.1
There are to many existing mods to make this required.
Yes, we are technically before a RB and can do breaking changes. However this is too large.
2020-07-28 00:16:18 -07:00
cpw 95d2b6ae89 Missed one event. NewRegistry needs the marker.
Signed-off-by: cpw <[email protected]>
2020-07-27 21:13:53 -04:00
cpw d21c05b9ea Update MDK license to default to All rights reserved, and offer a link to chooseyourlicense.com as a place to research appropriate licenses.
Note: the license field _is_ backwards compatible and will simply be ignored on older forge versions.
Signed-off-by: cpw <[email protected]>
2020-07-27 21:06:48 -04:00
cpw 97dfcbc52b Update coremods and spi, include mandatory license field in metadata. Added at top level of mods.toml file.
Signed-off-by: cpw <[email protected]>
2020-07-27 20:21:39 -04:00
cpw 532d153d33 Update modlauncher, eventbus, accesstransformers and more to use a newer mechanism for generating ASM.
Introduced IModBusEvent as a marker interface for events on the ModBus. Expect exceptions if you use
the modbus for events not listened there.

Signed-off-by: cpw <[email protected]>
2020-07-27 19:40:43 -04:00
Raycoms 849e718a42 Fix rail 180 rotations (#7177) 2020-07-27 16:35:15 -07:00
Jamie Mansfield 720966544d Fire AnimalTameEvent for cats (#7172) Closes #7171 2020-07-27 16:00:14 -07:00
LexManos 7717795f42 Fix Biome generation error. 2020-07-27 15:56:04 -07:00
Paul Becker daa817bbdf Fix SleepingTimeCheckEvent not being fired in initial sleep test. (#7005) 2020-07-27 14:35:13 -07:00
Yunus fba168051a Fix ClimberPathNavigator spinning when width is small. Closes #6993 (#6997) 2020-07-27 14:30:16 -07:00
Tschipp 941b9a1d1f Re-added PlayerEvent.NameFormat (#6992) 2020-07-27 14:16:35 -07:00
Xerousso 27798c5804 Fixed modded overworld biomes not spawning [1.16.x] (#6990) 2020-07-27 14:10:42 -07:00
Cyclonit 9d84b5df31 Added EntityLeaveWorldEvent (#6984) 2020-07-27 14:06:01 -07:00
Amber 00797fdb3a Re-implement moddable flammabilities (#6983) 2020-07-27 14:02:45 -07:00
Yunus 8d617767ad Updated versions in README and removed flocker.tv mentions (#6978) 2020-07-27 13:42:06 -07:00
Take Weiland c9f9fd01b5 Re-add patch for PlayerSetSpawnEvent (#6977) 2020-07-27 13:41:35 -07:00
sciwhiz12 2450693f7d Fix ChunkDataEvents using different data tags (#6961) Fixes #6957 2020-07-27 13:40:22 -07:00
Joseph Tarbit cf7784ac4b Post SoundLoadEvent on mod bus instead of forge bus (#6955) 2020-07-27 13:26:51 -07:00
cpw e3137213e5 Remove startupquery. Currently wasn't functional, and 1.16 has out of band state loading in all cases, so the complex functionality there is no longer needed. Going to research using the Lifecycle indicator from DFU as a proxy/replacement. Probably with some codec FUN.
Signed-off-by: cpw <[email protected]>
2020-07-21 21:26:02 -04:00
LexManos 7b43b9f8c0 Run Forge's data generators to sync 1.16 vanilla changes. 2020-07-21 17:34:23 -07:00
cpw daa85d3c5b Don't show the early launcher GUI when running data. It's not needed and prevents use on automated builds.
Need to investigate why a bunch of tags seem to be being blown away by rerunning on forge.

Signed-off-by: cpw <[email protected]>
2020-07-21 20:12:33 -04:00
cpw 9e8c4c3a58 Add mixin
Signed-off-by: cpw <[email protected]>
2020-07-21 19:55:57 -04:00
Cyborgmas 24f3ef5ffe Load Modded Datapacks in DatapackScreen, before world creation (#6913) 2020-07-20 15:56:21 -07:00
tterrag a3edfd3748 Fix inconsistencies with model/blockstate datagen 2020-07-18 18:34:35 -04:00
Max Becker 96b9a057b7 Filter duplicate mod files from mod file scan data (#6855) 2020-07-17 10:35:38 -07:00
LexManos 638d1d31de Fixed Forge commands. Closes #6973 Closes #6974 Closes #6976 2020-07-16 14:08:13 -07:00
Jared 00013865b0 Added an event for registering commands. closes #6968 (#6969) 2020-07-15 12:30:41 -07:00
Tyler Hancock 6722e7a428 Make all functions in Style common. (#6931) 2020-07-13 17:15:32 -07:00
seymourimadeit 0f56b4c4ee Mark Raid.WaveMembers as an extensible enum. (#6878) 2020-07-13 15:40:37 -07:00
LexManos 201349f8de Fix checkPatches task. Closes #6956
Fix patched in method using srg name. Closes #6965
Fix capabilities not being collected for ClientWorld. Closes #6966
Fix TagEmptyCondition using client side copy of tags instead of server. Closes #6949
Fix ExtendedButton using narrator text. Closes #6958, Closes #6959
Fix misaligned patch in RepairContainer. Closes #6950, Closes #6953
Fix LivingJumpEvent not being fired for players jumping horses. Closes #6929
Remove extra getToughness method in ArmorItem. Closes #6970
Remove GetCollisionBoxesEvent. Closes #6921
2020-07-13 15:17:37 -07:00
Richard Freimer 065ebde57e Fix race condition with DeferredRegister for custom registries (#6951) 2020-07-10 14:08:22 -07:00
sciwhiz12 6b3f2f46fa Remove hooks into beacon base/payments. Vanilla uses tags now for extensibility. (#6948) 2020-07-10 10:49:42 -07:00
Jared e4ffbeb329 Expose the DataPackRegistries instance to the AddReloadListenerEvent (#6933) 2020-07-08 14:24:01 -07:00
sciwhiz12 60ee0bcdb3 Fix canRepair not being set true as default (#6936)
Closes #6934 and #6935
2020-07-08 14:13:07 -07:00
David Quintana 2a2306d6e1 Fix misaligned patch causing LivingEquipmentChangeEvent to never be posted. 2020-07-08 16:54:47 +02:00
David Quintana fc3fa13bf3 Fix particles sometimes "losing" the lightmap and drawing fullbright. 2020-07-08 12:01:27 +02:00
Justin aab8adb884 Add simple patch checker and cleanup patches (#6851)
* Add simple patch checker and cleanup patches

* Address comments
 * move task implementation
 * genPatches is now finalized by checkPatches
 * the S2S artifacts are automatically removed
 * added class and method access checking
2020-07-06 14:30:10 -07:00
Richard Freimer 2ad347b043 Fix the modifier combined name for keybinds displaying two pluses outside of forgedev #6901 (#6902) 2020-07-06 14:26:54 -07:00
Richard Freimer d26e285e09 Fix harvest level and tool type not actually getting set #6906 (#6922) 2020-07-06 14:12:36 -07:00
Richard Freimer 91a2b02590 Reimplement ITeleporter Patches (#6886) 2020-07-06 13:45:22 -07:00
Mysterious_Dev a567ddaa10 Add function to add items with the same behavior as the pumpkin for enderman (#6890) 2020-07-06 13:34:01 -07:00
Richard Freimer 68e71009f3 Custom Item integration with Piglins (#6914) 2020-07-06 13:30:17 -07:00
ichttt 0227bfe9ee Some dead code cleanup, and re-implement some bed hooks. (#6903) 2020-07-06 13:19:53 -07:00
Take Weiland df57e0a1ba Fix missing null checks in ForgeIngameGui (#6907) 2020-07-06 13:06:31 -07:00
sciwhiz12 68ea1b654c Fix swap offhand keybind not working in GUIs (#6920) 2020-07-06 12:43:05 -07:00
Cyborgmas ff86201523 New AddReloadListenerEvent that gathers server side data reload handlers. (#6849) 2020-07-06 12:41:57 -07:00
David Quintana 8e5138da27 Attempt to use a more compatible method to initialize stencil support.
In case the separate attachments don't work for everyone, there's a new setting to choose the combined attachment.
2020-07-03 14:40:21 +02:00
David Quintana a690a7526a Fix multi-layer item rendering. 2020-07-03 05:54:46 +02:00
David Quintana 517bbc8b5b Update copyright year to 2020. 2020-07-02 19:49:11 +02:00
David Quintana ce3d8b40cf Model system improvements:
- Port some things I did in 1.14 which I couldn't do in 1.15 due to breaking changes.
- Fix multi-layer block models not working (1.16 RenderType doesn't override toString the same way anymore)
- Implement multi-layer item rendering.
- Improve CompositeModel submodel data passing.
2020-07-02 19:16:40 +02:00
Cyborgmas 45152c6073 Pass matrixstack in tooltip render events (#6885) 2020-07-02 14:43:41 +02:00
SuperMartijn642 46c9dec421 Include model data in getQuads call (#6884)
The model data wasn't included when getting quads from specific sides, but was when getting quads for side = null.
2020-07-02 14:43:23 +02:00
tterrag a0b0e6788d Fix improper handling of baked lighting in forge light pipeline
Closes #6812
2020-07-02 01:53:52 -04:00
pupnewfster b00c91af3c Fix FMLServerAboutToStartEvent being fired too late on the integrated server https://github.com/MinecraftForge/MinecraftForge/issues/6859 2020-07-01 21:59:03 -04:00
ichttt d11a582a25 Fix miss-aligned patch ItemEntity (#6895) 2020-07-01 11:14:16 -07:00
MelanX bf1a0461cb Add hoe tool type (#6872) 2020-06-30 13:17:57 -07:00
ichttt 4aa53dbb00 Fix loading screen color and text (#6824) 2020-06-30 13:16:51 -07:00
Curle a79e4b3722 Allow any armor to have custom knockback resistance (#6877) 2020-06-30 13:09:12 -07:00
Take Weiland d1016f752e Add senderUUID to ClientChatReceivedEvent (#6881) 2020-06-30 12:57:23 -07:00
LexManos ab29145328 Re-write checkATs function and automate making Items/Blocks public. 2020-06-29 19:33:34 -07:00
cpw 99e7fad655 Reorganize modloading on the dediserver. This removes the DedicatedServer parameter from the FMLDedicatedServerSetupEvent.
Code for customizing the server instance should be moved to the ServerAboutToStartEvent or similar, where the server instance
is available.

This reorganization means that mods will load fully before the server is even constructed, or the server properties loaded. We also move the EULA right to the front so we don't have to wait for bootstrap.

This should fix the problems with mods which customize world data and other things.

Signed-off-by: cpw <[email protected]>
2020-06-29 22:09:37 -04:00
Cyborgmas d5aa0c4a91 Fix datagen resolving tags and exploding. (#6865) 2020-06-29 16:39:04 -07:00
Matthew Messinger 20d231bbed Fix Language.javaLocale parsing (#6862) 2020-06-29 16:37:21 -07:00
Take Weiland 5db6f158f8 Fix IItemHandler wrappers for chests not updating both chests (#6875) 2020-06-29 15:58:22 -07:00
LexManos 88d02712db Fix missed patch in PlayerList and EntitySelectioonContext. Closes #6846 Closes #6850 2020-06-29 13:57:10 -07:00
ichttt 7858abe96d Make Type classes safe to use in concurrent loading (#6825) 2020-06-29 13:29:32 -07:00
Richard Freimer b0e35f358e Fix access levels being hardcoded to private via patch overriding AT entry (#6848) 2020-06-29 13:09:04 -07:00
LexManos 80d2730fec Fix tag related issues when connecting to a vanilla server. 2020-06-29 12:42:32 -07:00
LexManos 3b64ea6305 Fix Forge's internal handler being registered in wrong place.
Fix double call to loader end.
2020-06-28 15:08:03 -07:00
David Quintana 5f1a7326c7 Add a model loader that lets mods specify different models for different perspectives.
Allow custom models to reference vanilla item models as child models.
2020-06-28 00:32:50 +02:00
LexManos af9bb9641b Fix swim speed being incorrect. Closes #6845
Fix BreakSpeedEvent having null position. Closes #6844
Add MatrixStack to BackgroundDrawnEvent. Closes #6843
Fix some patches that should of been ATs. Closes #6839
Add getter to ServerPlayer to access client's language calue if sent. Closes #6829
Some patch cleanup.
2020-06-26 16:55:04 -07:00
LexManos fc6b38d7f2 Fix blocks being harvested with incorrect tools. 2020-06-26 15:40:05 -07:00
Cyborgmas 4887a5e0e7 fix misapplied patch
also sneak in an import patch removal
2020-06-26 18:40:02 -04:00
LexManos 97d4652f5f Make installer use MCPConfig version to identify MC assets. 2020-06-26 12:52:50 -07:00
cpw 41a6d70aee Tweak the server startup a bit, make sure methods that can't work because they run before a server exists explode saying so.
Also fix other launch profiles.

Signed-off-by: cpw <[email protected]>
2020-06-26 14:27:32 -04:00
LexManos 99917e569c Fix dedicated server loading by constructing mods before data packs are created. 2020-06-26 09:56:23 -07:00
David Quintana 30227a1e28 Fix create method.
Fix test mods not loading correctly.
2020-06-26 17:20:21 +02:00
David Quintana a1110b92d0 Reintroduce missed patch in EntityClassification. 2020-06-26 16:43:01 +02:00
Cyborgmas 438e3886cc Include a getter for the matrix stack in OverlayEvent (#6834) 2020-06-26 15:55:33 +02:00
Cyborgmas fa6ca9c275 Fix block render types not being properly applied to item entities (#6832) 2020-06-26 15:22:57 +02:00
its_meow 71baebcc93 [1.16.x] Allow GlobalEntityTypeAttributes' EntityType -> AttributeModifierMap to be added to (#6822)
* Make GlobalEntityTypeAttributes map able to be added to

* Split get patch into two lines

* Favor Forge's map over vanilla
2020-06-26 15:03:56 +02:00
Cyborgmas e7b5dcb149 Fixed creative screen arrows (#6827) 2020-06-26 14:58:48 +02:00
Yunus 29e52e963d Added call to method for tooltip with FontRenderer (#6831) 2020-06-26 14:57:26 +02:00
Curle 3dc8d2b293 Retarget Block.Properties patch to the new AbstractBlock, reintroduce harvestLevel and harvestTool fields (#6819)
* Retarget Block.Properties patch to the new AbstractBlock, reintroduces the harvestLevel and harvestTool fields.

* Slight adjustment to fix the lootTableSupplier.
2020-06-26 14:35:36 +02:00
Yunus 29be40adec Fixed sneaking while swimming (#6817) 2020-06-26 14:25:32 +02:00
Cyborgmas 272ea75aab Fixed tooltip rendering issues (#6815) 2020-06-26 14:24:58 +02:00
Cyborgmas cbac95de0f Fixed villager trades having non-applicable enchants
Also added an AT at lex's request
2020-06-25 22:30:44 -04:00
Yunus 87d89fb09a Updated MDK mods.toml versions (#6808) 2020-06-25 18:42:28 -07:00
Dominik Baumann 7bca3684bd Add missing patch to ScreenShotHelper (#6809)
Adds the missed patch back
2020-06-25 18:42:17 -07:00
Cyborgmas 6cfc88e707 Fix block drops (#6810) 2020-06-25 18:42:11 -07:00
Cyborgmas 8179a504cb Fix locate command (#6811) 2020-06-25 18:42:01 -07:00
LexManos baf32612db Rework BlockSnapshot and fix client notifications. Closes #6807 2020-06-25 18:41:38 -07:00
LexManos 9cf9305fd0 Bump MCPConfig version. 2020-06-25 16:24:35 -07:00
1173 changed files with 15600 additions and 7975 deletions

No files matched your search

+4 -1
View File
@@ -27,7 +27,6 @@
/projects/**/run/
/projects/**/*.launch
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
@@ -43,3 +42,7 @@ changelog.txt
gradle.properties
!/mdk/gradle.properties
/projects/forge/rejects/
# Srg2Source causes import bugs on these patches. If you intentionnally change these, remove the ignore.
/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.java.patch
/patches/minecraft/net/minecraft/data/BlockModelDefinition.java.patch
+1 -1
View File
@@ -1,5 +1,5 @@
Minecraft Forge
Copyright (c) 2016-2019.
Copyright (c) 2016-2020.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
+109 -403
View File
@@ -10,49 +10,38 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.178'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.187'
classpath 'org.ow2.asm:asm:7.2'
classpath 'org.ow2.asm:asm-tree:7.2'
}
}
import groovy.json.JsonSlurper
import groovy.json.JsonBuilder
import java.nio.file.Files
import java.text.SimpleDateFormat
import java.util.Date
import java.util.LinkedHashMap
import java.util.TreeSet
import java.util.stream.Collectors
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream
import java.security.MessageDigest
import java.net.URL
import net.minecraftforge.gradle.common.task.ArchiveChecksum
import net.minecraftforge.forge.tasks.*
import static net.minecraftforge.forge.tasks.Util.*
import net.minecraftforge.gradle.common.task.DownloadMavenArtifact
import net.minecraftforge.gradle.common.task.ExtractInheritance
import net.minecraftforge.gradle.common.task.SignJar
import net.minecraftforge.gradle.common.util.HashStore
import net.minecraftforge.gradle.mcp.function.MCPFunction
import net.minecraftforge.gradle.mcp.util.MCPEnvironment
import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import net.minecraftforge.gradle.userdev.tasks.RenameJar
import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import org.objectweb.asm.ClassReader
plugins {
id 'net.minecrell.licenser' version '0.4'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'de.undercouch.download' version '3.3.0'
id 'com.github.ben-manes.versions' version '0.22.0'
}
apply plugin: 'eclipse'
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version'))
Util.init() //Init all our extension methods!
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
ext {
JAR_SIGNER = null
@@ -64,9 +53,9 @@ ext {
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20200514-1.16'
MC_VERSION = '1.16.1'
MCP_VERSION = '20200625.134731'
MAPPING_VERSION = '20201028-1.16.3'
MC_VERSION = '1.16.4'
MCP_VERSION = '20201102.104115'
}
project(':mcp') {
@@ -122,7 +111,7 @@ project(':clean') {
clean_server {
taskName 'clean_server'
main 'net.minecraft.server.MinecraftServer'
main 'net.minecraft.server.Main'
workingDirectory project.file('run')
}
}
@@ -136,8 +125,7 @@ project(':forge') {
apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.patcher'
apply plugin: 'net.minecrell.licenser'
apply plugin: 'de.undercouch.download'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
group = 'net.minecraftforge'
@@ -209,7 +197,7 @@ project(':forge') {
}
ext {
SPEC_VERSION = '31.2' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '35.0' // This is overwritten by git tag, but here so dev time doesnt explode
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
// ForgeMC is a unique identifier for every MC version we have supported.
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
@@ -217,6 +205,7 @@ project(':forge') {
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5'
VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar'
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.11'
}
def getVersion = {
@@ -266,6 +255,7 @@ project(':forge') {
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev"
@@ -300,6 +290,7 @@ project(':forge') {
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev"
@@ -358,9 +349,14 @@ project(':forge') {
args '--flat', '--all', '--validate',
'--mod', 'data_gen_test',
'--mod', 'piston_event_test',
'--mod', 'piston_event_test',
'--mod', 'global_loot_test',
'--mod', 'scaffolding_test',
'--mod', 'custom_tag_types_test',
'--mod', 'new_model_loader_test',
'--output', rootProject.file('src/generated_test/resources/'),
'--existing', sourceSets.main.resources.srcDirs[0]
'--existing', sourceSets.main.resources.srcDirs[0],
'--existing', sourceSets.test.resources.srcDirs[0]
}
}
}
@@ -439,12 +435,14 @@ project(':forge') {
installer 'org.ow2.asm:asm:7.2'
installer 'org.ow2.asm:asm-commons:7.2'
installer 'org.ow2.asm:asm-tree:7.2'
installer 'cpw.mods:modlauncher:5.1.+'
installer 'org.ow2.asm:asm-util:7.2'
installer 'org.ow2.asm:asm-analysis:7.2'
installer 'cpw.mods:modlauncher:8.0.6'
installer 'cpw.mods:grossjava9hacks:1.3.+'
installer 'net.minecraftforge:accesstransformers:2.1.+:shadowed'
installer 'net.minecraftforge:eventbus:2.2.+:service'
installer 'net.minecraftforge:forgespi:3.0.+'
installer 'net.minecraftforge:coremods:2.0.+'
installer 'net.minecraftforge:accesstransformers:2.2.+:shadowed'
installer 'net.minecraftforge:eventbus:3.0.+:service'
installer 'net.minecraftforge:forgespi:3.2.+'
installer 'net.minecraftforge:coremods:3.0.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.2'
installer 'com.electronwill.night-config:toml:3.6.2'
@@ -455,12 +453,13 @@ project(':forge') {
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
installer 'net.minecrell:terminalconsoleappender:1.2.+'
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
installer 'org.spongepowered:mixin:0.8.2'
fmllauncherImplementation 'com.google.guava:guava:21.0'
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
fmllauncherImplementation "org.lwjgl:lwjgl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-glfw:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-opengl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-stb:3.2.2"
fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-glfw:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-opengl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-stb:3.2.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.+'
testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5
@@ -476,249 +475,70 @@ project(':forge') {
if (changelog.exists())
extraTxts += changelog
task downloadCrowdin() {
ext {
output = file('build/crowdin_raw.zip')
update = file('build/crowdin.json')
id = 'minecraft-forge'
}
onlyIf {
project.hasProperty('crowdinKey') && !project.gradle.startParameter.isOffline()
}
doLast {
download {
src "https://api.crowdin.com/api/project/${id}/export?key=${project.crowdinKey}&json"
dest update
overwrite true
}
if (!update.text.contains('success')) {
throw new RuntimeException("Crowdin export failed, see ${update} for more info")
}
download {
src "https://api.crowdin.com/api/project/${id}/download/all.zip?key=${project.crowdinKey}"
dest output
overwrite true
}
}
}
task crowdin(type: Zip) {
dependsOn downloadCrowdin
onlyIf {
!downloadCrowdin.state.skipped
}
baseName = project.name
version = project.version
classifier = 'crowdin'
destinationDir = file('build/distributions')
from(zipTree(downloadCrowdin.output)){
eachFile { //Tired of waiting for crowdin API, rename things myself. Remove once crowdin stops being dumb
if (it.name.equals('en_us.json') && !it.path.startsWith('assets/')) {
it.name = it.path.split('/')[0] + '.json'
it.path = 'assets/forge/lang/' + it.name
}
}
exclude { it.isDirectory() }
rename { it.toLowerCase() }//Minecraft needs it lowercase.
exclude '**/*.lang' //Pre-1.13 format
}
}
task crowdin(type: CrowdinTask) {
key = project.hasProperty('crowdinKey') ? project.crowdinKey : null
//TODO: Merge our english.json?
}
// We apply the bin patches we just created to make a jar that is JUST our changes
genClientBinPatches.tool = BINPATCH_TOOL
task applyClientBinPatches(type: ApplyBinPatches, dependsOn: genClientBinPatches) {
clean = { genClientBinPatches.cleanJar }
input = genClientBinPatches.output
tool = BINPATCH_TOOL
}
genServerBinPatches.tool = BINPATCH_TOOL
task applyServerBinPatches(type: ApplyBinPatches, dependsOn: genServerBinPatches) {
clean = { genServerBinPatches.cleanJar }
input = genServerBinPatches.output
tool = BINPATCH_TOOL
}
genJoinedBinPatches.tool = BINPATCH_TOOL
task applyJoinedBinPatches(type: ApplyBinPatches, dependsOn: genJoinedBinPatches) {
clean = { genJoinedBinPatches.cleanJar }
input = genJoinedBinPatches.output
tool = BINPATCH_TOOL
}
// Create SRG named Vanilla jars, using the SpecialSource we have in the installer
task createClientSRG(type: RenameJar, dependsOn: genClientBinPatches) {
tool = SPECIAL_SOURCE + ':shaded'
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
mappings = { genClientBinPatches.srg }
input = { genClientBinPatches.cleanJar }
output = file('build/createClientSRG/output.jar')
}
task createServerSRG(type: RenameJar, dependsOn: genServerBinPatches) {
tool = SPECIAL_SOURCE + ':shaded'
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
mappings = { genServerBinPatches.srg }
input = { genServerBinPatches.cleanJar }
output = file('build/createServerSRG/output.jar')
}
// Checksum tasks so that we can know if the vanilla classes are what we expect them to do!
task clientBaseChecksum(type: ArchiveChecksum, dependsOn: genClientBinPatches) {
input = { genClientBinPatches.cleanJar} //Lazy because Patcher Plugin sets the value afterEvaluate
name = 'client'
}
task serverBaseChecksum(type: ArchiveChecksum, dependsOn: genServerBinPatches) {
input = { genServerBinPatches.cleanJar }
name = 'server'
}
task joinedBaseChecksum(type: ArchiveChecksum, dependsOn: genJoinedBinPatches) {
input = { genJoinedBinPatches.cleanJar }
name = 'joined'
}
task clientPatchedChecksum(type: ArchiveChecksum, dependsOn: applyClientBinPatches) {
input = applyClientBinPatches.output
name = 'client_patched'
}
task serverPatchedChecksum(type: ArchiveChecksum, dependsOn: applyServerBinPatches) {
input = applyServerBinPatches.output
name = 'server_patched'
}
task joinedPatchedChecksum(type: ArchiveChecksum, dependsOn: applyJoinedBinPatches) {
input = applyJoinedBinPatches.output
name = 'joined_patched'
}
// Utility methods for testing checksums
task cleanChecksums() {
['client', 'server', 'joined'].each { side ->
['Base', 'Patched'].each { type ->
def clean = "clean${side.capitalize()}${type}Checksum"
dependsOn(clean)
tasks.findByName("${side}${type}Checksum").mustRunAfter(clean)
}
}
}
task checksums() {
['client', 'server', 'joined'].each { side ->
['Base', 'Patched'].each { type ->
dependsOn("${side}${type}Checksum")
}
}
}
['Client', 'Server', 'Joined'].each { side ->
def gen = tasks.getByName("gen${side}BinPatches")
gen.tool = BINPATCH_TOOL
task "apply${side}BinPatches"(type: ApplyBinPatches, dependsOn: gen) {
clean = { gen.cleanJar }
input = gen.output
tool = BINPATCH_TOOL
}
if (side != 'Joined') {
// Create SRG named Vanilla jars, using the SpecialSource we have in the installer
task "create${side}SRG"(type: RenameJar, dependsOn: gen) {
tool = SPECIAL_SOURCE + ':shaded'
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
mappings = { gen.srg }
input = { gen.cleanJar }
output = file("build/create${name}SRG/output.jar")
}
}
}
task downloadLibraries(dependsOn: ':mcp:setupMCP') {
inputs.file VERSION_JSON
doLast {
def json = new JsonSlurper().parseText(VERSION_JSON.text)
json.libraries.each {lib ->
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = file('build/libraries/' + art.path)
if (!target.exists()) {
download {
src art.url
dest target
}
}
}
}
}
task downloadLibraries(type: DownloadLibrariesTask, dependsOn: ':mcp:setupMCP') {
input = VERSION_JSON
output = rootProject.file('build/libraries/')
}
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
tool = INSTALLER_TOOLS + ':fatjar'
input { genJoinedBinPatches.cleanJar }
doFirst {
def json = new JsonSlurper().parseText(VERSION_JSON.text)
json.libraries.each {lib ->
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = file('build/libraries/' + art.path)
if (target.exists())
addLibrary(target)
}
}
}
doFirst { downloadLibraries.libraries.each{ addLibrary(it) } }
}
task checkATs(dependsOn: genJoinedBinPatches) {
inputs.file { genJoinedBinPatches.cleanJar }
inputs.files patcher.accessTransformers
doLast {
def vanilla = [:]
def zip = new java.util.zip.ZipFile(genJoinedBinPatches.cleanJar)
zip.entries().findAll { !it.directory && it.name.endsWith('.class') }.each { entry ->
new ClassReader(zip.getInputStream(entry)).accept(new org.objectweb.asm.ClassVisitor(org.objectweb.asm.Opcodes.ASM7) {
String name
void visit(int version, int access, String name, String sig, String superName, String[] interfaces) {
this.name = name
vanilla[name] = access
}
org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String sig, Object value) {
vanilla[this.name + ' ' + name] = access
return null
}
org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String desc, String sig, String[] excs) {
vanilla[this.name + ' ' + name + desc] = access
return null
}
}, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
}
patcher.accessTransformers.each { f ->
TreeMap lines = [:]
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) return
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
def access = vanilla[key.replace('.', '/')]
if (access == null) {
if ((desc.equals('*') || desc.equals('*()')) && vanilla[cls.replace('.', '/')] != null)
println('Warning: ' + line)
else {
println('Invalid: ' + line)
return
}
}
//TODO: Check access actually changes, and expand inheretence?
lines[key] = [modifier: modifier, comment: comment]
}
f.text = lines.collect{ it.value.modifier + ' ' + it.key + (it.value.comment == null ? '' : ' ' + it.value.comment) }.join('\n')
}
}
task checkATs(type: CheckATs, dependsOn: extractInheritance) {
inheritance = extractInheritance.output
ats = patcher.accessTransformers
}
task checkSAS(dependsOn: extractInheritance) {
inputs.file { extractInheritance.output }
inputs.files patcher.sideAnnotationStrippers
doLast {
def json = new JsonSlurper().parseText(extractInheritance.output.text)
patcher.sideAnnotationStrippers.each { f ->
def lines = []
f.eachLine { line ->
if (line[0] == '\t') return //Skip any tabed lines, those are ones we add
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
lines.add(line)
return
}
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (cls, desc) = (line.trim() + ' ').split(' ', -1)
cls = cls.replaceAll('\\.', '/')
desc = desc.replace('(', ' (')
if (desc.isEmpty() || json[cls] == null || json[cls]['methods'] == null || json[cls]['methods'][desc] == null) {
println('Invalid: ' + line)
return
}
def mtd = json[cls]['methods'][desc]
lines.add(cls + ' ' + desc.replace(' ', '') + (comment == null ? '' : ' ' + comment))
def children = json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls}
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
children.each { lines.add('\t' + it) }
}
f.text = lines.join('\n')
}
}
task checkSAS(type: CheckSAS, dependsOn: extractInheritance) {
inheritance = extractInheritance.output
sass = patcher.sideAnnotationStrippers
}
task checkExcs(type: CheckExcs, dependsOn: jar) {
binary = jar.archivePath
excs = patcher.excs
}
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs]){}
task checkPatchesAndFix(type: CheckPatches) {
patchDir = file("$rootDir/patches")
autoFix = true
}
task checkPatches(type: CheckPatches) {
patchDir = file("$rootDir/patches")
autoFix = false
}
project(':forge').getTasks().getByName('genPatches').finalizedBy(checkPatches)
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
inputs.file universalJar.archivePath
@@ -726,7 +546,7 @@ project(':forge') {
ext {
output = file('build/version.json')
vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
timestamp = dateToIso8601(new Date())
timestamp = iso8601Now()
comment = [
"Please do not automate the download and installation of Forge.",
"Our efforts are supported by ads from the download page.",
@@ -738,7 +558,7 @@ project(':forge') {
inputs.file vanilla
outputs.file output
doLast {
def json_vanilla = new JsonSlurper().parseText(vanilla.text)
def json_vanilla = vanilla.json()
def json = [
_comment_: comment,
id: id,
@@ -759,7 +579,7 @@ project(':forge') {
artifact: [
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
sha1: sha1(launcherJar.archivePath),
sha1: launcherJar.archivePath.sha1(),
size: launcherJar.archivePath.length()
]
]
@@ -779,7 +599,6 @@ project(':forge') {
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches/*, createClientSRG, createServerSRG*/]) {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.2'
}
doFirst {
@@ -802,7 +621,7 @@ project(':forge') {
artifact: [
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}-universal.jar",
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
sha1: sha1(universalJar.archivePath),
sha1: universalJar.archivePath.sha1(),
size: universalJar.archivePath.length()
]
]
@@ -829,36 +648,36 @@ project(':forge') {
server: '/data/server.lzma'
],
MC_SLIM: [
client: "[net.minecraft:client:${MC_VERSION}:slim]",
server: "[net.minecraft:server:${MC_VERSION}:slim]"
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:slim]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:slim]"
],
MC_SLIM_SHA: [
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
client: "'${tasks.getByName('downloadClientSlim').output.sha1()}'",
server: "'${tasks.getByName('downloadServerSlim').output.sha1()}'"
],
MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}:extra]"
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:extra]"
],
MC_EXTRA_SHA: [
client: "'${sha1(tasks.getByName('downloadClientExtra').output)}'",
server: "'${sha1(tasks.getByName('downloadServerExtra').output)}'"
client: "'${tasks.getByName('downloadClientExtra').output.sha1()}'",
server: "'${tasks.getByName('downloadServerExtra').output.sha1()}'"
],
MC_SRG: [
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:srg]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:srg]"
],
/*MC_SRG_SHA: [
client: "'${sha1(createClientSRG.output)}'",
server: "'${sha1(createServerSRG.output)}'"
client: "'${createClientSRG.output.sha1()}'",
server: "'${createServerSRG.output.sha1()}'"
],*/
PATCHED: [
client: "[${project.group}:${project.name}:${project.version}:client]",
server: "[${project.group}:${project.name}:${project.version}:server]"
],
PATCHED_SHA: [
client: "'${sha1(applyClientBinPatches.output)}'",
server: "'${sha1(applyServerBinPatches.output)}'"
client: "'${applyClientBinPatches.output.sha1()}'",
server: "'${applyServerBinPatches.output.sha1()}'"
],
MCP_VERSION: [
client: "'${MCP_VERSION}'",
@@ -926,7 +745,7 @@ project(':forge') {
['slim', 'extra'].each { type ->
def name = "download${side.capitalize()}${type.capitalize()}"
task "${name}"(type: DownloadMavenArtifact) {
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
artifact = "net.minecraft:${side}:${MC_VERSION}-${MCP_VERSION}:${type}"
}
installerJson.dependsOn(name)
installerJson.inputs.file(tasks.getByName(name).output)
@@ -936,28 +755,10 @@ project(':forge') {
universalJar {
from extraTxts
/* TODO: Annotation Cache? need to talk to cpw about his new design.
from(fixAnnotationsJson){
into 'META-INF'
}
dependsOn fixAnnotationsJson
*/
/* We do not actually check this anywhere, so it's 400KB of uselless data
// Add checksum files of clean and patched vanilla classes.
['client', 'server'].each { side ->
['Base', 'Patched'].each { type ->
from(tasks.getByName("${side}${type}Checksum").output) {
into 'checksums/'
}
}
}
dependsOn checksums
*/
// add crowdin locales
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
from { crowdin.output.exists() ? zipTree(crowdin.output) : null}
dependsOn crowdin
duplicatesStrategy = 'exclude'
doFirst {
MANIFESTS.each{ pkg, values ->
@@ -979,7 +780,7 @@ project(':forge') {
artifacts.each { key, lib ->
classpath += "libraries/${lib.downloads.artifact.path} "
}
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
classpath += "libraries/net/minecraft/server/${MC_VERSION}-${MCP_VERSION}/server-${MC_VERSION}-${MCP_VERSION}-extra.jar"
MANIFESTS.each{ pkg, values ->
if (pkg == '/') {
@@ -1258,103 +1059,8 @@ project(':forge') {
}
}
def dateToIso8601(date) {
def format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
def result = format.format(date)
return result[0..21] + ':' + result[22..-1]
}
def sha1(file) {
MessageDigest md = MessageDigest.getInstance('SHA-1')
file.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size)
}
return md.digest().collect {String.format "%02x", it}.join()
}
def artifactTree(project, artifact) {
if (!project.ext.has('tree_resolver'))
project.ext.tree_resolver = 1
def cfg = project.configurations.create('tree_resolver_' + project.ext.tree_resolver++)
def dep = project.dependencies.create(artifact)
cfg.dependencies.add(dep)
def files = cfg.resolve()
return getArtifacts(project, cfg, true)
}
def getArtifacts(project, config, classifiers) {
def ret = [:]
config.resolvedConfiguration.resolvedArtifacts.each {
def art = [
group: it.moduleVersion.id.group,
name: it.moduleVersion.id.name,
version: it.moduleVersion.id.version,
classifier: it.classifier,
extension: it.extension,
file: it.file
]
def key = art.group + ':' + art.name
def folder = "${art.group.replace('.', '/')}/${art.name}/${art.version}/"
def filename = "${art.name}-${art.version}"
if (art.classifier != null)
filename += "-${art.classifier}"
filename += ".${art.extension}"
def path = "${folder}${filename}"
def url = "https://libraries.minecraft.net/${path}"
if (!checkExists(url)) {
url = "https://files.minecraftforge.net/maven/${path}"
}
//TODO remove when Mojang launcher is updated
if (!classifiers && art.classifier != null) { //Mojang launcher doesn't currently support classifiers, so... move it to part of the version, and force the extension to 'jar'
art.version = "${art.version}-${art.classifier}"
art.classifier = null
art.extension = 'jar'
path = "${art.group.replace('.', '/')}/${art.name}/${art.version}/${art.name}-${art.version}.jar"
}
ret[key] = [
name: "${art.group}:${art.name}:${art.version}" + (art.classifier == null ? '' : ":${art.classifier}") + (art.extension == 'jar' ? '' : "@${art.extension}"),
downloads: [
artifact: [
path: path,
url: url,
sha1: sha1(art.file),
size: art.file.length()
]
]
]
}
return ret
}
def checkExists(url) {
try {
def code = new URL(url).openConnection().with {
requestMethod = 'HEAD'
connect()
responseCode
}
return code == 200
} catch (Exception e) {
if (e.toString().contains('unable to find valid certification path to requested target'))
throw new RuntimeException('Failed to connect to ' + url + ': Missing certificate root authority, try updating java')
throw e
}
}
def getClasspath(project, libs, artifact) {
def ret = []
artifactTree(project, artifact).each { key, lib ->
libs[lib.name] = lib
if (lib.name != artifact)
ret.add(lib.name)
}
return ret
}
//evaluationDependsOnChildren()
task setup() {
dependsOn ':clean:extractMapped'
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}
+2
View File
@@ -0,0 +1,2 @@
/.gradle/
/build/
+10
View File
@@ -0,0 +1,10 @@
repositories {
//mavenCentral() //TODO: Update Gradle to use HTTPS by default
maven {
name 'maven_central'
url 'https://repo.maven.apache.org/maven2/'
}
}
dependencies {
implementation 'org.ow2.asm:asm:7.2'
}
@@ -0,0 +1,231 @@
package net.minecraftforge.forge.tasks
import java.util.ArrayList
import java.util.TreeMap
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.Opcodes
public class CheckATs extends DefaultTask {
@InputFile File inheritance
@InputFiles File[] ats
@TaskAction
protected void exec() {
Util.init()
def parse = { line ->
def idx = line.indexOf('#')
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
return [modifier, cls, desc, comment, key]
}
def accessLevel = { access ->
if ((access & Opcodes.ACC_PUBLIC) != 0) return 3
if ((access & Opcodes.ACC_PROTECTED) != 0) return 2
if ((access & Opcodes.ACC_PRIVATE) != 0) return 0
return 1
}
def accessStr = { access ->
if (access.endsWith('-f') || access.endsWith('+f'))
return 4
switch (access.toLowerCase()) {
case 'public': return 3
case 'protected': return 2
case 'default': return 1
case 'private': return 0
default: return -1
}
}
def json = inheritance.json()
ats.each { f ->
TreeMap lines = [:]
def group = null
for (def line : f.readLines()) {
if (line.isEmpty()) continue
if (line.startsWith('#group ')) {
def (modifier, cls, desc, comment, key) = parse.call(line.substring(7))
if (!desc.equals('*') && !desc.equals('*()') && !desc.equals('<init>'))
throw new IllegalStateException('Invalid group: ' + line)
group = [modifier: modifier, cls: cls, desc: desc, comment: comment,
'existing': [] as Set,
'children': [] as TreeSet,
group: true
]
if (lines.containsKey(key))
throw new IllegalStateException('Duplicate group: ' + line)
lines[key] = group
} else if (group != null) {
if (line.startsWith('#endgroup')) {
group = null
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
group['existing'].add(key)
}
} else if (line.startsWith('#endgroup')) {
throw new IllegalStateException('Invalid group ending: ' + line)
} else if (line.startsWith('#')) {
//Nom
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
if (lines.containsKey(key)) {
println('Duplicate: ' + line)
continue
}
lines[key] = [modifier: modifier, cls: cls, desc: desc, comment: comment, group: false]
}
}
// Process Groups, this will remove any entries outside the group that is covered by the group
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid Group: ' + key)
} else if ('*'.equals(entry['desc'])) {
if (!jcls.containsKey('fields')) {
lines.remove(key)
println('Invalid Group, Class has no fields: ' + key)
} else {
jcls['fields'].each { field, value ->
def fkey = cls + ' ' + field
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(fkey)) {
lines.remove(fkey)
} else if (!entry['existing'].contains(fkey)) {
println('Added: ' + fkey)
}
entry['children'].add(fkey)
} else if (lines.containsKey(fkey)) {
lines.remove(fkey)
println('Removed: ' + fkey)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('*()'.equals(entry['desc'])) {
if (!jcls.containsKey('methods')) {
lines.remove(key)
println('Invalid Group, Class has no methods: ' + key)
} else {
jcls['methods'].each{ mtd, value ->
if (mtd.startsWith('<clinit>'))
return
key = cls + ' ' + mtd.replace(' ', '')
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(key)) {
lines.remove(key)
} else if (!entry['existing'].contains(key)) {
println('Added: ' + key)
}
entry['children'].add(key)
} else if (lines.containsKey(key)) {
lines.remove(key)
println('Removed: ' + key)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('<init>'.equals(entry['desc'])) { //Make all public non-abstract subclasses
json.each{ tcls,value ->
if (!value.containsKey('methods') || ((value['access'] & Opcodes.ACC_ABSTRACT) != 0))
return
def parents = [] as Set
def parent = tcls
while (parent != null && json.containsKey(parent)) {
parents.add(parent)
def p = json[parent]
parent = p == null ? null : p['superName']
}
if (parents.contains(cls.replaceAll('\\.', '/'))) {
value['methods'].each{ mtd, v ->
if (mtd.startsWith('<init>')) {
def child = tcls.replaceAll('/', '\\.') + ' ' + mtd.replace(' ', '')
if (accessLevel.call(v['access']) < 3) {
if (lines.containsKey(child)) {
lines.remove(child)
} else if (!entry['existing'].contains(child)) {
println('Added: ' + child)
}
entry['children'].add(child)
} else if (lines.containsKey(child)) {
lines.remove(child)
println('Removed: ' + child)
}
}
}
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
}
}
// Process normal lines, remove invalid and remove narrowing
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && !entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid: ' + key)
} else if (entry['desc'] == '') {
if (accessLevel.call(jcls['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
} else if (!entry['desc'].contains('(')) {
if (!jcls.containsKey('fields') || !jcls['fields'].containsKey(entry['desc'])) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['fields'][entry['desc']]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
println(entry.comment)
}
}
} else {
def jdesc = entry['desc'].replace('(', ' (')
if (!jcls.containsKey('methods') || !jcls['methods'].containsKey(jdesc)) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['methods'][jdesc]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
}
}
}
}
def data = []
lines.each { key,value ->
if (!value.group) {
data.add(value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
} else {
data.add('#group ' + value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
value.children.each{ data.add(value.modifier + ' ' + it) }
data.add('#endgroup')
}
}
f.text = data.join('\n')
}
}
}
@@ -0,0 +1,95 @@
package net.minecraftforge.forge.tasks
import java.util.ArrayList
import java.util.TreeMap
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
public class CheckExcs extends DefaultTask {
@InputFile File binary
@InputFiles File[] excs
@TaskAction
protected void exec() {
Util.init()
def known = []
binary.withInputStream { i ->
new ZipInputStream(i).withCloseable { zin ->
def visitor = new ClassVisitor(Opcodes.ASM7) {
private String cls
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
this.cls = name
}
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
known.add(this.cls + '.' + name + descriptor)
super.visitMethod(access, name, descriptor, signature, exceptions)
}
}
ZipEntry zein
while ((zein = zin.nextEntry) != null) {
if (zein.name.endsWith('.class')) {
ClassReader reader = new ClassReader(zin)
reader.accept(visitor, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
}
}
}
}
excs.each { f ->
def lines = []
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
return
}
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
if (!line.contains('=')) {
println('Invalid: ' + line)
return
}
def (key, value) = line.split('=', 2)
if (!known.contains(key)) {
println(key)
println('Invalid: ' + line)
return
}
def (cls, desc) = key.split('\\.', 2)
if (!desc.contains('(')) {
println('Invalid: ' + line)
return
}
def name = desc.split('\\(', 2)[0]
desc = '(' + desc.split('\\(', 2)[1]
def (exceptions, args) = value.contains('|') ? value.split('|', 2) : [value, '']
if (args.split(',').length != Type.getArgumentTypes(desc).length) {
println('Invalid: ' + line)
return
}
lines.add(line)
}
f.text = lines.sort().join('\n')
}
}
}
@@ -0,0 +1,218 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.TaskAction
import java.nio.file.Files
import java.nio.file.Paths
import java.util.regex.Pattern
public class CheckPatches extends DefaultTask {
@InputDirectory File patchDir
@Input boolean autoFix = false
@TaskAction
protected void exec() {
def hasS2SArtifact = [
Paths.get("patches/minecraft/net/minecraft/client/renderer/ViewFrustum.java.patch"),
Paths.get("patches/minecraft/net/minecraft/data/BlockModelDefinition.java.patch")
]
def verified = true;
project.fileTree(patchDir).each { patch ->
def patchPath = project.rootDir.toPath().relativize(patch.toPath())
verified &= verifyPatch(patch, autoFix, patchPath.toString(), hasS2SArtifact.contains(patchPath))
}
if (!verified)
throw new RuntimeException('One or more patches failed verification. Check the log for errors.')
}
def verifyPatch(patch, fix, patchPath, hasS2SArtifact) {
def hunk_start_pattern = Pattern.compile('^@@ -[0-9,]* \\+[0-9,]* @@$')
def white_space_pattern = Pattern.compile('^[+\\-]\\s*$')
def import_pattern = Pattern.compile('^[+\\-]\\s*import.*')
def field_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$')
def method_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^(]*)[(]([^)]*)?[)]\\s*[{]\\s*$')
def class_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final[\\s]*)?(class|interface)([^{]*)[{]\\s*$')
def accessMap = [("private"):0, (null):1, ("protected"):2, ("public"):3]
def hasProblem = false;
def lines = patch.readLines()
def hunksStart = 0
def onlyWhiteSpace = false
def didFix = false
def newLines = []
def whiteSpaceErrors = []
// First two lines are file name ++/-- and we do not care
newLines.add(lines[0] + '\n')
newLines.add(lines[1] + '\n')
int i = 2
for (; i < lines.size(); ++i) {
def line = lines[i]
newLines.add(line + '\n')
if (hunk_start_pattern.matcher(line).find()) {
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
whiteSpaceErrors.clear()
}
hunksStart = i
onlyWhiteSpace = true
continue
}
if (line.startsWithAny('+','-')) {
def prefixChange = false
def prevLine = lines[i - 1]
if (line.charAt(0) == (char)'+' && prevLine.charAt(0) == (char)'-') {
def prevTrim = prevLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (prevTrim.equals(currTrim)) {
prefixChange = true
}
def pMatcher = field_pattern.matcher(prevLine)
def cMatcher = field_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // = ...
pMatcher.group(5) == cMatcher.group(5) && // field name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = method_pattern.matcher(prevLine)
cMatcher = method_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // params
pMatcher.group(5) == cMatcher.group(5) && // <T> void name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = class_pattern.matcher(prevLine)
cMatcher = class_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // ClassName<> extends ...
pMatcher.group(5) == cMatcher.group(5) && // class | interface
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
if (line.charAt(0) == (char)'-' && i + 1 < lines.size()) {
def nextLine = lines[i + 1]
if (nextLine.charAt(0) == (char)'+') {
def nextTrim = nextLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (nextTrim.equals(currTrim)) {
prefixChange = true
}
}
}
def isWhiteSpaceChange = white_space_pattern.matcher(line).find()
if (!prefixChange && !isWhiteSpaceChange) {
onlyWhiteSpace = hasS2SArtifact && import_pattern.matcher(line).find()
}
else if (isWhiteSpaceChange) {
def prevLineChange = prevLine.startsWithAny('+','-')
def nextLineChange = i + 1 < lines.size() && lines[i + 1].startsWithAny('+','-')
if (!prevLineChange && !nextLineChange) {
whiteSpaceErrors.add(String.format("Patch contains white space change in valid hunk at line %d (cannot auto fix), file: %s", i + 1, patchPath))
}
}
if (line.contains("\t")) {
if (!fix) {
logger.lifecycle("Patch contains tabs on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
else {
logger.lifecycle("Fixing tabs on line {}, file: {}", i + 1, patchPath)
line = line.replaceAll('\t', ' ')
newLines.remove(newLines.size() - 1)
newLines.add(line + '\n')
didFix = true
}
}
if (import_pattern.matcher(line).find() && !hasS2SArtifact) {
logger.lifecycle("Patch contains import change on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
}
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
}
if (didFix) {
if (newLines.size() <= 2) {
logger.lifecycle("Patch is now empty removing, file: {}", patchPath)
Files.delete(patch.toPath())
}
else {
if (!hasS2SArtifact)
logger.lifecycle("*** Updating patch file. Please run setup then genPatches again. ***")
patch.withWriter('UTF-8') { writer ->
newLines.each { l -> writer.write(l) }
}
}
}
return !hasProblem
}
}
@@ -0,0 +1,64 @@
package net.minecraftforge.forge.tasks
import java.util.ArrayList
import java.util.TreeMap
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.Opcodes
public class CheckSAS extends DefaultTask {
@InputFile File inheritance
@InputFiles File[] sass
@TaskAction
protected void exec() {
Util.init()
def json = inheritance.json()
sass.each { f ->
def lines = []
f.eachLine { line ->
if (line[0] == '\t') return //Skip any tabbed lines, those are ones we add
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
lines.add(line)
return
}
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (cls, desc) = (line.trim() + ' ').split(' ', -1)
cls = cls.replaceAll('\\.', '/')
desc = desc.replace('(', ' (')
if (json[cls] == null || (!desc.isEmpty() && (json[cls]['methods'] == null || json[cls]['methods'][desc] == null))) {
println('Invalid: ' + line)
return
}
//Class SAS
if (desc.isEmpty()) {
lines.add(cls + (comment == null ? '' : ' ' + comment))
if (json[cls]['methods'] != null)
(json[cls]['methods'] as TreeMap).each {
findChildMethods(json, cls, it.key).each { lines.add('\t' + it) }
}
return
}
//Method SAS
lines.add(cls + ' ' + desc.replace(' ', '') + (comment == null ? '' : ' ' + comment))
findChildMethods(json, cls, desc).each { lines.add('\t' + it) }
}
f.text = lines.join('\n')
}
}
protected static findChildMethods(json, cls, desc)
{
return json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls}
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
}
}
@@ -0,0 +1,65 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream
import java.net.URL
public class CrowdinTask extends DefaultTask {
@Input String id = 'minecraft-forge'
@Input @Optional String key
@Input boolean json = true
@OutputFile output = project.file("build/${name}/output.zip")
@OutputFile export = project.file("build/${name}/export.json")
CrowdinTask() {
outputs.upToDateWhen{ false }
}
@TaskAction
def run() {
if (output.exists())
output.delete()
if (key == null)
return
// Force an export
new URL("https://api.crowdin.com/api/project/${id}/export?key=${key}").withInputStream { i ->
export.withOutputStream { it << i }
}
if (!export.text.contains('success')) {
throw new RuntimeException("Crowdin export failed, see ${export} for more info")
}
new URL("https://api.crowdin.com/api/project/${id}/download/all.zip?key=${key}").withInputStream { i ->
new ZipInputStream(i).withCloseable { zin ->
output.withOutputStream { out ->
new ZipOutputStream(out).withCloseable { zout ->
ZipEntry zein
while ((zein = zin.nextEntry) != null) {
if (zein.isDirectory()) {
zout.putNextEntry(new ZipEntry(zein.name))
} else {
// 1.13+ uses json
if (zein.name.endsWith('.json') == json) {
ZipEntry zeout = new ZipEntry(json ? zein.name.toLowerCase() : zein.name)
zeout.time = 1
zout.putNextEntry(zeout)
zout << zin
}
}
}
}
}
}
}
}
}
@@ -0,0 +1,43 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.OutputDirectory
import java.io.File
import java.util.HashSet
import java.util.Set
import java.net.URL
public class DownloadLibrariesTask extends DefaultTask {
@InputFile File input
@OutputDirectory File output = project.file("build/${name}/")
Set<File> libraries = new HashSet<>()
@TaskAction
def run() {
Util.init()
def json = input.json().libraries.each { lib ->
//TODO: Thread?
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = new File(output, art.path)
libraries.add(target)
if (!target.exists() || !art.sha1.equals(target.sha1())) {
project.logger.lifecycle("Downloading ${art.url}")
if (!target.parentFile.exists()) {
target.parentFile.mkdirs()
}
new URL(art.url).withInputStream { i ->
target.withOutputStream { it << i }
}
if (!art.sha1.equals(target.sha1())) {
throw new IllegalStateException("Failed to download ${art.url} to ${target.canonicalPath} SHA Mismatch")
}
}
}
}
}
}
@@ -0,0 +1,117 @@
package net.minecraftforge.forge.tasks
import groovy.json.JsonSlurper
import java.io.File
import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.Date
public class Util {
static void init() {
File.metaClass.sha1 = { ->
MessageDigest md = MessageDigest.getInstance('SHA-1')
delegate.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size)
}
return md.digest().collect {String.format "%02x", it}.join()
}
File.metaClass.json = { -> new JsonSlurper().parseText(delegate.text) }
Date.metaClass.iso8601 = { ->
def format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
def result = format.format(delegate)
return result[0..21] + ':' + result[22..-1]
}
}
public static String[] getClasspath(project, libs, artifact) {
def ret = []
artifactTree(project, artifact).each { key, lib ->
libs[lib.name] = lib
if (lib.name != artifact)
ret.add(lib.name)
}
return ret
}
public static def getArtifacts(project, config, classifiers) {
def ret = [:]
config.resolvedConfiguration.resolvedArtifacts.each {
def art = [
group: it.moduleVersion.id.group,
name: it.moduleVersion.id.name,
version: it.moduleVersion.id.version,
classifier: it.classifier,
extension: it.extension,
file: it.file
]
def key = art.group + ':' + art.name
def folder = "${art.group.replace('.', '/')}/${art.name}/${art.version}/"
def filename = "${art.name}-${art.version}"
if (art.classifier != null)
filename += "-${art.classifier}"
filename += ".${art.extension}"
def path = "${folder}${filename}"
def url = "https://libraries.minecraft.net/${path}"
if (!checkExists(url)) {
url = "https://files.minecraftforge.net/maven/${path}"
}
//TODO remove when Mojang launcher is updated
if (!classifiers && art.classifier != null) { //Mojang launcher doesn't currently support classifiers, so... move it to part of the version, and force the extension to 'jar'
art.version = "${art.version}-${art.classifier}"
art.classifier = null
art.extension = 'jar'
path = "${art.group.replace('.', '/')}/${art.name}/${art.version}/${art.name}-${art.version}.jar"
}
ret[key] = [
name: "${art.group}:${art.name}:${art.version}" + (art.classifier == null ? '' : ":${art.classifier}") + (art.extension == 'jar' ? '' : "@${art.extension}"),
downloads: [
artifact: [
path: path,
url: url,
sha1: sha1(art.file),
size: art.file.length()
]
]
]
}
return ret
}
public static def iso8601Now() { new Date().iso8601() }
public static def sha1(file) {
MessageDigest md = MessageDigest.getInstance('SHA-1')
file.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size)
}
return md.digest().collect {String.format "%02x", it}.join()
}
private static def artifactTree(project, artifact) {
if (!project.ext.has('tree_resolver'))
project.ext.tree_resolver = 1
def cfg = project.configurations.create('tree_resolver_' + project.ext.tree_resolver++)
def dep = project.dependencies.create(artifact)
cfg.dependencies.add(dep)
def files = cfg.resolve()
return getArtifacts(project, cfg, true)
}
private static boolean checkExists(url) {
try {
def code = new URL(url).openConnection().with {
requestMethod = 'HEAD'
connect()
responseCode
}
return code == 200
} catch (Exception e) {
if (e.toString().contains('unable to find valid certification path to requested target'))
throw new RuntimeException('Failed to connect to ' + url + ': Missing certificate root authority, try updating java')
throw e
}
}
}
+7 -7
View File
@@ -1,17 +1,17 @@
<img src="assets/Forge_logo.svg">
![Forge Logo](assets/Forge_logo.svg)
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.15.2-&query=$.promos["1.15.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.15.2-&query=$.promos["1.15.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/Flocker-Merch-blueviolet.svg)](https://forgedev.flocker.tv/)
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.16.3-&query=$.promos["1.16.3-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.16.3-&query=$.promos["1.16.3-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.15.x | Active |
| 1.14.x | LTS |
| 1.16.x | Active |
| 1.15.x | LTS |
* [Download]
* [Forum]
@@ -60,7 +60,7 @@ We require all contributors to acknowledge the [Forge Contributor
signed it, you should be OK.
#### Donate
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos) or buying some [cool merch](https://forgedev.flocker.tv/).*
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos).*
[Download]: https://files.minecraftforge.net/
[Forum]: https://www.minecraftforge.net/forum/
+6 -1
View File
@@ -19,6 +19,7 @@ archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
@@ -74,7 +75,8 @@ minecraft {
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
examplemod {
@@ -85,6 +87,9 @@ minecraft {
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
+6 -3
View File
@@ -6,7 +6,10 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="All rights reserved"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
@@ -42,7 +45,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[31,)" #mandatory
versionRange="[34,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
@@ -51,6 +54,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.15.2]"
versionRange="[1.16.3]"
ordering="NONE"
side="BOTH"
+2 -2
View File
@@ -1,7 +1,7 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 5,
"_comment": "A pack_format of 5 requires json lang files and some texture changes from 1.15. Note: we require v5 pack meta for all mods."
"pack_format": 6,
"_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
}
}
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
@@ -556,10 +556,17 @@
@@ -572,10 +572,17 @@
GL13.glClientActiveTexture(p_227747_0_);
}
@@ -15,4 +15,4 @@
+
public void func_230430_a_(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) {
this.func_230446_a_(p_230430_1_);
this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215);
func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215);
@@ -4,7 +4,7 @@
}
public static Advancement.Builder func_241043_a_(JsonObject p_241043_0_, ConditionArrayParser p_241043_1_) {
+ if (!net.minecraftforge.common.crafting.ConditionalAdvancement.processConditions(p_241043_0_)) return null;
+ if ((p_241043_0_ = net.minecraftforge.common.crafting.ConditionalAdvancement.processConditional(p_241043_0_)) == null) return null;
ResourceLocation resourcelocation = p_241043_0_.has("parent") ? new ResourceLocation(JSONUtils.func_151200_h(p_241043_0_, "parent")) : null;
DisplayInfo displayinfo = p_241043_0_.has("display") ? DisplayInfo.func_192294_a(JSONUtils.func_152754_s(p_241043_0_, "display")) : null;
AdvancementRewards advancementrewards = p_241043_0_.has("rewards") ? AdvancementRewards.func_241096_a_(JSONUtils.func_152754_s(p_241043_0_, "rewards")) : AdvancementRewards.field_192114_a;
@@ -4,8 +4,8 @@
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
p_192113_1_.func_195068_e(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
boolean flag = false;
for(ResourceLocation resourcelocation : this.field_192116_c) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractBlock.java
+++ b/net/minecraft/block/AbstractBlock.java
@@ -59,7 +59,8 @@
@@ -60,7 +60,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -10,15 +10,7 @@
protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
protected final Material field_149764_J;
protected final boolean field_235688_at_;
@@ -71,6 +72,7 @@
protected final float field_226887_g_;
protected final boolean field_208621_p;
protected final AbstractBlock.Properties field_235684_aB_;
+
@Nullable
protected ResourceLocation field_220085_g;
@@ -86,6 +88,8 @@
@@ -87,6 +88,8 @@
this.field_226887_g_ = p_i241196_1_.field_226894_k_;
this.field_208621_p = p_i241196_1_.field_208772_j;
this.field_235684_aB_ = p_i241196_1_;
@@ -27,16 +19,16 @@
}
@Deprecated
@@ -128,7 +132,7 @@
@@ -129,7 +132,7 @@
@Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
- if (this.func_235695_q_() && !p_196243_1_.func_203425_a(p_196243_4_.func_177230_c())) {
+ if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) {
+ if (p_196243_1_.hasTileEntity() && (!p_196243_1_.func_203425_a(p_196243_4_.func_177230_c()) || !p_196243_4_.hasTileEntity())) {
p_196243_2_.func_175713_t(p_196243_3_);
}
@@ -190,7 +194,7 @@
@@ -191,7 +194,7 @@
@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
@@ -45,16 +37,18 @@
}
@Deprecated
@@ -293,7 +297,7 @@
@@ -294,8 +297,8 @@
if (f == -1.0F) {
return 0.0F;
} else {
- int i = p_180647_2_.func_234569_d_(p_180647_1_) ? 30 : 100;
- return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
+ int i = net.minecraftforge.common.ForgeHooks.canHarvestBlock(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_) ? 30 : 100;
return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
+ return p_180647_2_.getDigSpeed(p_180647_1_, p_180647_4_) / f / (float)i;
}
}
@@ -320,14 +324,14 @@
@@ -321,14 +324,14 @@
return 0;
}
@@ -71,10 +65,14 @@
}
return this.field_220085_g;
@@ -345,6 +349,10 @@
@@ -346,6 +349,14 @@
return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P());
}
+ protected boolean isAir(BlockState state) {
+ return ((AbstractBlockState)state).field_235702_f_;
+ }
+
+ /* ======================================== FORGE START ===================================== */
+ private final java.util.function.Supplier<ResourceLocation> lootTableSupplier;
+ /* ========================================= FORGE END ====================================== */
@@ -82,16 +80,18 @@
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
private final int field_215708_d;
private final boolean field_215709_e;
@@ -427,6 +435,8 @@
@@ -428,14 +439,18 @@
return this.field_215708_d;
}
+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */
+ @Deprecated
public boolean func_196958_f() {
return this.field_235702_f_;
- return this.field_235702_f_;
+ return this.func_177230_c().isAir((BlockState)this);
}
@@ -435,6 +445,8 @@
public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) {
return this.field_235704_h_;
}
@@ -100,11 +100,56 @@
public BlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
}
@@ -786,6 +798,7 @@
@@ -802,6 +817,9 @@
private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true;
private boolean field_235813_o_;
+ private int harvestLevel = -1;
+ private net.minecraftforge.common.ToolType harvestTool;
+ private java.util.function.Supplier<ResourceLocation> lootTableSupplier;
private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> {
return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14;
};
@@ -863,6 +881,8 @@
abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_;
abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_;
abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_;
+ abstractblock$properties.harvestLevel = p_200950_0_.field_235684_aB_.harvestLevel;
+ abstractblock$properties.harvestTool = p_200950_0_.field_235684_aB_.harvestTool;
return abstractblock$properties;
}
@@ -877,6 +897,24 @@
return this;
}
+ public AbstractBlock.Properties harvestLevel(int harvestLevel) {
+ this.harvestLevel = harvestLevel;
+ return this;
+ }
+
+ public AbstractBlock.Properties harvestTool(net.minecraftforge.common.ToolType harvestTool) {
+ this.harvestTool = harvestTool;
+ return this;
+ }
+
+ public int getHarvestLevel() {
+ return this.harvestLevel;
+ }
+
+ public net.minecraftforge.common.ToolType getHarvestTool() {
+ return this.harvestTool;
+ }
+
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -933,7 +971,7 @@
}
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
- this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this;
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/block/AbstractFireBlock.java
+++ b/net/minecraft/block/AbstractFireBlock.java
@@ -124,6 +124,7 @@
if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) {
if (func_242649_a(p_220082_2_)) {
Optional<PortalSize> optional = PortalSize.func_242964_a(p_220082_2_, p_220082_3_, Direction.Axis.X);
+ optional = net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_220082_2_, p_220082_3_, optional);
if (optional.isPresent()) {
optional.get().func_150859_c();
return;
@@ -13,20 +13,20 @@
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
RailShape railshape = p_220053_1_.func_203425_a(this) ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
+ RailShape railShape2 = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
+ RailShape railShape2 = p_220053_1_.func_203425_a(this) ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
}
@@ -61,7 +62,7 @@
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (!p_220069_2_.field_72995_K) {
if (!p_220069_2_.field_72995_K && p_220069_2_.func_180495_p(p_220069_3_).func_203425_a(this)) {
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
if (func_235328_a_(p_220069_3_, p_220069_2_, railshape) && !p_220069_2_.func_175623_d(p_220069_3_)) {
if (!p_220069_6_) {
func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_);
@@ -113,7 +114,7 @@
if (func_235328_a_(p_220069_3_, p_220069_2_, railshape)) {
func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_);
p_220069_2_.func_217377_a(p_220069_3_, p_220069_6_);
@@ -110,7 +111,7 @@
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
@@ -35,7 +35,7 @@
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
}
@@ -132,5 +133,20 @@
@@ -129,5 +130,20 @@
return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractTopPlantBlock.java
+++ b/net/minecraft/block/AbstractTopPlantBlock.java
@@ -39,10 +39,11 @@
@@ -32,10 +32,11 @@
}
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -1,11 +1,14 @@
--- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java
@@ -101,8 +101,9 @@
@@ -100,10 +100,11 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
if (p_225542_1_.func_177229_b(field_220266_f) == 0) {
if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
- if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
+ if (p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
int i = this.func_220260_b(p_225542_2_, p_225542_3_) + 1;
- if (i < 16) {
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9)) {
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_.nextInt(3) == 0)) {
this.func_220258_a(p_225542_1_, p_225542_2_, p_225542_3_, p_225542_4_, i);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Block.java
+++ b/net/minecraft/block/Block.java
@@ -52,9 +52,10 @@
@@ -54,9 +54,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -13,25 +13,34 @@
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
public Boolean load(VoxelShape p_load_1_) {
return !VoxelShapes.func_197879_c(VoxelShapes.func_197868_b(), p_load_1_, IBooleanFunction.field_223236_g_);
@@ -270,7 +271,7 @@
@@ -151,6 +152,8 @@
super(p_i48440_1_);
StateContainer.Builder<Block, BlockState> builder = new StateContainer.Builder<>(this);
this.func_206840_a(builder);
+ this.harvestLevel = p_i48440_1_.getHarvestLevel();
+ this.harvestTool = p_i48440_1_.getHarvestTool();
this.field_176227_L = builder.func_235882_a_(Block::func_176223_P, BlockState::new);
this.func_180632_j(this.field_176227_L.func_177621_b());
}
@@ -261,7 +264,7 @@
}
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && p_180635_0_.restoringBlockSnapshots) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180635_0_.restoringBlockSnapshots) {
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -282,7 +283,7 @@
@@ -273,7 +276,7 @@
}
public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && p_180637_1_.restoringBlockSnapshots) {
public void func_180637_b(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
- if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) {
while(p_180637_3_ > 0) {
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
p_180637_3_ -= i;
@@ -292,6 +293,7 @@
@@ -283,6 +286,7 @@
}
@@ -39,7 +48,7 @@
public float func_149638_a() {
return this.field_235689_au_;
}
@@ -341,6 +343,7 @@
@@ -332,6 +336,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
}
@@ -47,7 +56,7 @@
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
return new ItemStack(this);
}
@@ -372,6 +375,7 @@
@@ -363,6 +368,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
}
@@ -55,7 +64,7 @@
public boolean func_149659_a(Explosion p_149659_1_) {
return true;
}
@@ -391,6 +395,7 @@
@@ -382,6 +388,7 @@
return this.field_196275_y;
}
@@ -63,7 +72,7 @@
public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H;
}
@@ -400,7 +405,7 @@
@@ -391,7 +398,7 @@
this.field_220086_i = Item.func_150898_a(this);
}
@@ -72,7 +81,7 @@
}
public boolean func_208619_r() {
@@ -408,7 +413,7 @@
@@ -399,7 +406,7 @@
}
public String toString() {
@@ -81,7 +90,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -419,6 +424,83 @@
@@ -410,6 +417,83 @@
return this;
}
@@ -128,7 +137,7 @@
+ } else if (net.minecraftforge.common.PlantType.CROP.equals(type)) {
+ return state.func_203425_a(Blocks.field_150458_ak);
+ } else if (net.minecraftforge.common.PlantType.CAVE.equals(type)) {
+ return Block.func_220056_d(state, world, pos, Direction.UP);
+ return state.func_224755_d(world, pos, Direction.UP);
+ } else if (net.minecraftforge.common.PlantType.PLAINS.equals(type)) {
+ return this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || this.getBlock() == Blocks.field_150458_ak;
+ } else if (net.minecraftforge.common.PlantType.WATER.equals(type)) {
@@ -1,14 +1,14 @@
--- a/net/minecraft/block/Blocks.java
+++ b/net/minecraft/block/Blocks.java
@@ -26,6 +26,7 @@
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.HugeFungusConfig;
@@ -25,6 +25,7 @@
import net.minecraft.world.IBlockReader;
import net.minecraft.world.gen.feature.Features;
[email protected]("minecraft")
public class Blocks {
public static final Block field_150350_a = func_222382_a("air", new AirBlock(AbstractBlock.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e().func_235859_g_()));
public static final Block field_150348_b = func_222382_a("stone", new Block(AbstractBlock.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_235861_h_().func_200948_a(1.5F, 6.0F)));
@@ -120,7 +121,7 @@
@@ -119,7 +120,7 @@
public static final Block field_196601_az = func_222382_a("green_bed", func_235422_a_(DyeColor.GREEN));
public static final Block field_196550_aA = func_222382_a("red_bed", func_235422_a_(DyeColor.RED));
public static final Block field_196551_aB = func_222382_a("black_bed", func_235422_a_(DyeColor.BLACK));
@@ -17,7 +17,7 @@
public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
public static final Block field_150320_F = func_222382_a("sticky_piston", func_235432_a_(true));
public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(AbstractBlock.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_235861_h_().func_200943_b(4.0F)));
@@ -938,15 +939,4 @@
@@ -937,15 +938,4 @@
public static void func_235419_a_() {
Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c);
}
@@ -6,7 +6,7 @@
-public class BushBlock extends Block {
+public class BushBlock extends Block implements net.minecraftforge.common.IPlantable {
protected BushBlock(AbstractBlock.Properties p_i48437_1_) {
public BushBlock(AbstractBlock.Properties p_i48437_1_) {
super(p_i48437_1_);
}
@@ -22,6 +22,8 @@
@@ -9,3 +9,12 @@
if (flag && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) {
BlockPos blockpos = p_220066_3_.func_216350_a();
p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11);
@@ -208,7 +208,7 @@
return true;
}
- boolean flag = VoxelShapes.func_197879_c(field_226912_f_, blockstate.func_215685_b(p_235474_0_, p_235474_1_, ISelectionContext.func_216377_a()), IBooleanFunction.field_223238_i_);
+ boolean flag = VoxelShapes.func_197879_c(field_226912_f_, blockstate.func_215685_b(p_235474_0_, blockpos, ISelectionContext.func_216377_a()), IBooleanFunction.field_223238_i_);//Forge fix: MC-201374
if (flag) {
BlockState blockstate1 = p_235474_0_.func_180495_p(blockpos.func_177977_b());
return func_226915_i_(blockstate1);
@@ -8,4 +8,4 @@
+public class DeadBushBlock extends BushBlock implements net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected DeadBushBlock(AbstractBlock.Properties p_i48418_1_) {
public DeadBushBlock(AbstractBlock.Properties p_i48418_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DetectorRailBlock.java
+++ b/net/minecraft/block/DetectorRailBlock.java
@@ -129,6 +129,8 @@
@@ -131,6 +131,8 @@
}
List<AbstractMinecartEntity> list1 = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, EntityPredicates.field_96566_b);
@@ -9,7 +9,7 @@
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -88,9 +88,9 @@
@@ -88,9 +88,10 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
}
@@ -17,12 +17,13 @@
- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c();
- return block instanceof CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock;
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
+ BlockState plant = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_);
+ return plant.func_177230_c() instanceof net.minecraftforge.common.IPlantable && state.canSustainPlant(p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)plant.func_177230_c());
}
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -100,7 +100,7 @@
@@ -100,7 +101,7 @@
}
}
@@ -1,11 +1,11 @@
--- a/net/minecraft/block/FireBlock.java
+++ b/net/minecraft/block/FireBlock.java
@@ -76,13 +76,13 @@
@@ -92,13 +92,13 @@
protected BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
BlockPos blockpos = p_196448_2_.func_177977_b();
BlockState blockstate = p_196448_1_.func_180495_p(blockpos);
- if (!this.func_196446_i(blockstate) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) {
+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) {
+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) {
BlockState blockstate1 = this.func_176223_P();
for(Direction direction : Direction.values()) {
@@ -16,7 +16,7 @@
}
}
@@ -105,7 +105,7 @@
@@ -121,7 +121,7 @@
}
BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b());
@@ -25,7 +25,7 @@
int i = p_225534_1_.func_177229_b(field_176543_a);
if (!flag && p_225534_2_.func_72896_J() && this.func_176537_d(p_225534_2_, p_225534_3_) && p_225534_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_225534_2_.func_217377_a(p_225534_3_, false);
@@ -126,7 +126,7 @@
@@ -142,7 +142,7 @@
return;
}
@@ -34,7 +34,7 @@
p_225534_2_.func_217377_a(p_225534_3_, false);
return;
}
@@ -134,12 +134,12 @@
@@ -150,12 +150,12 @@
boolean flag1 = p_225534_2_.func_180502_D(p_225534_3_);
int k = flag1 ? -50 : 0;
@@ -53,7 +53,7 @@
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
for(int l = -1; l <= 1; ++l) {
@@ -177,15 +177,17 @@
@@ -193,16 +193,18 @@
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
}
@@ -68,14 +68,17 @@
}
- private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_) {
- int i = this.func_220274_q(p_176536_1_.func_180495_p(p_176536_2_));
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, Direction face) {
int i = this.func_220274_q(p_176536_1_.func_180495_p(p_176536_2_));
+ int i = p_176536_1_.func_180495_p(p_176536_2_).getFlammability(p_176536_1_, p_176536_2_, face);
if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -197,10 +199,7 @@
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -212,11 +214,7 @@
p_176536_1_.func_217377_a(p_176536_2_, false);
}
Block block = blockstate.func_177230_c();
- Block block = blockstate.func_177230_c();
- if (block instanceof TNTBlock) {
- TNTBlock tntblock = (TNTBlock)block;
- TNTBlock.func_196534_a(p_176536_1_, p_176536_2_);
@@ -84,7 +87,7 @@
}
}
@@ -212,7 +211,7 @@
@@ -228,7 +226,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) {
@@ -93,7 +96,7 @@
return true;
}
}
@@ -228,13 +227,14 @@
@@ -244,13 +242,14 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -109,7 +112,7 @@
protected boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0;
}
@@ -253,10 +253,23 @@
@@ -269,10 +268,23 @@
}
private void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
@@ -20,7 +20,7 @@
+ * flower pots from altering vanilla behavior.
+ *
+ * @param emptyPot The empty pot for this pot, or null for self.
+ * @param p_i48395_1_ The flower block.
+ * @param block The flower block.
+ * @param properties
+ */
+ public FlowerPotBlock(@javax.annotation.Nullable java.util.function.Supplier<FlowerPotBlock> emptyPot, java.util.function.Supplier<? extends Block> p_i48395_1_, AbstractBlock.Properties properties) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FlowingFluidBlock.java
+++ b/net/minecraft/block/FlowingFluidBlock.java
@@ -31,10 +31,11 @@
@@ -29,10 +29,11 @@
public class FlowingFluidBlock extends Block implements IBucketPickupHandler {
public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag;
@@ -10,10 +10,10 @@
public static final VoxelShape field_235510_c_ = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
+ @Deprecated // Forge: Use the constructor that takes a supplier
protected FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) {
public FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) {
super(p_i49014_2_);
this.field_204517_c = p_i49014_1_;
@@ -47,8 +48,21 @@
@@ -45,8 +46,21 @@
this.field_212565_c.add(p_i49014_1_.func_207207_a(8, true));
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0)));
@@ -35,7 +35,7 @@
public VoxelShape func_220071_b(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, ISelectionContext p_220071_4_) {
return p_220071_4_.func_216378_a(field_235510_c_, p_220071_3_, true) && p_220071_1_.func_177229_b(field_176367_b) == 0 && p_220071_4_.func_230426_a_(p_220071_2_.func_204610_c(p_220071_3_.func_177984_a()), this.field_204517_c) ? field_235510_c_ : VoxelShapes.func_197880_a();
}
@@ -71,6 +85,7 @@
@@ -69,6 +83,7 @@
public FluidState func_204507_t(BlockState p_204507_1_) {
int i = p_204507_1_.func_177229_b(field_176367_b);
@@ -43,7 +43,7 @@
return this.field_212565_c.get(Math.min(i, 8));
}
@@ -122,13 +137,13 @@
@@ -120,13 +135,13 @@
BlockPos blockpos = p_204515_2_.func_177972_a(direction);
if (p_204515_1_.func_204610_c(blockpos).func_206884_a(FluidTags.field_206959_a)) {
Block block = p_204515_1_.func_204610_c(p_204515_2_).func_206889_d() ? Blocks.field_150343_Z : Blocks.field_150347_e;
@@ -59,9 +59,9 @@
this.func_180688_d(p_204515_1_, p_204515_2_);
return false;
}
@@ -166,4 +181,23 @@
@@ -153,4 +168,23 @@
return Fluids.field_204541_a;
}
}
+
+ // Forge start
@@ -1,11 +1,11 @@
--- a/net/minecraft/block/MushroomBlock.java
+++ b/net/minecraft/block/MushroomBlock.java
@@ -63,7 +63,7 @@
BlockPos blockpos = p_196260_3_.func_177977_b();
BlockState blockstate = p_196260_2_.func_180495_p(blockpos);
if (!blockstate.func_203425_a(Blocks.field_150391_bh) && !blockstate.func_203425_a(Blocks.field_196661_l)) {
@@ -64,7 +64,7 @@
if (blockstate.func_235714_a_(BlockTags.field_242171_aD)) {
return true;
} else {
- return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && this.func_200014_a_(blockstate, p_196260_2_, blockpos);
+ return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && blockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.Direction.UP, this);
} else {
return true;
}
}
@@ -1,47 +0,0 @@
--- a/net/minecraft/block/NetherPortalBlock.java
+++ b/net/minecraft/block/NetherPortalBlock.java
@@ -70,7 +70,7 @@
public static boolean func_176548_d(IWorld p_176548_0_, BlockPos p_176548_1_) {
NetherPortalBlock.Size netherportalblock$size = func_201816_b(p_176548_0_, p_176548_1_);
- if (netherportalblock$size != null) {
+ if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_0_, p_176548_1_, netherportalblock$size)) {
netherportalblock$size.func_150859_c();
return true;
} else {
@@ -241,12 +241,12 @@
int i;
for(i = 0; i < 22; ++i) {
BlockPos blockpos = p_180120_1_.func_177967_a(p_180120_2_, i);
- if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).isPortalFrame(field_150867_a, blockpos.func_177977_b())) {
break;
}
}
- return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_203425_a(Blocks.field_150343_Z) ? i : 0;
+ return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).isPortalFrame(field_150867_a, p_180120_1_.func_177967_a(p_180120_2_, i)) ? i : 0;
}
public int func_181100_a() {
@@ -272,17 +272,17 @@
}
if (i == 0) {
- if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150863_d))) {
break label56;
}
- } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_203425_a(Blocks.field_150343_Z)) {
+ } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150866_c))) {
break label56;
}
}
}
for(int j = 0; j < this.field_150868_h; ++j) {
- if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).isPortalFrame(field_150867_a, this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g))) {
this.field_150862_g = 0;
break;
}
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/OreBlock.java
@@ -31,12 +31,10 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) {
- int i = this.func_220281_a(p_220062_2_.field_73012_v);
@@ -24,16 +24,16 @@
return true;
}
@@ -230,7 +233,7 @@
@@ -234,7 +237,7 @@
return false;
}
- return !p_185646_0_.func_177230_c().func_235695_q_();
+ return !p_185646_0_.hasTileEntity();
} else {
return false;
}
@@ -271,7 +274,7 @@
} else {
return false;
@@ -273,7 +276,7 @@
for(int k = list2.size() - 1; k >= 0; --k) {
BlockPos blockpos2 = list2.get(k);
BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2);
@@ -42,7 +42,7 @@
func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity);
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
ablockstate[j++] = blockstate1;
@@ -335,6 +338,10 @@
@@ -337,6 +340,10 @@
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/PortalSize.java
+++ b/net/minecraft/block/PortalSize.java
@@ -16,7 +16,7 @@
public class PortalSize {
private static final AbstractBlock.IPositionPredicate field_242962_a = (p_242966_0_, p_242966_1_, p_242966_2_) -> {
- return p_242966_0_.func_203425_a(Blocks.field_150343_Z);
+ return p_242966_0_.isPortalFrame(p_242966_1_, p_242966_2_);
};
private final IWorld field_150867_a;
private final Direction.Axis field_150865_b;
@@ -6,7 +6,7 @@
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
+ private final boolean isActivator; // TRUE for an Activator Rail, FALSE for Powered Rail
protected PoweredRailBlock(AbstractBlock.Properties p_i48349_1_) {
public PoweredRailBlock(AbstractBlock.Properties p_i48349_1_) {
- super(true, p_i48349_1_);
+ this(p_i48349_1_, false);
+ }
@@ -35,7 +35,17 @@
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else {
return false;
@@ -255,4 +261,8 @@
@@ -156,6 +162,9 @@
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST);
+ case NORTH_SOUTH: //Forge fix: MC-196102
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) {
@@ -255,4 +264,8 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176568_b, field_176569_M);
}
@@ -0,0 +1,12 @@
--- a/net/minecraft/block/RailBlock.java
+++ b/net/minecraft/block/RailBlock.java
@@ -49,6 +49,9 @@
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST);
+ case NORTH_SOUTH: //Forge fix: MC-196102
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176565_b)) {
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/RedstoneOreBlock.java
@@ -71,11 +71,11 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) {
- int i = 1 + p_220062_2_.field_73012_v.nextInt(5);
@@ -8,4 +8,4 @@
+public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer, net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_207798_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
protected SeaGrassBlock(AbstractBlock.Properties p_i48780_1_) {
public SeaGrassBlock(AbstractBlock.Properties p_i48780_1_) {
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/SpawnerBlock.java
@@ -18,10 +18,13 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15);
- this.func_180637_b(p_220062_2_, p_220062_3_, i);
@@ -5,7 +5,7 @@
}
+ @Deprecated // Forge: Use the other constructor that takes a Supplier
protected StairsBlock(BlockState p_i48321_1_, AbstractBlock.Properties p_i48321_2_) {
public StairsBlock(BlockState p_i48321_1_, AbstractBlock.Properties p_i48321_2_) {
super(p_i48321_2_);
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false)));
this.field_150149_b = p_i48321_1_.func_177230_c();
@@ -8,4 +8,4 @@
+public class TallGrassBlock extends BushBlock implements IGrowable, net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected TallGrassBlock(AbstractBlock.Properties p_i48310_1_) {
public TallGrassBlock(AbstractBlock.Properties p_i48310_1_) {
@@ -5,7 +5,7 @@
return false;
} else {
- return p_212570_2_ instanceof PlayerEntity || p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b);
+ return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_) : true;
+ return p_212570_2_ instanceof PlayerEntity || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_);
}
} else {
return false;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/VineBlock.java
+++ b/net/minecraft/block/VineBlock.java
@@ -19,7 +19,7 @@
@@ -22,7 +22,7 @@
import net.minecraft.world.IWorldReader;
import net.minecraft.world.server.ServerWorld;
@@ -9,7 +9,7 @@
public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z;
public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a;
public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b;
@@ -143,14 +143,14 @@
@@ -152,14 +152,14 @@
}
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -26,16 +26,19 @@
Direction direction3 = direction.func_176746_e();
Direction direction4 = direction.func_176735_f();
boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3));
@@ -207,7 +207,7 @@
@@ -216,8 +216,9 @@
if (p_225542_3_.func_177956_o() > 0) {
BlockPos blockpos1 = p_225542_3_.func_177977_b();
BlockState blockstate = p_225542_2_.func_180495_p(blockpos1);
- if (blockstate.func_196958_f() || blockstate.func_203425_a(this)) {
+ if (blockstate.isAir(p_225542_2_, blockpos) || blockstate.func_203425_a(this)) {
BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate;
- BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate;
+ boolean isAir = blockstate.isAir(p_225542_2_, blockpos1);
+ if (isAir || blockstate.func_203425_a(this)) {
+ BlockState blockstate1 = isAir ? this.func_176223_P() : blockstate;
BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_);
if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) {
@@ -313,4 +313,7 @@
p_225542_2_.func_180501_a(blockpos1, blockstate2, 2);
@@ -322,4 +323,7 @@
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
return field_196546_A.get(p_176267_0_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/GameSettings.java
+++ b/net/minecraft/client/GameSettings.java
@@ -164,6 +164,7 @@
@@ -170,6 +170,7 @@
public boolean field_241568_aS_;
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
@@ -8,7 +8,7 @@
this.field_74317_L = p_i46326_1_;
this.field_74354_ai = new File(p_i46326_2_, "options.txt");
if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
@@ -507,7 +508,11 @@
@@ -529,7 +530,11 @@
for(KeyBinding keybinding : this.field_74324_K) {
if (s.equals("key_" + keybinding.func_151464_g())) {
@@ -21,7 +21,7 @@
}
}
@@ -554,6 +559,7 @@
@@ -576,6 +581,7 @@
}
public void func_74303_b() {
@@ -29,7 +29,7 @@
try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) {
printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion());
printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this));
@@ -635,7 +641,7 @@
@@ -661,7 +667,7 @@
printwriter.println("syncChunkWrites:" + this.field_241568_aS_);
for(KeyBinding keybinding : this.field_74324_K) {
@@ -38,11 +38,10 @@
}
for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -733,4 +739,22 @@
@@ -760,6 +766,23 @@
p_198017_1_.func_198985_a(set);
}
+
+ private void setForgeKeybindProperties() {
+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
+ field_74351_w.setKeyConflictContext(inGame);
@@ -58,6 +57,8 @@
+ field_74323_J.setKeyConflictContext(inGame);
+ field_151457_aa.setKeyConflictContext(inGame);
+ field_151458_ab.setKeyConflictContext(inGame);
+ field_186718_X.setKeyConflictContext(inGame);
+ }
}
+
public PointOfView func_243230_g() {
return this.field_243228_bb;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/KeyboardListener.java
+++ b/net/minecraft/client/KeyboardListener.java
@@ -256,7 +256,9 @@
@@ -255,7 +255,9 @@
}
INestedGuiEventHandler inestedguieventhandler = this.field_197972_a.field_71462_r;
@@ -11,7 +11,7 @@
if (this.field_197972_a.field_71474_y.field_152395_am.func_197976_a(p_197961_3_, p_197961_4_)) {
this.field_197972_a.func_228018_at_().func_198077_g();
this.field_197972_a.field_71474_y.field_74353_u = this.field_197972_a.func_228018_at_().func_198113_j();
@@ -275,6 +277,8 @@
@@ -274,6 +276,8 @@
});
return;
}
@@ -20,7 +20,7 @@
}
boolean flag = inestedguieventhandler == null || !(inestedguieventhandler.func_241217_q_() instanceof TextFieldWidget) || !((TextFieldWidget)inestedguieventhandler.func_241217_q_()).func_212955_f();
@@ -294,10 +298,14 @@
@@ -289,10 +293,14 @@
Screen.func_231153_a_(() -> {
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
if (p_197961_5_ == 0) {
@@ -37,7 +37,7 @@
}
}, "keyPressed event handler", inestedguieventhandler.getClass().getCanonicalName());
@@ -350,7 +358,7 @@
@@ -345,7 +353,7 @@
}
}
}
@@ -46,7 +46,7 @@
}
}
@@ -360,12 +368,16 @@
@@ -355,12 +363,16 @@
if (iguieventlistener != null && this.field_197972_a.func_213250_au() == null) {
if (Character.charCount(p_197963_3_) == 1) {
Screen.func_231153_a_(() -> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -358,6 +358,7 @@
@@ -368,6 +368,7 @@
public Minecraft(GameConfiguration p_i45547_1_) {
super("Client");
field_71432_P = this;
@@ -8,15 +8,15 @@
this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
File file1 = p_i45547_1_.field_178744_c.field_178759_c;
this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
@@ -370,7 +371,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
@@ -382,7 +383,6 @@
this.field_244734_au = this.func_244735_a(yggdrasilauthenticationservice, p_i45547_1_);
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
- field_147123_G.debug("(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_238175_ae_ = !p_i45547_1_.field_178741_d.field_239099_d_;
this.field_238176_af_ = !p_i45547_1_.field_178741_d.field_239100_e_;
@@ -416,13 +416,13 @@
@@ -428,13 +428,13 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
@@ -31,7 +31,7 @@
this.field_110448_aq.func_198983_a();
this.field_71474_y.func_198017_a(this.field_110448_aq);
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
@@ -463,6 +463,7 @@
@@ -476,6 +476,7 @@
this.func_193986_ar();
this.field_110451_am.func_219534_a(this.field_193995_ae);
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -39,7 +39,7 @@
this.field_110451_am.func_219534_a(this.field_71452_i);
this.field_213272_aL = new PaintingSpriteUploader(this.field_71446_o);
this.field_110451_am.func_219534_a(this.field_213272_aL);
@@ -470,7 +471,8 @@
@@ -483,7 +484,8 @@
this.field_110451_am.func_219534_a(this.field_213273_aM);
this.field_241557_ar_ = new GPUWarning();
this.field_110451_am.func_219534_a(this.field_241557_ar_);
@@ -49,7 +49,7 @@
this.field_184132_p = new DebugRenderer(this);
RenderSystem.setErrorCallback(this::func_195545_a);
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
@@ -482,11 +484,6 @@
@@ -495,11 +497,6 @@
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
this.field_195558_d.func_227801_c_();
this.func_213226_a();
@@ -61,7 +61,7 @@
ResourceLoadProgressGui.func_212970_a(this);
List<IResourcePack> list = this.field_110448_aq.func_232623_f_();
@@ -495,7 +492,14 @@
@@ -508,7 +505,14 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
@@ -77,7 +77,7 @@
});
}, false));
}
@@ -534,7 +538,7 @@
@@ -556,7 +560,7 @@
}
private void func_229988_a_(Throwable p_229988_1_) {
@@ -86,7 +86,7 @@
ITextComponent itextcomponent;
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_241203_a().func_195762_a());
@@ -618,7 +622,7 @@
@@ -644,7 +648,7 @@
return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b()));
});
SearchTreeReloadable<ItemStack> searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> {
@@ -95,7 +95,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -688,13 +692,13 @@
@@ -714,13 +718,13 @@
Bootstrap.func_179870_a(p_71377_0_.func_71502_e());
if (p_71377_0_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f());
@@ -112,7 +112,7 @@
}
}
@@ -703,6 +707,7 @@
@@ -729,6 +733,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -120,7 +120,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -791,10 +796,6 @@
@@ -817,10 +822,6 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -131,7 +131,7 @@
if (p_147108_1_ == null && this.field_71441_e == null) {
p_147108_1_ = new MainMenuScreen();
} else if (p_147108_1_ == null && this.field_71439_g.func_233643_dh_()) {
@@ -805,6 +806,14 @@
@@ -831,6 +832,14 @@
}
}
@@ -146,30 +146,29 @@
if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) {
this.field_71474_y.field_74330_P = false;
this.field_71456_v.func_146158_b().func_146231_a(true);
@@ -936,11 +945,13 @@
@@ -962,11 +971,13 @@
RenderSystem.enableCull();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71428_T.field_194147_b);
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b);
this.field_71424_I.func_219895_b("gameRenderer");
this.field_71460_t.func_195458_a(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b, i, p_195542_1_);
this.field_71424_I.func_219895_b("toasts");
this.field_193034_aS.func_238541_a_(new MatrixStack());
this.field_71424_I.func_76319_b();
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71428_T.field_194147_b);
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b);
}
if (this.field_238174_aV_ != null) {
@@ -1039,7 +1050,7 @@
@@ -1065,6 +1076,7 @@
Framebuffer framebuffer = this.func_147110_a();
framebuffer.func_216491_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), field_142025_a);
- this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
+ if (this.field_71460_t!=null) this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
+ if (this.field_71460_t != null)
this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
this.field_71417_B.func_198021_g();
}
@@ -1227,11 +1238,21 @@
@@ -1253,11 +1265,21 @@
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -193,7 +192,7 @@
}
}
@@ -1250,6 +1271,8 @@
@@ -1276,6 +1298,8 @@
}
} else if (!this.field_71439_g.func_184838_M()) {
@@ -202,7 +201,7 @@
switch(this.field_71476_x.func_216346_c()) {
case ENTITY:
this.field_71442_b.func_78764_a(this.field_71439_g, ((EntityRayTraceResult)this.field_71476_x).func_216348_a());
@@ -1257,7 +1280,7 @@
@@ -1283,7 +1307,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -211,7 +210,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1267,8 +1290,10 @@
@@ -1293,8 +1317,10 @@
}
this.field_71439_g.func_184821_cY();
@@ -222,7 +221,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1283,6 +1308,11 @@
@@ -1309,6 +1335,11 @@
}
for(Hand hand : Hand.values()) {
@@ -234,7 +233,7 @@
ItemStack itemstack = this.field_71439_g.func_184586_b(hand);
if (this.field_71476_x != null) {
switch(this.field_71476_x.func_216346_c()) {
@@ -1296,6 +1326,7 @@
@@ -1322,6 +1353,7 @@
if (actionresulttype.func_226246_a_()) {
if (actionresulttype.func_226247_b_()) {
@@ -242,7 +241,7 @@
this.field_71439_g.func_184609_a(hand);
}
@@ -1308,6 +1339,7 @@
@@ -1334,6 +1366,7 @@
ActionResultType actionresulttype1 = this.field_71442_b.func_217292_a(this.field_71439_g, this.field_71441_e, hand, blockraytraceresult);
if (actionresulttype1.func_226246_a_()) {
if (actionresulttype1.func_226247_b_()) {
@@ -250,7 +249,7 @@
this.field_71439_g.func_184609_a(hand);
if (!itemstack.func_190926_b() && (itemstack.func_190916_E() != i || this.field_71442_b.func_78758_h())) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
@@ -1323,6 +1355,9 @@
@@ -1349,6 +1382,9 @@
}
}
@@ -260,7 +259,7 @@
if (!itemstack.func_190926_b()) {
ActionResultType actionresulttype2 = this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand);
if (actionresulttype2.func_226246_a_()) {
@@ -1349,6 +1384,8 @@
@@ -1375,6 +1411,8 @@
--this.field_71467_ac;
}
@@ -269,7 +268,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1465,6 +1502,8 @@
@@ -1500,6 +1538,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -277,19 +276,8 @@
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
}
private void func_184117_aA() {
@@ -1676,6 +1715,10 @@
this.field_71424_I.func_76320_a("waitForServer");
while(!this.field_71437_Z.func_71200_ad()) {
+ if (!net.minecraftforge.fml.StartupQuery.check() || this.field_71437_Z.func_71241_aa()) {
+ this.func_147108_a(null);
+ return;
+ } else if (this.field_71462_r == null) // if we're showing nothing, put the working screen back again
worldloadprogressscreen.func_231023_e_();
this.func_195542_b(false);
@@ -1696,7 +1739,12 @@
private boolean func_244600_aM() {
@@ -1747,7 +1787,12 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -303,7 +291,7 @@
this.field_71453_ak = networkmanager;
} else {
this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> {
@@ -1770,6 +1818,7 @@
@@ -1821,6 +1866,7 @@
}
public void func_71403_a(ClientWorld p_71403_1_) {
@@ -311,7 +299,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1801,10 +1850,12 @@
@@ -1852,10 +1898,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -324,7 +312,7 @@
if (integratedserver != null) {
this.field_71424_I.func_76320_a("waitForServer");
@@ -1819,6 +1870,7 @@
@@ -1870,6 +1918,7 @@
this.field_71456_v.func_181029_i();
this.field_71422_O = null;
this.field_71455_al = false;
@@ -332,7 +320,7 @@
this.field_213274_aO.func_216815_b();
}
@@ -1849,6 +1901,7 @@
@@ -1900,6 +1949,7 @@
this.field_71452_i.func_78870_a(p_213257_1_);
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
this.func_230150_b_();
@@ -340,7 +328,7 @@
}
public boolean func_238216_r_() {
@@ -1894,112 +1947,9 @@
@@ -1945,112 +1995,9 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@@ -456,7 +444,7 @@
}
}
@@ -2081,6 +2031,7 @@
@@ -2140,6 +2087,7 @@
return field_71432_P;
}
@@ -464,16 +452,16 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> {
return p_229993_0_;
@@ -2388,7 +2339,7 @@
@@ -2451,7 +2399,7 @@
supplier = func_228022_c_(supplier);
}
- return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_);
+ return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden());
- return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_);
+ return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden());
}
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
@@ -2407,6 +2358,14 @@
@@ -2470,6 +2418,14 @@
this.field_175617_aL.func_229355_a_(p_228020_1_);
}
@@ -487,4 +475,4 @@
+
@OnlyIn(Dist.CLIENT)
public static final class PackManager implements AutoCloseable {
private final ResourcePackList<ResourcePackInfo> field_238221_a_;
private final ResourcePackList field_238221_a_;
@@ -4,7 +4,7 @@
this.field_148622_c = p_i50892_1_;
this.field_148619_d = p_i50892_2_;
this.field_217939_i = new AudioStreamManager(p_i50892_3_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this));
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
}
public void func_148596_a() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
+++ b/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
@@ -113,7 +113,7 @@
@@ -114,7 +114,7 @@
f = 1.0F;
}
@@ -9,11 +9,11 @@
int i = this.func_184612_cw();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F) {
@@ -125,6 +125,6 @@
@@ -126,6 +126,6 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
- return MathHelper.func_219799_g(Minecraft.func_71410_x().field_71474_y.field_243227_aN, 1.0F, f);
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/entity/player/ClientPlayerEntity.java
+++ b/net/minecraft/client/entity/player/ClientPlayerEntity.java
@@ -133,6 +133,7 @@
@@ -134,6 +134,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -8,7 +8,7 @@
return false;
}
@@ -479,6 +480,11 @@
@@ -457,6 +458,11 @@
}
public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
@@ -20,7 +20,7 @@
this.field_70170_p.func_184134_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false);
}
@@ -617,6 +623,7 @@
@@ -595,6 +601,7 @@
boolean flag2 = this.func_223110_ee();
this.field_239203_ch_ = !this.field_71075_bZ.field_75100_b && !this.func_203007_ba() && this.func_213298_c(Pose.CROUCHING) && (this.func_225608_bj_() || !this.func_70608_bn() && !this.func_213298_c(Pose.STANDING));
this.field_71158_b.func_225607_a_(this.func_228354_I_());
@@ -28,26 +28,17 @@
this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b);
if (this.func_184587_cr() && !this.func_184218_aH()) {
this.field_71158_b.field_78902_a *= 0.2F;
@@ -631,11 +638,12 @@
this.field_71158_b.field_78901_c = true;
}
@@ -667,7 +674,7 @@
- if (!this.field_70145_X) {
- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this);
+ if (!this.field_70145_X && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
if (this.field_71158_b.field_78901_c && !flag7 && !flag && !this.field_71075_bZ.field_75100_b && !this.func_184218_aH() && !this.func_70617_f_()) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack) && this.func_226566_ei_()) {
+ if (itemstack.canElytraFly(this) && this.func_226566_ei_()) {
this.field_71174_a.func_147297_a(new CEntityActionPacket(this, CEntityActionPacket.Action.START_FALL_FLYING));
}
}
if (flag1) {
@@ -985,4 +993,16 @@
return this.field_204230_bP;
@@ -975,4 +982,16 @@
return super.func_241843_o(p_241843_1_);
}
}
+
@@ -1,6 +1,15 @@
--- a/net/minecraft/client/gui/IngameGui.java
+++ b/net/minecraft/client/gui/IngameGui.java
@@ -416,6 +416,9 @@
@@ -79,7 +79,7 @@
protected static final ResourceLocation field_110329_b = new ResourceLocation("textures/misc/vignette.png");
protected static final ResourceLocation field_110330_c = new ResourceLocation("textures/gui/widgets.png");
protected static final ResourceLocation field_110328_d = new ResourceLocation("textures/misc/pumpkinblur.png");
- protected static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired");
+ private static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired");
protected final Random field_73842_c = new Random();
protected final Minecraft field_73839_d;
protected final ItemRenderer field_73841_b;
@@ -415,6 +415,9 @@
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
Effect effect = effectinstance.func_188419_a();
@@ -10,7 +19,7 @@
if (effectinstance.func_205348_f()) {
int k = this.field_194811_H;
int l = 1;
@@ -453,6 +456,7 @@
@@ -452,6 +455,7 @@
RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);
func_238470_a_(p_238444_1_, j1 + 3, k1 + 3, this.func_230927_p_(), 18, 18, textureatlassprite);
});
@@ -18,7 +27,7 @@
}
}
@@ -577,7 +581,8 @@
@@ -576,7 +580,8 @@
iformattabletextcomponent.func_240699_a_(TextFormatting.ITALIC);
}
@@ -28,22 +37,22 @@
int j = (this.field_194811_H - i) / 2;
int k = this.field_194812_I - 59;
if (!this.field_73839_d.field_71442_b.func_78755_b()) {
@@ -594,7 +599,13 @@
@@ -593,7 +598,13 @@
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
func_238467_a_(p_238453_1_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0));
- this.func_175179_f().func_238407_a_(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24));
- this.func_175179_f().func_243246_a(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24));
+ FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l);
+ if (font == null) {
+ this.func_175179_f().func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ this.func_175179_f().func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ } else {
+ j = (this.field_194811_H - font.func_238414_a_(highlightTip)) / 2;
+ font.func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ font.func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ }
RenderSystem.disableBlend();
RenderSystem.popMatrix();
}
@@ -1057,7 +1068,7 @@
@@ -1056,7 +1067,7 @@
ItemStack itemstack = this.field_73839_d.field_71439_g.field_71071_by.func_70448_g();
if (itemstack.func_190926_b()) {
this.field_92017_k = 0;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/advancements/AdvancementsScreen.java
+++ b/net/minecraft/client/gui/advancements/AdvancementsScreen.java
@@ -25,6 +25,7 @@
@@ -29,6 +29,7 @@
private final Map<Advancement, AdvancementTabGui> field_191947_i = Maps.newLinkedHashMap();
private AdvancementTabGui field_191940_s;
private boolean field_191944_v;
@@ -8,7 +8,7 @@
public AdvancementsScreen(ClientAdvancementManager p_i47383_1_) {
super(NarratorChatListener.field_216868_a);
@@ -40,7 +41,13 @@
@@ -44,7 +45,13 @@
} else {
this.field_191946_h.func_194230_a(this.field_191940_s == null ? null : this.field_191940_s.func_193935_c(), true);
}
@@ -23,7 +23,7 @@
}
public void func_231164_f_() {
@@ -58,7 +65,7 @@
@@ -62,7 +69,7 @@
int j = (this.field_230709_l_ - 140) / 2;
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -32,7 +32,7 @@
this.field_191946_h.func_194230_a(advancementtabgui.func_193935_c(), true);
break;
}
@@ -82,6 +89,12 @@
@@ -86,6 +93,12 @@
int i = (this.field_230708_k_ - 252) / 2;
int j = (this.field_230709_l_ - 140) / 2;
this.func_230446_a_(p_230430_1_);
@@ -40,12 +40,12 @@
+ net.minecraft.util.text.ITextComponent page = new net.minecraft.util.text.StringTextComponent(String.format("%d / %d", tabPage + 1, maxPages + 1));
+ int width = this.field_230712_o_.func_238414_a_(page);
+ RenderSystem.disableLighting();
+ this.field_230712_o_.func_238407_a_(p_230430_1_, page, i + (252 / 2) - (width / 2), j - 44, -1);
+ this.field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), i + (252 / 2) - (width / 2), j - 44, -1);
+ }
this.func_238696_c_(p_230430_1_, p_230430_2_, p_230430_3_, i, j);
this.func_238695_a_(p_230430_1_, i, j);
this.func_238697_d_(p_230430_1_, p_230430_2_, p_230430_3_, i, j);
@@ -129,6 +142,7 @@
@@ -132,6 +145,7 @@
this.field_230706_i_.func_110434_K().func_110577_a(field_191945_g);
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -53,7 +53,7 @@
advancementtabgui.func_238683_a_(p_238695_1_, p_238695_2_, p_238695_3_, advancementtabgui == this.field_191940_s);
}
@@ -136,6 +150,7 @@
@@ -139,6 +153,7 @@
RenderSystem.defaultBlendFunc();
for(AdvancementTabGui advancementtabgui1 : this.field_191947_i.values()) {
@@ -61,7 +61,7 @@
advancementtabgui1.func_191796_a(p_238695_2_, p_238695_3_, this.field_230707_j_);
}
@@ -158,7 +173,7 @@
@@ -161,7 +176,7 @@
if (this.field_191947_i.size() > 1) {
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -13,7 +13,7 @@
@@ -40,7 +43,9 @@
int i1 = i / 2 - l / 2;
int j1 = j - 9;
this.field_184059_f.field_71466_p.func_238407_a_(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215);
this.field_184059_f.field_71466_p.func_243246_a(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215);
- j += 10 + 9;
+ }
+ j += event.getIncrement();
@@ -4,7 +4,7 @@
list.add(this.func_211534_a(entry));
}
- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_199717_a().func_199913_a(blockstate.func_177230_c())) {
- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_241835_a().func_199913_a(blockstate.func_177230_c())) {
+ for(ResourceLocation resourcelocation : blockstate.func_177230_c().getTags()) {
list.add("#" + resourcelocation);
}
@@ -13,7 +13,7 @@
list.add(this.func_211534_a(entry1));
}
- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_205704_c().func_199913_a(fluidstate.func_206886_c())) {
- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_241837_c().func_199913_a(fluidstate.func_206886_c())) {
+ for(ResourceLocation resourcelocation1 : fluidstate.func_206886_c().getTags()) {
list.add("#" + resourcelocation1);
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/recipebook/RecipeBookGui.java
+++ b/net/minecraft/client/gui/recipebook/RecipeBookGui.java
@@ -92,7 +92,7 @@
@@ -95,7 +95,7 @@
this.func_205702_a();
this.field_193018_j.clear();
- for(RecipeBookCategories recipebookcategories : ClientRecipeBook.func_216769_b(this.field_201522_g)) {
- for(RecipeBookCategories recipebookcategories : RecipeBookCategories.func_243236_a(this.field_201522_g.func_241850_m())) {
+ for(RecipeBookCategories recipebookcategories : this.field_201522_g.getRecipeBookCategories()) {
this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories));
}
@@ -425,7 +425,7 @@
@@ -434,7 +434,7 @@
languagemanager.func_135045_a(language);
this.field_191888_F.field_71474_y.field_74363_ab = language.getCode();
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/screen/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screen/CreateWorldScreen.java
@@ -542,6 +542,7 @@
File file1 = path.toFile();
if (this.field_243416_G == null) {
this.field_243416_G = new ResourcePackList(new ServerPackFinder(), new FolderPackFinder(file1, IPackNameDecorator.field_232625_a_));
+ net.minecraftforge.fml.packs.ResourcePackLoader.loadResourcePacks(this.field_243416_G, net.minecraftforge.fml.server.ServerLifecycleHooks::buildPackFinder);
this.field_243416_G.func_198983_a();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/LanguageScreen.java
+++ b/net/minecraft/client/gui/screen/LanguageScreen.java
@@ -43,7 +43,7 @@
@@ -46,7 +46,7 @@
if (languagescreen$list$languageentry != null && !languagescreen$list$languageentry.field_214398_b.getCode().equals(this.field_146454_h.func_135041_c().getCode())) {
this.field_146454_h.func_135045_a(languagescreen$list$languageentry.field_214398_b);
this.field_228183_b_.field_74363_ab = languagescreen$list$languageentry.field_214398_b.getCode();
@@ -34,7 +34,7 @@
this.func_140005_i();
}, button$itooltip))).field_230693_o_ = flag;
}
@@ -222,6 +228,7 @@
@@ -229,6 +235,7 @@
this.field_230706_i_.func_110434_K().func_110577_a(field_194400_H);
func_238463_a_(p_230430_1_, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
@@ -42,22 +42,23 @@
if (this.field_73975_c != null) {
RenderSystem.pushMatrix();
RenderSystem.translatef((float)(this.field_230708_k_ / 2 + 90), 70.0F, 0.0F);
@@ -244,7 +251,13 @@
@@ -251,7 +258,14 @@
s = s + I18n.func_135052_a("menu.modded");
}
- this.func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l);
- func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l);
+ net.minecraftforge.fml.BrandingControl.forEachLine(true, true, (brdline, brd) ->
+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ );
+
+ net.minecraftforge.fml.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ );
this.func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l);
+
func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l);
if (p_230430_2_ > this.field_193979_N && p_230430_2_ < this.field_193979_N + this.field_193978_M && p_230430_3_ > this.field_230709_l_ - 10 && p_230430_3_ < this.field_230709_l_) {
func_238467_a_(p_230430_1_, this.field_193979_N, this.field_230709_l_ - 1, this.field_193979_N + this.field_193978_M, this.field_230709_l_, 16777215 | l);
@@ -258,6 +271,7 @@
@@ -265,6 +279,7 @@
if (this.func_183501_a() && f1 >= 1.0F) {
this.field_183503_M.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_);
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/gui/screen/OptionsScreen.java
+++ b/net/minecraft/client/gui/screen/OptionsScreen.java
@@ -146,4 +146,12 @@
this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215);
func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215);
super.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_);
}
+
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/PackLoadingManager.java
+++ b/net/minecraft/client/gui/screen/PackLoadingManager.java
@@ -135,6 +135,11 @@
@@ -134,6 +134,11 @@
public void func_230468_k_() {
this.func_238879_a_(1);
}
@@ -12,7 +12,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -230,5 +235,7 @@
@@ -229,5 +234,7 @@
boolean func_230469_o_();
boolean func_230470_p_();
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/gui/screen/PackScreen.java
+++ b/net/minecraft/client/gui/screen/PackScreen.java
@@ -84,7 +84,7 @@
@@ -129,7 +129,7 @@
private void func_238899_a_(ResourcePackList p_238899_1_, Stream<PackLoadingManager.IPack> p_238899_2_) {
private void func_238899_a_(net.minecraft.client.gui.widget.list.ResourcePackList p_238899_1_, Stream<PackLoadingManager.IPack> p_238899_2_) {
p_238899_1_.func_231039_at__().clear();
- p_238899_2_.forEach((p_238898_2_) -> {
+ p_238899_2_.filter(PackLoadingManager.IPack::notHidden).forEach((p_238898_2_) -> {
p_238899_1_.func_231039_at__().add(new ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_));
p_238899_1_.func_231039_at__().add(new net.minecraft.client.gui.widget.list.ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_));
});
}
@@ -4,28 +4,38 @@
}
protected void func_230457_a_(MatrixStack p_230457_1_, ItemStack p_230457_2_, int p_230457_3_, int p_230457_4_) {
- this.func_238654_b_(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_);
- this.func_243308_b(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_);
+ FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
+ this.func_238654_b_(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ this.renderWrappedToolTip(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
}
public List<ITextComponent> func_231151_a_(ItemStack p_231151_1_) {
@@ -125,7 +128,11 @@
@@ -121,14 +124,20 @@
}
public void func_238654_b_(MatrixStack p_238654_1_, List<? extends ITextProperties> p_238654_2_, int p_238654_3_, int p_238654_4_) {
- if (!p_238654_2_.isEmpty()) {
+
public void func_238652_a_(MatrixStack p_238652_1_, ITextComponent p_238652_2_, int p_238652_3_, int p_238652_4_) {
- this.func_238654_b_(p_238652_1_, Arrays.asList(p_238652_2_.func_241878_f()), p_238652_3_, p_238652_4_);
+ this.func_243308_b(p_238652_1_, Arrays.asList(p_238652_2_), p_238652_3_, p_238652_4_);
}
public void func_243308_b(MatrixStack p_243308_1_, List<ITextComponent> p_243308_2_, int p_243308_3_, int p_243308_4_) {
- this.func_238654_b_(p_243308_1_, Lists.transform(p_243308_2_, ITextComponent::func_241878_f), p_243308_3_, p_243308_4_);
+ this.renderWrappedToolTip(p_243308_1_, p_243308_2_, p_243308_3_, p_243308_4_, field_230712_o_);
}
+ public void renderWrappedToolTip(MatrixStack matrixStack, List<? extends net.minecraft.util.text.ITextProperties> tooltips, int mouseX, int mouseY, FontRenderer font) {
+ net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(matrixStack, tooltips, mouseX, mouseY, field_230708_k_, field_230709_l_, -1, font);
+ }
+ public void func_238654_b_(MatrixStack p_238654_1_, List<? extends ITextProperties> p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) {
+ net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font);
+ if (false && !p_238654_2_.isEmpty()) {
public void func_238654_b_(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_) {
+ this.renderToolTip(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230712_o_);
+ }
+ public void renderToolTip(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) {
if (!p_238654_2_.isEmpty()) {
int i = 0;
for(ITextProperties itextproperties : p_238654_2_) {
@@ -285,9 +292,12 @@
@@ -289,9 +298,12 @@
}
public void func_231159_b_(String p_231159_1_, boolean p_231159_2_) {
@@ -38,7 +48,7 @@
this.field_230706_i_.field_71439_g.func_71165_d(p_231159_1_);
}
@@ -298,10 +308,17 @@
@@ -302,10 +314,17 @@
this.field_230712_o_ = p_231158_1_.field_71466_p;
this.field_230708_k_ = p_231158_2_;
this.field_230709_l_ = p_231158_3_;
@@ -56,23 +66,23 @@
}
public List<? extends IGuiEventListener> func_231039_at__() {
@@ -324,6 +341,7 @@
@@ -328,6 +347,7 @@
public void func_238651_a_(MatrixStack p_238651_1_, int p_238651_2_) {
if (this.field_230706_i_.field_71441_e != null) {
this.func_238468_a_(p_238651_1_, 0, 0, this.field_230708_k_, this.field_230709_l_, -1072689136, -804253680);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, p_238651_1_));
} else {
this.func_231165_f_(p_238651_2_);
}
@@ -342,6 +360,7 @@
@@ -346,6 +366,7 @@
bufferbuilder.func_225582_a_((double)this.field_230708_k_, 0.0D, 0.0D).func_225583_a_((float)this.field_230708_k_ / 32.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
bufferbuilder.func_225582_a_(0.0D, 0.0D, 0.0D).func_225583_a_(0.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
tessellator.func_78381_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, new MatrixStack()));
}
public boolean func_231177_au__() {
@@ -428,4 +447,8 @@
@@ -432,4 +453,8 @@
public void func_230476_a_(List<Path> p_230476_1_) {
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/ServerSelectionList.java
+++ b/net/minecraft/client/gui/screen/ServerSelectionList.java
@@ -302,6 +302,8 @@
@@ -307,6 +307,8 @@
this.field_148303_c.func_238854_b_(list1);
}
@@ -105,19 +105,20 @@
this.func_184098_a(slot, k, p_231048_5_, ClickType.CLONE);
} else {
boolean flag1 = k != -999 && (InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 340) || InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 344));
@@ -534,19 +544,26 @@
@@ -530,34 +540,39 @@
}
public boolean func_231046_a_(int p_231046_1_, int p_231046_2_, int p_231046_3_) {
+ InputMappings.Input mouseKey = InputMappings.func_197954_a(p_231046_1_, p_231046_2_);
if (super.func_231046_a_(p_231046_1_, p_231046_2_, p_231046_3_)) {
return true;
- } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) {
- } else if (this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) {
+ } else if (this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) {
this.func_231175_as__();
return true;
} else {
- this.func_195363_d(p_231046_1_, p_231046_2_);
+ } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) {
+ boolean handled = false;// Forge MC-146650: Needs to return true when the key is handled.
+ if (this.func_195363_d(p_231046_1_, p_231046_2_))
+ handled = true;
+ boolean handled = this.func_195363_d(p_231046_1_, p_231046_2_);// Forge MC-146650: Needs to return true when the key is handled
if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) {
- if (this.field_230706_i_.field_71474_y.field_74322_I.func_197976_a(p_231046_1_, p_231046_2_)) {
+ if (this.field_230706_i_.field_71474_y.field_74322_I.isActiveAndMatches(mouseKey)) {
@@ -129,15 +130,13 @@
+ handled = true;
}
+ } else if (this.field_230706_i_.field_71474_y.field_74316_C.isActiveAndMatches(mouseKey)) {
+ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item.
+ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item.
}
- return true;
+ return handled;
} else {
this.field_230706_i_.field_71439_g.func_71053_j();
return true;
@@ -555,13 +572,13 @@
}
}
protected boolean func_195363_d(int p_195363_1_, int p_195363_2_) {
if (this.field_230706_i_.field_71439_g.field_71071_by.func_70445_o().func_190926_b() && this.field_147006_u != null) {
@@ -153,11 +152,10 @@
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP);
return true;
}
@@ -592,4 +609,16 @@
public T func_212873_a_() {
@@ -589,6 +604,18 @@
return this.field_147002_h;
}
+
+ @javax.annotation.Nullable
+ public Slot getSlotUnderMouse() { return this.field_147006_u; }
+ public int getGuiLeft() { return field_147003_i; }
@@ -169,4 +167,7 @@
+ public int getSlotColor(int index) {
+ return slotColor;
+ }
}
+
public void func_231175_as__() {
this.field_230706_i_.field_71439_g.func_71053_j();
super.func_231175_as__();
@@ -9,19 +9,19 @@
private boolean field_199506_G;
private final Map<ResourceLocation, ITag<Item>> field_214085_w = Maps.newTreeMap();
@@ -233,6 +235,12 @@
@@ -234,6 +236,12 @@
protected void func_231160_c_() {
if (this.field_230706_i_.field_71442_b.func_78758_h()) {
super.func_231160_c_();
+ int tabCount = ItemGroup.field_78032_a.length;
+ if (tabCount > 12) {
+ func_230480_a_(new net.minecraft.client.gui.widget.button.Button(field_147003_i, field_147009_r - 50, 20, 20, new StringTextComponent("<"), b -> tabPage = Math.max(tabPage - 1, 0 )));
+ func_230480_a_(new net.minecraft.client.gui.widget.button.Button(field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, new StringTextComponent(">"), b -> tabPage = Math.min(tabPage + 1, maxPages)));
+ maxPages = (int) Math.ceil((tabCount - 12) / 10D);
+ }
super.func_231160_c_();
this.field_230706_i_.field_195559_v.func_197967_a(true);
this.field_147062_A = new TextFieldWidget(this.field_230712_o_, this.field_147003_i + 82, this.field_147009_r + 6, 80, 9, new TranslationTextComponent("itemGroup.search"));
this.field_147062_A.func_146203_f(50);
@@ -275,7 +283,7 @@
public boolean func_231042_a_(char p_231042_1_, int p_231042_2_) {
if (this.field_195377_F) {
@@ -80,8 +80,8 @@
- if (itemgroup.func_78019_g()) {
+ if (itemgroup != null && itemgroup.func_78019_g()) {
RenderSystem.disableBlend();
- this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, 4210752);
+ this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, itemgroup.getLabelColor());
- this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, 4210752);
+ this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, itemgroup.getLabelColor());
}
}
@@ -154,11 +154,11 @@
break;
}
}
+ if (!rendered && !func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_))
+ func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_);
+ if (!rendered && !this.func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_))
+ this.func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_);
if (this.field_147064_C != null && field_147058_w == ItemGroup.field_78036_m.func_78021_a() && this.func_195359_a(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, (double)p_230430_2_, (double)p_230430_3_)) {
this.func_238652_a_(p_230430_1_, new TranslationTextComponent("inventory.binSlot"), p_230430_2_, p_230430_3_);
this.func_238652_a_(p_230430_1_, field_243345_D, p_230430_2_, p_230430_3_);
}
+ if (maxPages != 0) {
@@ -166,7 +166,7 @@
+ RenderSystem.disableLighting();
+ this.func_230926_e_(300);
+ this.field_230707_j_.field_77023_b = 300.0F;
+ field_230712_o_.func_238407_a_(p_230430_1_, page, field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1);
+ field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1);
+ this.func_230926_e_(0);
+ this.field_230707_j_.field_77023_b = 0.0F;
+ }
@@ -175,13 +175,13 @@
this.func_230459_a_(p_230430_1_, p_230430_2_, p_230430_3_);
}
@@ -612,7 +670,10 @@
list1.add(1, (new TranslationTextComponent(itemgroup.func_78024_c())).func_240699_a_(TextFormatting.BLUE));
list1.add(1, itemgroup.func_242392_c().func_230532_e_().func_240699_a_(TextFormatting.BLUE));
}
- this.func_238654_b_(p_230457_1_, list1, p_230457_3_, p_230457_4_);
- this.func_243308_b(p_230457_1_, list1, p_230457_3_, p_230457_4_);
+ net.minecraft.client.gui.FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
+ this.func_238654_b_(p_230457_1_, list1, p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ this.renderWrappedToolTip(p_230457_1_, list1, p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
} else {
super.func_230457_a_(p_230457_1_, p_230457_2_, p_230457_3_, p_230457_4_);
@@ -6,17 +6,13 @@
this.func_230441_a_(p_230431_1_, minecraft, p_230431_2_, p_230431_3_);
- int j = this.field_230693_o_ ? 16777215 : 10526880;
+ int j = getFGColor();
this.func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24);
func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24);
}
@@ -206,6 +206,14 @@
@@ -206,6 +206,10 @@
this.field_230688_j_ = p_230991_1_;
}
+ public int getHeight() {
+ return this.field_230689_k_;
+ }
+
+ public void setHeight(int value) {
+ this.field_230689_k_ = value;
+ }
@@ -24,7 +20,7 @@
public void func_230986_a_(float p_230986_1_) {
this.field_230695_q_ = p_230986_1_;
}
@@ -233,4 +241,17 @@
@@ -233,4 +237,17 @@
protected void func_230996_d_(boolean p_230996_1_) {
this.field_230686_c_ = p_230996_1_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/widget/list/AbstractList.java
+++ b/net/minecraft/client/gui/widget/list/AbstractList.java
@@ -471,6 +471,13 @@
@@ -492,6 +492,13 @@
p_238480_1_.field_230666_a_ = this;
}
@@ -29,7 +29,7 @@
@@ -114,7 +115,7 @@
public void func_230432_a_(MatrixStack p_230432_1_, int p_230432_2_, int p_230432_3_, int p_230432_4_, int p_230432_5_, int p_230432_6_, int p_230432_7_, int p_230432_8_, boolean p_230432_9_, float p_230432_10_) {
boolean flag = KeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b;
KeyBindingList.this.field_230668_b_.field_71466_p.func_238422_b_(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215);
KeyBindingList.this.field_230668_b_.field_71466_p.func_243248_b(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215);
- this.field_148281_e.field_230690_l_ = p_230432_4_ + 190;
+ this.field_148281_e.field_230690_l_ = p_230432_4_ + 190 + 20;
this.field_148281_e.field_230691_m_ = p_230432_3_;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/PlayerController.java
+++ b/net/minecraft/client/multiplayer/PlayerController.java
@@ -94,6 +94,7 @@
@@ -93,6 +93,7 @@
}
public boolean func_187103_a(BlockPos p_187103_1_) {
@@ -8,7 +8,7 @@
if (this.field_78776_a.field_71439_g.func_223729_a(this.field_78776_a.field_71441_e, p_187103_1_, this.field_78779_k)) {
return false;
} else {
@@ -105,12 +106,11 @@
@@ -104,12 +105,11 @@
Block block = blockstate.func_177230_c();
if ((block instanceof CommandBlockBlock || block instanceof StructureBlock || block instanceof JigsawBlock) && !this.field_78776_a.field_71439_g.func_195070_dx()) {
return false;
@@ -23,7 +23,7 @@
if (flag) {
block.func_176206_d(world, p_187103_1_, blockstate);
}
@@ -131,21 +131,25 @@
@@ -130,21 +130,25 @@
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, blockstate, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_);
@@ -50,7 +50,7 @@
if (flag && blockstate1.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) {
this.func_187103_a(p_180511_1_);
} else {
@@ -185,22 +189,24 @@
@@ -184,22 +188,24 @@
BlockState blockstate1 = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate1, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -77,7 +77,7 @@
if (this.field_78770_f >= 1.0F) {
this.field_78778_j = false;
this.func_225324_a(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -219,7 +225,8 @@
@@ -218,7 +224,8 @@
}
public float func_78757_d() {
@@ -87,7 +87,7 @@
}
public void func_78765_e() {
@@ -236,7 +243,7 @@
@@ -235,7 +242,7 @@
ItemStack itemstack = this.field_78776_a.field_71439_g.func_184614_ca();
boolean flag = this.field_85183_f.func_190926_b() && itemstack.func_190926_b();
if (!this.field_85183_f.func_190926_b() && !itemstack.func_190926_b()) {
@@ -96,7 +96,7 @@
}
return p_178893_1_.equals(this.field_178895_c) && flag;
@@ -258,13 +265,27 @@
@@ -257,13 +264,27 @@
return ActionResultType.FAIL;
} else {
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
@@ -126,7 +126,7 @@
ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
if (actionresulttype.func_226246_a_()) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -273,8 +294,8 @@
@@ -272,8 +293,8 @@
}
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -136,7 +136,7 @@
ActionResultType actionresulttype1;
if (this.field_78779_k.func_77145_d()) {
int i = itemstack.func_190916_E();
@@ -302,11 +323,14 @@
@@ -301,11 +322,14 @@
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
return ActionResultType.PASS;
} else {
@@ -151,7 +151,7 @@
}
return actionresult.func_188397_a();
@@ -335,6 +359,9 @@
@@ -334,6 +358,9 @@
public ActionResultType func_187097_a(PlayerEntity p_187097_1_, Entity p_187097_2_, Hand p_187097_3_) {
this.func_78750_j();
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187097_2_, p_187097_3_, p_187097_1_.func_225608_bj_()));
@@ -161,7 +161,7 @@
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
}
@@ -342,6 +369,9 @@
@@ -341,6 +368,9 @@
this.func_78750_j();
Vector3d vector3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.func_226277_ct_(), p_187102_2_.func_226278_cu_(), p_187102_2_.func_226281_cx_());
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vector3d, p_187102_1_.func_225608_bj_()));
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/login/ClientLoginNetHandler.java
+++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java
@@ -98,6 +98,7 @@
@@ -115,6 +115,7 @@
this.field_209525_d.accept(new TranslationTextComponent("connect.joining"));
this.field_175091_e = p_147390_1_.func_179730_a();
this.field_147393_d.func_150723_a(ProtocolType.PLAY);
@@ -8,7 +8,7 @@
this.field_147393_d.func_150719_a(new ClientPlayNetHandler(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e));
}
@@ -126,6 +127,7 @@
@@ -143,6 +144,7 @@
}
public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/play/ClientPlayNetHandler.java
+++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java
@@ -388,6 +388,7 @@
@@ -384,6 +384,7 @@
this.field_147299_f.field_184132_p.func_217737_a();
this.field_147299_f.field_71439_g.func_70065_x();
@@ -8,7 +8,7 @@
int i = p_147282_1_.func_149197_c();
this.field_147300_g.func_217408_a(i, this.field_147299_f.field_71439_g);
this.field_147299_f.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y);
@@ -399,6 +400,7 @@
@@ -395,6 +396,7 @@
this.field_147299_f.field_71439_g.func_228355_a_(p_147282_1_.func_229743_k_());
this.field_147299_f.field_71442_b.func_78746_a(p_147282_1_.func_149198_e());
this.field_147299_f.field_71442_b.func_241675_a_(p_147282_1_.func_241786_f_());
@@ -16,7 +16,7 @@
this.field_147299_f.field_71474_y.func_82879_c();
this.field_147302_e.func_179290_a(new CCustomPayloadPacket(CCustomPayloadPacket.field_210344_a, (new PacketBuffer(Unpooled.buffer())).func_180714_a(ClientBrandRetriever.getClientModName())));
this.field_147299_f.func_213229_ar().func_216814_a();
@@ -745,7 +747,7 @@
@@ -734,7 +736,7 @@
BlockPos blockpos = new BlockPos(compoundnbt.func_74762_e("x"), compoundnbt.func_74762_e("y"), compoundnbt.func_74762_e("z"));
TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos);
if (tileentity != null) {
@@ -25,18 +25,18 @@
}
}
@@ -844,7 +846,9 @@
@@ -815,7 +817,9 @@
public void func_147251_a(SChatPacket p_147251_1_) {
PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f);
- this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c(), p_147251_1_.func_240810_e_());
+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c());
+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c(), p_147251_1_.func_240810_e_());
+ if (message == null) return;
+ this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), message, p_147251_1_.func_240810_e_());
}
public void func_147279_a(SAnimateHandPacket p_147279_1_) {
@@ -1034,8 +1038,10 @@
@@ -1004,8 +1008,10 @@
clientplayerentity1.func_233645_dx_().func_233784_a_(clientplayerentity.func_233645_dx_());
}
@@ -47,7 +47,7 @@
this.field_147300_g.func_217408_a(i, clientplayerentity1);
clientplayerentity1.field_70177_z = -180.0F;
clientplayerentity1.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y);
@@ -1161,6 +1167,12 @@
@@ -1131,6 +1137,12 @@
if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) {
((CommandBlockScreen)this.field_147299_f.field_71462_r).func_184075_a();
@@ -60,15 +60,15 @@
}
}
@@ -1329,6 +1341,7 @@
clientrecipebook.func_199644_c();
@@ -1299,6 +1311,7 @@
clientrecipebook.func_243196_a(this.field_199528_o.func_199510_b());
clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a);
imutablesearchtree.func_194040_a();
+ net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.field_199528_o);
}
public void func_200232_a(SPlayerLookPacket p_200232_1_) {
@@ -1409,7 +1422,7 @@
@@ -1376,7 +1389,7 @@
PacketThreadUtil.func_218797_a(p_147260_1_, this, this.field_147299_f);
Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d());
if (entity instanceof LivingEntity) {
@@ -77,15 +77,23 @@
if (effect != null) {
EffectInstance effectinstance = new EffectInstance(effect, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h());
effectinstance.func_100012_b(p_147260_1_.func_149429_c());
@@ -1426,6 +1439,7 @@
}
this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.field_199725_m));
}
public void func_175098_a(SCombatPacket p_175098_1_) {
@@ -1909,10 +1923,12 @@
@@ -1388,11 +1401,14 @@
public void func_199723_a(STagsListPacket p_199723_1_) {
PacketThreadUtil.func_218797_a(p_199723_1_, this, this.field_147299_f);
ITagCollectionSupplier itagcollectionsupplier = p_199723_1_.func_199858_a();
- Multimap<ResourceLocation, ResourceLocation> multimap = TagRegistryManager.func_242198_b(itagcollectionsupplier);
+ boolean vanillaConnection = net.minecraftforge.fml.network.NetworkHooks.isVanillaConnection(field_147302_e);
+ Multimap<ResourceLocation, ResourceLocation> multimap = vanillaConnection ? TagRegistryManager.func_242198_b(net.minecraftforge.common.ForgeTagHandler.withNoCustom(itagcollectionsupplier)) : TagRegistryManager.validateVanillaTags(itagcollectionsupplier);//Forge: If we are connecting to vanilla validate all tags to properly validate custom tags the client may "require", and if we are connecting to forge only validate the vanilla tag types as the custom tag types get synced in a separate packet so may still arrive
if (!multimap.isEmpty()) {
field_147301_d.warn("Incomplete server tags, disconnecting. Missing: {}", (Object)multimap);
this.field_147302_e.func_150718_a(new TranslationTextComponent("multiplayer.disconnect.missing_tags"));
} else {
+ net.minecraftforge.common.ForgeTagHandler.resetCachedTagCollections(true, vanillaConnection);
+ itagcollectionsupplier = ITagCollectionSupplier.reinjectOptionalTags(itagcollectionsupplier);
this.field_199725_m = itagcollectionsupplier;
if (!this.field_147302_e.func_150731_c()) {
itagcollectionsupplier.func_242212_e();
@@ -1885,10 +1901,12 @@
int l5 = packetbuffer.readInt();
this.field_147299_f.field_184132_p.field_229018_q_.func_229022_a_(blockpos8, l3, s10, l5);
} else {
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/network/play/NetworkPlayerInfo.java
+++ b/net/minecraft/client/network/play/NetworkPlayerInfo.java
@@ -50,6 +50,7 @@
}
protected void func_178839_a(GameType p_178839_1_) {
+ net.minecraftforge.client.ForgeHooksClient.onClientChangeGameMode(this, this.field_178866_b, p_178839_1_);
this.field_178866_b = p_178839_1_;
}
@@ -0,0 +1,15 @@
--- a/net/minecraft/client/particle/Particle.java
+++ b/net/minecraft/client/particle/Particle.java
@@ -208,4 +208,12 @@
public void func_187108_a(AxisAlignedBB p_187108_1_) {
this.field_187120_G = p_187108_1_;
}
+
+ /**
+ * Forge added method that controls if a particle should be culled to it's bounding box.
+ * Default behaviour is culling enabled
+ */
+ public boolean shouldCull() {
+ return true;
+ }
}
@@ -34,15 +34,26 @@
return iparticlefactory == null ? null : iparticlefactory.func_199234_a(p_199927_1_, this.field_78878_a, p_199927_2_, p_199927_4_, p_199927_6_, p_199927_8_, p_199927_10_, p_199927_12_);
}
@@ -315,14 +315,18 @@
@@ -313,16 +313,29 @@
}
}
+ /**@deprecated Forge: use {@link #renderParticles(MatrixStack, IRenderTypeBuffer.Impl, LightTexture, ActiveRenderInfo, float, net.minecraft.client.renderer.culling.ClippingHelper)} with ClippingHelper as additional parameter*/
+ @Deprecated
public void func_228345_a_(MatrixStack p_228345_1_, IRenderTypeBuffer.Impl p_228345_2_, LightTexture p_228345_3_, ActiveRenderInfo p_228345_4_, float p_228345_5_) {
+ renderParticles(p_228345_1_, p_228345_2_, p_228345_3_, p_228345_4_, p_228345_5_, null);
+ }
+
+ public void renderParticles(MatrixStack p_228345_1_, IRenderTypeBuffer.Impl p_228345_2_, LightTexture p_228345_3_, ActiveRenderInfo p_228345_4_, float p_228345_5_, @Nullable net.minecraft.client.renderer.culling.ClippingHelper clippingHelper) {
p_228345_3_.func_205109_c();
+ Runnable enable = () -> {
RenderSystem.enableAlphaTest();
RenderSystem.defaultAlphaFunc();
RenderSystem.enableDepthTest();
RenderSystem.enableFog();
+ RenderSystem.activeTexture(org.lwjgl.opengl.GL13.GL_TEXTURE2);
+ RenderSystem.enableTexture();
+ RenderSystem.activeTexture(org.lwjgl.opengl.GL13.GL_TEXTURE0);
+ };
RenderSystem.pushMatrix();
RenderSystem.multMatrix(p_228345_1_.func_227866_c_().func_227870_a_());
@@ -54,7 +65,15 @@
Iterable<Particle> iterable = this.field_78876_b.get(iparticlerendertype);
if (iterable != null) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -362,7 +366,7 @@
@@ -331,6 +344,7 @@
iparticlerendertype.func_217600_a(bufferbuilder, this.field_78877_c);
for(Particle particle : iterable) {
+ if (clippingHelper != null && particle.shouldCull() && !clippingHelper.func_228957_a_(particle.func_187116_l())) continue;
try {
particle.func_225606_a_(bufferbuilder, p_228345_4_, p_228345_5_);
} catch (Throwable throwable) {
@@ -362,7 +376,7 @@
}
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
@@ -63,7 +82,7 @@
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_228348_3_, p_228348_5_, p_228348_7_, p_228348_9_, p_228348_11_, p_228348_13_) -> {
@@ -434,6 +438,12 @@
@@ -434,6 +448,12 @@
return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum());
}
@@ -81,7 +81,7 @@
- int i = WorldRenderer.func_228420_a_(p_228806_1_, p_228806_3_, p_228806_4_.func_177972_a(direction));
- this.func_228798_a_(p_228806_1_, p_228806_3_, p_228806_4_, i, p_228806_11_, false, p_228806_5_, p_228806_6_, list, bitset);
+ randomIn.setSeed(rand);
+ List<BakedQuad> list = modelIn.func_200117_a(stateIn, direction, randomIn);
+ List<BakedQuad> list = modelIn.getQuads(stateIn, direction, randomIn, modelData);
+ if (!list.isEmpty() && (!checkSides || Block.func_176225_a(stateIn, worldIn, posIn, direction))) {
+ int i = WorldRenderer.func_228420_a_(worldIn, stateIn, posIn.func_177972_a(direction));
+ this.func_228798_a_(worldIn, stateIn, posIn, i, combinedOverlayIn, false, matrixStackIn, buffer, list, bitset);
@@ -1,14 +1,6 @@
--- a/net/minecraft/client/renderer/BufferBuilder.java
+++ b/net/minecraft/client/renderer/BufferBuilder.java
@@ -121,7 +121,6 @@
bitset.set(l);
}
-
}
private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
@@ -297,6 +296,7 @@
@@ -297,6 +297,7 @@
}
ByteBuffer bytebuffer = this.field_179001_a.slice();
@@ -16,7 +8,7 @@
((Buffer)this.field_179001_a).clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
@@ -364,4 +364,15 @@
@@ -364,4 +365,15 @@
this.field_179018_e = p_i225907_2_;
}
}
@@ -81,10 +81,3 @@
}
if (this.field_187469_f < 0.1F) {
@@ -430,6 +440,5 @@
} else {
this.field_187471_h = 0.0F;
}
-
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
@@ -158,17 +158,28 @@
@@ -156,17 +156,28 @@
}
float f9 = Math.min(1.0F / field_205093_c, Math.min(1.0F / field_205094_d, 1.0F / field_205095_e));
@@ -29,33 +29,30 @@
RenderSystem.clearColor(field_205093_c, field_205094_d, field_205095_e, 0.0F);
}
@@ -177,10 +188,18 @@
@@ -174,10 +185,17 @@
RenderSystem.fogDensity(0.0F);
RenderSystem.fogMode(GlStateManager.FogMode.EXP2);
}
- public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ @Deprecated // FORGE: Pass in partialTicks
+ public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0);
+ }
-
+ @Deprecated // FORGE: Pass in partialTicks
public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0);
+ }
+
+ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) {
+ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) {
FluidState fluidstate = p_228372_0_.func_216771_k();
Entity entity = p_228372_0_.func_216773_g();
boolean flag = fluidstate.func_206886_c() != Fluids.field_204541_a;
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(p_228372_1_, p_228372_0_, partialTicks, 0.1F);
+ if (hook >= 0) RenderSystem.fogDensity(hook);
+ else
if (fluidstate.func_206884_a(FluidTags.field_206959_a)) {
float f = 1.0F;
f = 0.05F;
@@ -231,8 +250,8 @@
@@ -228,6 +246,7 @@
RenderSystem.fogEnd(f3);
RenderSystem.fogMode(GlStateManager.FogMode.LINEAR);
RenderSystem.setupNvFogDistance();
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(p_228372_1_, p_228372_0_, partialTicks, f3);
}
-
}
public static void func_228373_b_() {
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/GameRenderer.java
+++ b/net/minecraft/client/renderer/GameRenderer.java
@@ -132,6 +132,8 @@
@@ -135,6 +135,8 @@
this.func_175069_a(new ResourceLocation("shaders/post/spider.json"));
} else if (p_175066_1_ instanceof EndermanEntity) {
this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
@@ -9,7 +9,7 @@
}
}
@@ -307,7 +309,7 @@
@@ -310,7 +312,7 @@
d0 = d0 * 60.0D / 70.0D;
}
@@ -18,7 +18,7 @@
}
}
@@ -476,7 +478,7 @@
@@ -486,7 +488,7 @@
}
} else if (this.field_78531_r.field_71462_r != null) {
try {
@@ -27,10 +27,10 @@
} catch (Throwable throwable) {
CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details");
@@ -589,9 +591,16 @@
@@ -595,9 +597,16 @@
Matrix4f matrix4f = matrixstack.func_227866_c_().func_227870_a_();
this.func_228379_a_(matrix4f);
activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), this.field_78531_r.field_71474_y.field_74320_O > 0, this.field_78531_r.field_71474_y.field_74320_O == 2, p_228378_1_);
activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), !this.field_78531_r.field_71474_y.func_243230_g().func_243192_a(), this.field_78531_r.field_71474_y.func_243230_g().func_243193_b(), p_228378_1_);
+
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(this, activerenderinfo, p_228378_1_);
+ activerenderinfo.setAnglesInternal(cameraSetup.getYaw(), cameraSetup.getPitch());
@@ -44,7 +44,7 @@
this.field_78531_r.func_213239_aq().func_219895_b("hand");
if (this.field_175074_C) {
RenderSystem.clear(256, Minecraft.field_142025_a);
@@ -671,4 +680,9 @@
@@ -709,4 +718,9 @@
public OverlayTexture func_228385_m_() {
return this.field_228375_t_;
}
@@ -18,16 +18,28 @@
p_229111_4_.func_227861_a_(-0.5D, -0.5D, -0.5D);
if (!p_229111_8_.func_188618_c() && (p_229111_1_.func_77973_b() != Items.field_203184_eO || flag)) {
boolean flag1;
@@ -132,7 +132,7 @@
@@ -105,7 +105,8 @@
} else {
flag1 = true;
}
-
+ if (p_229111_8_.isLayered()) { net.minecraftforge.client.ForgeHooksClient.drawItemLayered(this, p_229111_8_, p_229111_1_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_, flag1); }
+ else {
RenderType rendertype = RenderTypeLookup.func_239219_a_(p_229111_1_, flag1);
IVertexBuilder ivertexbuilder;
if (p_229111_1_.func_77973_b() == Items.field_151111_aL && p_229111_1_.func_77962_s()) {
@@ -131,8 +132,9 @@
}
this.func_229114_a_(p_229111_8_, p_229111_1_, p_229111_6_, p_229111_7_, p_229111_4_, ivertexbuilder);
+ }
} else {
- ItemStackTileEntityRenderer.field_147719_a.func_239207_a_(p_229111_1_, p_229111_2_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_);
+ p_229111_1_.func_77973_b().getItemStackTileEntityRenderer().func_239207_a_(p_229111_1_, p_229111_2_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_);
}
p_229111_4_.func_227865_b_();
@@ -172,7 +172,7 @@
@@ -176,7 +178,7 @@
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@@ -36,7 +48,7 @@
}
}
@@ -263,6 +263,7 @@
@@ -267,6 +269,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_239387_2_.func_77973_b());
});
@@ -44,7 +56,7 @@
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_239387_2_.func_77952_i());
});
@@ -294,18 +295,16 @@
@@ -298,18 +301,16 @@
irendertypebuffer$impl.func_228461_a_();
}
@@ -67,7 +79,7 @@
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
RenderSystem.enableBlend();
@@ -343,4 +342,9 @@
@@ -347,4 +348,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/renderer/RenderState.java
+++ b/net/minecraft/client/renderer/RenderState.java
@@ -255,7 +255,7 @@
private final float field_228574_Q_;
public AlphaState(float p_i225974_1_) {
- super("alpha", () -> {
+ super("alpha", () -> { // FORGE: fix MC-167447
if (p_i225974_1_ > 0.0F) {
RenderSystem.enableAlphaTest();
RenderSystem.alphaFunc(516, p_i225974_1_);
@@ -32,7 +32,17 @@
public static RenderType func_239221_b_(BlockState p_239221_0_) {
Block block = p_239221_0_.func_177230_c();
if (block instanceof LeavesBlock) {
@@ -317,11 +321,60 @@
@@ -295,8 +299,7 @@
}
public static RenderType func_239220_a_(BlockState p_239220_0_, boolean p_239220_1_) {
- RenderType rendertype = func_228390_a_(p_239220_0_);
- if (rendertype == RenderType.func_228645_f_()) {
+ if (canRenderInLayer(p_239220_0_, RenderType.func_228645_f_())) {
if (!Minecraft.func_238218_y_()) {
return Atlases.func_228785_j_();
} else {
@@ -317,11 +320,60 @@
}
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/renderer/ViewFrustum.java
+++ b/net/minecraft/client/renderer/ViewFrustum.java
@@ -8,6 +8,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.ChunkRender;
+
@OnlyIn(Dist.CLIENT)
public class ViewFrustum {
protected final WorldRenderer field_178169_a;
@@ -1,6 +1,18 @@
--- a/net/minecraft/client/renderer/WorldRenderer.java
+++ b/net/minecraft/client/renderer/WorldRenderer.java
@@ -812,7 +812,7 @@
@@ -222,6 +222,11 @@
}
private void func_228438_a_(LightTexture p_228438_1_, float p_228438_2_, double p_228438_3_, double p_228438_5_, double p_228438_7_) {
+ net.minecraftforge.client.IWeatherRenderHandler renderHandler = field_72769_h.func_239132_a_().getWeatherRenderHandler();
+ if (renderHandler != null) {
+ renderHandler.render(field_72773_u, p_228438_2_, field_72769_h, field_72777_q, p_228438_1_, p_228438_3_, p_228438_5_, p_228438_7_);
+ return;
+ }
float f = this.field_72777_q.field_71441_e.func_72867_j(p_228438_2_);
if (!(f <= 0.0F)) {
p_228438_1_.func_205109_c();
@@ -830,7 +835,7 @@
this.field_147595_R = true;
BlockPos blockpos2 = chunkrenderdispatcher$chunkrender4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag1 = blockpos2.func_177951_i(blockpos) < 768.0D;
@@ -9,7 +21,7 @@
this.field_175009_l.add(chunkrenderdispatcher$chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -897,13 +897,13 @@
@@ -915,13 +920,13 @@
float f = p_228426_7_.func_205001_m();
boolean flag1 = this.field_72777_q.field_71441_e.func_239132_a_().func_230493_a_(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d1)) || this.field_72777_q.field_71456_v.func_184046_j().func_184056_f();
if (this.field_72777_q.field_71474_y.field_151451_c >= 4) {
@@ -25,7 +37,7 @@
iprofiler.func_219895_b("terrain_setup");
this.func_228437_a_(p_228426_6_, clippinghelper, flag, this.field_228409_ai_++, this.field_72777_q.field_71439_g.func_175149_v());
iprofiler.func_219895_b("updatechunks");
@@ -924,7 +924,9 @@
@@ -942,7 +947,9 @@
this.func_174967_a(p_228426_3_ + l1);
iprofiler.func_219895_b("terrain");
this.func_228441_a_(RenderType.func_228639_c_(), p_228426_1_, d0, d1, d2);
@@ -35,7 +47,7 @@
this.func_228441_a_(RenderType.func_228643_e_(), p_228426_1_, d0, d1, d2);
if (this.field_72769_h.func_239132_a_().func_239217_c_()) {
RenderHelper.func_237533_a_(p_228426_1_.func_227866_c_().func_227870_a_());
@@ -994,6 +996,7 @@
@@ -1010,6 +1017,7 @@
List<TileEntity> list = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b();
if (!list.isEmpty()) {
for(TileEntity tileentity1 : list) {
@@ -43,7 +55,7 @@
BlockPos blockpos3 = tileentity1.func_174877_v();
IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl;
p_228426_1_.func_227860_a_();
@@ -1019,6 +1022,7 @@
@@ -1035,6 +1043,7 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity : this.field_181024_n) {
@@ -51,17 +63,73 @@
BlockPos blockpos2 = tileentity.func_174877_v();
p_228426_1_.func_227860_a_();
p_228426_1_.func_227861_a_((double)blockpos2.func_177958_n() - d0, (double)blockpos2.func_177956_o() - d1, (double)blockpos2.func_177952_p() - d2);
@@ -1069,7 +1073,8 @@
@@ -1084,10 +1093,13 @@
iprofiler.func_219895_b("outline");
BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
- if (!blockstate.func_196958_f() && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_228426_6_, field_72777_q.field_71476_x, p_228426_2_, p_228426_1_, irendertypebuffer$impl))
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_228426_6_, raytraceresult, p_228426_2_, p_228426_1_, irendertypebuffer$impl))
+ if (!blockstate.isAir(this.field_72769_h, blockpos) && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.func_228659_m_());
this.func_228429_a_(p_228426_1_, ivertexbuilder2, p_228426_6_.func_216773_g(), d0, d1, d2, blockpos, blockstate);
}
@@ -2056,7 +2061,12 @@
+ } else if (raytraceresult != null && raytraceresult.func_216346_c() == RayTraceResult.Type.ENTITY) {
+ net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_228426_6_, raytraceresult, p_228426_2_, p_228426_1_, irendertypebuffer$impl);
}
RenderSystem.pushMatrix();
@@ -1119,7 +1131,7 @@
this.field_239224_H_.func_237506_a_(this.field_72777_q.func_147110_a());
RenderState.field_239237_T_.func_228547_a_();
iprofiler.func_219895_b("particles");
- this.field_72777_q.field_71452_i.func_228345_a_(p_228426_1_, irendertypebuffer$impl, p_228426_8_, p_228426_6_, p_228426_2_);
+ this.field_72777_q.field_71452_i.renderParticles(p_228426_1_, irendertypebuffer$impl, p_228426_8_, p_228426_6_, p_228426_2_, clippinghelper);
RenderState.field_239237_T_.func_228549_b_();
} else {
iprofiler.func_219895_b("translucent");
@@ -1129,7 +1141,7 @@
iprofiler.func_219895_b("string");
this.func_228441_a_(RenderType.func_241715_r_(), p_228426_1_, d0, d1, d2);
iprofiler.func_219895_b("particles");
- this.field_72777_q.field_71452_i.func_228345_a_(p_228426_1_, irendertypebuffer$impl, p_228426_8_, p_228426_6_, p_228426_2_);
+ this.field_72777_q.field_71452_i.renderParticles(p_228426_1_, irendertypebuffer$impl, p_228426_8_, p_228426_6_, p_228426_2_, clippinghelper);
}
RenderSystem.pushMatrix();
@@ -1481,6 +1493,11 @@
}
public void func_228424_a_(MatrixStack p_228424_1_, float p_228424_2_) {
+ net.minecraftforge.client.ISkyRenderHandler renderHandler = field_72769_h.func_239132_a_().getSkyRenderHandler();
+ if (renderHandler != null) {
+ renderHandler.render(field_72773_u, p_228424_2_, p_228424_1_, field_72769_h, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.func_239132_a_().func_241683_c_() == DimensionRenderInfo.FogType.END) {
this.func_228444_b_(p_228424_1_);
} else if (this.field_72777_q.field_71441_e.func_239132_a_().func_241683_c_() == DimensionRenderInfo.FogType.NORMAL) {
@@ -1609,6 +1626,11 @@
}
public void func_228425_a_(MatrixStack p_228425_1_, float p_228425_2_, double p_228425_3_, double p_228425_5_, double p_228425_7_) {
+ net.minecraftforge.client.ICloudRenderHandler renderHandler = field_72769_h.func_239132_a_().getCloudRenderHandler();
+ if (renderHandler != null) {
+ renderHandler.render(field_72773_u, p_228425_2_, p_228425_1_, field_72769_h, field_72777_q, p_228425_3_, p_228425_5_, p_228425_7_);
+ return;
+ }
float f = this.field_72769_h.func_239132_a_().func_239213_a_();
if (!Float.isNaN(f)) {
RenderSystem.disableCull();
@@ -1792,7 +1814,7 @@
while(iterator.hasNext()) {
ChunkRenderDispatcher.ChunkRender chunkrenderdispatcher$chunkrender = iterator.next();
- if (chunkrenderdispatcher$chunkrender.func_188281_o()) {
+ if (!net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() && chunkrenderdispatcher$chunkrender.func_188281_o()) {
this.field_174995_M.func_228902_a_(chunkrenderdispatcher$chunkrender);
} else {
chunkrenderdispatcher$chunkrender.func_228929_a_(this.field_174995_M);
@@ -2076,7 +2098,12 @@
this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_);
}
@@ -74,7 +142,7 @@
ISound isound = this.field_147593_P.get(p_184377_2_);
if (isound != null) {
this.field_72777_q.func_147118_V().func_147683_b(isound);
@@ -2064,7 +2074,7 @@
@@ -2084,7 +2111,7 @@
}
if (p_184377_1_ != null) {
@@ -83,7 +151,7 @@
if (musicdiscitem != null) {
this.field_72777_q.field_71456_v.func_238451_a_(musicdiscitem.func_234801_g_());
}
@@ -2212,7 +2222,7 @@
@@ -2232,7 +2259,7 @@
break;
case 1010:
if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) {
@@ -92,7 +160,7 @@
} else {
this.func_184377_a((SoundEvent)null, p_180439_3_);
}
@@ -2362,8 +2372,8 @@
@@ -2382,8 +2409,8 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
@@ -103,7 +171,7 @@
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}
@@ -2511,7 +2521,7 @@
@@ -2531,7 +2558,7 @@
} else {
int i = p_228420_0_.func_226658_a_(LightType.SKY, p_228420_2_);
int j = p_228420_0_.func_226658_a_(LightType.BLOCK, p_228420_2_);
@@ -112,7 +180,7 @@
if (j < k) {
j = k;
}
@@ -2550,6 +2560,11 @@
@@ -2570,6 +2597,11 @@
return this.field_239226_J_;
}
@@ -6,10 +6,19 @@
public void func_225623_a_(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
- if (this.func_177070_b(p_225623_1_)) {
- this.func_225629_a_(p_225623_1_, p_225623_1_.func_145748_c_(), p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_(), this, p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_(), this, p_225623_4_, p_225623_5_, p_225623_6_, p_225623_3_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(renderNameplateEvent);
+ if (renderNameplateEvent.getResult() != net.minecraftforge.eventbus.api.Event.Result.DENY && (renderNameplateEvent.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || this.func_177070_b(p_225623_1_))) {
+ this.func_225629_a_(p_225623_1_, renderNameplateEvent.getContent(), p_225623_4_, p_225623_5_, p_225623_6_);
}
}
@@ -77,7 +79,7 @@
protected void func_225629_a_(T p_225629_1_, ITextComponent p_225629_2_, MatrixStack p_225629_3_, IRenderTypeBuffer p_225629_4_, int p_225629_5_) {
double d0 = this.field_76990_c.func_229099_b_(p_225629_1_);
- if (!(d0 > 4096.0D)) {
+ if (net.minecraftforge.client.ForgeHooksClient.isNameplateInRenderDistance(p_225629_1_, d0)) {
boolean flag = !p_225629_1_.func_226273_bm_();
float f = p_225629_1_.func_213302_cg() + 0.5F;
int i = "deadmau5".equals(p_225629_2_.getString()) ? -10 : 0;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/EntityRendererManager.java
+++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java
@@ -187,13 +187,15 @@
@@ -188,7 +188,10 @@
this.field_178637_m = new PlayerRenderer(this);
this.field_178636_l.put("default", this.field_178637_m);
this.field_178636_l.put("slim", new PlayerRenderer(this, true));
@@ -11,13 +11,7 @@
for(EntityType<?> entitytype : Registry.field_212629_r) {
if (entitytype != EntityType.field_200729_aH && !this.field_78729_o.containsKey(entitytype)) {
throw new IllegalStateException("No renderer registered for " + Registry.field_212629_r.func_177774_c(entitytype));
}
}
-
}
public <T extends Entity> EntityRenderer<? super T> func_78713_a(T p_78713_1_) {
@@ -449,4 +451,8 @@
@@ -450,4 +453,8 @@
public FontRenderer func_78716_a() {
return this.field_78736_p;
}
@@ -0,0 +1,54 @@
--- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
+++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
@@ -30,7 +30,7 @@
public void func_225628_a_(MatrixStack p_225628_1_, IRenderTypeBuffer p_225628_2_, int p_225628_3_, T p_225628_4_, float p_225628_5_, float p_225628_6_, float p_225628_7_, float p_225628_8_, float p_225628_9_, float p_225628_10_) {
ItemStack itemstack = p_225628_4_.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR) {
+ if (shouldRender(itemstack, p_225628_4_)) {
ResourceLocation resourcelocation;
if (p_225628_4_ instanceof AbstractClientPlayerEntity) {
AbstractClientPlayerEntity abstractclientplayerentity = (AbstractClientPlayerEntity)p_225628_4_;
@@ -39,10 +39,10 @@
} else if (abstractclientplayerentity.func_152122_n() && abstractclientplayerentity.func_110303_q() != null && abstractclientplayerentity.func_175148_a(PlayerModelPart.CAPE)) {
resourcelocation = abstractclientplayerentity.func_110303_q();
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
p_225628_1_.func_227860_a_();
@@ -54,4 +54,29 @@
p_225628_1_.func_227865_b_();
}
}
+
+ /**
+ * Determines if the ElytraLayer should render.
+ * ItemStack and Entity are provided for modder convenience,
+ * For example, using the same ElytraLayer for multiple custom Elytra.
+ *
+ * @param stack The Elytra ItemStack
+ * @param entity The entity being rendered.
+ * @return If the ElytraLayer should render.
+ */
+ public boolean shouldRender(ItemStack stack, T entity) {
+ return stack.func_77973_b() == Items.field_185160_cR;
+ }
+
+ /**
+ * Gets the texture to use with this ElytraLayer.
+ * This assumes the vanilla Elytra model.
+ *
+ * @param stack The Elytra ItemStack.
+ * @param entity The entity being rendered.
+ * @return The texture.
+ */
+ public ResourceLocation getElytraTexture(ItemStack stack, T entity) {
+ return field_188355_a;
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/model/ModelBakery.java
+++ b/net/minecraft/client/renderer/model/ModelBakery.java
@@ -146,8 +146,16 @@
@@ -146,8 +146,17 @@
});
public ModelBakery(IResourceManager p_i226056_1_, BlockColors p_i226056_2_, IProfiler p_i226056_3_, int p_i226056_4_) {
@@ -14,10 +14,11 @@
+ }
+
+ protected void processLoading(IProfiler p_i226056_3_, int p_i226056_4_) {
+ net.minecraftforge.client.model.ModelLoaderRegistry.onModelLoadingStart();
p_i226056_3_.func_76320_a("missing_model");
try {
@@ -180,12 +188,16 @@
@@ -180,12 +189,16 @@
p_i226056_3_.func_219895_b("special");
this.func_217843_a(new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
@@ -34,7 +35,7 @@
set.stream().filter((p_229346_0_) -> {
return !p_229346_0_.getSecond().equals(field_229321_r_);
}).forEach((p_229330_0_) -> {
@@ -224,6 +236,7 @@
@@ -224,6 +237,7 @@
try {
ibakedmodel = this.func_217845_a(p_229350_1_, ModelRotation.X0_Y0);
} catch (Exception exception) {
@@ -42,7 +43,7 @@
field_177603_c.warn("Unable to bake model: '{}': {}", p_229350_1_, exception);
}
@@ -442,6 +455,13 @@
@@ -442,6 +456,13 @@
this.field_217848_D.addAll(p_209593_2_.func_187965_e());
}
@@ -56,7 +57,7 @@
private void func_217843_a(ModelResourceLocation p_217843_1_) {
IUnbakedModel iunbakedmodel = this.func_209597_a(p_217843_1_);
this.field_217849_F.put(p_217843_1_, iunbakedmodel);
@@ -456,7 +476,13 @@
@@ -456,7 +477,13 @@
}
@Nullable
@@ -70,7 +71,7 @@
Triple<ResourceLocation, TransformationMatrix, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.func_225615_b_(), p_217845_2_.func_188049_c());
if (this.field_217850_G.containsKey(triple)) {
return this.field_217850_G.get(triple);
@@ -467,11 +493,11 @@
@@ -467,11 +494,11 @@
if (iunbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)iunbakedmodel;
if (blockmodel.func_178310_f() == field_177606_o) {
@@ -84,7 +85,7 @@
this.field_217850_G.put(triple, ibakedmodel);
return ibakedmodel;
}
@@ -524,6 +550,10 @@
@@ -524,6 +551,10 @@
return this.field_225367_M;
}
@@ -95,7 +96,7 @@
@OnlyIn(Dist.CLIENT)
static class BlockStateDefinitionException extends RuntimeException {
public BlockStateDefinitionException(String p_i49526_1_) {
@@ -531,6 +561,10 @@
@@ -531,6 +562,10 @@
}
}
@@ -0,0 +1,79 @@
--- a/net/minecraft/client/renderer/model/MultipartBakedModel.java
+++ b/net/minecraft/client/renderer/model/MultipartBakedModel.java
@@ -18,7 +18,7 @@
import org.apache.commons.lang3.tuple.Pair;
@OnlyIn(Dist.CLIENT)
-public class MultipartBakedModel implements IBakedModel {
+public class MultipartBakedModel implements net.minecraftforge.client.model.data.IDynamicBakedModel {
private final List<Pair<Predicate<BlockState>, IBakedModel>> field_188626_f;
protected final boolean field_188621_a;
protected final boolean field_188622_b;
@@ -27,10 +27,12 @@
protected final ItemCameraTransforms field_188624_d;
protected final ItemOverrideList field_188625_e;
private final Map<BlockState, BitSet> field_210277_g = new Object2ObjectOpenCustomHashMap<>(Util.func_212443_g());
+ private final IBakedModel defaultModel;
public MultipartBakedModel(List<Pair<Predicate<BlockState>, IBakedModel>> p_i48273_1_) {
this.field_188626_f = p_i48273_1_;
IBakedModel ibakedmodel = p_i48273_1_.iterator().next().getRight();
+ this.defaultModel = ibakedmodel;
this.field_188621_a = ibakedmodel.func_177555_b();
this.field_188622_b = ibakedmodel.func_177556_c();
this.field_230185_c_ = ibakedmodel.func_230044_c_();
@@ -39,7 +41,8 @@
this.field_188625_e = ibakedmodel.func_188617_f();
}
- public List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_) {
+ // FORGE: Implement our overloads (here and below) so child models can have custom logic
+ public List<BakedQuad> getQuads(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_, net.minecraftforge.client.model.data.IModelData modelData) {
if (p_200117_1_ == null) {
return Collections.emptyList();
} else {
@@ -62,7 +65,7 @@
for(int j = 0; j < bitset.length(); ++j) {
if (bitset.get(j)) {
- list.addAll(this.field_188626_f.get(j).getRight().func_200117_a(p_200117_1_, p_200117_2_, new Random(k)));
+ list.addAll(this.field_188626_f.get(j).getRight().getQuads(p_200117_1_, p_200117_2_, new Random(k), modelData));
}
}
@@ -74,6 +77,10 @@
return this.field_188621_a;
}
+ public boolean isAmbientOcclusion(BlockState state) {
+ return this.defaultModel.isAmbientOcclusion(state);
+ }
+
public boolean func_177556_c() {
return this.field_188622_b;
}
@@ -86,14 +93,24 @@
return false;
}
+ @Deprecated
public TextureAtlasSprite func_177554_e() {
return this.field_188623_c;
}
+ public TextureAtlasSprite getParticleTexture(net.minecraftforge.client.model.data.IModelData modelData) {
+ return this.defaultModel.getParticleTexture(modelData);
+ }
+
+ @Deprecated
public ItemCameraTransforms func_177552_f() {
return this.field_188624_d;
}
+ public IBakedModel handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType transformType, com.mojang.blaze3d.matrix.MatrixStack matrixStack) {
+ return this.defaultModel.handlePerspective(transformType, matrixStack);
+ }
+
public ItemOverrideList func_188617_f() {
return this.field_188625_e;
}
@@ -5,7 +5,7 @@
private final ItemCameraTransforms field_177651_f;
+ public Builder(net.minecraftforge.client.model.IModelConfiguration model, ItemOverrideList overrides) {
+ this(model.useSmoothLighting(), model.isShadedInGui(), model.isSideLit(), model.getCameraTransforms(), overrides);
+ this(model.useSmoothLighting(), model.isSideLit(), model.isShadedInGui(), model.getCameraTransforms(), overrides);
+ }
+
public Builder(BlockModel p_i230060_1_, ItemOverrideList p_i230060_2_, boolean p_i230060_3_) {
@@ -1,12 +1,53 @@
--- a/net/minecraft/client/renderer/model/WeightedBakedModel.java
+++ b/net/minecraft/client/renderer/model/WeightedBakedModel.java
@@ -31,6 +31,9 @@
@@ -12,7 +12,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public class WeightedBakedModel implements IBakedModel {
+public class WeightedBakedModel implements net.minecraftforge.client.model.data.IDynamicBakedModel {
private final int field_177567_a;
private final List<WeightedBakedModel.WeightedModel> field_177565_b;
private final IBakedModel field_177566_c;
@@ -23,14 +23,20 @@
this.field_177566_c = (p_i46073_1_.get(0)).field_185281_b;
}
- public List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_) {
- return (WeightedRandom.func_180166_a(this.field_177565_b, Math.abs((int)p_200117_3_.nextLong()) % this.field_177567_a)).field_185281_b.func_200117_a(p_200117_1_, p_200117_2_, p_200117_3_);
+ // FORGE: Implement our overloads (here and below) so child models can have custom logic
+ public List<BakedQuad> getQuads(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_, net.minecraftforge.client.model.data.IModelData modelData) {
+ return (WeightedRandom.func_180166_a(this.field_177565_b, Math.abs((int)p_200117_3_.nextLong()) % this.field_177567_a)).field_185281_b.getQuads(p_200117_1_, p_200117_2_, p_200117_3_, modelData);
}
public boolean func_177555_b() {
return this.field_177566_c.func_177555_b();
}
+ @Override
+ public boolean isAmbientOcclusion(BlockState state) { return this.field_177566_c.isAmbientOcclusion(state); }
+ public boolean isAmbientOcclusion(BlockState state) {
+ return this.field_177566_c.isAmbientOcclusion(state);
+ }
+
public boolean func_177556_c() {
return this.field_177566_c.func_177556_c();
}
@@ -47,10 +53,18 @@
return this.field_177566_c.func_177554_e();
}
+ public TextureAtlasSprite getParticleTexture(net.minecraftforge.client.model.data.IModelData modelData) {
+ return this.field_177566_c.getParticleTexture(modelData);
+ }
+
public ItemCameraTransforms func_177552_f() {
return this.field_177566_c.func_177552_f();
}
+ public IBakedModel handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType transformType, com.mojang.blaze3d.matrix.MatrixStack matrixStack) {
+ return this.field_177566_c.handlePerspective(transformType, matrixStack);
+ }
+
public ItemOverrideList func_188617_f() {
return this.field_177566_c.func_188617_f();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/TextureManager.java
+++ b/net/minecraft/client/renderer/texture/TextureManager.java
@@ -145,6 +145,7 @@
@@ -157,6 +157,7 @@
public void func_147645_c(ResourceLocation p_147645_1_) {
Texture texture = this.func_229267_b_(p_147645_1_);
if (texture != null) {
@@ -1,10 +1,10 @@
--- a/net/minecraft/client/resources/ClientLanguageMap.java
+++ b/net/minecraft/client/resources/ClientLanguageMap.java
@@ -116,4 +116,9 @@
return p_239500_1_;
}
@@ -78,4 +78,9 @@
public IReorderingProcessor func_241870_a(ITextProperties p_241870_1_) {
return BidiReorderer.func_243508_a(p_241870_1_, this.field_239496_d_);
}
+
+
+ @Override
+ public Map<String, String> getLanguageData() {
+ return field_239495_c_;
@@ -1,28 +0,0 @@
--- a/net/minecraft/client/resources/ClientResourcePackInfo.java
+++ b/net/minecraft/client/resources/ClientResourcePackInfo.java
@@ -24,13 +24,23 @@
@Nullable
private ResourceLocation field_195810_b;
+ @Deprecated
public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier<IResourcePack> p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_) {
- super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_);
+ this(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, false);
+ }
+
+ public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier<IResourcePack> p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_, boolean hidden) {
+ super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, hidden);
this.field_195809_a = func_239491_a_(p_i232485_4_);
}
+ @Deprecated
public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier<IResourcePack> p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_) {
- super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_);
+ this(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, p_i232486_10_, false);
+ }
+
+ public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier<IResourcePack> p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_, boolean hidden) {
+ super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, hidden);
this.field_195809_a = p_i232486_10_;
}
@@ -4,7 +4,7 @@
this.field_135037_b = p_i1303_2_;
this.field_135038_c = p_i1303_3_;
this.field_135036_d = p_i1303_4_;
+ String[] splitLangCode = field_135038_c.split("_", 2);
+ String[] splitLangCode = field_135039_a.split("_", 2);
+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores
+ this.javaLocale = new java.util.Locale(field_135039_a);
+ } else {
Loaded 100 of 1173 files, more files were not shown because too many files have changed in this diff. Show more