Compare commits

..
127 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
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
428 changed files with 9319 additions and 3939 deletions

No files matched your search

+75 -557
View File
@@ -10,50 +10,37 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.179'
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.forge.tasks.*
import net.minecraftforge.gradle.common.task.ArchiveChecksum
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
import org.objectweb.asm.Opcodes
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'
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 {
@@ -66,9 +53,9 @@ ext {
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20200514-1.16'
MC_VERSION = '1.16.2'
MCP_VERSION = '20200812.004259'
MAPPING_VERSION = '20201028-1.16.3'
MC_VERSION = '1.16.4'
MCP_VERSION = '20201102.104115'
}
project(':mcp') {
@@ -138,7 +125,6 @@ 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'
@@ -211,7 +197,7 @@ project(':forge') {
}
ext {
SPEC_VERSION = '33.0' // 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.
@@ -363,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]
}
}
}
@@ -446,11 +437,11 @@ project(':forge') {
installer 'org.ow2.asm:asm-tree:7.2'
installer 'org.ow2.asm:asm-util:7.2'
installer 'org.ow2.asm:asm-analysis:7.2'
installer 'cpw.mods:modlauncher:6.1.+'
installer 'cpw.mods:modlauncher:8.0.6'
installer 'cpw.mods:grossjava9hacks:1.3.+'
installer 'net.minecraftforge:accesstransformers:2.2.+:shadowed'
installer 'net.minecraftforge:eventbus:3.0.+:service'
installer 'net.minecraftforge:forgespi:3.1.+'
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'
@@ -462,7 +453,7 @@ 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'
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'
@@ -484,419 +475,59 @@ 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: extractInheritance) {
inputs.file { extractInheritance.output }
inputs.files patcher.accessTransformers
doLast {
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 = new JsonSlurper().parseText(extractInheritance.output.text)
patcher.accessTransformers.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')
}
}
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")
@@ -915,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.",
@@ -927,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,
@@ -948,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()
]
]
@@ -990,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()
]
]
@@ -1021,32 +652,32 @@ project(':forge') {
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}-${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}'",
@@ -1124,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 ->
@@ -1446,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
}
+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,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
}
}
}
+3 -3
View File
@@ -1,9 +1,9 @@
<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.16.1-&query=$.promos["1.16.1-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.1-&query=$.promos["1.16.1-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
[![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!
+5 -1
View File
@@ -75,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 {
@@ -86,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.
+3 -3
View File
@@ -6,7 +6,7 @@
# 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="[32,)" #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"
@@ -45,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="[32,)" #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
@@ -54,6 +54,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.16.1]"
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_);
}
@@ -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;
@@ -24,7 +24,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_);
}
@@ -65,10 +65,14 @@
}
return this.field_220085_g;
@@ -346,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 ====================================== */
@@ -76,16 +80,18 @@
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
private final int field_215708_d;
private final boolean field_215709_e;
@@ -428,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);
}
@@ -436,6 +445,8 @@
public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) {
return this.field_235704_h_;
}
@@ -94,7 +100,7 @@
public BlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
}
@@ -802,6 +813,9 @@
@@ -802,6 +817,9 @@
private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true;
private boolean field_235813_o_;
@@ -104,7 +110,7 @@
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 +877,8 @@
@@ -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_;
@@ -113,7 +119,7 @@
return abstractblock$properties;
}
@@ -877,6 +893,24 @@
@@ -877,6 +897,24 @@
return this;
}
@@ -138,7 +144,7 @@
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -933,7 +967,7 @@
@@ -933,7 +971,7 @@
}
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
@@ -13,7 +13,7 @@
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;
}
@@ -1,11 +1,14 @@
--- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java
@@ -102,8 +102,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_);
}
@@ -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);
@@ -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) {
@@ -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;
@@ -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));
@@ -216,7 +216,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)) {
@@ -322,4 +322,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
@@ -167,6 +167,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) {
@@ -518,7 +519,11 @@
@@ -529,7 +530,11 @@
for(KeyBinding keybinding : this.field_74324_K) {
if (s.equals("key_" + keybinding.func_151464_g())) {
@@ -21,7 +21,7 @@
}
}
@@ -565,6 +570,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));
@@ -648,7 +654,7 @@
@@ -661,7 +667,7 @@
printwriter.println("syncChunkWrites:" + this.field_241568_aS_);
for(KeyBinding keybinding : this.field_74324_K) {
@@ -38,7 +38,7 @@
}
for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -747,6 +753,23 @@
@@ -760,6 +766,23 @@
p_198017_1_.func_198985_a(set);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -357,6 +357,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;
@@ -369,7 +370,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_;
@@ -415,14 +415,15 @@
@@ -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);
@@ -29,11 +29,9 @@
this.field_110451_am = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES);
+ net.minecraftforge.fml.client.ClientModLoader.begin(this, this.field_110448_aq, this.field_110451_am, this.field_195554_ax);
this.field_110448_aq.func_198983_a();
+ DatapackCodec.field_234880_a_.addModPacks(net.minecraftforge.common.ForgeHooks.getModPacks());
this.field_71474_y.func_198017_a(this.field_110448_aq);
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
this.field_110451_am.func_219534_a(this.field_135017_as);
@@ -462,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);
@@ -41,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);
@@ -469,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_);
@@ -51,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()) {
@@ -481,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();
@@ -63,7 +61,7 @@
ResourceLoadProgressGui.func_212970_a(this);
List<IResourcePack> list = this.field_110448_aq.func_232623_f_();
@@ -494,7 +492,14 @@
@@ -508,7 +505,14 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
@@ -79,7 +77,7 @@
});
}, false));
}
@@ -533,7 +538,7 @@
@@ -556,7 +560,7 @@
}
private void func_229988_a_(Throwable p_229988_1_) {
@@ -88,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());
@@ -621,7 +626,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_) -> {
@@ -97,7 +95,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -691,13 +696,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());
@@ -114,7 +112,7 @@
}
}
@@ -706,6 +711,7 @@
@@ -729,6 +733,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -122,7 +120,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -794,10 +800,6 @@
@@ -817,10 +822,6 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -133,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_()) {
@@ -808,6 +810,14 @@
@@ -831,6 +832,14 @@
}
}
@@ -148,7 +146,7 @@
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);
@@ -939,11 +949,13 @@
@@ -962,11 +971,13 @@
RenderSystem.enableCull();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -162,7 +160,7 @@
}
if (this.field_238174_aV_ != null) {
@@ -1042,6 +1054,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);
@@ -170,7 +168,7 @@
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();
}
@@ -1230,11 +1243,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();
@@ -194,7 +192,7 @@
}
}
@@ -1253,6 +1276,8 @@
@@ -1276,6 +1298,8 @@
}
} else if (!this.field_71439_g.func_184838_M()) {
@@ -203,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());
@@ -1260,7 +1285,7 @@
@@ -1283,7 +1307,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -212,7 +210,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1270,8 +1295,10 @@
@@ -1293,8 +1317,10 @@
}
this.field_71439_g.func_184821_cY();
@@ -223,7 +221,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1286,6 +1313,11 @@
@@ -1309,6 +1335,11 @@
}
for(Hand hand : Hand.values()) {
@@ -235,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()) {
@@ -1299,6 +1331,7 @@
@@ -1322,6 +1353,7 @@
if (actionresulttype.func_226246_a_()) {
if (actionresulttype.func_226247_b_()) {
@@ -243,7 +241,7 @@
this.field_71439_g.func_184609_a(hand);
}
@@ -1311,6 +1344,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_()) {
@@ -251,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);
@@ -1326,6 +1360,9 @@
@@ -1349,6 +1382,9 @@
}
}
@@ -261,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_()) {
@@ -1352,6 +1389,8 @@
@@ -1375,6 +1411,8 @@
--this.field_71467_ac;
}
@@ -270,7 +268,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1468,6 +1507,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();
@@ -278,8 +276,8 @@
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
}
private void func_184117_aA() {
@@ -1697,7 +1738,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));
@@ -293,7 +291,7 @@
this.field_71453_ak = networkmanager;
} else {
this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> {
@@ -1771,6 +1817,7 @@
@@ -1821,6 +1866,7 @@
}
public void func_71403_a(ClientWorld p_71403_1_) {
@@ -301,7 +299,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1802,10 +1849,12 @@
@@ -1852,10 +1898,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -314,7 +312,7 @@
if (integratedserver != null) {
this.field_71424_I.func_76320_a("waitForServer");
@@ -1820,6 +1869,7 @@
@@ -1870,6 +1918,7 @@
this.field_71456_v.func_181029_i();
this.field_71422_O = null;
this.field_71455_al = false;
@@ -322,7 +320,7 @@
this.field_213274_aO.func_216815_b();
}
@@ -1850,6 +1900,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_();
@@ -330,7 +328,7 @@
}
public boolean func_238216_r_() {
@@ -1895,112 +1946,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) {
@@ -446,7 +444,7 @@
}
}
@@ -2090,6 +2038,7 @@
@@ -2140,6 +2087,7 @@
return field_71432_P;
}
@@ -454,7 +452,7 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> {
return p_229993_0_;
@@ -2397,7 +2346,7 @@
@@ -2451,7 +2399,7 @@
supplier = func_228022_c_(supplier);
}
@@ -463,7 +461,7 @@
}
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
@@ -2416,6 +2365,14 @@
@@ -2470,6 +2418,14 @@
this.field_175617_aL.func_229355_a_(p_228020_1_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/IngameGui.java
+++ b/net/minecraft/client/gui/IngameGui.java
@@ -78,7 +78,7 @@
@@ -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");
@@ -9,7 +9,7 @@
protected final Random field_73842_c = new Random();
protected final Minecraft field_73839_d;
protected final ItemRenderer field_73841_b;
@@ -414,6 +414,9 @@
@@ -415,6 +415,9 @@
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
Effect effect = effectinstance.func_188419_a();
@@ -19,7 +19,7 @@
if (effectinstance.func_205348_f()) {
int k = this.field_194811_H;
int l = 1;
@@ -451,6 +454,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);
});
@@ -27,7 +27,7 @@
}
}
@@ -575,7 +579,8 @@
@@ -576,7 +580,8 @@
iformattabletextcomponent.func_240699_a_(TextFormatting.ITALIC);
}
@@ -37,7 +37,7 @@
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()) {
@@ -592,7 +597,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));
@@ -52,7 +52,7 @@
RenderSystem.disableBlend();
RenderSystem.popMatrix();
}
@@ -1055,7 +1066,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;
@@ -9,7 +9,7 @@
this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories));
}
@@ -433,7 +433,7 @@
@@ -434,7 +434,7 @@
languagemanager.func_135045_a(language);
this.field_191888_F.field_71474_y.field_74363_ab = language.getCode();
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/LanguageScreen.java
+++ b/net/minecraft/client/gui/screen/LanguageScreen.java
@@ -45,7 +45,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();
@@ -7,23 +7,35 @@
- 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.renderToolTip(p_230457_1_, Lists.transform(this.func_231151_a_(p_230457_2_), ITextComponent::func_241878_f), 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_) {
@@ -129,6 +132,10 @@
@@ -121,14 +124,20 @@
}
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 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) {
+ //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 (!p_238654_2_.isEmpty()) {
int i = 0;
@@ -289,9 +296,12 @@
@@ -289,9 +298,12 @@
}
public void func_231159_b_(String p_231159_1_, boolean p_231159_2_) {
@@ -36,7 +48,7 @@
this.field_230706_i_.field_71439_g.func_71165_d(p_231159_1_);
}
@@ -302,10 +312,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_;
@@ -54,7 +66,7 @@
}
public List<? extends IGuiEventListener> func_231039_at__() {
@@ -328,6 +345,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);
@@ -62,7 +74,7 @@
} else {
this.func_231165_f_(p_238651_2_);
}
@@ -346,6 +364,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();
@@ -70,7 +82,7 @@
}
public boolean func_231177_au__() {
@@ -432,4 +451,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
@@ -310,6 +310,8 @@
@@ -307,6 +307,8 @@
this.field_148303_c.func_238854_b_(list1);
}
@@ -181,7 +181,7 @@
- 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.renderToolTip(p_230457_1_, Lists.transform(list1, ITextComponent::func_241878_f), 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_);
@@ -9,14 +9,10 @@
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;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/login/ClientLoginNetHandler.java
+++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java
@@ -99,6 +99,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));
}
@@ -127,6 +128,7 @@
@@ -143,6 +144,7 @@
}
public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) {
@@ -77,7 +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());
@@ -1883,10 +1896,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,9 +34,17 @@
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,21 @@
@@ -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();
@@ -57,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 +369,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_) {
@@ -66,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 +441,12 @@
@@ -434,6 +448,12 @@
return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum());
}
@@ -1,6 +1,18 @@
--- a/net/minecraft/client/renderer/WorldRenderer.java
+++ b/net/minecraft/client/renderer/WorldRenderer.java
@@ -830,7 +830,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");
@@ -915,13 +915,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");
@@ -942,7 +942,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_());
@@ -1010,6 +1012,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_();
@@ -1035,6 +1038,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);
@@ -1084,7 +1088,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);
}
@@ -2076,7 +2081,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);
@@ -2084,7 +2094,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_());
}
@@ -2232,7 +2242,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_);
}
@@ -2382,8 +2392,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);
}
@@ -2531,7 +2541,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;
}
@@ -2570,6 +2580,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;
@@ -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_) {
@@ -54,7 +54,7 @@
public boolean func_151470_d() {
- return this.field_74513_e;
+ return this.field_74513_e && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext());
+ return this.field_74513_e && isConflictContextAndModifierActive();
}
public String func_151466_e() {
@@ -0,0 +1,17 @@
--- a/net/minecraft/client/settings/ToggleableKeyBinding.java
+++ b/net/minecraft/client/settings/ToggleableKeyBinding.java
@@ -16,7 +16,7 @@
public void func_225593_a_(boolean p_225593_1_) {
if (this.field_228053_a_.getAsBoolean()) {
- if (p_225593_1_) {
+ if (p_225593_1_ && isConflictContextAndModifierActive()) {
super.func_225593_a_(!this.func_151470_d());
}
} else {
@@ -24,4 +24,5 @@
}
}
+ @Override public boolean func_151470_d() { return this.field_74513_e && (isConflictContextAndModifierActive() || field_228053_a_.getAsBoolean()); }
}
@@ -62,3 +62,11 @@
if (p_217384_1_ == this.field_73037_M.field_71439_g) {
this.field_73037_M.func_147118_V().func_147682_a(new EntityTickableSound(p_217384_3_, p_217384_4_, p_217384_2_));
}
@@ -876,6 +893,7 @@
}
public void func_239156_a_(Difficulty p_239156_1_) {
+ net.minecraftforge.common.ForgeHooks.onDifficultyChange(p_239156_1_, this.field_239153_j_);
this.field_239153_j_ = p_239156_1_;
}
@@ -0,0 +1,41 @@
--- a/net/minecraft/client/world/DimensionRenderInfo.java
+++ b/net/minecraft/client/world/DimensionRenderInfo.java
@@ -26,6 +26,9 @@
private final DimensionRenderInfo.FogType field_241680_e_;
private final boolean field_241681_f_;
private final boolean field_239212_e_;
+ private net.minecraftforge.client.IWeatherRenderHandler weatherRenderHandler = null;
+ private net.minecraftforge.client.ISkyRenderHandler skyRenderHandler = null;
+ private net.minecraftforge.client.ICloudRenderHandler cloudRenderHandler = null;
public DimensionRenderInfo(float p_i241259_1_, boolean p_i241259_2_, DimensionRenderInfo.FogType p_i241259_3_, boolean p_i241259_4_, boolean p_i241259_5_) {
this.field_239210_c_ = p_i241259_1_;
@@ -82,6 +85,28 @@
return this.field_239212_e_;
}
+ public void setWeatherRenderHandler(net.minecraftforge.client.IWeatherRenderHandler weatherRenderHandler) {
+ this.weatherRenderHandler = weatherRenderHandler;
+ }
+ public void setSkyRenderHandler(net.minecraftforge.client.ISkyRenderHandler skyRenderHandler) {
+ this.skyRenderHandler = skyRenderHandler;
+ }
+ public void setCloudRenderHandler(net.minecraftforge.client.ICloudRenderHandler cloudRenderHandler) {
+ this.cloudRenderHandler = cloudRenderHandler;
+ }
+ @Nullable
+ public net.minecraftforge.client.ICloudRenderHandler getCloudRenderHandler() {
+ return cloudRenderHandler;
+ }
+ @Nullable
+ public net.minecraftforge.client.IWeatherRenderHandler getWeatherRenderHandler() {
+ return weatherRenderHandler;
+ }
+ @Nullable
+ public net.minecraftforge.client.ISkyRenderHandler getSkyRenderHandler() {
+ return skyRenderHandler;
+ }
+
@OnlyIn(Dist.CLIENT)
public static class End extends DimensionRenderInfo {
public End() {
@@ -8,10 +8,11 @@
this.field_197062_b.findAmbiguities((p_201302_1_, p_201302_2_, p_201302_3_, p_201302_4_) -> {
field_197061_a.warn("Ambiguity between arguments {} and {} with inputs: {}", this.field_197062_b.getPath(p_201302_2_), this.field_197062_b.getPath(p_201302_3_), p_201302_4_);
@@ -205,6 +206,14 @@
@@ -205,7 +206,15 @@
try {
try {
- return this.field_197062_b.execute(stringreader, p_197059_1_);
+ ParseResults<CommandSource> parse = this.field_197062_b.parse(stringreader, p_197059_1_);
+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(parse);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
@@ -20,6 +21,7 @@
+ }
+ return 1;
+ }
return this.field_197062_b.execute(stringreader, p_197059_1_);
+ return this.field_197062_b.execute(event.getParseResults());
} catch (CommandException commandexception) {
p_197059_1_.func_197021_a(commandexception.func_197003_a());
return 0;
@@ -8,7 +8,24 @@
}
public String func_71501_a() {
@@ -121,23 +122,13 @@
@@ -87,14 +88,8 @@
if (this.field_85060_g != null && this.field_85060_g.length > 0) {
p_71506_1_.append("-- Head --\n");
p_71506_1_.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
- p_71506_1_.append("Stacktrace:\n");
-
- for(StackTraceElement stacktraceelement : this.field_85060_g) {
- p_71506_1_.append("\t").append("at ").append((Object)stacktraceelement);
- p_71506_1_.append("\n");
- }
-
- p_71506_1_.append("\n");
+ p_71506_1_.append("Stacktrace:");
+ p_71506_1_.append(net.minecraftforge.fml.CrashReportExtender.generateEnhancedStackTrace(this.field_85060_g));
}
for(CrashReportCategory crashreportcategory : this.field_71512_c) {
@@ -121,23 +116,13 @@
throwable.setStackTrace(this.field_71511_b.getStackTrace());
}
@@ -13,3 +13,27 @@
return this.field_85075_d.length;
}
}
@@ -145,11 +147,7 @@
if (this.field_85075_d != null && this.field_85075_d.length > 0) {
p_85072_1_.append("\nStacktrace:");
-
- for(StackTraceElement stacktraceelement : this.field_85075_d) {
- p_85072_1_.append("\n\tat ");
- p_85072_1_.append((Object)stacktraceelement);
- }
+ p_85072_1_.append(net.minecraftforge.fml.CrashReportExtender.generateEnhancedStackTrace(this.field_85075_d));
}
}
@@ -158,6 +156,10 @@
return this.field_85075_d;
}
+ public void applyStackTrace(Throwable t) {
+ this.field_85075_d = t.getStackTrace();
+ }
+
public static void func_175750_a(CrashReportCategory p_175750_0_, BlockPos p_175750_1_, @Nullable BlockState p_175750_2_) {
if (p_175750_2_ != null) {
p_175750_0_.func_189529_a("Block", p_175750_2_::toString);
@@ -0,0 +1,16 @@
--- a/net/minecraft/data/BlockTagsProvider.java
+++ b/net/minecraft/data/BlockTagsProvider.java
@@ -8,9 +8,13 @@
import net.minecraft.util.registry.Registry;
public class BlockTagsProvider extends TagsProvider<Block> {
+ @Deprecated
public BlockTagsProvider(DataGenerator p_i48256_1_) {
super(p_i48256_1_, Registry.field_212618_g);
}
+ public BlockTagsProvider(DataGenerator p_i48256_1_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
+ super(p_i48256_1_, Registry.field_212618_g, modId, existingFileHelper);
+ }
protected void func_200432_c() {
this.func_240522_a_(BlockTags.field_199897_a).func_240534_a_(Blocks.field_196556_aL, Blocks.field_196557_aM, Blocks.field_196558_aN, Blocks.field_196559_aO, Blocks.field_196560_aP, Blocks.field_196561_aQ, Blocks.field_196562_aR, Blocks.field_196563_aS, Blocks.field_196564_aT, Blocks.field_196565_aU, Blocks.field_196566_aV, Blocks.field_196567_aW, Blocks.field_196568_aX, Blocks.field_196569_aY, Blocks.field_196570_aZ, Blocks.field_196602_ba);
@@ -0,0 +1,16 @@
--- a/net/minecraft/data/EntityTypeTagsProvider.java
+++ b/net/minecraft/data/EntityTypeTagsProvider.java
@@ -7,9 +7,13 @@
import net.minecraft.util.registry.Registry;
public class EntityTypeTagsProvider extends TagsProvider<EntityType<?>> {
+ @Deprecated
public EntityTypeTagsProvider(DataGenerator p_i50784_1_) {
super(p_i50784_1_, Registry.field_212629_r);
}
+ public EntityTypeTagsProvider(DataGenerator p_i50784_1_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
+ super(p_i50784_1_, Registry.field_212629_r, modId, existingFileHelper);
+ }
protected void func_200432_c() {
this.func_240522_a_(EntityTypeTags.field_219764_a).func_240534_a_(EntityType.field_200741_ag, EntityType.field_200750_ap, EntityType.field_200722_aA);
@@ -0,0 +1,16 @@
--- a/net/minecraft/data/FluidTagsProvider.java
+++ b/net/minecraft/data/FluidTagsProvider.java
@@ -8,9 +8,13 @@
import net.minecraft.util.registry.Registry;
public class FluidTagsProvider extends TagsProvider<Fluid> {
+ @Deprecated
public FluidTagsProvider(DataGenerator p_i49156_1_) {
super(p_i49156_1_, Registry.field_212619_h);
}
+ public FluidTagsProvider(DataGenerator p_i49156_1_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
+ super(p_i49156_1_, Registry.field_212619_h, modId, existingFileHelper);
+ }
protected void func_200432_c() {
this.func_240522_a_(FluidTags.field_206959_a).func_240534_a_(Fluids.field_204546_a, Fluids.field_207212_b);
@@ -0,0 +1,18 @@
--- a/net/minecraft/data/ItemTagsProvider.java
+++ b/net/minecraft/data/ItemTagsProvider.java
@@ -14,10 +14,15 @@
public class ItemTagsProvider extends TagsProvider<Item> {
private final Function<ITag.INamedTag<Block>, ITag.Builder> field_240520_d_;
+ @Deprecated
public ItemTagsProvider(DataGenerator p_i232552_1_, BlockTagsProvider p_i232552_2_) {
super(p_i232552_1_, Registry.field_212630_s);
this.field_240520_d_ = p_i232552_2_::func_240525_b_;
}
+ public ItemTagsProvider(DataGenerator p_i232552_1_, BlockTagsProvider p_i232552_2_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
+ super(p_i232552_1_, Registry.field_212630_s, modId, existingFileHelper);
+ this.field_240520_d_ = p_i232552_2_::func_240525_b_;
+ }
protected void func_200432_c() {
this.func_240521_a_(BlockTags.field_199897_a, ItemTags.field_199904_a);
@@ -26,7 +26,7 @@
+ Collection<Path> existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).collect(Collectors.toList());
+ java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
+ boolean isFlat = mods.isEmpty() || optionset.has(flat);
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5, isFlat);
+ net.minecraftforge.fml.DatagenModLoader.begin(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5, isFlat);
+ if (mods.contains("minecraft") || mods.isEmpty())
+ func_200264_a(isFlat ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
} else {
@@ -1,26 +1,33 @@
--- a/net/minecraft/data/TagsProvider.java
+++ b/net/minecraft/data/TagsProvider.java
@@ -28,11 +28,17 @@
@@ -28,10 +28,18 @@
protected final DataGenerator field_200433_a;
protected final Registry<T> field_200435_c;
protected final Map<ResourceLocation, ITag.Builder> field_200434_b = Maps.newLinkedHashMap();
+ protected String modId;
+ protected final String modId;
+ protected final net.minecraftforge.common.data.ExistingFileHelper existingFileHelper;
+ @Deprecated//Forge, Use ModID version.
protected TagsProvider(DataGenerator p_i49827_1_, Registry<T> p_i49827_2_) {
- this.field_200433_a = p_i49827_1_;
- this.field_200435_c = p_i49827_2_;
+ this(p_i49827_1_, p_i49827_2_, "vanilla");
}
+ protected TagsProvider(DataGenerator generatorIn, Registry<T> registryIn, String modId) {
+ this.field_200433_a = generatorIn;
+ this.field_200435_c = registryIn;
+ this.modId = modId;
+ this(p_i49827_1_, p_i49827_2_, "vanilla", null);
+ }
+ protected TagsProvider(DataGenerator p_i49827_1_, Registry<T> p_i49827_2_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
this.field_200433_a = p_i49827_1_;
this.field_200435_c = p_i49827_2_;
+ this.modId = modId;
+ this.existingFileHelper = existingFileHelper;
}
protected abstract void func_200432_c();
@@ -53,6 +59,7 @@
@@ -47,12 +55,14 @@
return this.field_200435_c.func_241873_b(p_240527_1_).orElse((T)null);
};
this.field_200434_b.forEach((p_240524_4_, p_240524_5_) -> {
- List<ITag.Proxy> list = p_240524_5_.func_232963_b_(function, function1).collect(Collectors.toList());
+ // FORGE: Add validation via existing resources
+ List<ITag.Proxy> list = p_240524_5_.func_232963_b_(function, function1).filter(this::missing).collect(Collectors.toList());
if (!list.isEmpty()) {
throw new IllegalArgumentException(String.format("Couldn't define tag %s as it is missing following references: %s", p_240524_4_, list.stream().map(Objects::toString).collect(Collectors.joining(","))));
} else {
JsonObject jsonobject = p_240524_5_.func_232965_c_();
Path path = this.func_200431_a(p_240524_4_);
@@ -28,7 +35,26 @@
try {
String s = field_200437_e.toJson((JsonElement)jsonobject);
@@ -78,7 +85,7 @@
@@ -74,11 +84,26 @@
});
}
+ private boolean missing(ITag.Proxy reference) {
+ ITag.ITagEntry entry = reference.func_232968_a_();
+ // We only care about non-optional tag entries, this is the only type that can reference a resource and needs validation
+ // Optional tags should not be validated
+ if (entry instanceof ITag.TagEntry) {
+ return existingFileHelper == null || !existingFileHelper.exists(((ITag.TagEntry)entry).getId(), net.minecraft.resources.ResourcePackType.SERVER_DATA, ".json", "tags/" + getTagFolder());
+ }
+ return false;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected String getTagFolder() {
+ return ((Registry)Registry.field_212617_f).func_177774_c(field_200435_c).func_110623_a() + "s";
+ }
+
protected abstract Path func_200431_a(ResourceLocation p_200431_1_);
protected TagsProvider.Builder<T> func_240522_a_(ITag.INamedTag<T> p_240522_1_) {
ITag.Builder itag$builder = this.func_240525_b_(p_240522_1_);
@@ -37,7 +63,7 @@
}
protected ITag.Builder func_240525_b_(ITag.INamedTag<T> p_240525_1_) {
@@ -87,7 +94,7 @@
@@ -87,7 +112,7 @@
});
}
@@ -46,7 +72,7 @@
private final ITag.Builder field_240528_a_;
private final Registry<T> field_240529_b_;
private final String field_240530_c_;
@@ -115,5 +122,18 @@
@@ -115,5 +140,18 @@
});
return this;
}
@@ -1,15 +1,31 @@
--- a/net/minecraft/enchantment/Enchantment.java
+++ b/net/minecraft/enchantment/Enchantment.java
@@ -18,7 +18,7 @@
@@ -18,7 +18,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public abstract class Enchantment {
+public abstract class Enchantment extends net.minecraftforge.registries.ForgeRegistryEntry<Enchantment> {
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Enchantment> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.ENCHANTMENTS));
private final EquipmentSlotType[] field_185263_a;
private final Enchantment.Rarity field_77333_a;
public final EnchantmentType field_77351_y;
@@ -114,7 +114,7 @@
@@ -37,6 +38,14 @@
this.field_185263_a = p_i46731_3_;
}
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ public boolean isIn(net.minecraft.tags.ITag<Enchantment> tag) {
+ return tag.func_230235_a_(this);
+ }
+
public Map<EquipmentSlotType, ItemStack> func_222181_a(LivingEntity p_222181_1_) {
Map<EquipmentSlotType, ItemStack> map = Maps.newEnumMap(EquipmentSlotType.class);
@@ -114,7 +123,7 @@
}
public boolean func_92089_a(ItemStack p_92089_1_) {
@@ -18,7 +34,7 @@
}
public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) {
@@ -139,6 +139,24 @@
@@ -139,6 +148,24 @@
return true;
}
@@ -23,7 +23,7 @@
for(Enchantment enchantment : Registry.field_212628_q) {
- if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.field_77351_y.func_77557_a(item) || flag)) {
+ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
+ if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
list.add(new EnchantmentData(enchantment, i));
@@ -31,18 +31,20 @@
this.field_200606_g = p_i48580_1_;
this.field_70170_p = p_i48580_2_;
this.field_213325_aI = p_i48580_1_.func_220334_j();
@@ -211,7 +214,9 @@
@@ -211,7 +214,11 @@
this.field_70180_af.func_187214_a(field_189655_aD, false);
this.field_70180_af.func_187214_a(field_213330_X, Pose.STANDING);
this.func_70088_a();
- this.field_213326_aJ = this.func_213316_a(Pose.STANDING, this.field_213325_aI);
+ this.field_213326_aJ = getEyeHeightForge(Pose.STANDING, this.field_213325_aI);
+ net.minecraftforge.event.entity.EntityEvent.Size sizeEvent = net.minecraftforge.event.ForgeEventFactory.getEntitySizeForge(this, Pose.STANDING, this.field_213325_aI, this.func_213316_a(Pose.STANDING, this.field_213325_aI));
+ this.field_213325_aI = sizeEvent.getNewSize();
+ this.field_213326_aJ = sizeEvent.getNewEyeHeight();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this));
+ this.gatherCapabilities();
}
@OnlyIn(Dist.CLIENT)
@@ -317,7 +322,13 @@
@@ -317,7 +324,13 @@
}
public void func_70106_y() {
@@ -56,7 +58,7 @@
}
public void func_213301_b(Pose p_213301_1_) {
@@ -330,6 +341,7 @@
@@ -330,6 +343,7 @@
public boolean func_233562_a_(Entity p_233562_1_, double p_233562_2_) {
double d0 = p_233562_1_.field_233557_ao_.field_72450_a - this.field_233557_ao_.field_72450_a;
@@ -64,7 +66,7 @@
double d1 = p_233562_1_.field_233557_ao_.field_72448_b - this.field_233557_ao_.field_72448_b;
double d2 = p_233562_1_.field_233557_ao_.field_72449_c - this.field_233557_ao_.field_72449_c;
return d0 * d0 + d1 * d1 + d2 * d2 < p_233562_2_ * p_233562_2_;
@@ -560,7 +572,7 @@
@@ -560,7 +574,7 @@
this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vector3d)) * 0.6D);
this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2) * 0.6D);
@@ -73,7 +75,7 @@
this.field_70150_b = this.func_203009_ad();
if (this.func_70090_H()) {
Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this;
@@ -575,7 +587,7 @@
@@ -575,7 +589,7 @@
} else {
this.func_180429_a(blockpos, blockstate);
}
@@ -82,7 +84,7 @@
this.field_191959_ay = this.func_191954_d(this.field_82151_R);
}
}
@@ -591,8 +603,9 @@
@@ -591,8 +605,9 @@
float f2 = this.func_225515_ai_();
this.func_213317_d(this.func_213322_ci().func_216372_d((double)f2, 1.0D, (double)f2));
@@ -94,7 +96,7 @@
}) && this.field_190534_ay <= 0) {
this.func_241209_g_(-this.func_190531_bD());
}
@@ -611,11 +624,10 @@
@@ -611,11 +626,10 @@
int j = MathHelper.func_76128_c(this.field_233557_ao_.field_72448_b - (double)0.2F);
int k = MathHelper.func_76128_c(this.field_233557_ao_.field_72449_c);
BlockPos blockpos = new BlockPos(i, j, k);
@@ -108,7 +110,7 @@
return blockpos1;
}
}
@@ -801,6 +813,7 @@
@@ -801,6 +815,7 @@
public void func_174829_m() {
AxisAlignedBB axisalignedbb = this.func_174813_aQ();
this.func_226288_n_((axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D, axisalignedbb.field_72338_b, (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D);
@@ -116,7 +118,7 @@
}
protected SoundEvent func_184184_Z() {
@@ -849,7 +862,7 @@
@@ -849,7 +864,7 @@
protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) {
if (!p_180429_2_.func_185904_a().func_76224_d()) {
BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a());
@@ -125,7 +127,7 @@
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -1056,9 +1069,10 @@
@@ -1056,9 +1071,10 @@
int k = MathHelper.func_76128_c(this.func_226281_cx_());
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -137,7 +139,7 @@
}
}
@@ -1377,6 +1391,7 @@
@@ -1377,6 +1393,7 @@
if (this.field_184238_ar) {
p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
}
@@ -145,7 +147,7 @@
if (!this.field_184236_aF.isEmpty()) {
ListNBT listnbt = new ListNBT();
@@ -1388,6 +1403,10 @@
@@ -1388,6 +1405,10 @@
p_189511_1_.func_218657_a("Tags", listnbt);
}
@@ -156,7 +158,7 @@
this.func_213281_b(p_189511_1_);
if (this.func_184207_aI()) {
ListNBT listnbt1 = new ListNBT();
@@ -1458,6 +1477,9 @@
@@ -1458,6 +1479,9 @@
this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
@@ -166,7 +168,7 @@
if (p_70020_1_.func_150297_b("Tags", 9)) {
this.field_184236_aF.clear();
ListNBT listnbt3 = p_70020_1_.func_150295_c("Tags", 8);
@@ -1546,6 +1568,8 @@
@@ -1546,6 +1570,8 @@
} else {
ItemEntity itementity = new ItemEntity(this.field_70170_p, this.func_226277_ct_(), this.func_226278_cu_() + (double)p_70099_2_, this.func_226281_cx_(), p_70099_1_);
itementity.func_174869_p();
@@ -175,7 +177,7 @@
this.field_70170_p.func_217376_c(itementity);
return itementity;
}
@@ -1582,6 +1606,7 @@
@@ -1582,6 +1608,7 @@
public void func_70098_U() {
this.func_213317_d(Vector3d.field_186680_a);
@@ -183,7 +185,7 @@
this.func_70071_h_();
if (this.func_184218_aH()) {
this.func_184187_bx().func_184232_k(this);
@@ -1627,6 +1652,7 @@
@@ -1627,6 +1654,7 @@
}
}
@@ -191,7 +193,7 @@
if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
if (this.func_184218_aH()) {
this.func_184210_p();
@@ -1659,6 +1685,7 @@
@@ -1659,6 +1687,7 @@
public void func_233575_bb_() {
if (this.field_184239_as != null) {
Entity entity = this.field_184239_as;
@@ -199,7 +201,7 @@
this.field_184239_as = null;
entity.func_184225_p(this);
}
@@ -1816,6 +1843,7 @@
@@ -1816,6 +1845,7 @@
return !this.func_184188_bt().isEmpty();
}
@@ -207,7 +209,7 @@
public boolean func_205710_ba() {
return true;
}
@@ -2032,7 +2060,7 @@
@@ -2032,7 +2062,7 @@
}
protected ITextComponent func_225513_by_() {
@@ -216,7 +218,7 @@
}
public boolean func_70028_i(Entity p_70028_1_) {
@@ -2087,6 +2115,10 @@
@@ -2087,14 +2117,19 @@
@Nullable
public Entity func_241206_a_(ServerWorld p_241206_1_) {
@@ -227,7 +229,9 @@
if (this.field_70170_p instanceof ServerWorld && !this.field_70128_L) {
this.field_70170_p.func_217381_Z().func_76320_a("changeDimension");
this.func_213319_R();
@@ -2095,6 +2127,7 @@
this.field_70170_p.func_217381_Z().func_76320_a("reposition");
- PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
+ PortalInfo portalinfo = teleporter.getPortalInfo(this, p_241206_1_, this::func_241829_a);
if (portalinfo == null) {
return null;
} else {
@@ -235,7 +239,7 @@
this.field_70170_p.func_217381_Z().func_219895_b("reloading");
Entity entity = this.func_200600_R().func_200721_a(p_241206_1_);
if (entity != null) {
@@ -2102,17 +2135,19 @@
@@ -2102,17 +2137,19 @@
entity.func_70012_b(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c, portalinfo.field_242960_c, entity.field_70125_A);
entity.func_213317_d(portalinfo.field_222506_b);
p_241206_1_.func_217460_e(entity);
@@ -257,16 +261,20 @@
}
} else {
return null;
@@ -2322,7 +2357,7 @@
@@ -2320,9 +2357,10 @@
public void func_213323_x_() {
EntitySize entitysize = this.field_213325_aI;
Pose pose = this.func_213283_Z();
EntitySize entitysize1 = this.func_213305_a(pose);
- EntitySize entitysize1 = this.func_213305_a(pose);
+ net.minecraftforge.event.entity.EntityEvent.Size sizeEvent = net.minecraftforge.event.ForgeEventFactory.getEntitySizeForge(this, pose, this.func_213305_a(pose), this.func_213316_a(pose, entitysize));
+ EntitySize entitysize1 = sizeEvent.getNewSize();
this.field_213325_aI = entitysize1;
- this.field_213326_aJ = this.func_213316_a(pose, entitysize1);
+ this.field_213326_aJ = getEyeHeightForge(pose, entitysize1);
+ this.field_213326_aJ = sizeEvent.getNewEyeHeight();
if (entitysize1.field_220315_a < entitysize.field_220315_a) {
double d0 = (double)entitysize1.field_220315_a / 2.0D;
this.func_174826_a(new AxisAlignedBB(this.func_226277_ct_() - d0, this.func_226278_cu_(), this.func_226281_cx_() - d0, this.func_226277_ct_() + d0, this.func_226278_cu_() + (double)entitysize1.field_220316_b, this.func_226281_cx_() + d0));
@@ -2796,6 +2831,7 @@
@@ -2796,6 +2834,7 @@
this.field_233555_aA_ = true;
}
@@ -274,7 +282,7 @@
}
@@ -2811,4 +2847,69 @@
@@ -2811,4 +2850,63 @@
public interface IMoveCallback {
void accept(Entity p_accept_1_, double p_accept_2_, double p_accept_4_, double p_accept_6_);
}
@@ -336,11 +344,5 @@
+ public void revive() {
+ this.field_70128_L = false;
+ this.reviveCaps();
+ }
+
+ private float getEyeHeightForge(Pose pose, EntitySize size) {
+ net.minecraftforge.event.entity.EntityEvent.EyeHeight evt = new net.minecraftforge.event.entity.EntityEvent.EyeHeight(this, pose, size, this.func_213316_a(pose, size));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(evt);
+ return evt.getNewHeight();
+ }
}
@@ -9,13 +9,28 @@
MONSTER("monster", 70, false, false, 128),
CREATURE("creature", 10, true, true, 128),
AMBIENT("ambient", 15, true, false, 128),
@@ -57,6 +57,10 @@
@@ -14,7 +14,7 @@
WATER_AMBIENT("water_ambient", 20, true, false, 64),
MISC("misc", -1, true, true, 128);
- public static final Codec<EntityClassification> field_233667_g_ = IStringSerializable.func_233023_a_(EntityClassification::values, EntityClassification::func_233670_a_);
+ public static final Codec<EntityClassification> field_233667_g_ = net.minecraftforge.common.IExtensibleEnum.createCodecForExtensibleEnum(EntityClassification::values, EntityClassification::func_233670_a_);
private static final Map<String, EntityClassification> field_220364_f = Arrays.stream(values()).collect(Collectors.toMap(EntityClassification::func_220363_a, (p_220362_0_) -> {
return p_220362_0_;
}));
@@ -57,6 +57,16 @@
return this.field_82707_i;
}
+ public static EntityClassification create(String name, String id, int maxNumberOfCreatureIn, boolean isPeacefulCreatureIn, boolean isAnimalIn, int despawnDistance) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ @Override
+ @Deprecated
+ public void init() {
+ field_220364_f.put(this.func_220363_a(), this);
+ }
+
public int func_233671_f_() {
return this.field_233669_n_;
@@ -343,6 +343,15 @@
float f4 = this.field_70122_E ? f3 * 0.91F : 0.91F;
Vector3d vector3d5 = this.func_233633_a_(p_213352_1_, f3);
double d2 = vector3d5.field_72448_b;
@@ -2049,7 +2081,7 @@
double d0 = MathHelper.func_151237_a(p_213362_1_.field_72450_a, (double)-0.15F, (double)0.15F);
double d1 = MathHelper.func_151237_a(p_213362_1_.field_72449_c, (double)-0.15F, (double)0.15F);
double d2 = Math.max(p_213362_1_.field_72448_b, (double)-0.15F);
- if (d2 < 0.0D && !this.func_213339_cH().func_203425_a(Blocks.field_222420_lI) && this.func_230491_ea_() && this instanceof PlayerEntity) {
+ if (d2 < 0.0D && !this.func_213339_cH().isScaffolding(this) && this.func_230491_ea_() && this instanceof PlayerEntity) {
d2 = 0.0D;
}
@@ -2077,6 +2109,7 @@
}
@@ -32,7 +32,7 @@
if (entity != null) {
double d0 = entity.func_70068_e(this);
int i = this.func_200600_R().func_220339_d().func_233671_f_();
@@ -878,6 +887,8 @@
@@ -879,6 +888,8 @@
}
public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) {
@@ -41,7 +41,7 @@
Item item = p_184640_0_.func_77973_b();
if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) {
if (item instanceof ArmorItem) {
@@ -885,7 +896,7 @@
@@ -886,7 +897,7 @@
} else if (item == Items.field_185160_cR) {
return EquipmentSlotType.CHEST;
} else {
@@ -207,9 +207,9 @@
+ private boolean canUseRail = true;
+ @Override public boolean canUseRail() { return canUseRail; }
+ @Override public void setCanUseRail(boolean value) { this.canUseRail = value; }
+ private float currentSpeedOnRail;
+ @Override public float getCurrentCartSpeedCapOnRail() { return currentSpeedOnRail; }
+ @Override public void setCurrentCartSpeedCapOnRail(float value) { currentSpeedOnRail = Math.min(value, getMaxCartSpeedOnRail()); }
+ private float currentSpeedCapOnRail = getMaxCartSpeedOnRail();
+ @Override public float getCurrentCartSpeedCapOnRail() { return currentSpeedCapOnRail; }
+ @Override public void setCurrentCartSpeedCapOnRail(float value) { currentSpeedCapOnRail = Math.min(value, getMaxCartSpeedOnRail()); }
+ private float maxSpeedAirLateral = DEFAULT_MAX_SPEED_AIR_LATERAL;
+ @Override public float getMaxSpeedAirLateral() { return maxSpeedAirLateral; }
+ @Override public void setMaxSpeedAirLateral(float value) { maxSpeedAirLateral = value; }
@@ -1,13 +0,0 @@
--- a/net/minecraft/entity/monster/HoglinEntity.java
+++ b/net/minecraft/entity/monster/HoglinEntity.java
@@ -279,8 +279,8 @@
return hoglinentity;
}
- public boolean func_204701_dC() {
- return !HoglinTasks.func_234386_c_(this) && super.func_204701_dC();
+ public boolean func_213743_em() {
+ return !HoglinTasks.func_234386_c_(this) && super.func_213743_em();
}
public SoundCategory func_184176_by() {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/monster/PhantomEntity.java
+++ b/net/minecraft/entity/monster/PhantomEntity.java
@@ -214,7 +214,7 @@
this.field_203142_b = 60;
List<PlayerEntity> list = PhantomEntity.this.field_70170_p.func_217373_a(this.field_220842_b, PhantomEntity.this, PhantomEntity.this.func_174813_aQ().func_72314_b(16.0D, 64.0D, 16.0D));
if (!list.isEmpty()) {
- list.sort(Comparator.comparing(Entity::func_226278_cu_).reversed());
+ list.sort(Comparator.<Entity, Double>comparing(Entity::func_226278_cu_).reversed());
for(PlayerEntity playerentity : list) {
if (PhantomEntity.this.func_213344_a(playerentity, EntityPredicate.field_221016_a)) {
@@ -1,23 +1,5 @@
--- a/net/minecraft/entity/passive/AnimalEntity.java
+++ b/net/minecraft/entity/passive/AnimalEntity.java
@@ -121,7 +121,7 @@
ItemStack itemstack = p_230254_1_.func_184586_b(p_230254_2_);
if (this.func_70877_b(itemstack)) {
int i = this.func_70874_b();
- if (!this.field_70170_p.field_72995_K && i == 0 && this.func_204701_dC()) {
+ if (!this.field_70170_p.field_72995_K && i == 0 && this.func_213743_em()) {
this.func_175505_a(p_230254_1_, itemstack);
this.func_146082_f(p_230254_1_);
return ActionResultType.SUCCESS;
@@ -148,7 +148,7 @@
}
- public boolean func_204701_dC() {
+ public boolean func_213743_em() {
return this.field_70881_d <= 0;
}
@@ -199,6 +199,17 @@
public void func_234177_a_(ServerWorld p_234177_1_, AnimalEntity p_234177_2_) {
@@ -1,11 +0,0 @@
--- a/net/minecraft/entity/passive/PandaEntity.java
+++ b/net/minecraft/entity/passive/PandaEntity.java
@@ -586,7 +586,7 @@
if (this.func_70631_g_()) {
this.func_175505_a(p_230254_1_, itemstack);
this.func_175501_a((int)((float)(-this.func_70874_b() / 20) * 0.1F), true);
- } else if (!this.field_70170_p.field_72995_K && this.func_70874_b() == 0 && this.func_204701_dC()) {
+ } else if (!this.field_70170_p.field_72995_K && this.func_70874_b() == 0 && this.func_213743_em()) {
this.func_175505_a(p_230254_1_, itemstack);
this.func_146082_f(p_230254_1_);
} else {
@@ -1,13 +0,0 @@
--- a/net/minecraft/entity/passive/TurtleEntity.java
+++ b/net/minecraft/entity/passive/TurtleEntity.java
@@ -235,8 +235,8 @@
this.func_184185_a(soundevent, 0.15F, 1.0F);
}
- public boolean func_204701_dC() {
- return super.func_204701_dC() && !this.func_203020_dx();
+ public boolean func_213743_em() {
+ return super.func_213743_em() && !this.func_203020_dx();
}
protected float func_203009_ad() {
@@ -1,11 +0,0 @@
--- a/net/minecraft/entity/passive/horse/LlamaEntity.java
+++ b/net/minecraft/entity/passive/horse/LlamaEntity.java
@@ -181,7 +181,7 @@
i = 90;
j = 6;
f = 10.0F;
- if (this.func_110248_bS() && this.func_70874_b() == 0 && this.func_204701_dC()) {
+ if (this.func_110248_bS() && this.func_70874_b() == 0 && this.func_213743_em()) {
flag = true;
this.func_146082_f(p_190678_1_);
}
@@ -8,16 +8,17 @@
public static final EntitySize field_213835_bs = EntitySize.func_220314_b(0.6F, 1.8F);
private static final Map<Pose, EntitySize> field_213836_b = ImmutableMap.<Pose, EntitySize>builder().put(Pose.STANDING, field_213835_bs).put(Pose.SLEEPING, field_213377_as).put(Pose.FALL_FLYING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SWIMMING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SPIN_ATTACK, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.CROUCHING, EntitySize.func_220314_b(0.6F, 1.5F)).put(Pose.DYING, EntitySize.func_220311_c(0.2F, 0.2F)).build();
private static final DataParameter<Float> field_184829_a = EntityDataManager.func_187226_a(PlayerEntity.class, DataSerializers.field_187193_c);
@@ -150,6 +151,8 @@
@@ -150,6 +151,9 @@
private final CooldownTracker field_184832_bU = this.func_184815_l();
@Nullable
public FishingBobberEntity field_71104_cf;
+ private final java.util.Collection<IFormattableTextComponent> prefixes = new java.util.LinkedList<>();
+ private final java.util.Collection<IFormattableTextComponent> suffixes = new java.util.LinkedList<>();
+ @Nullable private Pose forcedPose;
public PlayerEntity(World p_i241920_1_, BlockPos p_i241920_2_, float p_i241920_3_, GameProfile p_i241920_4_) {
super(EntityType.field_200729_aH, p_i241920_1_);
@@ -175,7 +178,7 @@
@@ -175,7 +179,7 @@
}
public static AttributeModifierMap.MutableAttribute func_234570_el_() {
@@ -26,7 +27,7 @@
}
protected void func_70088_a() {
@@ -189,6 +192,7 @@
@@ -189,6 +193,7 @@
}
public void func_70071_h_() {
@@ -34,7 +35,7 @@
this.field_70145_X = this.func_175149_v();
if (this.func_175149_v()) {
this.field_70122_E = false;
@@ -204,7 +208,7 @@
@@ -204,7 +209,7 @@
this.field_71076_b = 100;
}
@@ -43,7 +44,7 @@
this.func_225652_a_(false, true);
}
} else if (this.field_71076_b > 0) {
@@ -258,6 +262,7 @@
@@ -258,6 +263,7 @@
this.func_203041_m();
this.field_184832_bU.func_185144_a();
this.func_213832_dB();
@@ -51,7 +52,18 @@
}
public boolean func_226563_dT_() {
@@ -550,6 +555,7 @@
@@ -333,6 +339,10 @@
}
protected void func_213832_dB() {
+ if(forcedPose != null) {
+ this.func_213301_b(forcedPose);
+ return;
+ }
if (this.func_213298_c(Pose.SWIMMING)) {
Pose pose;
if (this.func_184613_cA()) {
@@ -550,6 +560,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -59,7 +71,7 @@
super.func_70645_a(p_70645_1_);
this.func_226264_Z_();
if (!this.func_175149_v()) {
@@ -603,12 +609,14 @@
@@ -603,12 +614,14 @@
}
public boolean func_225609_n_(boolean p_225609_1_) {
@@ -76,7 +88,7 @@
}
@Nullable
@@ -646,7 +654,12 @@
@@ -646,7 +659,12 @@
}
}
@@ -89,7 +101,7 @@
float f = this.field_71071_by.func_184438_a(p_184813_1_);
if (f > 1.0F) {
int i = EnchantmentHelper.func_185293_e(this);
@@ -688,11 +701,12 @@
@@ -688,11 +706,12 @@
f /= 5.0F;
}
@@ -103,7 +115,7 @@
}
public void func_70037_a(CompoundNBT p_70037_1_) {
@@ -767,6 +781,7 @@
@@ -767,6 +786,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -111,7 +123,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) {
@@ -798,7 +813,7 @@
@@ -798,7 +818,7 @@
protected void func_190629_c(LivingEntity p_190629_1_) {
super.func_190629_c(p_190629_1_);
@@ -120,7 +132,7 @@
this.func_190777_m(true);
}
@@ -819,7 +834,7 @@
@@ -819,7 +839,7 @@
}
protected void func_184590_k(float p_184590_1_) {
@@ -129,7 +141,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_71029_a(Stats.field_75929_E.func_199076_b(this.field_184627_bm.func_77973_b()));
}
@@ -829,6 +844,7 @@
@@ -829,6 +849,7 @@
Hand hand = this.func_184600_cs();
this.field_184627_bm.func_222118_a(i, this, (p_213833_1_) -> {
p_213833_1_.func_213334_d(hand);
@@ -137,7 +149,7 @@
});
if (this.field_184627_bm.func_190926_b()) {
if (hand == Hand.MAIN_HAND) {
@@ -847,10 +863,13 @@
@@ -847,10 +868,13 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -151,7 +163,7 @@
float f = p_70665_2_ - f2;
if (f > 0.0F && f < 3.4028235E37F) {
this.func_195067_a(Stats.field_212738_J, Math.round(f * 10.0F));
@@ -909,6 +928,8 @@
@@ -909,6 +933,8 @@
return ActionResultType.PASS;
} else {
@@ -160,7 +172,7 @@
ItemStack itemstack = this.func_184586_b(p_190775_2_);
ItemStack itemstack1 = itemstack.func_77946_l();
ActionResultType actionresulttype = p_190775_1_.func_184230_a(this, p_190775_2_);
@@ -917,6 +938,9 @@
@@ -917,6 +943,9 @@
itemstack.func_190920_e(itemstack1.func_190916_E());
}
@@ -170,7 +182,7 @@
return actionresulttype;
} else {
if (!itemstack.func_190926_b() && p_190775_1_ instanceof LivingEntity) {
@@ -927,6 +951,7 @@
@@ -927,6 +956,7 @@
ActionResultType actionresulttype1 = itemstack.func_111282_a_(this, (LivingEntity)p_190775_1_, p_190775_2_);
if (actionresulttype1.func_226246_a_()) {
if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) {
@@ -178,7 +190,7 @@
this.func_184611_a(p_190775_2_, ItemStack.field_190927_a);
}
@@ -1011,6 +1036,7 @@
@@ -1011,6 +1041,7 @@
}
public void func_71059_n(Entity p_71059_1_) {
@@ -186,7 +198,7 @@
if (p_71059_1_.func_70075_an()) {
if (!p_71059_1_.func_85031_j(this)) {
float f = (float)this.func_233637_b_(Attributes.field_233823_f_);
@@ -1038,8 +1064,10 @@
@@ -1038,8 +1069,10 @@
boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(Effects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof LivingEntity;
flag2 = flag2 && !this.func_70051_ag();
@@ -198,7 +210,7 @@
}
f = f + f1;
@@ -1127,8 +1155,10 @@
@@ -1127,8 +1160,10 @@
}
if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) {
@@ -209,7 +221,7 @@
this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a);
}
}
@@ -1170,7 +1200,7 @@
@@ -1170,7 +1205,7 @@
}
if (this.field_70146_Z.nextFloat() < f) {
@@ -218,7 +230,7 @@
this.func_184602_cy();
this.field_70170_p.func_72960_a(this, (byte)30);
}
@@ -1196,8 +1226,9 @@
@@ -1196,8 +1231,9 @@
public void func_71004_bE() {
}
@@ -230,7 +242,7 @@
this.field_71069_bz.func_75134_a(this);
if (this.field_71070_bA != null) {
this.field_71070_bA.func_75134_a(this);
@@ -1220,6 +1251,7 @@
@@ -1220,6 +1256,7 @@
}
public void func_225652_a_(boolean p_225652_1_, boolean p_225652_2_) {
@@ -238,7 +250,7 @@
super.func_213366_dy();
if (this.field_70170_p instanceof ServerWorld && p_225652_2_) {
((ServerWorld)this.field_70170_p).func_72854_c();
@@ -1242,8 +1274,8 @@
@@ -1242,8 +1279,8 @@
}
return optional;
@@ -249,7 +261,7 @@
} else if (!p_242374_3_) {
return Optional.empty();
} else {
@@ -1425,6 +1457,7 @@
@@ -1425,6 +1462,7 @@
public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) {
if (this.field_71075_bZ.field_75101_c) {
@@ -257,7 +269,7 @@
return false;
} else {
if (p_225503_1_ >= 2.0F) {
@@ -1438,7 +1471,7 @@
@@ -1438,7 +1476,7 @@
public boolean func_226566_ei_() {
if (!this.field_70122_E && !this.func_184613_cA() && !this.func_70090_H() && !this.func_70644_a(Effects.field_188424_y)) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
@@ -266,7 +278,7 @@
this.func_226567_ej_();
return true;
}
@@ -1479,6 +1512,10 @@
@@ -1479,6 +1517,10 @@
}
public void func_195068_e(int p_195068_1_) {
@@ -277,7 +289,7 @@
this.func_85039_t(p_195068_1_);
this.field_71106_cc += (float)p_195068_1_ / (float)this.func_71050_bK();
this.field_71067_cb = MathHelper.func_76125_a(this.field_71067_cb + p_195068_1_, 0, Integer.MAX_VALUE);
@@ -1507,7 +1544,7 @@
@@ -1507,7 +1549,7 @@
}
public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) {
@@ -286,7 +298,7 @@
if (this.field_71068_ca < 0) {
this.field_71068_ca = 0;
this.field_71106_cc = 0.0F;
@@ -1518,6 +1555,10 @@
@@ -1518,6 +1560,10 @@
}
public void func_82242_a(int p_82242_1_) {
@@ -297,7 +309,7 @@
this.field_71068_ca += p_82242_1_;
if (this.field_71068_ca < 0) {
this.field_71068_ca = 0;
@@ -1708,7 +1749,11 @@
@@ -1708,7 +1754,11 @@
}
public ITextComponent func_145748_c_() {
@@ -310,7 +322,7 @@
return this.func_208016_c(iformattabletextcomponent);
}
@@ -1987,4 +2032,45 @@
@@ -1987,4 +2037,62 @@
return this.field_221260_g;
}
}
@@ -354,5 +366,22 @@
+ else if (facing.func_176740_k().func_176722_c()) return playerEquipmentHandler.cast();
+ }
+ return super.getCapability(capability, facing);
+ }
+
+ /**
+ * Force a pose for the player. If set, the vanilla pose determination and clearance check is skipped. Make sure the pose is clear yourself (e.g. in PlayerTick).
+ * This has to be set just once, do not set it every tick.
+ * Make sure to clear (null) the pose if not required anymore and only use if necessary.
+ */
+ public void setForcedPose(@Nullable Pose pose) {
+ this.forcedPose = pose;
+ }
+
+ /**
+ * @return The forced pose if set, null otherwise
+ */
+ @Nullable
+ public Pose getForcedPose() {
+ return this.forcedPose;
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/player/ServerPlayerEntity.java
+++ b/net/minecraft/entity/player/ServerPlayerEntity.java
@@ -471,6 +471,7 @@
@@ -475,6 +475,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -8,7 +8,7 @@
boolean flag = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223609_l);
if (flag) {
ITextComponent itextcomponent = this.func_110142_aN().func_151521_b();
@@ -614,13 +615,14 @@
@@ -618,13 +619,14 @@
}
@Nullable
@@ -19,22 +19,23 @@
ServerWorld serverworld = this.func_71121_q();
RegistryKey<World> registrykey = serverworld.func_234923_W_();
- if (registrykey == World.field_234920_i_ && p_241206_1_.func_234923_W_() == World.field_234918_g_) {
+ if (registrykey == World.field_234920_i_ && p_241206_1_.func_234923_W_() == World.field_234918_g_ && teleporter instanceof net.minecraft.world.Teleporter) { //Forge: Fix non-vanilla teleporters triggering end credits
+ if (registrykey == World.field_234920_i_ && p_241206_1_.func_234923_W_() == World.field_234918_g_ && teleporter.isVanilla()) { //Forge: Fix non-vanilla teleporters triggering end credits
this.func_213319_R();
- this.func_71121_q().func_217434_e(this);
+ this.func_71121_q().removePlayer(this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom
if (!this.field_71136_j) {
this.field_71136_j = true;
this.field_71135_a.func_147359_a(new SChangeGameStatePacket(SChangeGameStatePacket.field_241768_e_, this.field_192040_cp ? 0.0F : 1.0F));
@@ -634,14 +636,15 @@
@@ -638,14 +640,15 @@
this.field_71135_a.func_147359_a(new SServerDifficultyPacket(iworldinfo.func_176130_y(), iworldinfo.func_176123_z()));
PlayerList playerlist = this.field_71133_b.func_184103_al();
playerlist.func_187243_f(this);
- serverworld.func_217434_e(this);
- this.field_70128_L = false;
- PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
+ serverworld.removeEntity(this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call.
+ this.revive();
PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
+ PortalInfo portalinfo = teleporter.getPortalInfo(this, p_241206_1_, this::func_241829_a);
if (portalinfo != null) {
+ Entity e = teleporter.placeEntity(this, serverworld, p_241206_1_, this.field_70177_z, spawnPortal -> {//Forge: Start vanilla logic
serverworld.func_217381_Z().func_76320_a("moving");
@@ -45,7 +46,7 @@
this.func_242110_a(p_241206_1_, new BlockPos(portalinfo.field_222505_a));
}
@@ -653,6 +656,9 @@
@@ -657,6 +660,9 @@
this.func_225653_b_(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c);
serverworld.func_217381_Z().func_76319_b();
this.func_213846_b(serverworld);
@@ -55,7 +56,7 @@
this.field_71134_c.func_73080_a(p_241206_1_);
this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ));
playerlist.func_72354_b(this, p_241206_1_);
@@ -666,6 +672,7 @@
@@ -670,6 +676,7 @@
this.field_71144_ck = -1;
this.field_71149_ch = -1.0F;
this.field_71146_ci = -1;
@@ -63,7 +64,7 @@
}
return this;
@@ -739,6 +746,9 @@
@@ -743,6 +750,9 @@
}
public Either<PlayerEntity.SleepResult, Unit> func_213819_a(BlockPos p_213819_1_) {
@@ -73,7 +74,7 @@
Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D);
if (!this.func_70608_bn() && this.func_70089_S()) {
if (!this.field_70170_p.func_230315_m_().func_236043_f_()) {
@@ -749,7 +759,7 @@
@@ -753,7 +763,7 @@
return Either.left(PlayerEntity.SleepResult.OBSTRUCTED);
} else {
this.func_242111_a(this.field_70170_p.func_234923_W_(), p_213819_1_, this.field_70177_z, false, true);
@@ -82,7 +83,7 @@
return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW);
} else {
if (!this.func_184812_l_()) {
@@ -783,6 +793,7 @@
@@ -787,6 +797,7 @@
}
private boolean func_241147_a_(BlockPos p_241147_1_, Direction p_241147_2_) {
@@ -90,7 +91,7 @@
return this.func_241158_g_(p_241147_1_) || this.func_241158_g_(p_241147_1_.func_177972_a(p_241147_2_.func_176734_d()));
}
@@ -882,6 +893,7 @@
@@ -886,6 +897,7 @@
this.field_71135_a.func_147359_a(new SOpenWindowPacket(container.field_75152_c, container.func_216957_a(), p_213829_1_.func_145748_c_()));
container.func_75132_a(this);
this.field_71070_bA = container;
@@ -98,7 +99,7 @@
return OptionalInt.of(this.field_71139_cq);
}
}
@@ -900,6 +912,7 @@
@@ -904,6 +916,7 @@
this.field_71135_a.func_147359_a(new SOpenHorseWindowPacket(this.field_71139_cq, p_184826_2_.func_70302_i_(), p_184826_1_.func_145782_y()));
this.field_71070_bA = new HorseInventoryContainer(this.field_71139_cq, this.field_71071_by, p_184826_2_, p_184826_1_);
this.field_71070_bA.func_75132_a(this);
@@ -106,7 +107,7 @@
}
public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) {
@@ -957,6 +970,7 @@
@@ -961,6 +974,7 @@
public void func_71128_l() {
this.field_71070_bA.func_75134_a(this);
@@ -114,7 +115,7 @@
this.field_71070_bA = this.field_71069_bz;
}
@@ -1081,6 +1095,13 @@
@@ -1085,6 +1099,13 @@
this.field_193110_cw = p_193104_1_.field_193110_cw;
this.func_192029_h(p_193104_1_.func_192023_dk());
this.func_192031_i(p_193104_1_.func_192025_dl());
@@ -128,7 +129,15 @@
}
protected void func_70670_a(EffectInstance p_70670_1_) {
@@ -1187,6 +1208,7 @@
@@ -1143,6 +1164,7 @@
}
public void func_71033_a(GameType p_71033_1_) {
+ if (!net.minecraftforge.common.ForgeHooks.onChangeGameMode(this, this.field_71134_c.func_73081_b(), p_71033_1_)) return;
this.field_71134_c.func_73076_a(p_71033_1_);
this.field_71135_a.func_147359_a(new SChangeGameStatePacket(SChangeGameStatePacket.field_241767_d_, (float)p_71033_1_.func_77148_a()));
if (p_71033_1_ == GameType.SPECTATOR) {
@@ -1191,6 +1213,7 @@
this.field_71140_co = p_147100_1_.func_149520_f();
this.func_184212_Q().func_187227_b(field_184827_bp, (byte)p_147100_1_.func_149521_d());
this.func_184212_Q().func_187227_b(field_184828_bq, (byte)(p_147100_1_.func_186991_f() == HandSide.LEFT ? 0 : 1));
@@ -136,7 +145,7 @@
}
public ChatVisibility func_147096_v() {
@@ -1297,14 +1319,14 @@
@@ -1301,14 +1324,14 @@
this.func_184210_p();
if (p_200619_1_ == this.field_70170_p) {
this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
@@ -154,7 +163,7 @@
this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
this.func_70029_a(p_200619_1_);
p_200619_1_.func_217446_a(this);
@@ -1313,6 +1335,7 @@
@@ -1317,6 +1340,7 @@
this.field_71134_c.func_73080_a(p_200619_1_);
this.field_71133_b.func_184103_al().func_72354_b(this, p_200619_1_);
this.field_71133_b.func_184103_al().func_72385_f(this);
@@ -162,7 +171,7 @@
}
}
@@ -1335,6 +1358,7 @@
@@ -1339,6 +1363,7 @@
}
public void func_242111_a(RegistryKey<World> p_242111_1_, @Nullable BlockPos p_242111_2_, float p_242111_3_, boolean p_242111_4_, boolean p_242111_5_) {
@@ -170,7 +179,7 @@
if (p_242111_2_ != null) {
boolean flag = p_242111_2_.equals(this.field_241138_cr_) && p_242111_1_.equals(this.field_241137_cq_);
if (p_242111_5_ && !flag) {
@@ -1387,6 +1411,8 @@
@@ -1391,6 +1416,8 @@
if (itementity == null) {
return null;
} else {
@@ -179,11 +188,10 @@
this.field_70170_p.func_217376_c(itementity);
ItemStack itemstack = itementity.func_92059_d();
if (p_146097_3_) {
@@ -1400,4 +1426,13 @@
return itementity;
@@ -1405,6 +1432,15 @@
}
}
+
+ private String language = "en_us";
+ /**
+ * Returns the language last reported by the player as their local language.
@@ -192,4 +200,7 @@
+ public String getLanguage() {
+ return this.language;
+ }
}
+
@Nullable
public IChatFilter func_244529_Q() {
return this.field_244528_co;
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/projectile/FireworkRocketEntity.java
+++ b/net/minecraft/entity/projectile/FireworkRocketEntity.java
@@ -155,6 +155,13 @@
@@ -156,6 +156,13 @@
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/fluid/FlowingFluid.java
+++ b/net/minecraft/fluid/FlowingFluid.java
@@ -159,7 +159,7 @@
BlockState blockstate = p_205576_1_.func_180495_p(blockpos);
FluidState fluidstate = blockstate.func_204520_s();
if (fluidstate.func_206886_c().func_207187_a(this) && this.func_212751_a(direction, p_205576_1_, p_205576_2_, p_205576_3_, blockpos, blockstate)) {
- if (fluidstate.func_206889_d()) {
+ if (fluidstate.func_206889_d() && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_205576_1_, blockpos, blockstate, this.func_205579_d())) {
++j;
}
@@ -167,7 +167,7 @@
}
}
- if (this.func_205579_d() && j >= 2) {
+ if (j >= 2) {
BlockState blockstate1 = p_205576_1_.func_180495_p(p_205576_2_.func_177977_b());
FluidState fluidstate1 = blockstate1.func_204520_s();
if (blockstate1.func_185904_a().func_76220_a() || this.func_211758_g(fluidstate1)) {
@@ -35,7 +35,7 @@
p_77659_2_.func_71029_a(Stats.field_75929_E.func_199076_b(this));
- p_77659_2_.func_184185_a(fluid.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187633_N : SoundEvents.field_187630_M, 1.0F, 1.0F);
+
+ SoundEvent soundevent = this.field_77876_a.getAttributes().getEmptySound();
+ SoundEvent soundevent = this.field_77876_a.getAttributes().getFillSound();
+ if (soundevent == null) soundevent = fluid.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187633_N : SoundEvents.field_187630_M;
+ p_77659_2_.func_184185_a(soundevent, 1.0F, 1.0F);
ItemStack itemstack1 = DrinkHelper.func_242398_a(itemstack, p_77659_2_, new ItemStack(fluid.func_204524_b()));
@@ -4,7 +4,7 @@
private final int field_196066_w;
private final float[] field_193352_x;
private final int field_196067_y;
+ private final net.minecraft.tags.ITag.INamedTag<Item> tag;
+ private final net.minecraftforge.common.Tags.IOptionalNamedTag<Item> tag;
private final int field_218390_z;
private DyeColor(int p_i50049_3_, String p_i50049_4_, int p_i50049_5_, MaterialColor p_i50049_6_, int p_i50049_7_, int p_i50049_8_) {
@@ -12,7 +12,7 @@
int j = (p_i50049_5_ & '\uff00') >> 8;
int k = (p_i50049_5_ & 255) >> 0;
this.field_196066_w = k << 16 | j << 8 | i << 0;
+ this.tag = net.minecraft.tags.ItemTags.func_199901_a("forge:dyes/" + p_i50049_4_);
+ this.tag = net.minecraft.tags.ItemTags.createOptional(new net.minecraft.util.ResourceLocation("forge", "dyes/" + p_i50049_4_));
this.field_193352_x = new float[]{(float)i / 255.0F, (float)j / 255.0F, (float)k / 255.0F};
this.field_196067_y = p_i50049_7_;
}
@@ -25,7 +25,7 @@
+ return field_193351_w;
+ }
+
+ public net.minecraft.tags.ITag.INamedTag<Item> getTag() {
+ public net.minecraftforge.common.Tags.IOptionalNamedTag<Item> getTag() {
+ return tag;
+ }
+
@@ -53,7 +53,7 @@
public boolean func_77616_k(ItemStack p_77616_1_) {
- return this.func_77639_j() == 1 && this.func_77645_m();
+ return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m();
+ return this.getItemStackLimit(p_77616_1_) == 1 && this.isDamageable(p_77616_1_);
}
protected static BlockRayTraceResult func_219968_a(World p_219968_0_, PlayerEntity p_219968_1_, RayTraceContext.FluidMode p_219968_2_) {
@@ -93,7 +93,7 @@
+
+ @Override
+ public boolean isRepairable(ItemStack stack) {
+ return canRepair && func_77645_m();
+ return canRepair && isDamageable(stack);
+ }
+
+ @Override
@@ -19,7 +19,7 @@
private static final Logger field_199558_c = LogManager.getLogger();
public static final ItemStack field_190927_a = new ItemStack((Item)null);
public static final DecimalFormat field_111284_a = Util.func_200696_a(new DecimalFormat("#.##"), (p_234699_0_) -> {
@@ -109,7 +112,10 @@
@@ -109,14 +112,18 @@
p_i231596_3_.ifPresent(this::func_77982_d);
}
@@ -30,8 +30,9 @@
+ this.capNBT = capNBT;
this.field_151002_e = p_i48204_1_ == null ? null : p_i48204_1_.func_199767_j();
this.field_77994_a = p_i48204_2_;
if (this.field_151002_e != null && this.field_151002_e.func_77645_m()) {
@@ -117,6 +123,7 @@
- if (this.field_151002_e != null && this.field_151002_e.func_77645_m()) {
+ if (this.field_151002_e != null && this.field_151002_e.isDamageable(this)) {
this.func_196085_b(this.func_77952_i());
}
this.func_190923_F();
@@ -48,7 +49,13 @@
this.field_151002_e = Registry.field_212630_s.func_82594_a(new ResourceLocation(p_i47263_1_.func_74779_i("id")));
this.field_77994_a = p_i47263_1_.func_74771_c("Count");
if (p_i47263_1_.func_150297_b("tag", 10)) {
@@ -137,6 +146,7 @@
@@ -132,11 +141,12 @@
this.func_77973_b().func_179215_a(p_i47263_1_);
}
- if (this.func_77973_b().func_77645_m()) {
+ if (this.func_77973_b().isDamageable(this)) {
this.func_196085_b(this.func_77952_i());
}
this.func_190923_F();
@@ -118,7 +125,7 @@
public boolean func_77984_f() {
- if (!this.field_190928_g && this.func_77973_b().func_77612_l() > 0) {
+ if (!this.field_190928_g && this.func_77973_b().getMaxDamage(this) > 0) {
+ if (!this.field_190928_g && this.func_77973_b().isDamageable(this)) {
CompoundNBT compoundnbt = this.func_77978_p();
return compoundnbt == null || !compoundnbt.func_74767_n("Unbreakable");
} else {
@@ -190,6 +197,15 @@
}
}
@@ -479,7 +502,7 @@
public void func_77982_d(@Nullable CompoundNBT p_77982_1_) {
this.field_77990_d = p_77982_1_;
- if (this.func_77973_b().func_77645_m()) {
+ if (this.func_77973_b().isDamageable(this)) {
this.func_196085_b(this.func_77952_i());
}
@@ -673,6 +696,7 @@
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/item/MerchantOffer.java
+++ b/net/minecraft/item/MerchantOffer.java
@@ -178,7 +178,7 @@
return true;
} else {
ItemStack itemstack = p_222201_1_.func_77946_l();
- if (itemstack.func_77973_b().func_77645_m()) {
+ if (itemstack.func_77973_b().isDamageable(itemstack)) {
itemstack.func_196085_b(itemstack.func_77952_i());
}
@@ -20,7 +20,7 @@
this.field_199807_b = p_i49381_1_.toArray((p_209360_0_) -> {
return new Ingredient.IItemList[p_209360_0_];
});
+ this.isSimple = !net.minecraftforge.fml.ModLoader.isDataGenRunning() && !Arrays.stream(field_199807_b).anyMatch(list -> list.func_199799_a().stream().anyMatch(stack -> stack.func_77973_b().func_77645_m()));
+ this.isSimple = !net.minecraftforge.fml.DatagenModLoader.isRunningDataGen() && !Arrays.stream(field_199807_b).anyMatch(list -> list.func_199799_a().stream().anyMatch(stack -> stack.func_77973_b().isDamageable(stack)));
+ Ingredient.INSTANCES.add(this);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/NetworkManager.java
+++ b/net/minecraft/network/NetworkManager.java
@@ -75,6 +75,7 @@
@@ -74,6 +74,7 @@
private float field_211397_t;
private int field_211398_u;
private boolean field_211399_v;
@@ -8,7 +8,7 @@
public NetworkManager(PacketDirection p_i46004_1_) {
this.field_179294_g = p_i46004_1_;
@@ -84,6 +85,7 @@
@@ -83,6 +84,7 @@
super.channelActive(p_channelActive_1_);
this.field_150746_k = p_channelActive_1_.channel();
this.field_150743_l = this.field_150746_k.remoteAddress();
@@ -16,7 +16,7 @@
try {
this.func_150723_a(ProtocolType.HANDSHAKING);
@@ -172,7 +174,7 @@
@@ -171,7 +173,7 @@
++this.field_211395_r;
if (protocoltype1 != protocoltype) {
field_150735_g.debug("Disabled auto read");
@@ -25,7 +25,7 @@
}
if (this.field_150746_k.eventLoop().inEventLoop()) {
@@ -260,7 +262,9 @@
@@ -259,7 +261,9 @@
@OnlyIn(Dist.CLIENT)
public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) {
@@ -35,7 +35,7 @@
Class<? extends SocketChannel> oclass;
LazyValue<? extends EventLoopGroup> lazyvalue;
if (Epoll.isAvailable() && p_181124_2_) {
@@ -287,6 +291,7 @@
@@ -286,6 +290,7 @@
@OnlyIn(Dist.CLIENT)
public static NetworkManager func_150722_a(SocketAddress p_150722_0_) {
final NetworkManager networkmanager = new NetworkManager(PacketDirection.CLIENTBOUND);
@@ -43,7 +43,7 @@
(new Bootstrap()).group(field_179296_e.func_179281_c()).handler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel p_initChannel_1_) throws Exception {
p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager);
@@ -377,6 +382,14 @@
@@ -376,6 +381,14 @@
return this.field_211397_t;
}
@@ -25,11 +25,13 @@
if (p_150788_1_.func_190926_b()) {
this.writeBoolean(false);
} else {
@@ -301,7 +310,7 @@
@@ -300,8 +309,8 @@
this.func_150787_b(Item.func_150891_b(item));
this.writeByte(p_150788_1_.func_190916_E());
CompoundNBT compoundnbt = null;
if (item.func_77645_m() || item.func_77651_p()) {
- if (item.func_77645_m() || item.func_77651_p()) {
- compoundnbt = p_150788_1_.func_77978_p();
+ if (item.isDamageable(p_150788_1_) || item.func_77651_p()) {
+ compoundnbt = limitedTag ? p_150788_1_.getShareTag() : p_150788_1_.func_77978_p();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/login/ServerLoginNetHandler.java
+++ b/net/minecraft/network/login/ServerLoginNetHandler.java
@@ -53,7 +53,13 @@
@@ -55,7 +55,13 @@
}
public void func_73660_a() {
@@ -15,48 +15,48 @@
this.func_147326_c();
} else if (this.field_147328_g == ServerLoginNetHandler.State.DELAY_ACCEPT) {
ServerPlayerEntity serverplayerentity = this.field_147327_f.func_184103_al().func_177451_a(this.field_147337_i.getId());
@@ -128,7 +134,7 @@
@@ -130,7 +136,7 @@
this.field_147328_g = ServerLoginNetHandler.State.KEY;
this.field_147333_a.func_179290_a(new SEncryptionRequestPacket("", this.field_147327_f.func_71250_E().getPublic(), this.field_147330_e));
this.field_147333_a.func_179290_a(new SEncryptionRequestPacket("", this.field_147327_f.func_71250_E().getPublic().getEncoded(), this.field_147330_e));
} else {
- this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
+ this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
}
}
@@ -142,7 +148,7 @@
this.field_147335_k = p_147315_1_.func_149300_a(privatekey);
this.field_147328_g = ServerLoginNetHandler.State.AUTHENTICATING;
this.field_147333_a.func_150727_a(this.field_147335_k);
- Thread thread = new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) {
+ Thread thread = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, "User Authenticator #" + field_147331_b.incrementAndGet()) {
public void run() {
GameProfile gameprofile = ServerLoginNetHandler.this.field_147337_i;
@@ -155,7 +161,7 @@
throw new IllegalStateException("Protocol error", cryptexception);
}
@@ -151,11 +157,11 @@
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.func_191235_a());
if (ServerLoginNetHandler.this.field_147337_i != null) {
ServerLoginNetHandler.field_147332_c.info("UUID of player {} is {}", ServerLoginNetHandler.this.field_147337_i.getName(), ServerLoginNetHandler.this.field_147337_i.getId());
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
- Thread thread = new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) {
+ Thread thread = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, "User Authenticator #" + field_147331_b.incrementAndGet()) {
public void run() {
GameProfile gameprofile = ServerLoginNetHandler.this.field_147337_i;
@@ -163,11 +169,11 @@
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.func_191235_a());
if (ServerLoginNetHandler.this.field_147337_i != null) {
ServerLoginNetHandler.field_147332_c.info("UUID of player {} is {}", ServerLoginNetHandler.this.field_147337_i.getName(), ServerLoginNetHandler.this.field_147337_i.getId());
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
} else if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
ServerLoginNetHandler.field_147332_c.warn("Failed to verify username but will let them in anyway!");
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
} else if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
ServerLoginNetHandler.field_147332_c.warn("Failed to verify username but will let them in anyway!");
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
} else {
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.unverified_username"));
ServerLoginNetHandler.field_147332_c.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
@@ -164,7 +170,7 @@
if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
ServerLoginNetHandler.field_147332_c.warn("Authentication servers are down but will let them in anyway!");
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
} else {
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.unverified_username"));
ServerLoginNetHandler.field_147332_c.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
@@ -176,7 +182,7 @@
if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
ServerLoginNetHandler.field_147332_c.warn("Authentication servers are down but will let them in anyway!");
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
} else {
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.authservers_down"));
ServerLoginNetHandler.field_147332_c.error("Couldn't verify username because servers are unavailable");
@@ -185,6 +191,7 @@
} else {
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.authservers_down"));
ServerLoginNetHandler.field_147332_c.error("Couldn't verify username because servers are unavailable");
@@ -196,6 +202,7 @@
}
public void func_209526_a(CCustomPayloadLoginPacket p_209526_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/play/ServerPlayNetHandler.java
+++ b/net/minecraft/network/play/ServerPlayNetHandler.java
@@ -348,9 +348,11 @@
@@ -391,9 +391,11 @@
}
entity.func_70080_a(d3, d4, d5, f, f1);
@@ -12,7 +12,7 @@
this.field_147371_a.func_179290_a(new SMoveVehiclePacket(entity));
return;
}
@@ -367,7 +369,7 @@
@@ -410,7 +412,7 @@
}
private boolean func_241162_a_(Entity p_241162_1_) {
@@ -21,7 +21,7 @@
}
public void func_184339_a(CConfirmTeleportPacket p_184339_1_) {
@@ -881,7 +883,9 @@
@@ -950,7 +952,9 @@
Direction direction = blockraytraceresult.func_216354_b();
this.field_147369_b.func_143004_u();
if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) {
@@ -32,18 +32,18 @@
ActionResultType actionresulttype = this.field_147369_b.field_71134_c.func_219441_a(this.field_147369_b, serverworld, itemstack, hand, blockraytraceresult);
if (direction == Direction.UP && !actionresulttype.func_226246_a_() && blockpos.func_177956_o() >= this.field_147367_d.func_71207_Z() - 1 && func_241166_a_(this.field_147369_b, itemstack)) {
ITextComponent itextcomponent = (new TranslationTextComponent("build.tooHigh", this.field_147367_d.func_71207_Z())).func_240699_a_(TextFormatting.RED);
@@ -1014,7 +1018,9 @@
if (s.startsWith("/")) {
this.func_147361_d(s);
@@ -1097,7 +1101,9 @@
if (p_244548_1_.startsWith("/")) {
this.func_147361_d(p_244548_1_);
} else {
- ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), s);
+ ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s));
+ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, itextcomponent);
- ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), p_244548_1_);
+ ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(p_244548_1_));
+ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, p_244548_1_, itextcomponent);
+ if (itextcomponent == null) return;
this.field_147367_d.func_184103_al().func_232641_a_(itextcomponent, ChatType.CHAT, this.field_147369_b.func_110124_au());
}
@@ -1104,6 +1110,7 @@
@@ -1187,6 +1193,7 @@
if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT) {
optional = Optional.of(this.field_147369_b.func_190775_a(entity, hand));
} else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT_AT) {
@@ -51,7 +51,7 @@
optional = Optional.of(entity.func_184199_a(this.field_147369_b, p_147340_1_.func_179712_b(), hand));
} else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.ATTACK) {
if (entity instanceof ItemEntity || entity instanceof ExperienceOrbEntity || entity instanceof AbstractArrowEntity || entity == this.field_147369_b) {
@@ -1315,6 +1322,8 @@
@@ -1402,6 +1409,8 @@
}
public void func_147349_a(CCustomPayloadPacket p_147349_1_) {
@@ -0,0 +1,22 @@
--- a/net/minecraft/network/rcon/ClientThread.java
+++ b/net/minecraft/network/rcon/ClientThread.java
@@ -116,13 +116,14 @@
}
private void func_72655_a(int p_72655_1_, String p_72655_2_) throws IOException {
- int i = p_72655_2_.length();
-
+ byte[] whole = p_72655_2_.getBytes(StandardCharsets.UTF_8);
+ int i = whole.length;
+ int start = 0;
do {
int j = 4096 <= i ? 4096 : i;
- this.func_72654_a(p_72655_1_, 0, p_72655_2_.substring(0, j));
- p_72655_2_ = p_72655_2_.substring(j);
- i = p_72655_2_.length();
+ this.func_72654_a(p_72655_1_, 0, new String(java.util.Arrays.copyOfRange(whole, start, j+start), StandardCharsets.UTF_8));
+ i -= j;
+ start += j;
} while(0 != i);
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/network/rcon/RConConsoleSource.java
+++ b/net/minecraft/network/rcon/RConConsoleSource.java
@@ -34,7 +34,7 @@
}
public void func_145747_a(ITextComponent p_145747_1_, UUID p_145747_2_) {
- this.field_70009_b.append(p_145747_1_.getString());
+ this.field_70009_b.append(p_145747_1_.getString()).append("\n"); // FIX MC-7569 - RCON has no newlines in multiline output
}
public boolean func_195039_a() {
@@ -1,11 +1,27 @@
--- a/net/minecraft/potion/Potion.java
+++ b/net/minecraft/potion/Potion.java
@@ -6,7 +6,7 @@
@@ -6,7 +6,8 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
-public class Potion {
+public class Potion extends net.minecraftforge.registries.ForgeRegistryEntry<Potion> {
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Potion> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.POTION_TYPES));
private final String field_185179_d;
private final ImmutableList<EffectInstance> field_185180_e;
@@ -23,6 +24,14 @@
this.field_185180_e = ImmutableList.copyOf(p_i46740_2_);
}
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ public boolean isIn(net.minecraft.tags.ITag<Potion> tag) {
+ return tag.func_230235_a_(this);
+ }
+
public String func_185174_b(String p_185174_1_) {
return p_185174_1_ + (this.field_185179_d == null ? Registry.field_212621_j.func_177774_c(this).func_110623_a() : this.field_185179_d);
}
@@ -8,3 +8,11 @@
}
public FunctionReloader func_240960_a_() {
@@ -81,6 +82,7 @@
public void func_240971_i_() {
this.field_240955_e_.func_242231_a().func_242212_e();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent.CustomTagTypes(field_240955_e_.func_242231_a()));
}
public void close() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
@@ -72,6 +72,8 @@
@@ -71,6 +71,8 @@
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1);
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
OptionSpec<String> optionspec13 = optionparser.nonOptions();
@@ -9,7 +9,7 @@
try {
OptionSet optionset = optionparser.parse(p_main_0_);
@@ -79,33 +81,38 @@
@@ -78,33 +80,38 @@
optionparser.printHelpOn(System.err);
return;
}
@@ -43,7 +43,7 @@
- }
-
File file1 = new File(optionset.valueOf(optionspec9));
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY);
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(file1, MinecraftServer.field_152367_a.getName()));
@@ -55,7 +55,7 @@
SaveFormat saveformat = SaveFormat.func_237269_a_(file1.toPath());
SaveFormat.LevelSave saveformat$levelsave = saveformat.func_237274_c_(s);
MinecraftServer.func_240777_a_(saveformat$levelsave);
@@ -170,6 +177,7 @@
@@ -169,6 +176,7 @@
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
dedicatedserver.func_71263_m(true);
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -225,7 +225,7 @@
@@ -228,7 +228,7 @@
public static <S extends MinecraftServer> S func_240784_a_(Function<Thread, S> p_240784_0_) {
AtomicReference<S> atomicreference = new AtomicReference<>();
@@ -9,7 +9,7 @@
atomicreference.get().func_240802_v_();
}, "Server thread");
thread.setUncaughtExceptionHandler((p_240779_0_, p_240779_1_) -> {
@@ -373,6 +373,7 @@
@@ -376,6 +376,7 @@
worldborder.func_177737_a(new IBorderListener.Impl(serverworld1.func_175723_af()));
this.field_71305_c.put(registrykey1, serverworld1);
}
@@ -17,7 +17,7 @@
}
}
@@ -384,6 +385,7 @@
@@ -387,6 +388,7 @@
} else if (p_240786_3_) {
p_240786_1_.func_176143_a(BlockPos.field_177992_a.func_177984_a(), 0.0F);
} else {
@@ -25,7 +25,15 @@
BiomeProvider biomeprovider = chunkgenerator.func_202090_b();
Random random = new Random(p_240786_0_.func_72905_C());
BlockPos blockpos = biomeprovider.func_225531_a_(0, p_240786_0_.func_181545_F(), 0, 256, (p_244265_0_) -> {
@@ -563,6 +565,7 @@
@@ -452,6 +454,7 @@
}
private void func_213186_a(IChunkStatusListener p_213186_1_) {
+ net.minecraftforge.common.world.StructureSpawnManager.gatherEntitySpawns();
ServerWorld serverworld = this.func_241755_D_();
field_147145_h.info("Preparing start region for dimension {}", (Object)serverworld.func_234923_W_().func_240901_a_());
BlockPos blockpos = serverworld.func_241135_u_();
@@ -566,6 +569,7 @@
for(ServerWorld serverworld1 : this.func_212370_w()) {
if (serverworld1 != null) {
try {
@@ -33,7 +41,7 @@
serverworld1.close();
} catch (IOException ioexception1) {
field_147145_h.error("Exception closing the level", (Throwable)ioexception1);
@@ -611,6 +614,7 @@
@@ -614,6 +618,7 @@
protected void func_240802_v_() {
try {
if (this.func_71197_b()) {
@@ -41,7 +49,7 @@
this.field_211151_aa = Util.func_211177_b();
this.field_147147_p.func_151315_a(new StringTextComponent(this.field_71286_C));
this.field_147147_p.func_151321_a(new ServerStatusResponse.Version(SharedConstants.func_215069_a().getName(), SharedConstants.func_215069_a().getProtocolVersion()));
@@ -640,7 +644,10 @@
@@ -643,7 +648,10 @@
this.func_240795_b_(longtickdetector);
this.field_71296_Q = true;
}
@@ -52,7 +60,7 @@
this.func_71228_a((CrashReport)null);
}
} catch (Throwable throwable1) {
@@ -659,6 +666,7 @@
@@ -662,6 +670,7 @@
field_147145_h.error("We were unable to save this crash report to disk.");
}
@@ -60,7 +68,7 @@
this.func_71228_a(crashreport);
} finally {
try {
@@ -667,6 +675,7 @@
@@ -670,6 +679,7 @@
} catch (Throwable throwable) {
field_147145_h.error("Exception stopping the server", throwable);
} finally {
@@ -68,7 +76,7 @@
this.func_71240_o();
}
@@ -768,6 +777,7 @@
@@ -771,6 +781,7 @@
protected void func_71217_p(BooleanSupplier p_71217_1_) {
long i = Util.func_211178_c();
@@ -76,7 +84,7 @@
++this.field_71315_w;
this.func_71190_q(p_71217_1_);
if (i - this.field_147142_T >= 5000000000L) {
@@ -782,6 +792,7 @@
@@ -785,6 +796,7 @@
Collections.shuffle(Arrays.asList(agameprofile));
this.field_147147_p.func_151318_b().func_151330_a(agameprofile);
@@ -84,7 +92,7 @@
}
if (this.field_71315_w % 6000 == 0) {
@@ -809,6 +820,7 @@
@@ -812,6 +824,7 @@
long i1 = Util.func_211178_c();
this.field_213215_ap.func_181747_a(i1 - i);
this.field_71304_b.func_76319_b();
@@ -92,7 +100,7 @@
}
protected void func_71190_q(BooleanSupplier p_71190_1_) {
@@ -816,7 +828,8 @@
@@ -819,7 +832,8 @@
this.func_193030_aL().func_73660_a();
this.field_71304_b.func_219895_b("levels");
@@ -102,7 +110,7 @@
this.field_71304_b.func_194340_a(() -> {
return serverworld + " " + serverworld.func_234923_W_().func_240901_a_();
});
@@ -827,6 +840,7 @@
@@ -830,6 +844,7 @@
}
this.field_71304_b.func_76320_a("tick");
@@ -110,7 +118,7 @@
try {
serverworld.func_72835_b(p_71190_1_);
@@ -835,9 +849,11 @@
@@ -838,9 +853,11 @@
serverworld.func_72914_a(crashreport);
throw new ReportedException(crashreport);
}
@@ -122,7 +130,7 @@
}
this.field_71304_b.func_219895_b("connection");
@@ -912,7 +928,7 @@
@@ -915,7 +932,7 @@
}
public String getServerModName() {
@@ -131,7 +139,7 @@
}
public CrashReport func_71230_b(CrashReport p_71230_1_) {
@@ -925,6 +941,7 @@
@@ -928,6 +945,7 @@
p_71230_1_.func_85056_g().func_189529_a("Data Packs", () -> {
StringBuilder stringbuilder = new StringBuilder();
@@ -139,7 +147,7 @@
for(ResourcePackInfo resourcepackinfo : this.field_195577_ad.func_198980_d()) {
if (stringbuilder.length() > 0) {
stringbuilder.append(", ");
@@ -1271,6 +1288,7 @@
@@ -1280,6 +1298,7 @@
this.func_184103_al().func_193244_w();
this.field_200258_al.func_240946_a_(this.field_195576_ac.func_240960_a_());
this.field_240765_ak_.func_195410_a(this.field_195576_ac.func_240970_h_());
@@ -147,7 +155,7 @@
}, this);
if (this.func_213162_bc()) {
this.func_213161_c(completablefuture::isDone);
@@ -1280,10 +1298,13 @@
@@ -1289,10 +1308,13 @@
}
public static DatapackCodec func_240772_a_(ResourcePackList p_240772_0_, DatapackCodec p_240772_1_, boolean p_240772_2_) {
@@ -163,7 +171,7 @@
} else {
Set<String> set = Sets.newLinkedHashSet();
@@ -1433,6 +1454,31 @@
@@ -1442,6 +1464,31 @@
public abstract boolean func_213199_b(GameProfile p_213199_1_);
@@ -195,7 +203,7 @@
public void func_223711_a(Path p_223711_1_) throws IOException {
Path path = p_223711_1_.resolve("levels");
@@ -1561,6 +1607,10 @@
@@ -1570,6 +1617,10 @@
return this.field_240768_i_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -76,6 +76,7 @@
@@ -81,6 +81,7 @@
public boolean func_71197_b() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@@ -8,7 +8,7 @@
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
String s1;
@@ -158,11 +159,13 @@
@@ -162,11 +163,13 @@
SkullTileEntity.func_184293_a(this.func_152358_ax());
SkullTileEntity.func_184294_a(this.func_147130_as());
PlayerProfileCache.func_187320_a(this.func_71266_T());
@@ -22,7 +22,7 @@
if (serverproperties.field_219027_u != null) {
this.func_200252_aR().func_223585_a(GameRules.field_223620_w).func_223570_a(serverproperties.field_219027_u, this);
}
@@ -186,11 +189,12 @@
@@ -190,11 +193,12 @@
}
Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a());
@@ -36,7 +36,7 @@
}
}
@@ -507,6 +511,11 @@
@@ -515,6 +519,11 @@
return false;
}
@@ -1,10 +1,10 @@
--- a/net/minecraft/server/dedicated/ServerHangWatchdog.java
+++ b/net/minecraft/server/dedicated/ServerHangWatchdog.java
@@ -36,7 +36,7 @@
@@ -40,7 +40,7 @@
ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();
ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true);
StringBuilder stringbuilder = new StringBuilder();
- Error error = new Error();
- Error error = new Error("Watchdog");
+ Error error = new Error(String.format("ServerHangWatchdog detected that a single server tick took %.2f seconds (should be max 0.05)", k / 1000F)); // Forge: don't just make a crash report with a seemingly-inexplicable Error
for(ThreadInfo threadinfo : athreadinfo) {
@@ -1,9 +1,9 @@
--- a/net/minecraft/server/integrated/IntegratedServer.java
+++ b/net/minecraft/server/integrated/IntegratedServer.java
@@ -58,9 +58,10 @@
@@ -56,9 +56,10 @@
this.func_71188_g(true);
this.func_71245_h(true);
field_147148_h.info("Generating keypair");
this.func_71253_a(CryptManager.func_75891_b());
this.func_244801_P();
+ if (!net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(this)) return false;
this.func_240800_l__();
this.func_71205_p(this.func_71214_G() + " - " + this.func_240793_aU_().func_76065_j());
@@ -12,7 +12,7 @@
}
public void func_71217_p(BooleanSupplier p_71217_1_) {
@@ -174,6 +175,7 @@
@@ -172,6 +173,7 @@
}
public void func_71263_m(boolean p_71263_1_) {
@@ -16,7 +16,15 @@
GameRules gamerules = serverworld1.func_82736_K();
boolean flag = gamerules.func_223586_b(GameRules.field_226683_z_);
boolean flag1 = gamerules.func_223586_b(GameRules.field_223612_o);
@@ -170,7 +172,7 @@
@@ -156,6 +158,7 @@
serverplaynethandler.func_147359_a(new SHeldItemChangePacket(p_72355_2_.field_71071_by.field_70461_c));
serverplaynethandler.func_147359_a(new SUpdateRecipesPacket(this.field_72400_f.func_199529_aN().func_199510_b()));
serverplaynethandler.func_147359_a(new STagsListPacket(this.field_72400_f.func_244266_aF()));
+ net.minecraftforge.fml.network.NetworkHooks.syncCustomTagTypes(p_72355_2_, this.field_72400_f.func_244266_aF());
this.func_187243_f(p_72355_2_);
p_72355_2_.func_147099_x().func_150877_d();
p_72355_2_.func_192037_E().func_192826_c(p_72355_2_);
@@ -170,7 +173,7 @@
this.func_232641_a_(iformattabletextcomponent.func_240699_a_(TextFormatting.YELLOW), ChatType.SYSTEM, Util.field_240973_b_);
serverplaynethandler.func_147364_a(p_72355_2_.func_226277_ct_(), p_72355_2_.func_226278_cu_(), p_72355_2_.func_226281_cx_(), p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
@@ -25,7 +33,7 @@
this.field_177454_f.put(p_72355_2_.func_110124_au(), p_72355_2_);
this.func_148540_a(new SPlayerListItemPacket(SPlayerListItemPacket.Action.ADD_PLAYER, p_72355_2_));
@@ -225,6 +227,7 @@
@@ -225,6 +228,7 @@
}
p_72355_2_.func_71116_b();
@@ -33,7 +41,7 @@
}
protected void func_96456_a(ServerScoreboard p_96456_1_, ServerPlayerEntity p_96456_2_) {
@@ -285,6 +288,7 @@
@@ -285,6 +289,7 @@
compoundnbt1 = compoundnbt;
p_72380_1_.func_70020_e(compoundnbt);
field_148546_d.debug("loading single player");
@@ -41,7 +49,7 @@
} else {
compoundnbt1 = this.field_72412_k.func_237336_b_(p_72380_1_);
}
@@ -293,6 +297,7 @@
@@ -293,6 +298,7 @@
}
protected void func_72391_b(ServerPlayerEntity p_72391_1_) {
@@ -49,7 +57,7 @@
this.field_72412_k.func_237335_a_(p_72391_1_);
ServerStatisticsManager serverstatisticsmanager = this.field_148547_k.get(p_72391_1_.func_110124_au());
if (serverstatisticsmanager != null) {
@@ -307,6 +312,7 @@
@@ -307,6 +313,7 @@
}
public void func_72367_e(ServerPlayerEntity p_72367_1_) {
@@ -57,7 +65,7 @@
ServerWorld serverworld = p_72367_1_.func_71121_q();
p_72367_1_.func_195066_a(Stats.field_75947_j);
this.func_72391_b(p_72367_1_);
@@ -330,7 +336,7 @@
@@ -330,7 +337,7 @@
p_72367_1_.func_213319_R();
serverworld.func_217434_e(p_72367_1_);
p_72367_1_.func_192039_O().func_192745_a();
@@ -66,7 +74,7 @@
this.field_72400_f.func_201300_aS().func_201382_b(p_72367_1_);
UUID uuid = p_72367_1_.func_110124_au();
ServerPlayerEntity serverplayerentity = this.field_177454_f.get(uuid);
@@ -400,8 +406,8 @@
@@ -400,8 +407,8 @@
}
public ServerPlayerEntity func_232644_a_(ServerPlayerEntity p_232644_1_, boolean p_232644_2_) {
@@ -77,7 +85,7 @@
BlockPos blockpos = p_232644_1_.func_241140_K_();
float f = p_232644_1_.func_242109_L();
boolean flag = p_232644_1_.func_241142_M_();
@@ -424,6 +430,7 @@
@@ -424,6 +431,7 @@
ServerPlayerEntity serverplayerentity = new ServerPlayerEntity(this.field_72400_f, serverworld1, p_232644_1_.func_146103_bH(), playerinteractionmanager);
serverplayerentity.field_71135_a = p_232644_1_.field_71135_a;
serverplayerentity.func_193104_a(p_232644_1_, p_232644_2_);
@@ -85,7 +93,7 @@
serverplayerentity.func_145769_d(p_232644_1_.func_145782_y());
serverplayerentity.func_184819_a(p_232644_1_.func_184591_cq());
@@ -465,10 +472,11 @@
@@ -465,10 +473,11 @@
this.func_72354_b(serverplayerentity, serverworld1);
this.func_187243_f(serverplayerentity);
serverworld1.func_217433_d(serverplayerentity);
@@ -98,7 +106,7 @@
if (flag2) {
serverplayerentity.field_71135_a.func_147359_a(new SPlaySoundEffectPacket(SoundEvents.field_232818_ms_, SoundCategory.BLOCKS, (double)blockpos.func_177958_n(), (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p(), 1.0F, 1.0F));
}
@@ -786,7 +794,7 @@
@@ -786,7 +795,7 @@
}
public List<ServerPlayerEntity> func_181057_v() {
@@ -107,7 +115,15 @@
}
@Nullable
@@ -816,4 +824,12 @@
@@ -804,6 +813,7 @@
}
this.func_148540_a(new STagsListPacket(this.field_72400_f.func_244266_aF()));
+ net.minecraftforge.fml.network.NetworkHooks.syncCustomTagTypes(this.field_72400_f.func_244266_aF());
SUpdateRecipesPacket supdaterecipespacket = new SUpdateRecipesPacket(this.field_72400_f.func_199529_aN().func_199510_b());
for(ServerPlayerEntity serverplayerentity : this.field_72404_b) {
@@ -816,4 +826,12 @@
public boolean func_206257_x() {
return this.field_72407_n;
}
@@ -0,0 +1,17 @@
--- a/net/minecraft/tags/BlockTags.java
+++ b/net/minecraft/tags/BlockTags.java
@@ -97,6 +97,14 @@
return field_199899_c.func_232937_a_(p_199894_0_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Block> createOptional(ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Block> createOptional(ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Block>> defaults) {
+ return field_199899_c.createOptional(name, defaults);
+ }
+
public static ITagCollection<Block> func_199896_a() {
return field_199899_c.func_232939_b_();
}
@@ -0,0 +1,17 @@
--- a/net/minecraft/tags/EntityTypeTags.java
+++ b/net/minecraft/tags/EntityTypeTags.java
@@ -16,6 +16,14 @@
return field_219766_c.func_232937_a_(p_232896_0_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<EntityType<?>> createOptional(ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<EntityType<?>> createOptional(ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<EntityType<?>>> defaults) {
+ return field_219766_c.createOptional(name, defaults);
+ }
+
public static ITagCollection<EntityType<?>> func_219762_a() {
return field_219766_c.func_232939_b_();
}
@@ -1,6 +1,17 @@
--- a/net/minecraft/tags/FluidTags.java
+++ b/net/minecraft/tags/FluidTags.java
@@ -16,4 +16,9 @@
@@ -13,7 +13,20 @@
return field_206961_c.func_232937_a_(p_206956_0_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Fluid> createOptional(ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Fluid> createOptional(ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Fluid>> defaults) {
+ return field_206961_c.createOptional(name, defaults);
+ }
+
public static List<? extends ITag.INamedTag<Fluid>> func_241280_c_() {
return field_206961_c.func_241288_c_();
}
@@ -32,29 +32,16 @@
list.forEach((p_232958_2_) -> {
this.field_232953_a_.add(new ITag.Proxy(p_232958_2_, p_232956_2_));
});
@@ -135,11 +146,20 @@
JsonArray jsonarray = new JsonArray();
for(ITag.Proxy itag$proxy : this.field_232953_a_) {
+ if(!(itag$proxy.field_232966_a_ instanceof net.minecraftforge.common.data.IOptionalTagEntry))
@@ -138,7 +149,7 @@
itag$proxy.func_232968_a_().func_230237_a_(jsonarray);
}
- jsonobject.addProperty("replace", false);
+ JsonArray optopnals = new JsonArray();
+ func_232962_b_()
+ .map(e -> e.field_232966_a_)
+ .filter(e -> e instanceof net.minecraftforge.common.data.IOptionalTagEntry)
+ .forEach(e -> e.func_230237_a_(optopnals));
+
+ jsonobject.addProperty("replace", replace);
jsonobject.add("values", jsonarray);
+ if (optopnals.size() > 0)
+ jsonobject.add("optional", optopnals);
return jsonobject;
}
}
@@ -178,6 +198,7 @@
@@ -178,6 +189,7 @@
public String toString() {
return this.field_232969_a_.toString();
}
@@ -62,10 +49,11 @@
}
public static class OptionalItemEntry implements ITag.ITagEntry {
@@ -278,5 +299,6 @@
@@ -278,5 +290,7 @@
public String toString() {
return "#" + this.field_200163_a;
}
+ @Override public boolean equals(Object o) { return o == this || (o instanceof ITag.TagEntry && java.util.Objects.equals(this.field_200163_a, ((ITag.TagEntry) o).field_200163_a)); }
+ public ResourceLocation getId() { return field_200163_a; }
}
}
@@ -1,10 +1,52 @@
--- a/net/minecraft/tags/ITagCollectionSupplier.java
+++ b/net/minecraft/tags/ITagCollectionSupplier.java
@@ -8,7 +8,7 @@
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.registry.Registry;
-public interface ITagCollectionSupplier {
+public interface ITagCollectionSupplier extends net.minecraftforge.common.extensions.IForgeTagCollectionSupplier {
ITagCollectionSupplier field_242208_a = func_242209_a(ITagCollection.func_242205_c(), ITagCollection.func_242205_c(), ITagCollection.func_242205_c(), ITagCollection.func_242205_c());
ITagCollection<Block> func_241835_a();
@@ -22,6 +22,7 @@
default void func_242212_e() {
TagRegistryManager.func_242193_a(this);
Blocks.func_235419_a_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent.VanillaTagTypes(this));
}
default void func_242210_a(PacketBuffer p_242210_1_) {
@@ -58,4 +59,32 @@
}
};
}
+
+ static ITagCollectionSupplier reinjectOptionalTags(ITagCollectionSupplier tagCollectionSupplier) {
+ ITagCollection<Block> blockTagCollection = BlockTags.field_199899_c.reinjectOptionalTags(tagCollectionSupplier.func_241835_a());
+ ITagCollection<Item> itemTagCollection = ItemTags.field_199906_c.reinjectOptionalTags(tagCollectionSupplier.func_241836_b());
+ ITagCollection<Fluid> fluidTagCollection = FluidTags.field_206961_c.reinjectOptionalTags(tagCollectionSupplier.func_241837_c());
+ ITagCollection<EntityType<?>> entityTypeTagCollection = EntityTypeTags.field_219766_c.reinjectOptionalTags(tagCollectionSupplier.func_241838_d());
+ return new ITagCollectionSupplier() {
+ @Override
+ public ITagCollection<Block> func_241835_a() {
+ return blockTagCollection;
+ }
+
+ @Override
+ public ITagCollection<Item> func_241836_b() {
+ return itemTagCollection;
+ }
+
+ @Override
+ public ITagCollection<Fluid> func_241837_c() {
+ return fluidTagCollection;
+ }
+
+ @Override
+ public ITagCollection<EntityType<?>> func_241838_d() {
+ return entityTypeTagCollection;
+ }
+ };
+ }
}
@@ -0,0 +1,17 @@
--- a/net/minecraft/tags/ItemTags.java
+++ b/net/minecraft/tags/ItemTags.java
@@ -65,6 +65,14 @@
return field_199906_c.func_232937_a_(p_199901_0_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Item> createOptional(ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Item> createOptional(ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Item>> defaults) {
+ return field_199906_c.createOptional(name, defaults);
+ }
+
public static ITagCollection<Item> func_199903_a() {
return field_199906_c.func_232939_b_();
}
@@ -0,0 +1,34 @@
--- a/net/minecraft/tags/NetworkTagManager.java
+++ b/net/minecraft/tags/NetworkTagManager.java
@@ -20,6 +20,7 @@
protected TagCollectionReader<Item> field_199720_b = new TagCollectionReader<>(Registry.field_212630_s::func_241873_b, "tags/items", "item");
protected TagCollectionReader<Fluid> field_205705_c = new TagCollectionReader<>(Registry.field_212619_h::func_241873_b, "tags/fluids", "fluid");
protected TagCollectionReader<EntityType<?>> field_215299_d = new TagCollectionReader<>(Registry.field_212629_r::func_241873_b, "tags/entity_types", "entity_type");
+ protected Map<ResourceLocation, TagCollectionReader<?>> customTagTypeReaders = net.minecraftforge.common.ForgeTagHandler.createCustomTagTypeReaders();
private ITagCollectionSupplier field_242230_e = ITagCollectionSupplier.field_242208_a;
public ITagCollectionSupplier func_242231_a() {
@@ -31,11 +32,13 @@
CompletableFuture<Map<ResourceLocation, ITag.Builder>> completablefuture1 = this.field_199720_b.func_242224_a(p_215226_2_, p_215226_5_);
CompletableFuture<Map<ResourceLocation, ITag.Builder>> completablefuture2 = this.field_205705_c.func_242224_a(p_215226_2_, p_215226_5_);
CompletableFuture<Map<ResourceLocation, ITag.Builder>> completablefuture3 = this.field_215299_d.func_242224_a(p_215226_2_, p_215226_5_);
- return CompletableFuture.allOf(completablefuture, completablefuture1, completablefuture2, completablefuture3).thenCompose(p_215226_1_::func_216872_a).thenAcceptAsync((p_232979_5_) -> {
+ CompletableFuture<java.util.List<net.minecraftforge.common.ForgeTagHandler.TagCollectionReaderInfo>> customTagTypeResults = net.minecraftforge.common.ForgeTagHandler.getCustomTagTypeReloadResults(p_215226_2_, p_215226_5_, customTagTypeReaders);
+ return CompletableFuture.allOf(completablefuture, completablefuture1, completablefuture2, completablefuture3, customTagTypeResults).thenCompose(p_215226_1_::func_216872_a).thenAcceptAsync((p_232979_5_) -> {
ITagCollection<Block> itagcollection = this.field_199719_a.func_242226_a(completablefuture.join());
ITagCollection<Item> itagcollection1 = this.field_199720_b.func_242226_a(completablefuture1.join());
ITagCollection<Fluid> itagcollection2 = this.field_205705_c.func_242226_a(completablefuture2.join());
ITagCollection<EntityType<?>> itagcollection3 = this.field_215299_d.func_242226_a(completablefuture3.join());
+ net.minecraftforge.common.ForgeTagHandler.updateCustomTagTypes(customTagTypeResults.join());
ITagCollectionSupplier itagcollectionsupplier = ITagCollectionSupplier.func_242209_a(itagcollection, itagcollection1, itagcollection2, itagcollection3);
Multimap<ResourceLocation, ResourceLocation> multimap = TagRegistryManager.func_242198_b(itagcollectionsupplier);
if (!multimap.isEmpty()) {
@@ -43,6 +46,8 @@
return p_232978_0_.getKey() + ":" + p_232978_0_.getValue();
}).sorted().collect(Collectors.joining(",")));
} else {
+ itagcollectionsupplier = ITagCollectionSupplier.reinjectOptionalTags(itagcollectionsupplier);
+ net.minecraftforge.common.ForgeTagHandler.reinjectOptionalTagsCustomTypes();
TagCollectionManager.func_242180_a(itagcollectionsupplier);
this.field_242230_e = itagcollectionsupplier;
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/tags/TagCollectionManager.java
+++ b/net/minecraft/tags/TagCollectionManager.java
@@ -3,13 +3,13 @@
import java.util.stream.Collectors;
public class TagCollectionManager {
- private static volatile ITagCollectionSupplier field_232918_a_ = ITagCollectionSupplier.func_242209_a(ITagCollection.func_242202_a(BlockTags.func_242174_b().stream().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242183_0_) -> {
+ private static volatile ITagCollectionSupplier field_232918_a_ = net.minecraftforge.common.ForgeTagHandler.populateTagCollectionManager(ITagCollection.func_242202_a(BlockTags.func_242174_b().stream().distinct().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242183_0_) -> {
return p_242183_0_;
- }))), ITagCollection.func_242202_a(ItemTags.func_242177_b().stream().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242182_0_) -> {
+ }))), ITagCollection.func_242202_a(ItemTags.func_242177_b().stream().distinct().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242182_0_) -> {
return p_242182_0_;
- }))), ITagCollection.func_242202_a(FluidTags.func_241280_c_().stream().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242181_0_) -> {
+ }))), ITagCollection.func_242202_a(FluidTags.func_241280_c_().stream().distinct().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242181_0_) -> {
return p_242181_0_;
- }))), ITagCollection.func_242202_a(EntityTypeTags.func_242175_b().stream().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242179_0_) -> {
+ }))), ITagCollection.func_242202_a(EntityTypeTags.func_242175_b().stream().distinct().collect(Collectors.toMap(ITag.INamedTag::func_230234_a_, (p_242179_0_) -> {
return p_242179_0_;
}))));
@@ -1,14 +1,89 @@
--- a/net/minecraft/tags/TagRegistry.java
+++ b/net/minecraft/tags/TagRegistry.java
@@ -23,6 +23,7 @@
@@ -16,13 +16,51 @@
private ITagCollection<T> field_232930_b_ = ITagCollection.func_242205_c();
private final List<TagRegistry.NamedTag<T>> field_232931_c_ = Lists.newArrayList();
private final Function<ITagCollectionSupplier, ITagCollection<T>> field_242184_c;
+ private static java.util.Map<ResourceLocation, List<TagRegistry.NamedTag<?>>> toAdd = com.google.common.collect.Maps.newHashMap();
public TagRegistry(Function<ITagCollectionSupplier, ITagCollection<T>> p_i241894_1_) {
this.field_242184_c = p_i241894_1_;
}
public ITag.INamedTag<T> func_232937_a_(String p_232937_1_) {
TagRegistry.NamedTag<T> namedtag = new TagRegistry.NamedTag<>(new ResourceLocation(p_232937_1_));
- TagRegistry.NamedTag<T> namedtag = new TagRegistry.NamedTag<>(new ResourceLocation(p_232937_1_));
+ return add(new TagRegistry.NamedTag<>(new ResourceLocation(p_232937_1_)));
+ }
+
+ public net.minecraftforge.common.Tags.IOptionalNamedTag<T> createOptional(ResourceLocation key, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ return add(new TagRegistry.OptionalNamedTag<>(key, defaults));
+ }
+
+ /** Call via ForgeTagHandler#makeWrapperTag to avoid any exceptions due to calling this after it is safe to call {@link #createTag(String)} */
+ public static <T> ITag.INamedTag<T> createDelayedTag(ResourceLocation tagRegistry, ResourceLocation name) {
+ return delayedAdd(tagRegistry, new TagRegistry.NamedTag<>(name));
+ }
+
+ /** Call via ForgeTagHandler#createOptionalTag to avoid any exceptions due to calling this after it is safe to call {@link #createOptional(ResourceLocation, Set)} */
+ public static <T> net.minecraftforge.common.Tags.IOptionalNamedTag<T> createDelayedOptional(ResourceLocation tagRegistry, ResourceLocation key, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ return delayedAdd(tagRegistry, new TagRegistry.OptionalNamedTag<>(key, defaults));
+ }
+
+ private static synchronized <T, R extends TagRegistry.NamedTag<T>> R delayedAdd(ResourceLocation tagRegistry, R tag) {
+ if (toAdd == null) throw new RuntimeException("Creating delayed tags or optional tags, is only supported before custom tag types have been added.");
+ toAdd.computeIfAbsent(tagRegistry, registry -> Lists.newArrayList()).add(tag);
+ return tag;
+ }
+
+ public static void performDelayedAdd() {
+ if (toAdd != null) {
+ for (java.util.Map.Entry<ResourceLocation, List<TagRegistry.NamedTag<?>>> entry : toAdd.entrySet()) {
+ TagRegistry<?> tagRegistry = TagRegistryManager.get(entry.getKey());
+ if (tagRegistry == null) throw new RuntimeException("A mod attempted to add a delayed tag for a registry that doesn't have custom tag support.");
+ for (TagRegistry.NamedTag<?> tag : entry.getValue()) {
+ tagRegistry.add((TagRegistry.NamedTag) tag);
+ }
+ }
+ toAdd = null;
+ }
+ }
+
+ private <R extends TagRegistry.NamedTag<T>> R add(R namedtag) {
+ namedtag.func_232943_a_(field_232930_b_::func_199910_a);
this.field_232931_c_.add(namedtag);
return namedtag;
}
@@ -93,5 +94,10 @@
@@ -46,6 +84,20 @@
});
}
+ public ITagCollection<T> reinjectOptionalTags(ITagCollection<T> tagCollection) {
+ java.util.Map<ResourceLocation, ITag<T>> currentTags = tagCollection.func_241833_a();
+ java.util.Map<ResourceLocation, ITag<T>> missingOptionals = this.field_232931_c_.stream().filter(e -> e instanceof OptionalNamedTag && !currentTags.containsKey(e.func_230234_a_())).collect(Collectors.toMap(NamedTag::func_230234_a_, namedTag -> {
+ OptionalNamedTag<T> optionalNamedTag = (OptionalNamedTag<T>) namedTag;
+ optionalNamedTag.defaulted = true;
+ return optionalNamedTag.resolveDefaulted();
+ }));
+ if (!missingOptionals.isEmpty()) {
+ missingOptionals.putAll(currentTags);
+ return ITagCollection.func_242202_a(missingOptionals);
+ }
+ return tagCollection;
+ }
+
public ITagCollection<T> func_232939_b_() {
return this.field_232930_b_;
}
@@ -56,7 +108,7 @@
public Set<ResourceLocation> func_242189_b(ITagCollectionSupplier p_242189_1_) {
ITagCollection<T> itagcollection = this.field_242184_c.apply(p_242189_1_);
- Set<ResourceLocation> set = this.field_232931_c_.stream().map(TagRegistry.NamedTag::func_230234_a_).collect(Collectors.toSet());
+ Set<ResourceLocation> set = this.field_232931_c_.stream().filter(e -> !(e instanceof OptionalNamedTag)).map(TagRegistry.NamedTag::func_230234_a_).collect(Collectors.toSet());
ImmutableSet<ResourceLocation> immutableset = ImmutableSet.copyOf(itagcollection.func_199908_a());
return Sets.difference(set, immutableset);
}
@@ -93,5 +145,40 @@
public List<T> func_230236_b_() {
return this.func_232944_c_().func_230236_b_();
}
@@ -17,5 +92,35 @@
+ public String toString() {
+ return "NamedTag[" + func_230234_a_().toString() + ']';
+ }
+ @Override public boolean equals(Object o) { return (o == this) || (o instanceof ITag.INamedTag && java.util.Objects.equals(this.func_230234_a_(), ((ITag.INamedTag<T>)o).func_230234_a_())); }
+ @Override public int hashCode() { return func_230234_a_().hashCode(); }
}
+
+ private static class OptionalNamedTag<T> extends NamedTag<T> implements net.minecraftforge.common.Tags.IOptionalNamedTag<T> {
+ @Nullable
+ private final Set<java.util.function.Supplier<T>> defaults;
+ private boolean defaulted = false;
+
+ private OptionalNamedTag(ResourceLocation name, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ super(name);
+ this.defaults = defaults;
+ }
+
+ @Override
+ public boolean isDefaulted() {
+ return defaulted;
+ }
+
+ Tag<T> resolveDefaulted() {
+ if (defaults == null || defaults.isEmpty()) {
+ return Tag.func_241284_a_();
+ }
+ return Tag.func_241286_a_(ImmutableSet.copyOf(defaults.stream().map(java.util.function.Supplier::get).collect(Collectors.toSet())));
+ }
+
+ @Override
+ public String toString() {
+ return "OptionalNamedTag[" + func_230234_a_().toString() + ']';
+ }
+ }
}
@@ -0,0 +1,26 @@
--- a/net/minecraft/tags/TagRegistryManager.java
+++ b/net/minecraft/tags/TagRegistryManager.java
@@ -51,4 +51,23 @@
throw new IllegalStateException("Missing helper registrations");
}
}
+
+ @javax.annotation.Nullable
+ public static TagRegistry<?> get(ResourceLocation rl) {
+ return field_242190_a.get(rl);
+ }
+
+ public static Multimap<ResourceLocation, ResourceLocation> validateVanillaTags(ITagCollectionSupplier tagCollectionSupplier) {
+ Multimap<ResourceLocation, ResourceLocation> missingTags = HashMultimap.create();
+ for (java.util.Map.Entry<ResourceLocation, TagRegistry<?>> entry : field_242190_a.entrySet()) {
+ if (!net.minecraftforge.common.ForgeTagHandler.getCustomTagTypeNames().contains(entry.getKey())) {
+ missingTags.putAll(entry.getKey(), entry.getValue().func_242189_b(tagCollectionSupplier));
+ }
+ }
+ return missingTags;
+ }
+
+ public static void fetchCustomTagTypes(ITagCollectionSupplier tagCollectionSupplier) {
+ net.minecraftforge.common.ForgeTagHandler.getCustomTagTypeNames().forEach(tagRegistry -> field_242190_a.get(tagRegistry).func_242188_a(tagCollectionSupplier));
+ }
}
@@ -17,7 +17,7 @@
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ public static BannerPattern create(String enumName, String fileNameIn, String hashNameIn, boolean p_i231861_5_) {
+ public static BannerPattern create(String enumName, String fileNameIn, String hashNameIn, boolean hasPatternItem) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
Loaded 100 of 428 files, more files were not shown because too many files have changed in this diff. Show more