Compare commits

...
104 Commits
Author SHA1 Message Date
LexManos f173bde812 1.16.5 Initial Update. 2021-01-15 11:33:11 -08:00
LexManos dd10933ab0 Update Coremods, ASM, and include standalone Nashorn to load on J15. 2021-01-14 15:48:53 -08:00
Ian Rehwinkel c3e84646db Added IWeatherParticleRenderHandler to allow a mod to take control over weather particles and sounds. (#7522) 2021-01-07 12:24:40 -08:00
covers1624 2094f99640 Allow Chunk loading Tickets to opt-into forcing chunk ticks. (#7525) 2021-01-07 12:13:47 -08:00
malte0811 94f3bdaa69 Fix crash when mods add goals to skeleton horses (MC-206338) (#7509) 2021-01-07 12:04:50 -08:00
Take Weiland 7220e9d0b0 Set WM_CLASS and WM_INSTANCE_NAME for early progress window (#7534) 2021-01-07 12:03:46 -08:00
Alex O'Neill 020102d87f Make UnboundedMapCodec more lenient in decoding dimensions. Fixes MC-197860 (#7527) 2021-01-05 19:17:24 -08:00
LexManos f101700969 Fix FML's Config Sync packet not allowing same length filenames in encoder and decoder. Closes #7584 2021-01-05 11:50:05 -08:00
LexManos c4b148b84b Prevent NPE and deprecated MissingMappings.getMappings function. Closes #6252 2021-01-05 11:47:00 -08:00
LexManos b6a9274870 Fix entities not correctly being able to be ridden under water. 2021-01-03 03:02:32 -08:00
Jonathan Coates 830d9699e3 Fix crash when beehive is broken by fake player (#7566) 2020-12-28 13:56:44 -08:00
Alex O'Neill fc68b81b21 Add supplier variant to AbstractBlock.Properties#lootFrom (#7563) 2020-12-28 13:42:15 -08:00
Take Weiland 2904772b16 Fix ModFileResourcePack.getAllResourceLocations ignoring resourceNamespace. (#7562)
Fixes #7405
2020-12-28 13:39:44 -08:00
Take Weiland e120b57032 Fix missing serializers when deserializing global loot modifiers (#7561) 2020-12-28 13:37:32 -08:00
Take Weiland b86b56260d Fix VanillaConnectionNetworkFilter sending out invalid entity properties packets without an entity ID (#7560) 2020-12-28 13:34:31 -08:00
Richard Freimer b222b23557 Make shear interactions extend to subclasses (#7544) 2020-12-28 13:10:35 -08:00
sciwhiz12 8ec4253068 Add a SoundType subclass that uses suppliers (#7538) 2020-12-28 13:09:03 -08:00
sciwhiz12 74ca88b7be Fix compound ingredient in shapeless recipes (#7537) Fixes #7530 2020-12-28 13:03:48 -08:00
Alex O'Neill a1119cd77a Fix potential NPE in ForgeHooks.onItemPlaceIntoWorld when passing in null player. (#7505) 2020-12-28 12:18:52 -08:00
mrp-v2 545723dc8c Fix modded PointOfInterestType's not populating blockstate map when registered (#7503) 2020-12-28 12:17:51 -08:00
poopoodice b64f4780c5 Add new LivingConversionEvent to control mobs turning into other mobs. (#7386) 2020-12-28 12:03:11 -08:00
KnightMiner 1c98b29087 Add ItemAttributeModifierEvent (#7484) 2020-12-28 11:59:09 -08:00
Brennan Ward 33880331d2 Fix RightClickBlock ALLOW not being implemented (#7426) 2020-12-28 11:54:30 -08:00
LexManos 74a43877e4 Quiet down errors related to modders not changing their update urls from the default. 2020-12-26 11:39:14 -08:00
LexManos 7542fbea48 Make mod data packs able to be disabled. It'll break things, but that's on you. Closes #6776 2020-12-26 11:38:45 -08:00
tterrag 2d9a1bc6f9 Add generated resource tracking to ExistingFileHelper 2020-12-12 12:33:56 -05:00
tterrag a57a240c13 Fix BlockStateProvider item models not knowing about block models
Add tests for this case
2020-12-10 21:37:13 -05:00
Richard Freimer b7fb6484d7 Override invalidateCaps instead of remove for vanilla TE capability invalidation (#7536)
Properly invalidate patched in vanilla TE caps in invalidateCaps instead of remove so that they get invalidated on chunk unload
2020-12-08 11:54:29 -08:00
Richard Freimer 1a539ffebc Make TEs invalidate capabilities when the chunk they are in unloads (#7529)
Fixed LazyOptional potentially notifying invalidation listeners multiple times.
2020-12-05 12:05:32 -08:00
Kevin G 27220a5ad8 Fixed entity navigation to stop entities spinning - MC-94054 (#7520) 2020-12-05 11:54:03 -08:00
Unbekannt1998 e975fc8252 Fix wrong function call in BlockStateProvider::horizontalFaceBlock (#7514) 2020-12-05 11:52:44 -08:00
tterrag d85ea5a3b0 Fix datagen order of multipart conditions being unstable 2020-11-28 21:10:49 -05:00
Alex O'Neill ccb7345084 Fix forge config option for default world type not applying unless you change the default world type (#7521) 2020-11-28 03:56:44 +01:00
David Quintana 93c00b67d9 Implement feature for mods to define new world types (#7448)
* Mods can now register world types via a new forge registry, and optionally register a settings screen to tweak them.
  * The default world type for dedicated servers and singleplayer world creation is configurable via forge's common config.
2020-11-28 00:57:15 +01:00
IzzelAliz cd393bbfdc Fix dimType not encode to registries (#7513) 2020-11-24 09:14:10 -08:00
Richard Freimer fd045d4628 Add support for referencing forge's resources and specifying existing mods to data generators (#7456) 2020-11-22 22:45:13 -05:00
cpw 47e076071b Fix #6692
Thanks @AterAnimAvis for help and suggestions

Signed-off-by: cpw <[email protected]>
2020-11-22 17:00:48 -05:00
Cyborgmas a73e003dd3 Fix translucent blocks not rendering properly when moved by pistons on fabulous (#7441) 2020-11-21 11:57:33 -08:00
LexManos 949984268d Bump version for RB. 2020-11-20 12:53:44 -08:00
Take Weiland 114acfca3b Fix food bar not rendering when non-living entities are mounted (#7446) 2020-11-20 10:24:43 -08:00
Alex O'Neill 56e538e8a9 Fix MC-194811 - Removing structures causes chunk save errors. 2020-11-20 10:23:50 -08:00
Take Weiland fa46f3dd49 Fix concurrency issue in StartupMessageManager (#7483) 2020-11-20 10:17:00 -08:00
Alex O'Neill 6ec5a8f2c1 Fix forge registry types that have private constructors (BlockStateProviderType, BlockPlacerType, FoliagePlacerType, TreeDecoratorType) (#7482) 2020-11-20 10:11:15 -08:00
cpw 49b596dda3 Fix problem where the absence of forge and MC in later loading triggered a weird crash.
Signed-off-by: cpw <[email protected]>
2020-11-15 11:08:34 -05:00
cpw 0c5ced1bbf Fix NPE problem when modid is mismatched.
Signed-off-by: cpw <[email protected]>
2020-11-13 20:41:20 -05:00
cpw 4a09a2420d Return the processed modlist data to the upstream system, not the raw unprocessed data. Should resolve the problem
that mixin complains about missing info when it's in a "crashed" situation.

Signed-off-by: cpw <[email protected]>
2020-11-13 19:12:43 -05:00
Cyborgmas 0ff8a596fc Fix dims on servers not loading the first run (#7445) 2020-11-11 01:09:35 -08:00
Take Weiland bca20ace4e Allow for custom argument types by filtering them on vanilla connections (#7463) 2020-11-10 12:24:25 -08:00
Brennan Ward f3b53001c9 Add Player context to AnvilUpdateEvent (#7442) 2020-11-10 12:05:47 -08:00
Jonathan Coates 15bac0eeaa Don't overwrite PlayerAdvancement's player with a fake one (#7454)
If a FakePlayer is constructed with the same UUID/GameProfile as a
currently active player, the player object within PlayerAdvancement is
set to the fake player.

As fake players cannot receive advancements (see grantCriterion), this
prevents the actual player from receiving any advancements until they
change dimension/relog.
2020-11-10 11:55:42 -08:00
Curle 1782973a29 Add BannerBlock.forColor to SAS to fix banner.toItem() on servers. 2020-11-10 11:38:20 -08:00
Boy132 9a4a501a95 Call Harvest check event even if the block doesn't require any tool (#7414) 2020-11-10 11:36:32 -08:00
LexManos 9bbfbd5479 Use linked collections to stabilize order when adding new registry entries. 2020-11-10 11:24:57 -08:00
Dennis C 8c68731838 Render local player when the renderViewEntity is not the local player (#7216) 2020-11-10 11:13:49 -08:00
cpw 0d7f507f4e Some help in ExtensionPoint regarding DISPLAYTEST. Let's improve those tick rates!
Signed-off-by: cpw <[email protected]>
2020-11-07 23:11:45 -05:00
cpw f78b943bdf Handle erroring during early mod construction phases, and actually report that into the error UI
by doing armslength exception handling and propagation.

Signed-off-by: cpw <[email protected]>
2020-11-07 22:30:19 -05:00
cpw 160f3f88f9 Support backwards loading 1.16.3 mods in 1.16.4, because we are able to do that. Tweak loading a bit to be smarter about dependency errors of various kinds.
Signed-off-by: cpw <[email protected]>
2020-11-07 20:48:02 -05:00
David Quintana 45e38859ed Add FluidStack codec, and a test mod that verifies its behaviour matches the existing write/read logic.
Add missing license headers.
2020-11-07 21:10:18 +01:00
cpw 38a5400a8c Update event bus version (should be 3.0.5)
Tweak MDK to automatically populate recommended values for things like forge version, loader version and minecraft version.

Signed-off-by: cpw <[email protected]>
2020-11-06 21:11:26 -05:00
diesieben07 acd18455c2 Workaround for modded attributes on vanilla entities logging warnings on vanilla clients
Switch to a handler-based approach per packet class, simplify patch, add some docs

Add license header and docs

Switch to a network handler based approach

Switch to a network handler based approach

revert build gradle change

Simplify Packet patch

Add license header to IForgePacket

Revert ForgeHooks changes

Less hacky and more generic way to filter packets for vanilla connections

_Actually_ Order SAS.
It's early

Order SAS

simplify vanilla connection check

Remove unneeded import change
2020-11-03 18:47:04 -05:00
cpw 5a7facc20f Fix early sorting bug that meant the file deduping was causing an error, to, well, not cause it, so we can get to an error screen.
Signed-off-by: cpw <[email protected]>
2020-11-02 14:57:23 -05:00
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
307 changed files with 6508 additions and 1609 deletions

No files matched your search

+64 -56
View File
@@ -10,9 +10,9 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.179'
classpath 'org.ow2.asm:asm:7.2'
classpath 'org.ow2.asm:asm-tree:7.2'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.187'
classpath 'org.ow2.asm:asm:9.0'
classpath 'org.ow2.asm:asm-tree:9.0'
}
}
@@ -53,9 +53,9 @@ ext {
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20200514-1.16'
MC_VERSION = '1.16.3'
MCP_VERSION = '20200911.084530'
MAPPING_VERSION = '20201028-1.16.3'
MC_VERSION = '1.16.5'
MCP_VERSION = '20210115.111550'
}
project(':mcp') {
@@ -197,7 +197,7 @@ project(':forge') {
}
ext {
SPEC_VERSION = '34.1' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '36.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.
@@ -353,8 +353,10 @@ project(':forge') {
'--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]
}
}
}
@@ -430,17 +432,18 @@ project(':forge') {
fmllauncherImplementation.extendsFrom(installer)
}
dependencies {
installer 'org.ow2.asm:asm:7.2'
installer 'org.ow2.asm:asm-commons:7.2'
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:7.0.+'
installer 'org.ow2.asm:asm:9.0'
installer 'org.ow2.asm:asm-commons:9.0'
installer 'org.ow2.asm:asm-tree:9.0'
installer 'org.ow2.asm:asm-util:9.0'
installer 'org.ow2.asm:asm-analysis:9.0'
installer 'cpw.mods:modlauncher:8.0.+'
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:coremods:3.0.+'
installer 'net.minecraftforge:accesstransformers:3.0.+'
installer 'org.antlr:antlr4-runtime:4.9.1' //Dep of AccessTransformer
installer 'net.minecraftforge:eventbus:4.0.+'
installer 'net.minecraftforge:forgespi:3.2.+'
installer 'net.minecraftforge:coremods:4.0.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.2'
installer 'com.electronwill.night-config:toml:3.6.2'
@@ -451,7 +454,10 @@ 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.1'
installer 'org.spongepowered:mixin:0.8.2'
// This is org.openjdk.nashorn:nashorn-core:15.1.1 repackaged so it doesn't crash on JREs < 15.
// See: https://github.com/LexManos/NashornLegacyPackager
installer 'net.minecraftforge:nashorn-core-compat:15.1.1'
fmllauncherImplementation 'com.google.guava:guava:21.0'
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2'
@@ -473,35 +479,35 @@ project(':forge') {
if (changelog.exists())
extraTxts += changelog
task crowdin(type: CrowdinTask) {
key = project.hasProperty('crowdinKey') ? project.crowdinKey : null
//TODO: Merge our english.json?
}
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
['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")
}
}
}
['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(type: DownloadLibrariesTask, dependsOn: ':mcp:setupMCP') {
input = VERSION_JSON
output = rootProject.file('build/libraries/')
input = VERSION_JSON
output = rootProject.file('build/libraries/')
}
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
@@ -509,23 +515,23 @@ project(':forge') {
input { genJoinedBinPatches.cleanJar }
doFirst { downloadLibraries.libraries.each{ addLibrary(it) } }
}
task checkATs(type: CheckATs, dependsOn: extractInheritance) {
inheritance = extractInheritance.output
ats = patcher.accessTransformers
ats = patcher.accessTransformers
}
task checkSAS(type: CheckSAS, dependsOn: extractInheritance) {
inheritance = extractInheritance.output
sass = patcher.sideAnnotationStrippers
sass = patcher.sideAnnotationStrippers
}
task checkExcs(type: CheckExcs, dependsOn: jar) {
binary = jar.archivePath
excs = patcher.excs
excs = patcher.excs
}
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs]){}
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs]){}
task checkPatchesAndFix(type: CheckPatches) {
patchDir = file("$rootDir/patches")
@@ -636,6 +642,7 @@ project(':forge') {
logo: '/big_logo.png',
minecraft: MC_VERSION,
welcome: "Welcome to the simple ${project.name.capitalize()} installer.",
mirrorList: "https://files.minecraftforge.net/mirrors-2.0.json",
data: [
MAPPINGS: [
client: "[${MCP_ARTIFACT.group}:${MCP_ARTIFACT.name}:${MCP_ARTIFACT.version}:mappings@txt]",
@@ -756,7 +763,7 @@ project(':forge') {
// add crowdin locales
from { crowdin.output.exists() ? zipTree(crowdin.output) : null}
dependsOn crowdin
duplicatesStrategy = 'exclude'
duplicatesStrategy = 'exclude'
doFirst {
MANIFESTS.each{ pkg, values ->
@@ -877,7 +884,9 @@ project(':forge') {
FORGE_NAME: project.name,
MC_VERSION: MC_VERSION,
MAPPING_CHANNEL: MAPPING_CHANNEL,
MAPPING_VERSION: MAPPING_VERSION
MAPPING_VERSION: MAPPING_VERSION,
FORGE_SPEC_VERSION: SPEC_VERSION.split("\\.")[0],
MC_NEXT_VERSION: "1."+((MC_VERSION.split("\\.")[1] as int)+1)
])
rename 'gitignore\\.txt', '.gitignore'
rename 'gitattributes\\.txt', '.gitattributes'
@@ -945,6 +954,7 @@ project(':forge') {
exclude 'net/minecraftforge/fml/common/versioning/InvalidVersionSpecificationException.java'
exclude 'net/minecraftforge/fml/common/versioning/Restriction.java'
exclude 'net/minecraftforge/fml/common/versioning/VersionRange.java'
exclude 'net/minecraftforge/common/LenientUnboundedMapCodec.java'
tasks {
main {
@@ -1062,5 +1072,3 @@ task setup() {
dependsOn ':clean:extractMapped'
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}
@@ -21,31 +21,44 @@ public class CheckSAS extends DefaultTask {
sass.each { f ->
def lines = []
f.eachLine { line ->
if (line[0] == '\t') return //Skip any tabed lines, those are ones we add
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 (desc.isEmpty() || json[cls] == null || json[cls]['methods'] == null || json[cls]['methods'][desc] == null) {
if (json[cls] == null || (!desc.isEmpty() && (json[cls]['methods'] == null || json[cls]['methods'][desc] == null))) {
println('Invalid: ' + line)
return
}
def mtd = json[cls]['methods'][desc]
//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))
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) }
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
}
}
@@ -59,11 +59,12 @@ public class Util {
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'
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'
// However, keep the path normal so that our mirror system works.
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}"),
+1 -1
View File
@@ -1,4 +1,4 @@
<img src="assets/Forge_logo.svg">
![Forge Logo](assets/Forge_logo.svg)
MinecraftForge
=============
+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.
+10 -7
View File
@@ -6,24 +6,26 @@
# 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="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[@FORGE_SPEC_VERSION@,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="All rights reserved"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="examplemod" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="${file.jarVersion}" #mandatory
# A display name for the mod
displayName="Example Mod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
updateJSONURL="http://myurl.me/" #optional
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
@@ -45,7 +47,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="[34,)" #mandatory
versionRange="[@FORGE_SPEC_VERSION@,)" #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 +56,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.16.3]"
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[@MC_VERSION@,@MC_NEXT_VERSION@)"
ordering="NONE"
side="BOTH"
@@ -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;
@@ -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,12 +144,22 @@
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -933,7 +967,7 @@
@@ -932,11 +970,17 @@
return this;
}
+ @Deprecated // FORGE: Use the variant that takes a Supplier below
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
- this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this;
}
+ public AbstractBlock.Properties lootFrom(java.util.function.Supplier<? extends Block> blockIn) {
+ this.lootTableSupplier = () -> blockIn.get().func_220068_i();
+ return this;
+ }
+
public AbstractBlock.Properties func_235859_g_() {
this.field_235813_o_ = true;
return this;
@@ -0,0 +1,19 @@
--- a/net/minecraft/block/BeehiveBlock.java
+++ b/net/minecraft/block/BeehiveBlock.java
@@ -85,6 +85,7 @@
List<BeeEntity> list = p_226881_1_.func_217357_a(BeeEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
if (!list.isEmpty()) {
List<PlayerEntity> list1 = p_226881_1_.func_217357_a(PlayerEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
+ if (list1.isEmpty()) return; //Forge: Prevent Error when no players are around.
int i = list1.size();
for(BeeEntity beeentity : list) {
@@ -105,7 +106,7 @@
int i = p_225533_1_.func_177229_b(field_226873_c_);
boolean flag = false;
if (i >= 5) {
- if (itemstack.func_77973_b() == Items.field_151097_aZ) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ShearsItem) {
p_225533_2_.func_184148_a(p_225533_4_, p_225533_4_.func_226277_ct_(), p_225533_4_.func_226278_cu_(), p_225533_4_.func_226281_cx_(), SoundEvents.field_226133_ah_, SoundCategory.NEUTRAL, 1.0F, 1.0F);
func_226878_a_(p_225533_2_, p_225533_3_);
itemstack.func_222118_a(1, p_225533_4_, (p_226874_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) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/PumpkinBlock.java
+++ b/net/minecraft/block/PumpkinBlock.java
@@ -20,7 +20,7 @@
public ActionResultType func_225533_a_(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) {
ItemStack itemstack = p_225533_4_.func_184586_b(p_225533_5_);
- if (itemstack.func_77973_b() == Items.field_151097_aZ) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ShearsItem) {
if (!p_225533_2_.field_72995_K) {
Direction direction = p_225533_6_.func_216354_b();
Direction direction1 = direction.func_176740_k() == Direction.Axis.Y ? p_225533_4_.func_174811_aO().func_176734_d() : direction;
@@ -0,0 +1,10 @@
--- a/net/minecraft/block/SoundType.java
+++ b/net/minecraft/block/SoundType.java
@@ -59,6 +59,7 @@
private final SoundEvent field_185865_r;
private final SoundEvent field_185866_s;
+ @Deprecated // Forge: Use {@link net.minecraftforge.common.util.ForgeSoundType} instead for suppliers
public SoundType(float p_i46679_1_, float p_i46679_2_, SoundEvent p_i46679_3_, SoundEvent p_i46679_4_, SoundEvent p_i46679_5_, SoundEvent p_i46679_6_, SoundEvent p_i46679_7_) {
this.field_185860_m = p_i46679_1_;
this.field_185861_n = p_i46679_2_;
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/TripWireBlock.java
+++ b/net/minecraft/block/TripWireBlock.java
@@ -67,7 +67,7 @@
}
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) {
- if (!p_176208_1_.field_72995_K && !p_176208_4_.func_184614_ca().func_190926_b() && p_176208_4_.func_184614_ca().func_77973_b() == Items.field_151097_aZ) {
+ if (!p_176208_1_.field_72995_K && !p_176208_4_.func_184614_ca().func_190926_b() && p_176208_4_.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ShearsItem) {
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_.func_206870_a(field_176295_N, Boolean.valueOf(true)), 4);
}
@@ -26,16 +26,19 @@
Direction direction3 = direction.func_176746_e();
Direction direction4 = direction.func_176735_f();
boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3));
@@ -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);
}
@@ -9,3 +9,11 @@
if (monitor != null) {
VideoMode videomode = monitor.func_197992_a(this.field_198125_l ? this.field_198124_k : Optional.empty());
this.field_198120_g = this.field_198127_n = monitor.func_197989_c() + videomode.func_198064_a() / 2 - this.field_198129_p / 2;
@@ -271,6 +271,7 @@
GLFW.glfwGetFramebufferSize(this.field_198119_f, aint, aint1);
this.field_198131_r = aint[0];
this.field_198132_s = aint1[0];
+ if (this.field_198132_s == 0 || this.field_198131_r==0) net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.updateFBSize(w->this.field_198131_r=w, h->this.field_198132_s=h);
}
private void func_198089_c(long p_198089_1_, int p_198089_3_, int p_198089_4_) {
@@ -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,13 +415,13 @@
@@ -428,13 +428,13 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
@@ -31,7 +31,7 @@
this.field_110448_aq.func_198983_a();
this.field_71474_y.func_198017_a(this.field_110448_aq);
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
@@ -462,6 +462,7 @@
@@ -476,6 +476,7 @@
this.func_193986_ar();
this.field_110451_am.func_219534_a(this.field_193995_ae);
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -39,7 +39,7 @@
this.field_110451_am.func_219534_a(this.field_71452_i);
this.field_213272_aL = new PaintingSpriteUploader(this.field_71446_o);
this.field_110451_am.func_219534_a(this.field_213272_aL);
@@ -469,7 +470,8 @@
@@ -483,7 +484,8 @@
this.field_110451_am.func_219534_a(this.field_213273_aM);
this.field_241557_ar_ = new GPUWarning();
this.field_110451_am.func_219534_a(this.field_241557_ar_);
@@ -49,7 +49,7 @@
this.field_184132_p = new DebugRenderer(this);
RenderSystem.setErrorCallback(this::func_195545_a);
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
@@ -481,11 +483,6 @@
@@ -495,11 +497,6 @@
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
this.field_195558_d.func_227801_c_();
this.func_213226_a();
@@ -61,7 +61,7 @@
ResourceLoadProgressGui.func_212970_a(this);
List<IResourcePack> list = this.field_110448_aq.func_232623_f_();
@@ -494,7 +491,14 @@
@@ -508,7 +505,14 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
@@ -77,7 +77,7 @@
});
}, false));
}
@@ -533,7 +537,7 @@
@@ -556,7 +560,7 @@
}
private void func_229988_a_(Throwable p_229988_1_) {
@@ -86,7 +86,7 @@
ITextComponent itextcomponent;
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_241203_a().func_195762_a());
@@ -621,7 +625,7 @@
@@ -644,7 +648,7 @@
return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b()));
});
SearchTreeReloadable<ItemStack> searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> {
@@ -95,7 +95,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -691,13 +695,13 @@
@@ -714,13 +718,13 @@
Bootstrap.func_179870_a(p_71377_0_.func_71502_e());
if (p_71377_0_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f());
@@ -112,7 +112,7 @@
}
}
@@ -706,6 +710,7 @@
@@ -729,6 +733,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -120,7 +120,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -794,10 +799,6 @@
@@ -817,10 +822,6 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -131,7 +131,7 @@
if (p_147108_1_ == null && this.field_71441_e == null) {
p_147108_1_ = new MainMenuScreen();
} else if (p_147108_1_ == null && this.field_71439_g.func_233643_dh_()) {
@@ -808,6 +809,14 @@
@@ -831,6 +832,14 @@
}
}
@@ -146,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 +948,13 @@
@@ -962,11 +971,13 @@
RenderSystem.enableCull();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -160,7 +160,7 @@
}
if (this.field_238174_aV_ != null) {
@@ -1042,6 +1053,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);
@@ -168,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 +1242,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();
@@ -192,7 +192,7 @@
}
}
@@ -1253,6 +1275,8 @@
@@ -1276,6 +1298,8 @@
}
} else if (!this.field_71439_g.func_184838_M()) {
@@ -201,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 +1284,7 @@
@@ -1283,7 +1307,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -210,7 +210,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1270,8 +1294,10 @@
@@ -1293,8 +1317,10 @@
}
this.field_71439_g.func_184821_cY();
@@ -221,7 +221,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1286,6 +1312,11 @@
@@ -1309,6 +1335,11 @@
}
for(Hand hand : Hand.values()) {
@@ -233,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 +1330,7 @@
@@ -1322,6 +1353,7 @@
if (actionresulttype.func_226246_a_()) {
if (actionresulttype.func_226247_b_()) {
@@ -241,7 +241,7 @@
this.field_71439_g.func_184609_a(hand);
}
@@ -1311,6 +1343,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_()) {
@@ -249,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 +1359,9 @@
@@ -1349,6 +1382,9 @@
}
}
@@ -259,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 +1388,8 @@
@@ -1375,6 +1411,8 @@
--this.field_71467_ac;
}
@@ -268,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 +1506,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();
@@ -276,8 +276,8 @@
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
}
private void func_184117_aA() {
@@ -1697,7 +1737,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));
@@ -291,7 +291,7 @@
this.field_71453_ak = networkmanager;
} else {
this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> {
@@ -1771,6 +1816,7 @@
@@ -1821,6 +1866,7 @@
}
public void func_71403_a(ClientWorld p_71403_1_) {
@@ -299,7 +299,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1802,10 +1848,12 @@
@@ -1852,10 +1898,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -312,7 +312,7 @@
if (integratedserver != null) {
this.field_71424_I.func_76320_a("waitForServer");
@@ -1820,6 +1868,7 @@
@@ -1870,6 +1918,7 @@
this.field_71456_v.func_181029_i();
this.field_71422_O = null;
this.field_71455_al = false;
@@ -320,7 +320,7 @@
this.field_213274_aO.func_216815_b();
}
@@ -1850,6 +1899,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_();
@@ -328,7 +328,7 @@
}
public boolean func_238216_r_() {
@@ -1895,112 +1945,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) {
@@ -444,7 +444,7 @@
}
}
@@ -2090,6 +2037,7 @@
@@ -2140,6 +2087,7 @@
return field_71432_P;
}
@@ -452,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 +2345,7 @@
@@ -2451,7 +2399,7 @@
supplier = func_228022_c_(supplier);
}
@@ -461,7 +461,7 @@
}
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
@@ -2416,6 +2364,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();
@@ -0,0 +1,21 @@
--- a/net/minecraft/client/gui/screen/BiomeGeneratorTypeScreens.java
+++ b/net/minecraft/client/gui/screen/BiomeGeneratorTypeScreens.java
@@ -113,6 +113,9 @@
private BiomeGeneratorTypeScreens(String p_i232324_1_) {
this.field_239076_k_ = new TranslationTextComponent("generator." + p_i232324_1_);
}
+ public BiomeGeneratorTypeScreens(ITextComponent displayName) {
+ this.field_239076_k_ = displayName;
+ }
private static DimensionGeneratorSettings func_243452_a(DynamicRegistries p_243452_0_, DimensionGeneratorSettings p_243452_1_, BiomeGeneratorTypeScreens p_243452_2_, Biome p_243452_3_) {
BiomeProvider biomeprovider = new SingleBiomeProvider(p_243452_3_);
@@ -166,4 +169,8 @@
public interface IFactory {
Screen createEditScreen(CreateWorldScreen p_createEditScreen_1_, DimensionGeneratorSettings p_createEditScreen_2_);
}
+
+ // Forge start
+ // For internal use only, automatically called for all ForgeWorldTypes. Register your ForgeWorldType in the forge registry!
+ public static void registerGenerator(BiomeGeneratorTypeScreens gen) { field_239068_c_.add(gen); }
}
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/gui/screen/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screen/CreateWorldScreen.java
@@ -110,7 +110,7 @@
public static CreateWorldScreen func_243425_a(@Nullable Screen p_243425_0_) {
DynamicRegistries.Impl dynamicregistries$impl = DynamicRegistries.func_239770_b_();
- return new CreateWorldScreen(p_243425_0_, DatapackCodec.field_234880_a_, new WorldOptionsScreen(dynamicregistries$impl, DimensionGeneratorSettings.func_242751_a(dynamicregistries$impl.func_243612_b(Registry.field_239698_ad_), dynamicregistries$impl.func_243612_b(Registry.field_239720_u_), dynamicregistries$impl.func_243612_b(Registry.field_243549_ar)), Optional.of(BiomeGeneratorTypeScreens.field_239066_a_), OptionalLong.empty()));
+ return new CreateWorldScreen(p_243425_0_, DatapackCodec.field_234880_a_, new WorldOptionsScreen(dynamicregistries$impl, net.minecraftforge.client.ForgeHooksClient.getDefaultWorldType().map(type -> type.func_241220_a_(dynamicregistries$impl, new java.util.Random().nextLong(), true, false)).orElseGet(() -> DimensionGeneratorSettings.func_242751_a(dynamicregistries$impl.func_243612_b(Registry.field_239698_ad_), dynamicregistries$impl.func_243612_b(Registry.field_239720_u_), dynamicregistries$impl.func_243612_b(Registry.field_243549_ar))), net.minecraftforge.client.ForgeHooksClient.getDefaultWorldType(), OptionalLong.empty()));
}
private CreateWorldScreen(@Nullable Screen p_i242063_1_, DatapackCodec p_i242063_2_, WorldOptionsScreen p_i242063_3_) {
@@ -542,6 +542,7 @@
File file1 = path.toFile();
if (this.field_243416_G == null) {
@@ -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);
}
@@ -0,0 +1,19 @@
--- a/net/minecraft/client/gui/screen/WorldOptionsScreen.java
+++ b/net/minecraft/client/gui/screen/WorldOptionsScreen.java
@@ -134,6 +134,7 @@
this.field_239035_i_.field_230693_o_ = this.field_239040_n_.isPresent();
this.field_239036_j_ = p_239048_1_.func_230480_a_(new Button(j, 120, 150, 20, new TranslationTextComponent("selectWorld.customizeType"), (p_239044_3_) -> {
BiomeGeneratorTypeScreens.IFactory biomegeneratortypescreens$ifactory = BiomeGeneratorTypeScreens.field_239069_d_.get(this.field_239040_n_);
+ biomegeneratortypescreens$ifactory = net.minecraftforge.client.ForgeHooksClient.getBiomeGeneratorTypeScreenFactory(this.field_239040_n_, biomegeneratortypescreens$ifactory);
if (biomegeneratortypescreens$ifactory != null) {
p_239048_2_.func_147108_a(biomegeneratortypescreens$ifactory.createEditScreen(p_239048_1_, this.field_239039_m_));
}
@@ -292,7 +293,7 @@
} else {
this.field_239034_h_.field_230694_p_ = p_239059_1_;
this.field_239027_a_.field_230694_p_ = p_239059_1_;
- this.field_239036_j_.field_230694_p_ = p_239059_1_ && BiomeGeneratorTypeScreens.field_239069_d_.containsKey(this.field_239040_n_);
+ this.field_239036_j_.field_230694_p_ = p_239059_1_ && (BiomeGeneratorTypeScreens.field_239069_d_.containsKey(this.field_239040_n_) || net.minecraftforge.client.ForgeHooksClient.hasBiomeGeneratorSettingsOptionsScreen(this.field_239040_n_));
this.field_239037_k_.field_230694_p_ = p_239059_1_;
}
@@ -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_);
@@ -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;
}
@@ -101,7 +101,7 @@
} else {
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
+ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks
+ .onRightClickBlock(p_217292_1_, p_217292_3_, blockpos, p_217292_4_.func_216354_b());
+ .onRightClickBlock(p_217292_1_, p_217292_3_, blockpos, p_217292_4_);
+ if (event.isCanceled()) {
+ this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
+ return event.getCancellationResult();
@@ -122,7 +122,7 @@
+ boolean flag = !p_217292_1_.func_184614_ca().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_) || !p_217292_1_.func_184592_cb().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_);
boolean flag1 = p_217292_1_.func_226563_dT_() && flag;
- if (!flag1) {
+ if (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && !flag1) {
+ if (event.getUseBlock() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && !flag1)) {
ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
if (actionresulttype.func_226246_a_()) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -130,9 +130,10 @@
}
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return ActionResultType.PASS;
if (!itemstack.func_190926_b() && !p_217292_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
- if (!itemstack.func_190926_b() && !p_217292_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
- ItemUseContext itemusecontext = new ItemUseContext(p_217292_1_, p_217292_3_, p_217292_4_);
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return ActionResultType.PASS;
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (!itemstack.func_190926_b() && !p_217292_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b()))) {
ActionResultType actionresulttype1;
if (this.field_78779_k.func_77145_d()) {
int i = itemstack.func_190916_E();
@@ -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_) {
@@ -93,7 +93,7 @@
this.field_199725_m = itagcollectionsupplier;
if (!this.field_147302_e.func_150731_c()) {
itagcollectionsupplier.func_242212_e();
@@ -1883,10 +1899,12 @@
@@ -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_;
}
@@ -12,7 +12,19 @@
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 @@
@@ -347,6 +352,11 @@
}
public void func_228436_a_(ActiveRenderInfo p_228436_1_) {
+ net.minecraftforge.client.IWeatherParticleRenderHandler renderHandler = field_72769_h.func_239132_a_().getWeatherParticleRenderHandler();
+ if (renderHandler != null) {
+ renderHandler.render(field_72773_u, field_72769_h, field_72777_q, p_228436_1_);
+ return;
+ }
float f = this.field_72777_q.field_71441_e.func_72867_j(1.0F) / (Minecraft.func_71375_t() ? 1.0F : 2.0F);
if (!(f <= 0.0F)) {
Random random = new Random((long)this.field_72773_u * 312987231L);
@@ -830,7 +840,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;
@@ -21,7 +33,7 @@
this.field_175009_l.add(chunkrenderdispatcher$chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -915,13 +920,13 @@
@@ -915,13 +925,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) {
@@ -37,7 +49,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 +947,9 @@
@@ -942,7 +952,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);
@@ -47,7 +59,16 @@
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 +1017,7 @@
@@ -972,7 +984,7 @@
IRenderTypeBuffer.Impl irendertypebuffer$impl = this.field_228415_m_.func_228487_b_();
for(Entity entity : this.field_72769_h.func_217416_b()) {
- if ((this.field_175010_j.func_229086_a_(entity, clippinghelper, d0, d1, d2) || entity.func_184215_y(this.field_72777_q.field_71439_g)) && (entity != p_228426_6_.func_216773_g() || p_228426_6_.func_216770_i() || p_228426_6_.func_216773_g() instanceof LivingEntity && ((LivingEntity)p_228426_6_.func_216773_g()).func_70608_bn()) && (!(entity instanceof ClientPlayerEntity) || p_228426_6_.func_216773_g() == entity)) {
+ if ((this.field_175010_j.func_229086_a_(entity, clippinghelper, d0, d1, d2) || entity.func_184215_y(this.field_72777_q.field_71439_g)) && (entity != p_228426_6_.func_216773_g() || p_228426_6_.func_216770_i() || p_228426_6_.func_216773_g() instanceof LivingEntity && ((LivingEntity)p_228426_6_.func_216773_g()).func_70608_bn()) && (!(entity instanceof ClientPlayerEntity) || p_228426_6_.func_216773_g() == entity || (entity == field_72777_q.field_71439_g && !field_72777_q.field_71439_g.func_175149_v()))) { //FORGE: render local player entity when it is not the renderViewEntity
++this.field_72749_I;
if (entity.field_70173_aa == 0) {
entity.field_70142_S = entity.func_226277_ct_();
@@ -1010,6 +1022,7 @@
List<TileEntity> list = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b();
if (!list.isEmpty()) {
for(TileEntity tileentity1 : list) {
@@ -55,7 +76,7 @@
BlockPos blockpos3 = tileentity1.func_174877_v();
IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl;
p_228426_1_.func_227860_a_();
@@ -1035,6 +1043,7 @@
@@ -1035,6 +1048,7 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity : this.field_181024_n) {
@@ -63,7 +84,7 @@
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,10 +1093,13 @@
@@ -1084,10 +1098,13 @@
iprofiler.func_219895_b("outline");
BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
@@ -78,7 +99,7 @@
}
RenderSystem.pushMatrix();
@@ -1119,7 +1131,7 @@
@@ -1119,7 +1136,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");
@@ -87,7 +108,7 @@
RenderState.field_239237_T_.func_228549_b_();
} else {
iprofiler.func_219895_b("translucent");
@@ -1129,7 +1141,7 @@
@@ -1129,7 +1146,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");
@@ -96,7 +117,7 @@
}
RenderSystem.pushMatrix();
@@ -1481,6 +1493,11 @@
@@ -1481,6 +1498,11 @@
}
public void func_228424_a_(MatrixStack p_228424_1_, float p_228424_2_) {
@@ -108,7 +129,7 @@
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 @@
@@ -1609,6 +1631,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_) {
@@ -120,7 +141,7 @@
float f = this.field_72769_h.func_239132_a_().func_239213_a_();
if (!Float.isNaN(f)) {
RenderSystem.disableCull();
@@ -1792,7 +1814,7 @@
@@ -1792,7 +1819,7 @@
while(iterator.hasNext()) {
ChunkRenderDispatcher.ChunkRender chunkrenderdispatcher$chunkrender = iterator.next();
@@ -129,7 +150,7 @@
this.field_174995_M.func_228902_a_(chunkrenderdispatcher$chunkrender);
} else {
chunkrenderdispatcher$chunkrender.func_228929_a_(this.field_174995_M);
@@ -2076,7 +2098,12 @@
@@ -2076,7 +2103,12 @@
this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_);
}
@@ -142,7 +163,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 +2111,7 @@
@@ -2084,7 +2116,7 @@
}
if (p_184377_1_ != null) {
@@ -151,7 +172,7 @@
if (musicdiscitem != null) {
this.field_72777_q.field_71456_v.func_238451_a_(musicdiscitem.func_234801_g_());
}
@@ -2232,7 +2259,7 @@
@@ -2232,7 +2264,7 @@
break;
case 1010:
if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) {
@@ -160,7 +181,7 @@
} else {
this.func_184377_a((SoundEvent)null, p_180439_3_);
}
@@ -2382,8 +2409,8 @@
@@ -2382,8 +2414,8 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
@@ -171,7 +192,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 +2558,7 @@
@@ -2531,7 +2563,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_);
@@ -180,7 +201,7 @@
if (j < k) {
j = k;
}
@@ -2570,6 +2597,11 @@
@@ -2570,6 +2602,11 @@
return this.field_239226_J_;
}
@@ -13,3 +13,12 @@
}
}
@@ -77,7 +79,7 @@
protected void func_225629_a_(T p_225629_1_, ITextComponent p_225629_2_, MatrixStack p_225629_3_, IRenderTypeBuffer p_225629_4_, int p_225629_5_) {
double d0 = this.field_76990_c.func_229099_b_(p_225629_1_);
- if (!(d0 > 4096.0D)) {
+ if (net.minecraftforge.client.ForgeHooksClient.isNameplateInRenderDistance(p_225629_1_, d0)) {
boolean flag = !p_225629_1_.func_226273_bm_();
float f = p_225629_1_.func_213302_cg() + 0.5F;
int i = "deadmau5".equals(p_225629_2_.getString()) ? -10 : 0;
@@ -1,16 +1,14 @@
--- a/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
@@ -61,8 +61,12 @@
@@ -61,8 +61,11 @@
}
private void func_228876_a_(BlockPos p_228876_1_, BlockState p_228876_2_, MatrixStack p_228876_3_, IRenderTypeBuffer p_228876_4_, World p_228876_5_, boolean p_228876_6_, int p_228876_7_) {
- RenderType rendertype = RenderTypeLookup.func_239221_b_(p_228876_2_);
+ net.minecraft.client.renderer.RenderType.func_228661_n_().stream().filter(t -> RenderTypeLookup.canRenderInLayer(p_228876_2_, t)).forEach(rendertype -> {
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(rendertype);
+ net.minecraftforge.client.ForgeHooksClient.renderPistonMovedBlocks(p_228876_1_, p_228876_2_, p_228876_3_, p_228876_4_, p_228876_5_, p_228876_6_, p_228876_7_, field_178462_c == null ? field_178462_c = Minecraft.func_71410_x().func_175602_ab() : field_178462_c);
+ if(false) {
RenderType rendertype = RenderTypeLookup.func_239221_b_(p_228876_2_);
IVertexBuilder ivertexbuilder = p_228876_4_.getBuffer(rendertype);
+ if (field_178462_c == null) field_178462_c = Minecraft.func_71410_x().func_175602_ab();
this.field_178462_c.func_175019_b().func_228802_a_(p_228876_5_, this.field_178462_c.func_184389_a(p_228876_2_), p_228876_2_, p_228876_1_, p_228876_3_, ivertexbuilder, p_228876_6_, new Random(), p_228876_2_.func_209533_a(p_228876_1_), p_228876_7_);
+ });
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
+ }
}
}
@@ -13,5 +13,5 @@
}
}
+ @Override public boolean func_151470_d() { return this.field_74513_e; }
+ @Override public boolean func_151470_d() { return this.field_74513_e && (isConflictContextAndModifierActive() || field_228053_a_.getAsBoolean()); }
}
@@ -1,22 +1,26 @@
--- a/net/minecraft/client/world/DimensionRenderInfo.java
+++ b/net/minecraft/client/world/DimensionRenderInfo.java
@@ -26,6 +26,9 @@
@@ -26,6 +26,10 @@
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.IWeatherParticleRenderHandler weatherParticleRenderHandler = 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 @@
@@ -82,6 +86,35 @@
return this.field_239212_e_;
}
+ public void setWeatherRenderHandler(net.minecraftforge.client.IWeatherRenderHandler weatherRenderHandler) {
+ this.weatherRenderHandler = weatherRenderHandler;
+ }
+ public void setWeatherParticleRenderHandler(net.minecraftforge.client.IWeatherParticleRenderHandler weatherParticleRenderHandler) {
+ this.weatherParticleRenderHandler = weatherParticleRenderHandler;
+ }
+ public void setSkyRenderHandler(net.minecraftforge.client.ISkyRenderHandler skyRenderHandler) {
+ this.skyRenderHandler = skyRenderHandler;
+ }
@@ -32,6 +36,10 @@
+ return weatherRenderHandler;
+ }
+ @Nullable
+ public net.minecraftforge.client.IWeatherParticleRenderHandler getWeatherParticleRenderHandler() {
+ return weatherParticleRenderHandler;
+ }
+ @Nullable
+ public net.minecraftforge.client.ISkyRenderHandler getSkyRenderHandler() {
+ return skyRenderHandler;
+ }
@@ -0,0 +1,11 @@
--- a/net/minecraft/command/arguments/ArgumentTypes.java
+++ b/net/minecraft/command/arguments/ArgumentTypes.java
@@ -220,4 +220,8 @@
this.field_197481_c = p_i48088_3_;
}
}
+ @javax.annotation.Nullable public static ResourceLocation getId(ArgumentType<?> type) {
+ Entry<?> entry = func_201040_a(type);
+ return entry == null ? null : entry.field_197481_c;
+ }
}
@@ -1,10 +1,11 @@
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -21,8 +21,12 @@
@@ -21,8 +21,13 @@
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
+ OptionSpec<String> existing = optionparser.accepts("existing", "Existing resource packs that generated resources can reference").withRequiredArg();
+ OptionSpec<String> existingMod = optionparser.accepts("existing-mod", "Existing mods that generated resources can reference the resource packs of").withRequiredArg();
+ OptionSpec<java.io.File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(java.io.File.class).defaultsTo(new java.io.File(".")).required(); //Need by modlauncher, so lets just eat it
+ OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
+ OptionSpec<Void> flat = optionparser.accepts("flat", "Do not append modid prefix to output directory when generating for multiple mods");
@@ -14,7 +15,7 @@
Path path = Paths.get(optionspec7.value(optionset));
boolean flag = optionset.has(optionspec6);
boolean flag1 = flag || optionset.has(optionspec2);
@@ -30,10 +34,13 @@
@@ -30,10 +35,14 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
@@ -24,9 +25,10 @@
- datagenerator.func_200392_c();
+ Collection<Path> inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList());
+ Collection<Path> existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).collect(Collectors.toList());
+ java.util.Set<String> existingMods = new java.util.HashSet<>(optionset.valuesOf(existingMod));
+ java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
+ boolean isFlat = mods.isEmpty() || optionset.has(flat);
+ net.minecraftforge.fml.DatagenModLoader.begin(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5, isFlat);
+ net.minecraftforge.fml.DatagenModLoader.begin(mods, path, inputs, existingPacks, existingMods, 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,11 +1,12 @@
--- a/net/minecraft/data/TagsProvider.java
+++ b/net/minecraft/data/TagsProvider.java
@@ -28,10 +28,18 @@
@@ -28,10 +28,20 @@
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 final String modId;
+ protected final net.minecraftforge.common.data.ExistingFileHelper existingFileHelper;
+ private final net.minecraftforge.common.data.ExistingFileHelper.IResourceType resourceType;
+ @Deprecated//Forge, Use ModID version.
protected TagsProvider(DataGenerator p_i49827_1_, Registry<T> p_i49827_2_) {
@@ -16,10 +17,11 @@
this.field_200435_c = p_i49827_2_;
+ this.modId = modId;
+ this.existingFileHelper = existingFileHelper;
+ this.resourceType = new net.minecraftforge.common.data.ExistingFileHelper.ResourceType(net.minecraft.resources.ResourcePackType.SERVER_DATA, ".json", "tags/" + getTagFolder());
}
protected abstract void func_200432_c();
@@ -47,12 +55,14 @@
@@ -47,12 +57,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_) -> {
@@ -35,7 +37,7 @@
try {
String s = field_200437_e.toJson((JsonElement)jsonobject);
@@ -74,11 +84,26 @@
@@ -74,20 +86,36 @@
});
}
@@ -44,7 +46,7 @@
+ // 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 existingFileHelper == null || !existingFileHelper.exists(((ITag.TagEntry)entry).getId(), resourceType);
+ }
+ return false;
+ }
@@ -63,7 +65,9 @@
}
protected ITag.Builder func_240525_b_(ITag.INamedTag<T> p_240525_1_) {
@@ -87,7 +112,7 @@
return this.field_200434_b.computeIfAbsent(p_240525_1_.func_230234_a_(), (p_240526_0_) -> {
+ existingFileHelper.trackGenerated(p_240526_0_, resourceType);
return new ITag.Builder();
});
}
@@ -72,7 +76,7 @@
private final ITag.Builder field_240528_a_;
private final Registry<T> field_240529_b_;
private final String field_240530_c_;
@@ -115,5 +140,18 @@
@@ -115,5 +143,18 @@
});
return this;
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/enchantment/EfficiencyEnchantment.java
+++ b/net/minecraft/enchantment/EfficiencyEnchantment.java
@@ -22,6 +22,6 @@
}
public boolean func_92089_a(ItemStack p_92089_1_) {
- return p_92089_1_.func_77973_b() == Items.field_151097_aZ ? true : super.func_92089_a(p_92089_1_);
+ return p_92089_1_.func_77973_b() instanceof net.minecraft.item.ShearsItem ? true : super.func_92089_a(p_92089_1_);
}
}
@@ -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;
}
@@ -231,9 +231,8 @@
this.func_213319_R();
this.field_70170_p.func_217381_Z().func_76320_a("reposition");
- PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
- if (portalinfo == null) {
+ PortalInfo portalinfo = teleporter.isVanilla() ? this.func_241829_a(p_241206_1_) : null;
+ if (portalinfo == null && teleporter.isVanilla()) {
+ PortalInfo portalinfo = teleporter.getPortalInfo(this, p_241206_1_, this::func_241829_a);
if (portalinfo == null) {
return null;
} else {
+ Entity transportedEntity = teleporter.placeEntity(this, (ServerWorld) this.field_70170_p, p_241206_1_, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic
@@ -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_;
@@ -481,7 +481,7 @@
}
public boolean func_70094_T() {
@@ -3082,6 +3138,60 @@
@@ -3082,6 +3138,58 @@
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}
@@ -531,12 +531,10 @@
+ }
+
+ @Override
+ public void remove(boolean keepData) {
+ super.remove(keepData);
+ if (!keepData) {
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ }
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ }
+
@OnlyIn(Dist.CLIENT)
@@ -0,0 +1,22 @@
--- a/net/minecraft/entity/ai/goal/TriggerSkeletonTrapGoal.java
+++ b/net/minecraft/entity/ai/goal/TriggerSkeletonTrapGoal.java
@@ -28,6 +28,10 @@
public void func_75246_d() {
ServerWorld serverworld = (ServerWorld)this.field_188516_a.field_70170_p;
+ // Forge: Trigger the trap in a tick task to avoid crashes when mods add goals to skeleton horses
+ // (MC-206338/Forge PR #7509)
+ serverworld.func_73046_m().func_212871_a_(new net.minecraft.util.concurrent.TickDelayedTask(serverworld.func_73046_m().func_71259_af(), () -> {
+ if (!this.field_188516_a.func_70089_S()) return;
DifficultyInstance difficultyinstance = serverworld.func_175649_E(this.field_188516_a.func_233580_cy_());
this.field_188516_a.func_190691_p(false);
this.field_188516_a.func_110234_j(true);
@@ -47,7 +51,7 @@
abstracthorseentity.func_70024_g(this.field_188516_a.func_70681_au().nextGaussian() * 0.5D, 0.0D, this.field_188516_a.func_70681_au().nextGaussian() * 0.5D);
serverworld.func_242417_l(abstracthorseentity);
}
-
+ }));
}
private AbstractHorseEntity func_188515_a(DifficultyInstance p_188515_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
+++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
@@ -118,17 +118,19 @@
@@ -118,17 +118,18 @@
}
@Nullable
@@ -20,11 +20,10 @@
- super.func_70106_y();
+ super.remove(keepData);
+ if (!keepData) itemHandler.invalidate();
}
protected void func_213281_b(CompoundNBT p_213281_1_) {
@@ -157,6 +159,8 @@
@@ -157,6 +158,8 @@
}
public ActionResultType func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) {
@@ -33,7 +32,7 @@
p_184230_1_.func_213829_a(this);
if (!p_184230_1_.field_70170_p.field_72995_K) {
PiglinTasks.func_234478_a_(p_184230_1_, true);
@@ -185,6 +189,8 @@
@@ -185,6 +188,8 @@
this.field_184290_c = null;
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_237457_g_, this.func_213303_ch()).func_216016_a(this.field_184291_d);
@@ -42,7 +41,7 @@
if (p_184288_1_ != null) {
lootcontext$builder.func_186469_a(p_184288_1_.func_184817_da()).func_216015_a(LootParameters.field_216281_a, p_184288_1_);
}
@@ -215,4 +221,17 @@
@@ -215,4 +220,23 @@
}
protected abstract Container func_213968_a(int p_213968_1_, PlayerInventory p_213968_2_);
@@ -56,6 +55,12 @@
+ return super.getCapability(capability, facing);
+ }
+
+ @Override
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ itemHandler.invalidate();
+ }
+
+ public void dropContentsWhenDead(boolean value) {
+ this.field_94112_b = value;
+ }
@@ -19,3 +19,20 @@
}
@OnlyIn(Dist.CLIENT)
@@ -687,7 +688,7 @@
}
public void func_241841_a(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_) {
- if (p_241841_1_.func_175659_aa() != Difficulty.PEACEFUL) {
+ if (p_241841_1_.func_175659_aa() != Difficulty.PEACEFUL && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_200759_ay, (timer) -> {})) {
field_184243_a.info("Villager {} was struck by lightning {}.", this, p_241841_2_);
WitchEntity witchentity = EntityType.field_200759_ay.func_200721_a(p_241841_1_);
witchentity.func_70012_b(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), this.field_70177_z, this.field_70125_A);
@@ -699,6 +700,7 @@
}
witchentity.func_110163_bv();
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, witchentity);
p_241841_1_.func_242417_l(witchentity);
this.func_242369_fq();
this.func_70106_y();
@@ -1,13 +1,19 @@
--- a/net/minecraft/entity/monster/HoglinEntity.java
+++ b/net/minecraft/entity/monster/HoglinEntity.java
@@ -279,8 +279,8 @@
return hoglinentity;
}
@@ -117,7 +117,7 @@
HoglinTasks.func_234377_a_(this);
if (this.func_234364_eK_()) {
++this.field_234358_by_;
- if (this.field_234358_by_ > 300) {
+ if (this.field_234358_by_ > 300 && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_233590_aW_, (timer) -> this.field_234358_by_ = timer)) {
this.func_241412_a_(SoundEvents.field_232715_fE_);
this.func_234360_a_((ServerWorld)this.field_70170_p);
}
@@ -212,6 +212,7 @@
ZoglinEntity zoglinentity = this.func_233656_b_(EntityType.field_233590_aW_, true);
if (zoglinentity != null) {
zoglinentity.func_195064_c(new EffectInstance(Effects.field_76431_k, 200, 0));
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, zoglinentity);
}
- 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() {
@@ -1,11 +0,0 @@
--- 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,6 +1,24 @@
--- a/net/minecraft/entity/monster/ZombieEntity.java
+++ b/net/minecraft/entity/monster/ZombieEntity.java
@@ -268,12 +268,16 @@
@@ -186,7 +186,8 @@
if (!this.field_70170_p.field_72995_K && this.func_70089_S() && !this.func_175446_cd()) {
if (this.func_204706_dD()) {
--this.field_204708_bE;
- if (this.field_204708_bE < 0) {
+
+ if (this.field_204708_bE < 0 && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_200725_aD, (timer) -> this.field_204708_bE = timer)) {
this.func_207302_dI();
}
} else if (this.func_204703_dA()) {
@@ -248,6 +249,7 @@
if (zombieentity != null) {
zombieentity.func_207304_a(zombieentity.field_70170_p.func_175649_E(zombieentity.func_233580_cy_()).func_180170_c());
zombieentity.func_146070_a(zombieentity.func_204900_dz() && this.func_146072_bX());
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, zombieentity);
}
}
@@ -268,12 +270,16 @@
livingentity = (LivingEntity)p_70097_1_.func_76346_g();
}
@@ -19,7 +37,7 @@
for(int l = 0; l < 50; ++l) {
int i1 = i + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
@@ -284,6 +288,7 @@
@@ -284,6 +290,7 @@
if (WorldEntitySpawner.func_209382_a(entityspawnplacementregistry$placementtype, this.field_70170_p, blockpos, entitytype) && EntitySpawnPlacementRegistry.func_223515_a(entitytype, serverworld, SpawnReason.REINFORCEMENT, blockpos, this.field_70170_p.field_73012_v)) {
zombieentity.func_70107_b((double)i1, (double)j1, (double)k1);
if (!this.field_70170_p.func_217358_a((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_226668_i_(zombieentity) && this.field_70170_p.func_226669_j_(zombieentity) && !this.field_70170_p.func_72953_d(zombieentity.func_174813_aQ())) {
@@ -27,7 +45,24 @@
zombieentity.func_70624_b(livingentity);
zombieentity.func_213386_a(serverworld, this.field_70170_p.func_175649_E(zombieentity.func_233580_cy_()), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null);
serverworld.func_242417_l(zombieentity);
@@ -448,7 +453,7 @@
@@ -369,7 +376,7 @@
public void func_241847_a(ServerWorld p_241847_1_, LivingEntity p_241847_2_) {
super.func_241847_a(p_241847_1_, p_241847_2_);
- if ((p_241847_1_.func_175659_aa() == Difficulty.NORMAL || p_241847_1_.func_175659_aa() == Difficulty.HARD) && p_241847_2_ instanceof VillagerEntity) {
+ if ((p_241847_1_.func_175659_aa() == Difficulty.NORMAL || p_241847_1_.func_175659_aa() == Difficulty.HARD) && p_241847_2_ instanceof VillagerEntity && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(p_241847_2_, EntityType.field_200727_aF, (timer) -> {})) {
if (p_241847_1_.func_175659_aa() != Difficulty.HARD && this.field_70146_Z.nextBoolean()) {
return;
}
@@ -381,6 +388,7 @@
zombievillagerentity.func_223727_a(villagerentity.func_223722_es().func_234058_a_(NBTDynamicOps.field_210820_a).getValue());
zombievillagerentity.func_213790_g(villagerentity.func_213706_dY().func_222199_a());
zombievillagerentity.func_213789_a(villagerentity.func_213708_dV());
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(p_241847_2_, zombievillagerentity);
if (!this.func_174814_R()) {
p_241847_1_.func_217378_a((PlayerEntity)null, 1026, this.func_233580_cy_(), 0);
}
@@ -448,7 +456,7 @@
}
public static boolean func_241399_a_(Random p_241399_0_) {
@@ -36,7 +71,7 @@
}
protected void func_207304_a(float p_207304_1_) {
@@ -468,7 +473,7 @@
@@ -468,7 +476,7 @@
}
protected void func_230291_eT_() {
@@ -0,0 +1,20 @@
--- a/net/minecraft/entity/monster/ZombieVillagerEntity.java
+++ b/net/minecraft/entity/monster/ZombieVillagerEntity.java
@@ -116,7 +116,7 @@
if (!this.field_70170_p.field_72995_K && this.func_70089_S() && this.func_82230_o()) {
int i = this.func_190735_dq();
this.field_82234_d -= i;
- if (this.field_82234_d <= 0) {
+ if (this.field_82234_d <= 0 && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_200756_av, (timer) -> this.field_82234_d = timer)) {
this.func_213791_a((ServerWorld)this.field_70170_p);
}
}
@@ -218,7 +218,7 @@
if (!this.func_174814_R()) {
p_213791_1_.func_217378_a((PlayerEntity)null, 1027, this.func_233580_cy_(), 0);
}
-
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, villagerentity);
}
private int func_190735_dq() {
@@ -0,0 +1,19 @@
--- a/net/minecraft/entity/monster/piglin/AbstractPiglinEntity.java
+++ b/net/minecraft/entity/monster/piglin/AbstractPiglinEntity.java
@@ -83,7 +83,7 @@
this.field_242334_c = 0;
}
- if (this.field_242334_c > 300) {
+ if (this.field_242334_c > 300 && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_233592_ba_, (timer) -> this.field_242334_c = timer)) {
this.func_241848_eP();
this.func_234416_a_((ServerWorld)this.field_70170_p);
}
@@ -98,6 +98,7 @@
ZombifiedPiglinEntity zombifiedpiglinentity = this.func_233656_b_(EntityType.field_233592_ba_, true);
if (zombifiedpiglinentity != null) {
zombifiedpiglinentity.func_195064_c(new EffectInstance(Effects.field_76431_k, 200, 0));
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, zombifiedpiglinentity);
}
}
@@ -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 {
@@ -0,0 +1,19 @@
--- a/net/minecraft/entity/passive/PigEntity.java
+++ b/net/minecraft/entity/passive/PigEntity.java
@@ -203,7 +203,7 @@
}
public void func_241841_a(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_) {
- if (p_241841_1_.func_175659_aa() != Difficulty.PEACEFUL) {
+ if (p_241841_1_.func_175659_aa() != Difficulty.PEACEFUL && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.field_233592_ba_, (timer) -> {})) {
ZombifiedPiglinEntity zombifiedpiglinentity = EntityType.field_233592_ba_.func_200721_a(p_241841_1_);
zombifiedpiglinentity.func_184201_a(EquipmentSlotType.MAINHAND, new ItemStack(Items.field_151010_B));
zombifiedpiglinentity.func_70012_b(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), this.field_70177_z, this.field_70125_A);
@@ -215,6 +215,7 @@
}
zombifiedpiglinentity.func_110163_bv();
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, zombifiedpiglinentity);
p_241841_1_.func_217376_c(zombifiedpiglinentity);
this.func_70106_y();
} 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() {
@@ -43,9 +43,9 @@
+ }
+
+ @Override
+ public void remove(boolean keepData) {
+ super.remove(keepData);
+ if (!keepData && itemHandler != null) {
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ if (itemHandler != null) {
+ itemHandler.invalidate();
+ itemHandler = null;
+ }
@@ -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_);
}
@@ -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
@@ -26,18 +26,17 @@
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_);
- if (portalinfo != null) {
+ 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 = teleporter.isVanilla() ? this.func_241829_a(p_241206_1_) : null;
+ if (portalinfo != null || !teleporter.isVanilla()) {
+ 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");
if (registrykey == World.field_234918_g_ && p_241206_1_.func_234923_W_() == World.field_234919_h_) {
@@ -47,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);
@@ -57,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;
@@ -65,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_) {
@@ -75,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);
@@ -84,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_) {
@@ -92,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;
@@ -100,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);
@@ -108,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);
@@ -116,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());
@@ -130,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));
@@ -138,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_);
@@ -156,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);
@@ -164,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_) {
@@ -172,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 {
@@ -181,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.
@@ -194,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 @@
}
@@ -26,7 +26,7 @@
+
if (!itemstack2.func_190926_b()) {
- boolean flag = itemstack2.func_77973_b() == Items.field_151134_bR && !EnchantedBookItem.func_92110_g(itemstack2).isEmpty();
+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_234642_c_, field_82857_m, j)) return;
+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_234642_c_, field_82857_m, j, this.field_234645_f_)) return;
+ flag = itemstack2.func_77973_b() == Items.field_151134_bR && !EnchantedBookItem.func_92110_g(itemstack2).isEmpty();
if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) {
int l2 = Math.min(itemstack1.func_77952_i(), itemstack1.func_77958_k() / 4);
@@ -214,7 +214,7 @@
return list;
}
@@ -817,7 +841,7 @@
@@ -817,9 +841,10 @@
}
}
} else {
@@ -222,8 +222,11 @@
+ multimap = this.func_77973_b().getAttributeModifiers(p_111283_1_, this);
}
+ multimap = net.minecraftforge.common.ForgeHooks.getAttributeModifiers(this, p_111283_1_, multimap);
return multimap;
@@ -954,6 +978,35 @@
}
@@ -954,6 +979,35 @@
return this.func_77973_b().func_219971_r();
}
@@ -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;
}
@@ -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_) {
@@ -1,12 +0,0 @@
--- a/net/minecraft/network/play/server/SCommandListPacket.java
+++ b/net/minecraft/network/play/server/SCommandListPacket.java
@@ -119,6 +119,9 @@
String s = p_197695_0_.func_150789_c(32767);
ArgumentType<?> argumenttype = ArgumentTypes.func_197486_a(p_197695_0_);
if (argumenttype == null) {
+ if ((i & 16) != 0) { // FORGE: Flush unused suggestion data
+ p_197695_0_.func_192575_l();
+ }
return null;
} else {
RequiredArgumentBuilder<ISuggestionProvider, ?> requiredargumentbuilder = RequiredArgumentBuilder.argument(s, argumenttype);
@@ -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() {
@@ -0,0 +1,14 @@
--- a/net/minecraft/pathfinding/PathNavigator.java
+++ b/net/minecraft/pathfinding/PathNavigator.java
@@ -208,9 +208,9 @@
Vector3d vector3d = this.func_75502_i();
this.field_188561_o = this.field_75515_a.func_213311_cf() > 0.75F ? this.field_75515_a.func_213311_cf() / 2.0F : 0.75F - this.field_75515_a.func_213311_cf() / 2.0F;
Vector3i vector3i = this.field_75514_c.func_242948_g();
- double d0 = Math.abs(this.field_75515_a.func_226277_ct_() - ((double)vector3i.func_177958_n() + 0.5D));
+ double d0 = Math.abs(this.field_75515_a.func_226277_ct_() - ((double)vector3i.func_177958_n() + (this.field_75515_a.func_213311_cf() + 1) / 2D)); //Forge: Fix MC-94054
double d1 = Math.abs(this.field_75515_a.func_226278_cu_() - (double)vector3i.func_177956_o());
- double d2 = Math.abs(this.field_75515_a.func_226281_cx_() - ((double)vector3i.func_177952_p() + 0.5D));
+ double d2 = Math.abs(this.field_75515_a.func_226281_cx_() - ((double)vector3i.func_177952_p() + (this.field_75515_a.func_213311_cf() + 1) / 2D)); //Forge: Fix MC-94054
boolean flag = d0 < (double)this.field_188561_o && d2 < (double)this.field_188561_o && d1 < 1.0D;
if (flag || this.field_75515_a.func_233660_b_(this.field_75514_c.func_237225_h_().field_186287_m) && this.func_234112_b_(vector3d)) {
this.field_75514_c.func_75875_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);
}
@@ -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,16 @@
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 @@
@@ -142,6 +149,8 @@
dimensiongeneratorsettings = optionset.has(optionspec3) ? serverproperties.field_241082_U_.func_236230_k_() : serverproperties.field_241082_U_;
}
+ // Forge: Deserialize the DimensionGeneratorSettings to ensure modded dims are loaded on first server load (see SimpleRegistryCodec#decode). Vanilla behaviour only loads from the server.properties and deserializes only after the 2nd server load.
+ dimensiongeneratorsettings = DimensionGeneratorSettings.field_236201_a_.encodeStart(net.minecraft.util.registry.WorldGenSettingsExport.func_240896_a_(NBTDynamicOps.field_210820_a, dynamicregistries$impl), dimensiongeneratorsettings).flatMap(nbt -> DimensionGeneratorSettings.field_236201_a_.parse(worldsettingsimport, nbt)).getOrThrow(false, errorMsg->{});
iserverconfiguration = new ServerWorldInfo(worldsettings, dimensiongeneratorsettings, Lifecycle.stable());
}
@@ -169,6 +178,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_) {
@@ -125,7 +125,7 @@
public ActionResultType func_219441_a(ServerPlayerEntity p_219441_1_, World p_219441_2_, ItemStack p_219441_3_, Hand p_219441_4_, BlockRayTraceResult p_219441_5_) {
BlockPos blockpos = p_219441_5_.func_216350_a();
BlockState blockstate = p_219441_2_.func_180495_p(blockpos);
+ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks.onRightClickBlock(p_219441_1_, p_219441_4_, blockpos, p_219441_5_.func_216354_b());
+ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks.onRightClickBlock(p_219441_1_, p_219441_4_, blockpos, p_219441_5_);
+ if (event.isCanceled()) return event.getCancellationResult();
if (this.field_73091_c == GameType.SPECTATOR) {
INamedContainerProvider inamedcontainerprovider = blockstate.func_215699_b(p_219441_2_, blockpos);
@@ -144,15 +144,17 @@
+ boolean flag1 = (p_219441_1_.func_226563_dT_() && flag) && !(p_219441_1_.func_184614_ca().doesSneakBypassUse(p_219441_2_, blockpos, p_219441_1_) && p_219441_1_.func_184592_cb().doesSneakBypassUse(p_219441_2_, blockpos, p_219441_1_));
ItemStack itemstack = p_219441_3_.func_77946_l();
- if (!flag1) {
+ if (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && !flag1) {
+ if (event.getUseBlock() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && !flag1)) {
ActionResultType actionresulttype = blockstate.func_227031_a_(p_219441_2_, p_219441_1_, p_219441_4_, p_219441_5_);
if (actionresulttype.func_226246_a_()) {
CriteriaTriggers.field_232607_M_.func_226695_a_(p_219441_1_, blockpos, itemstack);
@@ -312,7 +343,7 @@
@@ -311,8 +342,8 @@
}
}
if (!p_219441_3_.func_190926_b() && !p_219441_1_.func_184811_cZ().func_185141_a(p_219441_3_.func_77973_b())) {
- if (!p_219441_3_.func_190926_b() && !p_219441_1_.func_184811_cZ().func_185141_a(p_219441_3_.func_77973_b())) {
- ItemUseContext itemusecontext = new ItemUseContext(p_219441_1_, p_219441_4_, p_219441_5_);
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (!p_219441_3_.func_190926_b() && !p_219441_1_.func_184811_cZ().func_185141_a(p_219441_3_.func_77973_b()))) {
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return ActionResultType.PASS;
ActionResultType actionresulttype1;
if (this.func_73083_d()) {
@@ -106,7 +106,16 @@
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 +795,7 @@
@@ -769,6 +778,8 @@
this.field_192055_p.put(uuid, playeradvancements);
}
+ // Forge: don't overwrite active player with a fake one.
+ if (!(p_192054_1_ instanceof net.minecraftforge.common.util.FakePlayer))
playeradvancements.func_192739_a(p_192054_1_);
return playeradvancements;
}
@@ -786,7 +797,7 @@
}
public List<ServerPlayerEntity> func_181057_v() {
@@ -115,7 +124,7 @@
}
@Nullable
@@ -804,6 +813,7 @@
@@ -804,6 +815,7 @@
}
this.func_148540_a(new STagsListPacket(this.field_72400_f.func_244266_aF()));
@@ -123,7 +132,7 @@
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 @@
@@ -816,4 +828,12 @@
public boolean func_206257_x() {
return this.field_72407_n;
}
@@ -19,7 +19,7 @@
+ 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 #func_232937_a_(String)} */
+ /** 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));
+ }
@@ -118,8 +118,8 @@
+ }
+
+ @Override
+ public void func_145843_s() {
+ super.func_145843_s();
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ }
@@ -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");
+ }
+
@@ -76,8 +76,8 @@
+ }
+
+ @Override
+ public void func_145843_s() {
+ super.func_145843_s();
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ }
@@ -51,8 +51,8 @@
+ }
+
+ @Override
+ public void func_145843_s() {
+ super.func_145843_s();
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ if (chestHandler != null)
+ chestHandler.invalidate();
+ }
@@ -1,6 +1,6 @@
--- a/net/minecraft/tileentity/LockableTileEntity.java
+++ b/net/minecraft/tileentity/LockableTileEntity.java
@@ -81,4 +81,22 @@
@@ -81,4 +81,21 @@
}
protected abstract Container func_213906_a(int p_213906_1_, PlayerInventory p_213906_2_);
@@ -10,7 +10,6 @@
+ return new net.minecraftforge.items.wrapper.InvWrapper(this);
+ }
+
+ @javax.annotation.Nullable
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, @javax.annotation.Nullable net.minecraft.util.Direction side) {
+ if (!this.field_145846_f && cap == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY )
+ return itemHandler.cast();
@@ -18,8 +17,8 @@
+ }
+
+ @Override
+ public void func_145843_s() {
+ super.func_145843_s();
+ protected void invalidateCaps() {
+ super.invalidateCaps();
+ itemHandler.invalidate();
+ }
}
@@ -49,7 +49,7 @@
this.field_145850_b.func_175666_e(this.field_174879_c, this.field_195045_e.func_177230_c());
}
}
@@ -133,6 +140,8 @@
@@ -133,8 +140,15 @@
public void func_145843_s() {
this.field_145846_f = true;
@@ -57,8 +57,15 @@
+ requestModelDataUpdate();
}
+ @Override
+ public void onChunkUnloaded() {
+ this.invalidateCaps();
+ }
+
public void func_145829_t() {
@@ -175,6 +184,13 @@
this.field_145846_f = false;
}
@@ -175,6 +189,13 @@
return this.field_200663_e;
}
@@ -9,3 +9,26 @@
private static final Logger field_206866_A = LogManager.getLogger();
public static final TileEntityType<FurnaceTileEntity> field_200971_b = func_200966_a("furnace", TileEntityType.Builder.func_223042_a(FurnaceTileEntity::new, Blocks.field_150460_al));
public static final TileEntityType<ChestTileEntity> field_200972_c = func_200966_a("chest", TileEntityType.Builder.func_223042_a(ChestTileEntity::new, Blocks.field_150486_ae));
@@ -54,6 +54,7 @@
private final Supplier<? extends T> field_200995_z;
private final Set<Block> field_223046_I;
private final Type<?> field_206867_C;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<TileEntityType<?>> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.TILE_ENTITIES));
@Nullable
public static ResourceLocation func_200969_a(TileEntityType<?> p_200969_0_) {
@@ -75,6 +76,14 @@
this.field_206867_C = p_i51497_3_;
}
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ public boolean isIn(net.minecraft.tags.ITag<TileEntityType<?>> tag) {
+ return tag.func_230235_a_(this);
+ }
+
@Nullable
public T func_200968_a() {
return this.field_200995_z.get();
@@ -0,0 +1,15 @@
--- a/net/minecraft/util/ResourceLocation.java
+++ b/net/minecraft/util/ResourceLocation.java
@@ -112,6 +112,12 @@
return i;
}
+ // Normal compare sorts by path first, this compares namespace first.
+ public int compareNamespaced(ResourceLocation o) {
+ int ret = this.field_110626_a.compareTo(o.field_110626_a);
+ return ret != 0 ? ret : this.field_110625_b.compareTo(o.field_110625_b);
+ }
+
public static ResourceLocation func_195826_a(StringReader p_195826_0_) throws CommandSyntaxException {
int i = p_195826_0_.getCursor();
@@ -1,6 +1,6 @@
--- a/net/minecraft/util/SharedConstants.java
+++ b/net/minecraft/util/SharedConstants.java
@@ -40,6 +40,7 @@
@@ -44,6 +44,7 @@
}
static {
@@ -1,6 +1,6 @@
--- a/net/minecraft/util/math/vector/Vector4f.java
+++ b/net/minecraft/util/math/vector/Vector4f.java
@@ -128,4 +128,16 @@
@@ -125,4 +125,16 @@
public String toString() {
return "[" + this.field_229368_a_ + ", " + this.field_229369_b_ + ", " + this.field_229370_c_ + ", " + this.field_229371_d_ + "]";
}
@@ -1,14 +1,15 @@
--- a/net/minecraft/util/registry/Bootstrap.java
+++ b/net/minecraft/util/registry/Bootstrap.java
@@ -48,6 +48,7 @@
@@ -48,6 +48,8 @@
IDispenseItemBehavior.func_218401_c();
ArgumentTypes.func_197483_a();
TagRegistryManager.func_242197_b();
+ net.minecraftforge.registries.GameData.vanillaSnapshot();
+ if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context
func_179868_d();
}
}
@@ -103,7 +104,6 @@
@@ -103,7 +105,6 @@
Commands.func_242986_b();
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/util/registry/DynamicRegistries.java
+++ b/net/minecraft/util/registry/DynamicRegistries.java
@@ -90,6 +90,8 @@
RegistryKey<? extends Registry<E>> registrykey = p_243607_2_.func_243622_a();
boolean flag = !registrykey.equals(Registry.field_243549_ar) && !registrykey.equals(Registry.field_239698_ad_);
Registry<E> registry = field_243600_c.func_243612_b(registrykey);
+ if (!registrykey.equals(Registry.field_239698_ad_))
+ registry = ((Registry<Registry<E>>)WorldGenRegistries.field_243650_b).func_230516_a_((RegistryKey<Registry<E>>)registrykey);
MutableRegistry<E> mutableregistry = p_243607_0_.func_243612_b(registrykey);
for(Entry<RegistryKey<E>, E> entry : registry.func_239659_c_()) {
@@ -0,0 +1,12 @@
--- a/net/minecraft/util/registry/SimpleRegistry.java
+++ b/net/minecraft/util/registry/SimpleRegistry.java
@@ -212,7 +212,8 @@
}
public static <T> Codec<SimpleRegistry<T>> func_241745_c_(RegistryKey<? extends Registry<T>> p_241745_0_, Lifecycle p_241745_1_, Codec<T> p_241745_2_) {
- return Codec.unboundedMap(ResourceLocation.field_240908_a_.xmap(RegistryKey.func_240902_a_(p_241745_0_), RegistryKey::func_240901_a_), p_241745_2_).xmap((p_239656_2_) -> {
+ // FORGE: Fix MC-197860
+ return new net.minecraftforge.common.LenientUnboundedMapCodec<>(ResourceLocation.field_240908_a_.xmap(RegistryKey.func_240902_a_(p_241745_0_), RegistryKey::func_240901_a_), p_241745_2_).xmap((p_239656_2_) -> {
SimpleRegistry<T> simpleregistry = new SimpleRegistry<>(p_241745_0_, p_241745_1_);
p_239656_2_.forEach((p_239653_2_, p_239653_3_) -> {
simpleregistry.func_218381_a(p_239653_2_, p_239653_3_, p_241745_1_);
@@ -9,3 +9,33 @@
private static final Supplier<Set<PointOfInterestType>> field_234168_y_ = Suppliers.memoize(() -> {
return Registry.field_218370_L.func_201756_e().map(VillagerProfession::func_221149_b).collect(Collectors.toSet());
});
@@ -36,7 +36,7 @@
}).filter((p_234173_0_) -> {
return p_234173_0_.func_177229_b(BedBlock.field_176472_a) == BedPart.HEAD;
}).collect(ImmutableSet.toImmutableSet());
- private static final Map<BlockState, PointOfInterestType> field_221073_u = Maps.newHashMap();
+ private static final Map<BlockState, PointOfInterestType> field_221073_u = net.minecraftforge.registries.GameData.getBlockStatePointOfInterestTypeMap();
public static final PointOfInterestType field_221054_b = func_226360_a_("unemployed", ImmutableSet.of(), 1, field_221071_s, 1);
public static final PointOfInterestType field_221055_c = func_226359_a_("armorer", func_221042_a(Blocks.field_222424_lM), 1, 1);
public static final PointOfInterestType field_221056_d = func_226359_a_("butcher", func_221042_a(Blocks.field_222423_lL), 1, 1);
@@ -112,16 +112,14 @@
}
private static PointOfInterestType func_221052_a(PointOfInterestType p_221052_0_) {
- p_221052_0_.field_221075_w.forEach((p_234169_1_) -> {
- PointOfInterestType pointofinteresttype = field_221073_u.put(p_234169_1_, p_221052_0_);
- if (pointofinteresttype != null) {
- throw (IllegalStateException)Util.func_229757_c_(new IllegalStateException(String.format("%s is defined in too many tags", p_234169_1_)));
- }
- });
return p_221052_0_;
}
public static Optional<PointOfInterestType> func_221047_b(BlockState p_221047_0_) {
return Optional.ofNullable(field_221073_u.get(p_221047_0_));
}
+
+ public ImmutableSet<BlockState> getBlockStates() {
+ return ImmutableSet.copyOf(this.field_221075_w);
+ }
}
@@ -248,7 +248,7 @@
explosion.func_77278_a();
explosion.func_77279_a(true);
return explosion;
@@ -562,6 +621,7 @@
@@ -561,6 +620,7 @@
public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
if (!func_189509_E(p_175690_1_)) {
@@ -256,7 +256,7 @@
if (p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
if (this.field_147481_N) {
p_175690_2_.func_226984_a_(this, p_175690_1_);
@@ -577,7 +637,8 @@
@@ -576,7 +636,8 @@
this.field_147484_a.add(p_175690_2_);
} else {
@@ -266,7 +266,7 @@
this.func_175700_a(p_175690_2_);
}
}
@@ -590,6 +651,8 @@
@@ -589,6 +650,8 @@
if (tileentity != null && this.field_147481_N) {
tileentity.func_145843_s();
this.field_147484_a.remove(tileentity);
@@ -275,7 +275,7 @@
} else {
if (tileentity != null) {
this.field_147484_a.remove(tileentity);
@@ -599,7 +662,7 @@
@@ -598,7 +661,7 @@
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
}
@@ -284,7 +284,7 @@
}
public boolean func_195588_v(BlockPos p_195588_1_) {
@@ -652,10 +715,10 @@
@@ -651,10 +714,10 @@
public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
this.func_217381_Z().func_230035_c_("getEntities");
List<Entity> list = Lists.newArrayList();
@@ -299,7 +299,7 @@
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
for(int i1 = i; i1 <= j; ++i1) {
@@ -672,10 +735,10 @@
@@ -671,10 +734,10 @@
public <T extends Entity> List<T> func_217394_a(@Nullable EntityType<T> p_217394_1_, AxisAlignedBB p_217394_2_, Predicate<? super T> p_217394_3_) {
this.func_217381_Z().func_230035_c_("getEntities");
@@ -314,7 +314,7 @@
List<T> list = Lists.newArrayList();
for(int i1 = i; i1 < j; ++i1) {
@@ -692,10 +755,10 @@
@@ -691,10 +754,10 @@
public <T extends Entity> List<T> func_175647_a(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate<? super T> p_175647_3_) {
this.func_217381_Z().func_230035_c_("getEntities");
@@ -329,7 +329,7 @@
List<T> list = Lists.newArrayList();
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
@@ -713,10 +776,10 @@
@@ -712,10 +775,10 @@
public <T extends Entity> List<T> func_225316_b(Class<? extends T> p_225316_1_, AxisAlignedBB p_225316_2_, @Nullable Predicate<? super T> p_225316_3_) {
this.func_217381_Z().func_230035_c_("getLoadedEntities");
@@ -344,7 +344,7 @@
List<T> list = Lists.newArrayList();
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
@@ -740,6 +803,7 @@
@@ -739,6 +802,7 @@
this.func_175726_f(p_175646_1_).func_76630_e();
}
@@ -352,7 +352,7 @@
}
public int func_181545_F() {
@@ -784,7 +848,7 @@
@@ -783,7 +847,7 @@
public int func_175651_c(BlockPos p_175651_1_, Direction p_175651_2_) {
BlockState blockstate = this.func_180495_p(p_175651_1_);
int i = blockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
@@ -361,7 +361,7 @@
}
public boolean func_175640_z(BlockPos p_175640_1_) {
@@ -939,16 +1003,15 @@
@@ -938,16 +1002,15 @@
public abstract Scoreboard func_96441_U();
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
@@ -382,7 +382,7 @@
blockstate.func_215697_a(this, blockpos, p_175666_2_, p_175666_1_, false);
}
}
@@ -1025,6 +1088,18 @@
@@ -1024,6 +1087,18 @@
return this.field_226689_w_;
}
@@ -5,7 +5,7 @@
import org.apache.logging.log4j.Logger;
-public final class Biome {
+public final class Biome extends net.minecraftforge.registries.ForgeRegistryEntry<Biome> {
+public final class Biome extends net.minecraftforge.registries.ForgeRegistryEntry.UncheckedRegistryEntry<Biome> {
public static final Logger field_150586_aC = LogManager.getLogger();
public static final Codec<Biome> field_242418_b = RecordCodecBuilder.create((p_235064_0_) -> {
return p_235064_0_.group(Biome.Climate.field_242459_a.forGetter((p_242446_0_) -> {
@@ -14,9 +14,9 @@
}), MobSpawnInfo.field_242552_c.forGetter((p_242442_0_) -> {
return p_242442_0_.field_242425_l;
- })).apply(p_235064_0_, Biome::new);
+ }), ResourceLocation.field_240908_a_.fieldOf("forge:registry_name").forGetter(Biome::getRegistryName))
+ }), ResourceLocation.field_240908_a_.optionalFieldOf("forge:registry_name").forGetter(b -> Optional.ofNullable(b.getRegistryName())))
+ .apply(p_235064_0_, (climate, category, depth, scale, effects, gen, spawns, name) ->
+ net.minecraftforge.common.ForgeHooks.enhanceBiome(name, climate, category, depth, scale, effects, gen, spawns, p_235064_0_, Biome::new));
+ net.minecraftforge.common.ForgeHooks.enhanceBiome(name.orElse(null), climate, category, depth, scale, effects, gen, spawns, p_235064_0_, Biome::new));
});
public static final Codec<Biome> field_242419_c = RecordCodecBuilder.create((p_242432_0_) -> {
return p_242432_0_.group(Biome.Climate.field_242459_a.forGetter((p_242441_0_) -> {
@@ -17,6 +17,15 @@
chunkprimer.func_201637_h(blockpos);
}
}
@@ -167,7 +168,7 @@
Heightmap.func_222690_a(ichunk, enumset);
CompoundNBT compoundnbt4 = compoundnbt.func_74775_l("Structures");
ichunk.func_201612_a(func_235967_a_(p_222656_1_, compoundnbt4, p_222656_0_.func_72905_C()));
- ichunk.func_201606_b(func_227075_a_(p_222656_3_, compoundnbt4));
+ net.minecraftforge.common.ForgeHooks.fixNullStructureReferences(ichunk, func_227075_a_(p_222656_3_, compoundnbt4));
if (compoundnbt.func_74767_n("shouldSave")) {
ichunk.func_177427_f(true);
}
@@ -183,6 +184,7 @@
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/FlatGenerationSettings.java
+++ b/net/minecraft/world/gen/FlatGenerationSettings.java
@@ -174,7 +174,7 @@
}
}
- return (new Biome.Builder()).func_205415_a(biome.func_201851_b()).func_205419_a(biome.func_201856_r()).func_205421_a(biome.func_185355_j()).func_205420_b(biome.func_185360_m()).func_205414_c(biome.func_242445_k()).func_205417_d(biome.func_76727_i()).func_235097_a_(biome.func_235089_q_()).func_242457_a(biomegenerationsettings$builder.func_242508_a()).func_242458_a(biome.func_242433_b()).func_242455_a();
+ return (new Biome.Builder()).func_205415_a(biome.func_201851_b()).func_205419_a(biome.func_201856_r()).func_205421_a(biome.func_185355_j()).func_205420_b(biome.func_185360_m()).func_205414_c(biome.func_242445_k()).func_205417_d(biome.func_76727_i()).func_235097_a_(biome.func_235089_q_()).func_242457_a(biomegenerationsettings$builder.func_242508_a()).func_242458_a(biome.func_242433_b()).func_242455_a().setRegistryName(biome.getRegistryName());
}
public DimensionStructuresSettings func_236943_d_() {
@@ -11,3 +11,21 @@
chunkprimer.func_201637_h(blockpos$mutable);
}
@@ -582,6 +582,9 @@
}
public List<MobSpawnInfo.Spawners> func_230353_a_(Biome p_230353_1_, StructureManager p_230353_2_, EntityClassification p_230353_3_, BlockPos p_230353_4_) {
+ List<MobSpawnInfo.Spawners> spawns = net.minecraftforge.common.world.StructureSpawnManager.getStructureSpawns(p_230353_2_, p_230353_3_, p_230353_4_);
+ if (spawns != null) return spawns;
+ if (false) {//Forge: We handle these hardcoded cases above in StructureSpawnManager#getStructureSpawns, but allow for insideOnly to be changed and allow for creatures to be spawned in ones other than just the witch hut
if (p_230353_2_.func_235010_a_(p_230353_4_, true, Structure.field_236374_j_).func_75069_d()) {
if (p_230353_3_ == EntityClassification.MONSTER) {
return Structure.field_236374_j_.func_202279_e();
@@ -605,6 +608,7 @@
return Structure.field_236378_n_.func_202279_e();
}
}
+ }
return super.func_230353_a_(p_230353_1_, p_230353_2_, p_230353_3_, p_230353_4_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/gen/WorldGenRegion.java
+++ b/net/minecraft/world/gen/WorldGenRegion.java
@@ -170,11 +170,11 @@
@@ -173,11 +173,11 @@
public boolean func_241212_a_(BlockPos p_241212_1_, boolean p_241212_2_, @Nullable Entity p_241212_3_, int p_241212_4_) {
BlockState blockstate = this.func_180495_p(p_241212_1_);
@@ -14,7 +14,7 @@
Block.func_220054_a(blockstate, this.field_201689_f, p_241212_1_, tileentity, p_241212_3_, ItemStack.field_190927_a);
}
@@ -194,11 +194,11 @@
@@ -197,11 +197,11 @@
if (compoundnbt != null) {
if ("DUMMY".equals(compoundnbt.func_74779_i("id"))) {
Block block = blockstate.func_177230_c();
@@ -28,7 +28,7 @@
} else {
tileentity = TileEntity.func_235657_b_(blockstate, compoundnbt);
}
@@ -209,7 +209,7 @@
@@ -212,7 +212,7 @@
}
}
@@ -37,7 +37,7 @@
field_208303_a.warn("Tried to access a block entity before it was created. {}", (Object)p_175625_1_);
}
@@ -225,9 +225,9 @@
@@ -228,9 +228,9 @@
}
Block block = p_241211_2_.func_177230_c();
@@ -49,7 +49,7 @@
} else {
CompoundNBT compoundnbt = new CompoundNBT();
compoundnbt.func_74768_a("x", p_241211_1_.func_177958_n());
@@ -236,7 +236,7 @@
@@ -239,7 +239,7 @@
compoundnbt.func_74778_a("id", "DUMMY");
ichunk.func_201591_a(compoundnbt);
}
Loaded 100 of 307 files, more files were not shown because too many files have changed in this diff. Show more