Compare commits

..
74 Commits
Author SHA1 Message Date
44c689f171 Forge 1.19.4
Properly move `ServerStatusPing` to codec
Reimplement custom display contexts

Co-authored-by: Matyrobbrt <[email protected]>
Co-authored-by: coehlrich <[email protected]>
Signed-off-by: SizableShrimp <[email protected]>
2023-03-14 17:22:27 -05:00
coehlrich 1f44339d6e Fix experimental world warning screen appearing everytime (#9375) 2023-03-09 08:26:32 -08:00
KnightMiner 001372bef2 Fix continuing to use items after dropping or when a shield breaks (MC-231097, MC-168573) (#9344) 2023-03-08 12:21:04 -08:00
KnightMiner 8f72c143a1 Add onStopUsing hook to IForgeItem (#9343) 2023-03-03 11:14:51 -08:00
Joseph B 3c75e1269d Document RegisterParticleProvidersEvent's APIs (#9346) 2023-02-24 13:18:07 -08:00
CreativeMD 121120aee1 Fix incorrect ListTag.getLongArray result (MC-260378) (#9351) 2023-02-24 13:16:32 -08:00
Su5eD 62ce55d8d7 Fix missing patch that left TagBuilder#replace unused (#9354) 2023-02-24 10:49:37 -08:00
Adneths 183d43f5f8 Add 2 new RenderLevelStageEvent.Stage for After Entities and After Block Entities (#9259) 2023-02-18 15:43:10 +01:00
ferriarnus 79dfdb0ace Cleanup StemBlock Patch (#9337) 2023-02-06 14:05:21 -08:00
Dennis C bb4a0b7dd6 Cleanup ItemProperties patch (#9332) 2023-02-06 14:04:04 -08:00
Dennis C 4cddc62be7 Make IForgeIntrinsicHolderTagAppender methods properly chainable (#9331) 2023-02-06 14:03:51 -08:00
ChampionAsh5357 914b2fe984 Fix in custom fluids not respecting max height correctly. (#9319) 2023-02-06 14:03:38 -08:00
cech12 308d4fa68e Fix inconsistent vaporization in BucketItem & FluidType (#9269) 2023-02-06 13:30:49 -08:00
cpw 50f325c8fe Fix reloading event firing during server shutdown and add explicit unloading event instead (#9016) 2023-02-06 13:30:16 -08:00
Joseph B 57fd0ecb2e Homogenize and/or holdersets when serializing to prevent serializing to NBT from crashing (#9048) Fixes #9043 2023-02-06 11:48:44 -08:00
matyrobbrt 94af5cc43a [1.19.x] Fix ForgeSlider not respecting custom height (#9237) 2023-02-05 18:58:08 +01:00
Mysterious_Dev 3c19a0309e Fix stepsound for blocks in the inside_step_sound_blocks tag. (#9318) 2023-01-25 13:19:54 -08:00
Minecraftschurli 0eb9d94bf3 Fix missing hanging sign material for modded wood type (#9303) 2023-01-23 13:34:22 -08:00
Jonathan Colmenares 4d57a1bec6 Fire TickEvent.LevelTickEvent on ClientLevel tick (#9299) 2023-01-23 11:47:00 -08:00
coehlrich 59ab01a559 Add ClientChatReceivedEvent for system messages (#9284) 2023-01-10 13:45:04 -08:00
matyrobbrt 5946356f8e PR Action update (#9274) 2023-01-08 21:24:00 +00:00
Minecraftschurli f0f7b18528 fix HangingSignEditScreen crash when using custom wood types using modid (#9294) 2023-01-08 21:21:23 +00:00
LexManos 5311b0bc90 Bump SecureJarHandler version, to help identify invalid mods. 2023-01-06 13:01:59 -08:00
Brennan Ward 43580f5804 [1.19.3] Hotfix missing null check in createUnbakedItemElements (#9285) 2023-01-06 19:42:56 +01:00
Curle b0a68b8c79 Mark 1.19.3 Recommended Build 2023-01-02 03:37:31 +00:00
Brennan Ward f225d1f3fb [1.19.3] Allow Item and Elements models to specify static color, sky light, and block light values. (#9106) 2022-12-31 10:36:56 +01:00
bconlon 15214a6e9a Fix StemBlock not checking canSustainPlant for the correct block, it now checks for Melons/Pumpkins instead of the stem itself. (#9270) 2022-12-30 11:13:42 -08:00
matyrobbrt dfce6b62d4 Add github shared actions for automation purposes. (#9251) 2022-12-30 11:12:49 -08:00
Mysterious_Dev 0232ad7424 Add translate key for Forge pack.mcmeta description (#9260) 2022-12-30 11:12:11 -08:00
Mysterious_Dev e6ff2e0c24 Fix broken link for update checker docs in mdk (#9271) 2022-12-30 11:11:43 -08:00
sciwhiz12 72980d2b03 Remove duplicate updateNeighbourForOutputSignal call Fixes #9169 (#9234) 2022-12-30 11:11:23 -08:00
Minecraftschurli 6e3b51d81f Add helper methods to access the set of loaded sprite locations (#9223) 2022-12-30 11:11:02 -08:00
Dennis C 6b1c628326 Disable guiLight3d for generated item models (#9230) 2022-12-30 17:59:36 +01:00
matyrobbrt 85f9b1012c Remove resource caching (#9254) 2022-12-27 11:40:06 -08:00
failall 7569de7004 Add TradeWithVillagerEvent (#9244) 2022-12-26 13:20:01 -08:00
Mysterious_Dev 5ccde7422c Update link for Parchment "Getting Started" (#9243) 2022-12-26 13:19:44 -08:00
bconlon ad6bf9428e Allows DatapackBuiltinEntriesProvider to datagen LevelStems (#9247) 2022-12-26 13:19:36 -08:00
noeppi_noeppi d176bab28e Add a method to LootContext.Builder that allows changing the queried loot table id (#9084) 2022-12-19 15:18:52 -08:00
ChampionAsh5357 58d6f072e4 [1.19.3] Fix Datagen Tests and Providers (#9212) 2022-12-19 16:28:19 +00:00
matyrobbrt cc393818e4 Fix concrete powder not being hydrated by singular water sources (#9236) 2022-12-19 16:05:22 +00:00
Girafi e84098a011 [1.19.3] Fix LootTableLoadEvent not getting fired (#9239) 2022-12-19 16:05:08 +00:00
matyrobbrt f2db3941ea Allow using custom factories in button builders (#9238) 2022-12-19 16:04:41 +00:00
Dennis C c2bfe12068 Fix logspam when a root resource is requested from DelegatingPackResources, fixes #9197 (#9227) 2022-12-19 16:04:27 +00:00
matyrobbrt d9e3a0081e [1.19.3] Fix retrieveRegistryLookup attempting to get the registry lookup from a HolderGetter (#9225) 2022-12-19 16:03:56 +00:00
Minecraftschurliandsciwhiz12 84d7a0facb [1.19.3] Add ability to datagen forge specific values in pack.mcmeta (#9221)
Co-authored-by: sciwhiz12 <[email protected]>
2022-12-16 16:52:54 +00:00
Dennis C 9c66928854 Add block atlas config to register forge:white texture (#9187) 2022-12-16 16:48:20 +00:00
bl4ckscor3 4b494451db Fix ExtendedButton not being highlighted when focused (#9144) 2022-12-16 16:46:58 +00:00
matyrobbrt e9ea4ca169 Separate checkAndFix from the check* tasks. (#9213) 2022-12-16 16:44:56 +00:00
Dennis C c5ca054936 Fix forge resources overriding vanilla ones (#9222) 2022-12-16 16:43:46 +00:00
Exopandora 7d2c7c0f91 Fix tooltip customization not working for creative inventory (#9218) 2022-12-16 16:42:51 +00:00
sciwhiz12 54b872af69 Fix glowing item frame entity's texture (#9126)
Fixes #9123
2022-12-16 16:41:45 +00:00
matyrobbrt ae954bea17 Fix datapack registries not being synced to clients (#9219) 2022-12-15 11:53:53 -08:00
Dennis C ad59985a9b Fix creatives tabs rendering overlapping tabs if the selected tab isn't on the current page. (#9214) 2022-12-15 11:41:29 -08:00
Technici4n f8fdd43552 Fix SidedInvWrapper not accounting for vanilla stacking special cases in brewing stands and furnaces (#9189) 2022-12-15 11:40:25 -08:00
Marc Hermans b269f7dbfd Update to the latest JarJar. (#9217) 2022-12-15 11:39:37 -08:00
ChampionAsh5357 e688f136dd Specify NetworkHooks#getEntitySpawningPacket Generic Return Type (#9220) 2022-12-15 11:39:29 -08:00
LexManos 81276b341a Fix using a DeferredRegister on a non-forge wrapped registry. Closes #9199 2022-12-12 12:00:23 -08:00
Dennis C f050617b47 Add support for custom CreativeModeTab implementations (#9210) 2022-12-12 10:23:48 -08:00
eerussianguy e6c7958456 Simplify tree grower patches (#9209) 2022-12-12 10:23:32 -08:00
ChampionAsh5357 4802ceeccc Replace AdvancementProvider patch with Forge helper (#9188) 2022-12-12 10:23:10 -08:00
matyrobbrt 2ea16d89ca Allow using PackOutputs in Forge-added datagen classes (#9182) 2022-12-12 10:22:48 -08:00
J.T. McQuigg e541201129 Add simpleBlockWithItem for data gens (#9170) 2022-12-12 10:22:32 -08:00
Technici4n 09aac3a4d3 Fix running test mods (#9211) 2022-12-12 10:22:09 -08:00
Dennis C dccb1ab3a4 [1.19.3] Fix models nested in custom geometries not resolving parents (#9200) 2022-12-11 21:25:14 +01:00
gigaherz 8bf96d8738 Fix OBJ Loader caches not being thread-safe. (#9204) 2022-12-11 20:36:17 +01:00
Dennis C 069a94f205 [1.19.3] Add event before baked models are cached by the BlockModelShaper (#9190) 2022-12-11 20:35:45 +01:00
sciwhiz12 332ed4ab76 Fix compatibility checker task configuration (#9202) 2022-12-11 20:24:47 +01:00
matyrobbrt 030f2dbd38 Fix chat offset (#9184) 2022-12-11 16:46:17 +01:00
LexManos ec3abdea14 Redesign CreativeTab collection event to be a lot more straight forward. (#9198) 2022-12-10 15:03:23 -08:00
LexManos 4cf5508e04 Move ICondition patch placement to before MC throws an error.
Disable the explicitly erroring test biome modifier.
2022-12-09 19:52:30 -08:00
shartte d861f647d7 Fix BlockStateProvider not waiting for models before finishing. (#9196) Fixes #9195: 2022-12-09 12:50:55 -08:00
LexManos 992f793695 Fix tooltips not rendering on screens. Closes #9191 2022-12-09 12:48:59 -08:00
LexManos 69eb940764 Fix merged mod resource pack not returning all resources with the same name when asked. Closes #9194 2022-12-09 12:44:40 -08:00
Marc Hermans c1f26d544a Fix searching using the wrong prefix for items or tags. Fixes #9176 Fixes #9179 (#9177) 2022-12-08 09:11:18 -08:00
501 changed files with 9039 additions and 5172 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
name: 'Comment actions'
on: issue_comment
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/comment_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
+16
View File
@@ -0,0 +1,16 @@
name: 'Issue actions'
on: issues
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/issue_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
+13
View File
@@ -0,0 +1,13 @@
name: 'PR Review'
on: pull_request_review
jobs:
upload_payload:
name: Upload payload
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v3 # Payload artifact is consumed in Actionable
with:
name: payload
path: ${{ github.event_path }}
@@ -0,0 +1,13 @@
name: 'PR Review Comment'
on: pull_request_review_comment
jobs:
upload_payload:
name: Upload payload
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v3 # Payload artifact is consumed in Actionable
with:
name: payload
path: ${{ github.event_path }}
@@ -0,0 +1,20 @@
name: 'Pull Request Review Comment actions'
on:
workflow_run:
workflows: [PR Review Comment]
types:
- completed
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/pr_review_comment_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
@@ -0,0 +1,20 @@
name: 'Pull Request Review actions'
on:
workflow_run:
workflows: [PR Review]
types:
- completed
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/pr_review_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
+18
View File
@@ -0,0 +1,18 @@
name: 'Pull Request actions'
on:
pull_request_target:
types: [assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, converted_to_draft, ready_for_review, locked, unlocked, review_requested, review_request_removed, auto_merge_enabled, auto_merge_disabled]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/pr_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
+16
View File
@@ -0,0 +1,16 @@
name: 'Push actions'
on: push
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
labels:
uses: MinecraftForge/SharedActions/.github/workflows/push_actions.yml@main
secrets:
GH_APP_KEY: ${{ secrets.GH_APP_KEY }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
-42
View File
@@ -1,42 +0,0 @@
name: 'Spam label'
on:
issues:
types: [labeled]
pull_request:
types: [labeled]
discussion:
types: [labeled]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
lock:
if: ${{ (github.event.label.name == 'spam') && (github.event.action == 'labeled') }}
runs-on: ubuntu-latest
steps:
- uses: peter-evans/close-issue@v2
name: Close Issue
with:
close-reason: 'not_planned'
if: ${{ github.event_name != 'pull_request' }}
- run: gh pr close ${{ github.event.pull_request.html_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Close PR
if: ${{ github.event_name == 'pull_request' }}
- uses: maxkomarychev/[email protected]
name: Lock PR
if: ${{ github.event_name == 'pull_request' }}
with:
token: "${{ secrets.GITHUB_TOKEN }}"
issue_number: ${{ github.event.number }}
- uses: OSDKDev/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
name: Lock issue
if: ${{ github.event_name != 'pull_request' }}
-27
View File
@@ -1,27 +0,0 @@
name: Support Requests
on:
issues:
types:
- labeled
- unlabeled
- reopened
permissions:
issues: write
jobs:
support:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v2
with:
support-label: Forum
issue-comment: >
:wave: We use the issue tracker exclusively for final bug reports and feature requests.
However, this issue appears to be better suited for the
[Forge Support Forums](https://forums.minecraftforge.net/) or
[Forge Discord](https://discord.gg/UvedJ9m). Please create a new topic on the support forum
with this issue or ask in the `#tech-support` channel in the Discord server, and the
conversation can continue there.
lock-issue: true
+43 -20
View File
@@ -1,4 +1,10 @@
import groovy.json.JsonBuilder
import net.minecraftforge.forge.tasks.checks.CheckATs
import net.minecraftforge.forge.tasks.checks.CheckExcs
import net.minecraftforge.forge.tasks.checks.CheckPatches
import net.minecraftforge.forge.tasks.checks.CheckSAS
import net.minecraftforge.forge.tasks.checks.CheckTask
import net.minecraftforge.forge.tasks.checks.CheckMode
import java.nio.file.Files
import java.util.Date
@@ -36,16 +42,16 @@ ext {
]
}
MAPPING_CHANNEL = 'official'
MAPPING_VERSION = '1.19.3'
MC_VERSION = '1.19.3'
MAPPING_VERSION = '1.19.4'
MC_VERSION = '1.19.4'
MC_NEXT_VERSION = '1.20'
MCP_VERSION = '20221207.122022'
MCP_VERSION = '20230314.122934'
SPI_VERSION = '6.0.0'
ACCESSTRANSFORMERS_VERSION = '8.0.4'
COREMODS_VERSION = '5.0.1'
EVENTBUS_VERSION = '6.0.3'
MODLAUNCHER_VERSION = '10.0.8'
SECUREJARHANDLER_VERSION = '2.1.4'
SECUREJARHANDLER_VERSION = '2.1.6'
BOOTSTRAPLAUNCHER_VERSION = '1.1.2'
ASM_VERSION = '9.3'
INSTALLER_VERSION = '2.1.+'
@@ -56,7 +62,7 @@ ext {
JETBRAINS_ANNOTATIONS_VERSION = '23.0.0'
SLF4J_API_VERSION = '1.8.0-beta4'
APACHE_MAVEN_ARTIFACT_VERSION = '3.8.5'
JARJAR_VERSION = '0.3.18'
JARJAR_VERSION = '0.3.19'
// These versions should be kept in sync with the version manifest JSON
// To use a version newer than the version manifest JSON, the dependency must be added to the installer configuration
@@ -1168,34 +1174,45 @@ project(':forge') {
}
}
task checkATs(type: CheckATs, dependsOn: [extractInheritance, createSrg2Mcp]) {
inheritance = extractInheritance.output
tasks.register('checkAll') {
dependsOn 'checkLicenses'
group = 'checks'
}
tasks.register('checkAllAndFix') {
dependsOn 'findFieldInstanceChecks', 'checkLicenses'
group = 'checks'
}
CheckTask.registerTask(tasks, 'ATs', CheckATs) {
dependsOn extractInheritance, createSrg2Mcp
ats.from patcher.accessTransformers
inheritance = extractInheritance.output
mappings = createSrg2Mcp.output
}
task checkSAS(type: CheckSAS, dependsOn: extractInheritance) {
inheritance = extractInheritance.output
CheckTask.registerTask(tasks, 'SAS', CheckSAS) {
dependsOn extractInheritance
sass.from patcher.sideAnnotationStrippers
inheritance = extractInheritance.output
}
task checkExcs(type: CheckExcs, dependsOn: jar) {
CheckTask.registerTask(tasks, 'Excs', CheckExcs) {
dependsOn jar
binary = jar.archiveFile.get().asFile
excs.from patcher.excs
}
task checkPatchesAndFix(type: CheckPatches, dependsOn: genPatches) {
CheckTask.registerTask(tasks, 'Patches', CheckPatches) {
dependsOn genPatches
patchDir = file("$rootDir/patches")
autoFix = true
}
task checkPatches(type: CheckPatches, dependsOn: genPatches) {
patchDir = file("$rootDir/patches")
autoFix = false
patchesWithS2SArtifact = [
'minecraft/net/minecraft/client/renderer/ViewArea.java.patch',
'minecraft/net/minecraft/data/models/blockstates/Variant.java.patch',
]
}
genPatches {
finalizedBy checkPatches
finalizedBy checkAndFixPatches
autoHeader true
lineEnding = '\n'
}
@@ -1241,9 +1258,15 @@ project(':forge') {
dependsOn 'setupCheckJarCompatibility'
baseJar = project.tasks.named('mergeBaseForgeJar').flatMap { it.output }
}
baseLibraries.from(project.tasks.named('createJoinedSRG').flatMap { it.output })
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs, findFieldInstanceChecks, checkPatches, checkLicenses]){}
inputJar = project.tasks.named('reobfJar').flatMap { it.output }
concreteLibraries.from(project.PACKED_DEPS.collect { project.rootProject.tasks.getByPath(it).archiveFile })
commonLibraries.from(project.configurations.minecraftImplementation)
commonLibraries.from(project.configurations.installer)
commonLibraries.from(project.configurations.moduleonly)
}
task launcherJson(type: LauncherJson) {
packedDependencies = [':fmlloader:jar']
+1
View File
@@ -8,4 +8,5 @@ dependencies {
implementation 'org.ow2.asm:asm-tree:9.3'
implementation 'net.minecraftforge:srgutils:0.4.+'
implementation 'commons-io:commons-io:2.8.0'
implementation 'com.google.code.gson:gson:2.10'
}
@@ -1,267 +0,0 @@
package net.minecraftforge.forge.tasks
import net.minecraftforge.srgutils.IMappingFile
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.Opcodes
abstract class CheckATs extends DefaultTask {
@InputFile abstract RegularFileProperty getInheritance()
@InputFiles abstract ConfigurableFileCollection getAts()
@InputFile @Optional abstract RegularFileProperty getMappings()
@TaskAction
protected void exec() {
def mappings = mappings.map { IMappingFile.load(it.asFile) }.getOrNull()
Util.init()
def parse = { line ->
def idx = line.indexOf('#')
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
return [modifier, cls, desc, comment, key]
}
def accessLevel = { access ->
if ((access & Opcodes.ACC_PUBLIC) != 0) return 3
if ((access & Opcodes.ACC_PROTECTED) != 0) return 2
if ((access & Opcodes.ACC_PRIVATE) != 0) return 0
return 1
}
def accessStr = { access ->
if (access.endsWith('-f') || access.endsWith('+f'))
return 4
switch (access.toLowerCase()) {
case 'public': return 3
case 'protected': return 2
case 'default': return 1
case 'private': return 0
default: return -1
}
}
def json = inheritance.get().asFile.json()
ats.each { f ->
TreeMap lines = [:]
def group = null
for (def line : f.readLines()) {
if (line.isEmpty()) continue
if (line.startsWith('#group ')) {
def (modifier, cls, desc, comment, key) = parse.call(line.substring(7))
if (desc != '*' && desc != '*()' && desc != '<init>')
throw new IllegalStateException('Invalid group: ' + line)
group = [modifier: modifier, cls: cls, desc: desc, comment: comment,
existing: [] as Set,
children: [] as TreeSet,
group: true
]
if (lines.containsKey(key))
throw new IllegalStateException('Duplicate group: ' + line)
lines[key] = group
} else if (group != null) {
if (line.startsWith('#endgroup')) {
group = null
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
group['existing'].add(key)
}
} else if (line.startsWith('#endgroup')) {
throw new IllegalStateException('Invalid group ending: ' + line)
} else if (line.startsWith('#')) {
//Nom
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
if (lines.containsKey(key)) {
println('Duplicate: ' + line)
continue
}
lines[key] = [modifier: modifier, cls: cls, desc: desc, comment: comment, group: false]
}
}
// Process Groups, this will remove any entries outside the group that is covered by the group
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid Group: ' + key)
} else if ('*' == entry['desc']) {
if (!jcls.containsKey('fields')) {
lines.remove(key)
println('Invalid Group, Class has no fields: ' + key)
} else {
jcls['fields'].each { field, value ->
def fkey = cls + ' ' + field
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(fkey)) {
lines.remove(fkey)
} else if (!entry['existing'].contains(fkey)) {
println('Added: ' + fkey)
}
entry['children'].add(fkey)
} else if (lines.containsKey(fkey)) {
lines.remove(fkey)
println('Removed: ' + fkey)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('*()' == entry['desc']) {
if (!jcls.containsKey('methods')) {
lines.remove(key)
println('Invalid Group, Class has no methods: ' + key)
} else {
jcls['methods'].each{ mtd, value ->
if (mtd.startsWith('<clinit>') || mtd.startsWith('lambda$'))
return
key = cls + ' ' + mtd.replace(' ', '')
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(key)) {
lines.remove(key)
} else if (!entry['existing'].contains(key)) {
println('Added: ' + key)
}
entry['children'].add(key)
} else if (lines.containsKey(key)) {
lines.remove(key)
println('Removed: ' + key)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('<init>' == entry['desc']) { //Make all public non-abstract subclasses
json.each{ tcls,value ->
if (!value.containsKey('methods') || ((value['access'] & Opcodes.ACC_ABSTRACT) != 0))
return
def parents = [] as Set
def parent = tcls
while (parent != null && json.containsKey(parent)) {
parents.add(parent)
def p = json[parent]
parent = p == null ? null : p['superName']
}
if (parents.contains(cls.replaceAll('\\.', '/'))) {
value['methods'].each{ mtd, v ->
if (mtd.startsWith('<init>')) {
def child = tcls.replaceAll('/', '\\.') + ' ' + mtd.replace(' ', '')
if (accessLevel.call(v['access']) < 3) {
if (lines.containsKey(child)) {
lines.remove(child)
} else if (!entry['existing'].contains(child)) {
println('Added: ' + child)
}
entry['children'].add(child)
} else if (lines.containsKey(child)) {
lines.remove(child)
println('Removed: ' + child)
}
}
}
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
}
}
// Process normal lines, remove invalid and remove narrowing
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && !entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid: ' + key)
} else if (entry['desc'] == '') {
if (accessLevel.call(jcls['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
} else if (!entry['desc'].contains('(')) {
if (!jcls.containsKey('fields') || !jcls['fields'].containsKey(entry['desc'])) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['fields'][entry['desc']]
if (accessLevel.call(value['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
println(entry.comment)
}
}
} else {
def jdesc = entry['desc'].replace('(', ' (')
if (!jcls.containsKey('methods') || !jcls['methods'].containsKey(jdesc)) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['methods'][jdesc]
if (accessLevel.call(value['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
}
}
}
}
def data = []
def remapComment = { entry ->
if (!mappings || !entry || !entry.desc) return null
def comment = entry.comment?.substring(1)?.trim()
def jsonCls = json.get(entry.cls.replaceAll('\\.', '/'))
def mappingsClass = mappings?.getClass(jsonCls.name)
if (!mappingsClass) return entry.comment
def idx = entry.desc.indexOf('(')
def mappedName = idx == -1
? mappingsClass.remapField(entry.desc)
: mappingsClass.remapMethod(entry.desc.substring(0, idx), entry.desc.substring(idx))
if (!mappedName) return entry.comment
if (mappedName == '<init>')
mappedName = 'constructor'
if (comment?.startsWith(mappedName))
return '# ' + comment
if (comment && comment.indexOf(' ') != -1) {
def split = comment.split(" - ").toList()
if (split[0].indexOf(' ') != -1)
// The first string is more than one word, so append before it
return "# ${mappedName} - ${comment}"
split.remove(0)
return "# ${mappedName} - ${String.join(' - ', split)}"
}
return '# ' + mappedName
}
lines.each { key,value ->
if (!value.group) {
def comment = remapComment.call(value)
data.add(value.modifier + ' ' + key + (comment ? ' ' + comment : ''))
} else {
data.add('#group ' + value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
value.children.each {
def line = value.modifier + ' ' + it
def (modifier, cls, desc, comment) = parse.call(line)
comment = remapComment.call([modifier: modifier, cls: cls, desc: desc, comment: comment])
data.add(line + (comment ? ' ' + comment : ''))
}
data.add('#endgroup')
}
}
f.text = data.join('\n')
}
}
}
@@ -1,94 +0,0 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
abstract class CheckExcs extends DefaultTask {
@InputFile abstract RegularFileProperty getBinary()
@InputFiles abstract ConfigurableFileCollection getExcs()
@TaskAction
protected void exec() {
Util.init()
def known = []
binary.get().asFile.withInputStream { i ->
new ZipInputStream(i).withCloseable { zin ->
def visitor = new ClassVisitor(Opcodes.ASM9) {
private String cls
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
this.cls = name
}
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
known.add(this.cls + '.' + name + descriptor)
super.visitMethod(access, name, descriptor, signature, exceptions)
}
}
ZipEntry zein
while ((zein = zin.nextEntry) != null) {
if (zein.name.endsWith('.class')) {
ClassReader reader = new ClassReader(zin)
reader.accept(visitor, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
}
}
}
}
excs.each { f ->
def lines = []
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
return
}
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
if (!line.contains('=')) {
println('Invalid: ' + line)
return
}
def (key, value) = line.split('=', 2)
if (!known.contains(key)) {
println('Unknown: ' + line)
return
}
def (cls, desc) = key.split('\\.', 2)
if (!desc.contains('(')) {
println('Invalid: ' + line)
return
}
def name = desc.split('\\(', 2)[0]
desc = '(' + desc.split('\\(', 2)[1]
def (exceptions, args) = value.contains('|') ? value.split('|', 2) : [value, '']
if (args.split(',').length != Type.getArgumentTypes(desc).length) {
println('Invalid: ' + line)
return
}
lines.add(line)
}
f.text = lines.sort().join('\n')
}
}
}
@@ -1,219 +0,0 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.TaskAction
import java.nio.file.Files
import java.nio.file.Paths
import java.util.regex.Pattern
abstract class CheckPatches extends DefaultTask {
@InputDirectory abstract DirectoryProperty getPatchDir()
@Input boolean autoFix = false
@TaskAction
protected void exec() {
def hasS2SArtifact = [
Paths.get("patches/minecraft/net/minecraft/client/renderer/ViewArea.java.patch"),
Paths.get("patches/minecraft/net/minecraft/data/models/blockstates/Variant.java.patch")
]
def verified = true;
patchDir.get().asFileTree.each { patch ->
def patchPath = project.rootDir.toPath().relativize(patch.toPath())
verified &= verifyPatch(patch, autoFix, patchPath.toString(), hasS2SArtifact.contains(patchPath))
}
if (!verified)
throw new RuntimeException('One or more patches failed verification. Check the log for errors.')
}
def verifyPatch(patch, fix, patchPath, hasS2SArtifact) {
def hunk_start_pattern = Pattern.compile('^@@ -[0-9,]* \\+[0-9,_]* @@$')
def white_space_pattern = Pattern.compile('^[+\\-]\\s*$')
def import_pattern = Pattern.compile('^[+\\-]\\s*import.*')
def field_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$')
def method_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^(]*)[(]([^)]*)?[)]\\s*[{]\\s*$')
def class_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final[\\s]*)?(class|interface)([^{]*)[{]\\s*$')
def accessMap = [("private"):0, (null):1, ("protected"):2, ("public"):3]
def hasProblem = false;
def lines = patch.readLines()
def hunksStart = 0
def onlyWhiteSpace = false
def didFix = false
def newLines = []
def whiteSpaceErrors = []
// First two lines are file name ++/-- and we do not care
newLines.add(lines[0] + '\n')
newLines.add(lines[1] + '\n')
int i = 2
for (; i < lines.size(); ++i) {
def line = lines[i]
newLines.add(line + '\n')
if (hunk_start_pattern.matcher(line).find()) {
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
whiteSpaceErrors.clear()
}
hunksStart = i
onlyWhiteSpace = true
continue
}
if (line.startsWithAny('+','-')) {
def prefixChange = false
def prevLine = lines[i - 1]
if (line.charAt(0) == (char)'+' && prevLine.charAt(0) == (char)'-') {
def prevTrim = prevLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (prevTrim.equals(currTrim)) {
prefixChange = true
}
def pMatcher = field_pattern.matcher(prevLine)
def cMatcher = field_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // = ...
pMatcher.group(5) == cMatcher.group(5) && // field name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = method_pattern.matcher(prevLine)
cMatcher = method_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // params
pMatcher.group(5) == cMatcher.group(5) && // <T> void name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = class_pattern.matcher(prevLine)
cMatcher = class_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // ClassName<> extends ...
pMatcher.group(5) == cMatcher.group(5) && // class | interface
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
if (line.charAt(0) == (char)'-' && i + 1 < lines.size()) {
def nextLine = lines[i + 1]
if (nextLine.charAt(0) == (char)'+') {
def nextTrim = nextLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (nextTrim.equals(currTrim)) {
prefixChange = true
}
}
}
def isWhiteSpaceChange = white_space_pattern.matcher(line).find()
if (!prefixChange && !isWhiteSpaceChange) {
onlyWhiteSpace = hasS2SArtifact && import_pattern.matcher(line).find()
}
else if (isWhiteSpaceChange) {
def prevLineChange = prevLine.startsWithAny('+','-')
def nextLineChange = i + 1 < lines.size() && lines[i + 1].startsWithAny('+','-')
if (!prevLineChange && !nextLineChange) {
whiteSpaceErrors.add(String.format("Patch contains white space change in valid hunk at line %d (cannot auto fix), file: %s", i + 1, patchPath))
}
}
if (line.contains("\t")) {
if (!fix) {
logger.lifecycle("Patch contains tabs on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
else {
logger.lifecycle("Fixing tabs on line {}, file: {}", i + 1, patchPath)
line = line.replaceAll('\t', ' ')
newLines.remove(newLines.size() - 1)
newLines.add(line + '\n')
didFix = true
}
}
if (import_pattern.matcher(line).find() && !hasS2SArtifact) {
logger.lifecycle("Patch contains import change on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
}
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
}
if (didFix) {
if (newLines.size() <= 2) {
logger.lifecycle("Patch is now empty removing, file: {}", patchPath)
Files.delete(patch.toPath())
}
else {
if (!hasS2SArtifact)
logger.lifecycle("*** Updating patch file. Please run setup then genPatches again. ***")
patch.withWriter('UTF-8') { writer ->
newLines.each { l -> writer.write(l) }
}
}
}
return !hasProblem
}
}
@@ -1,107 +0,0 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction
abstract class CheckSAS extends DefaultTask {
@InputFile abstract RegularFileProperty getInheritance()
@InputFiles abstract ConfigurableFileCollection getSass()
@TaskAction
protected void exec() {
Util.init()
def json = inheritance.get().asFile.json()
sass.each { f ->
def lines = []
f.eachLine { line ->
if (line[0] == '\t') return //Skip any tabbed lines, those are ones we add
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
lines.add(line)
return
}
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (cls, name, desc) = (line.trim().replace('(', ' (') + ' ').split(' ', -1)
cls = cls.replaceAll('\\.', '/')
if (json[cls] == null) {
println('Invalid: ' + line)
} else if (name.isEmpty()) { //Class SAS
def toAdd = []
def clsSided = isSided(json[cls])
def sided = clsSided
/* TODO: MergeTool doesn't do fields
if (json[cls]['fields'] != null) {
for (entry in json[cls]['fields']) {
if (isSided(entry.value)) {
sided = true
toAdd.add('\t' + cls + ' ' + entry.key)
}
}
}
*/
if (json[cls]['methods'] != null) {
for (entry in json[cls]['methods']) {
if (isSided(entry.value)) {
sided = true
toAdd.add('\t' + cls + ' ' + entry.key.replaceAll(' ', ''))
findChildMethods(json, cls, entry.key).each { lines.add('\t' + it) }
findChildMethods(json, cls, entry.key).each { println(line + ' -- ' + it) }
} else if (clsSided) {
findChildMethods(json, cls, entry.key).each { lines.add('\t' + it) }
findChildMethods(json, cls, entry.key).each { println(line + ' -- ' + it) }
}
}
}
if (sided) {
lines.add(cls + (comment == null ? '' : ' ' + comment))
lines.addAll(toAdd.sort())
} else
println('Invalid: ' + line)
} else if (desc.isEmpty()) { // Fields
/* TODO: MergeTool doesn't do fields
if (json[cls]['fields'] != null && isSided(json[cls]['fields'][name]))
lines.add(cls + ' ' + name + (comment == null ? '' : ' ' + comment))
else
*/
println('Invalid: ' + line)
} else { // Methods
if (json[cls]['methods'] == null || !isSided(json[cls]['methods'][name + ' ' + desc]))
println('Invalid: ' + line)
else {
lines.add(cls + ' ' + name + desc + (comment == null ? '' : ' ' + comment))
findChildMethods(json, cls, name + ' ' + desc).each { println(line + ' -- ' + it) }
findChildMethods(json, cls, name + ' ' + desc).each { lines.add('\t' + it) }
}
}
}
f.text = lines.join('\n')
}
}
protected static isSided(json) {
if (json == null || json['annotations'] == null)
return false
for (ann in json['annotations']) {
if ('Lnet/minecraftforge/api/distmarker/OnlyIn;'.equals(ann.desc))
return true
}
return false
}
protected static findChildMethods(json, cls, desc)
{
return json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls && isSided(it.methods[desc]) }
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
}
}
@@ -0,0 +1,49 @@
package net.minecraftforge.forge.tasks
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import groovy.transform.CompileStatic
import groovy.transform.TupleConstructor
@CompileStatic
@TupleConstructor
final class InheritanceData implements Annotatable {
String name
int access
String superName
List<String> interfaces = []
Map<String, Method> methods = [:]
Map<String, Field> fields = [:]
List<Annotation> annotations = []
@TupleConstructor
static final class Method implements Annotatable {
int access
String override
List<Annotation> annotations = []
}
@TupleConstructor
static final class Field implements Annotatable {
int access
String desc
List<Annotation> annotations = []
}
@TupleConstructor
static final class Annotation {
String desc
}
private static final Gson GSON = new Gson()
static Map<String, InheritanceData> parse(File file) {
try (final reader = file.newReader()) {
return GSON.fromJson(reader, new TypeToken<Map<String, InheritanceData>>() {})
}
}
}
@CompileStatic
interface Annotatable {
List<InheritanceData.Annotation> getAnnotations()
}
@@ -18,6 +18,7 @@ abstract class SetupCheckJarCompatibility extends DefaultTask {
onlyIf {
inputVersion.getOrNull() != null
}
outputs.upToDateWhen { false } // Never up to date, because this setup task should always run
baseBinPatchesOutput.convention(project.layout.buildDirectory.dir(name).map { it.file('joined.lzma') })
}
@@ -31,17 +32,9 @@ abstract class SetupCheckJarCompatibility extends DefaultTask {
}.toArray(Dependency[]::new))
project.tasks.named('checkJarCompatibility') {
baseLibraries.from(project.tasks.createJoinedSRG.output)
baseLibraries.from(project.provider {
fmlLibs.resolvedConfiguration.lenientConfiguration.files
})
inputJar = project.tasks.reobfJar.output
concreteLibraries.from(project.PACKED_DEPS.collect { project.rootProject.tasks.getByPath(it).archiveFile })
commonLibraries.from(project.configurations.minecraftImplementation)
commonLibraries.from(project.configurations.installer)
commonLibraries.from(project.configurations.moduleonly)
}
def baseForgeUserdev = project.layout.buildDirectory.dir(name).map { it.file("forge-${inputVersion}-userdev.jar") }.get().asFile
@@ -0,0 +1,310 @@
package net.minecraftforge.forge.tasks.checks
import groovy.transform.CompileStatic
import groovy.transform.TupleConstructor
import net.minecraftforge.forge.tasks.InheritanceData
import net.minecraftforge.srgutils.IMappingFile
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFile
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.objectweb.asm.Opcodes
@CompileStatic
abstract class CheckATs extends CheckTask {
@InputFile abstract RegularFileProperty getInheritance()
@InputFiles abstract ConfigurableFileCollection getAts()
@InputFile @Optional abstract RegularFileProperty getMappings()
@Override
void check(Reporter reporter, boolean fix) {
final IMappingFile mappings = mappings.map { RegularFile it -> IMappingFile.load(it.asFile) }.getOrNull()
final inheritance = InheritanceData.parse(this.inheritance.get().asFile)
ats.each {
final lines = process(it, reporter, inheritance)
if (fix) {
it.text = joinBack(lines, inheritance, mappings).join('\n')
}
}
}
private static TreeMap<String, ATParser.Entry> process(File file, Reporter reporter, Map<String, InheritanceData> inheritance) {
final TreeMap<String, ATParser.Entry> lines = ATParser.parse(file.readLines(), reporter)
final Map<String, ATParser.Entry> constructorGroups = [:]
final itr = lines.entrySet().iterator()
final toRemove = []
while (itr.hasNext()) {
final next = itr.next()
String key = next.key
final entry = next.value
if (entry === null) continue
final binaryName = entry.cls.replaceAll('\\.', '/')
// Process Groups, this will remove any entries outside the group that is covered by the group
if (entry.group) {
final jcls = inheritance[binaryName]
if (jcls === null) {
itr.remove()
reporter.report("Invalid group: $key")
} else if ('*' == entry.desc) {
if (!jcls.fields) {
itr.remove()
reporter.report("Invalid group, class has no fields: $key")
} else {
jcls.fields.each { field, value ->
final fkey = entry.cls + ' ' + field
if (accessLevel(value.access) < accessStr(entry.modifier)) {
if (lines.containsKey(fkey)) {
toRemove.add(fkey)
} else if (!entry.existing.contains(fkey)) {
reporter.report("Missing group entry: $fkey")
}
entry.children.add(fkey)
} else if (lines.containsKey(fkey)) {
toRemove.add(fkey)
reporter.report("Found invalid group entry: $fkey")
}
}
entry.existing.findAll { it !in entry.children }.each { println('Removed: ' + it) }
}
} else if ('*()' == entry.desc) {
if (!jcls.methods) {
itr.remove()
reporter.report("Invalid group, class has no methods: $key")
} else {
jcls.methods.each { mtd, value ->
if (mtd.startsWith('<clinit>') || mtd.startsWith('lambda$')) return
key = entry.cls + ' ' + mtd.replace(' ', '')
if (accessLevel(value.access) < accessStr(entry.modifier)) {
if (lines.containsKey(key)) {
toRemove.add(key)
} else if (!entry.existing.contains(key)) {
reporter.report("Missing group entry: $key")
}
entry.children.add(key)
} else if (lines.containsKey(key)) {
toRemove.add(key)
reporter.report("Found invalid group entry: $key")
}
}
entry.existing.findAll { it !in entry.children }.each { println('Removed: ' + it) }
}
} else if ('<init>' == entry.desc) { //Make all public non-abstract subclasses
constructorGroups.put(binaryName, entry)
}
}
// Process normal lines, remove invalid and remove narrowing
else {
def jcls = inheritance.get(binaryName)
if (jcls === null) {
itr.remove()
reporter.report("Invalid: $key")
} else if (entry.desc == '') {
if (accessLevel(jcls.access) > accessStr(entry.modifier) && (entry.comment === null || !entry.comment.startsWith('#force '))) {
itr.remove()
reporter.report("Invalid Narrowing: $key")
}
} else if (!entry.desc.contains('(')) {
if (!jcls.fields || !jcls.fields.containsKey(entry.desc)) {
itr.remove()
reporter.report("Invalid: $key")
} else {
final value = jcls.fields[entry.desc]
if (accessLevel(value.access) > accessStr(entry.modifier) && (entry.comment === null || !entry.comment.startsWith('#force '))) {
itr.remove()
reporter.report("Invalid Narrowing: $key - ${entry.comment}")
}
}
} else {
final jdesc = entry.desc.replace('(', ' (')
if (!jcls.methods || !jcls.methods.containsKey(jdesc)) {
itr.remove()
reporter.report("Invalid: $key")
} else {
final value = jcls.methods[jdesc]
if (accessLevel(value.access) > accessStr(entry.modifier) && (entry.comment === null || !entry.comment.startsWith('#force '))) {
itr.remove()
reporter.report("Invalid Narrowing: $key")
}
}
}
}
}
inheritance.each { tcls, value ->
if (!value.methods || ((value.access & Opcodes.ACC_ABSTRACT) !== 0)) return
String parent = tcls
while (parent !== null) {
constructorGroups[parent]?.tap { entry ->
value.methods.each { mtd, v ->
if (mtd.startsWith('<init>')) {
final child = tcls.replaceAll('/', '\\.') + ' ' + mtd.replace(' ', '')
if (accessLevel(v.access) < 3) {
if (lines.containsKey(child)) {
toRemove.add(child)
} else if (child !in entry.existing) {
reporter.report("Missing group entry: $child")
}
entry.children.add(child)
} else if (lines.containsKey(child)) {
toRemove.add(child)
reporter.report("Found invalid group entry: $child")
}
}
}
}
parent = inheritance[parent]?.superName
}
}
constructorGroups.values().each { entry -> entry.existing.findAll { it !in entry.children }.each{ reporter.report("Found invalid group entry: $it") } }
toRemove.each(lines.&remove)
return lines
}
private static List<String> joinBack(TreeMap<String, ATParser.Entry> lines, Map<String, InheritanceData> inheritance, IMappingFile mappings) {
final data = []
final remapComment = { ATParser.Entry entry ->
if (!mappings || !entry || !entry.desc) return null
final comment = entry.comment?.substring(1)?.trim()
final jsonCls = inheritance.get(entry.cls.replaceAll('\\.', '/'))
final mappingsClass = mappings?.getClass(jsonCls.name)
if (mappingsClass === null) return entry.comment
final idx = entry.desc.indexOf('(')
String mappedName = idx == -1
? mappingsClass.remapField(entry.desc)
: mappingsClass.remapMethod(entry.desc.substring(0, idx), entry.desc.substring(idx))
if (!mappedName) return entry.comment
if (mappedName == '<init>')
mappedName = 'constructor'
if (comment?.startsWith(mappedName))
return '# ' + comment
if (comment && comment.indexOf(' ') !== -1) {
def split = comment.split(' - ').toList()
if (split[0].indexOf(' ') !== -1)
// The first string is more than one word, so append before it
return "# ${mappedName} - ${comment}"
split.remove(0)
return "# ${mappedName} - ${String.join(' - ', split)}"
}
return '# ' + mappedName
}
lines.each { key, value ->
if (!value.group) {
def comment = remapComment.call(value)
data.add(value.modifier + ' ' + key + (comment ? ' ' + comment : ''))
} else {
data.add(('#group ' + value.modifier + ' ' + key + ' ' + (value.comment ?: '')).trim())
value.children.each {
final line = value.modifier + ' ' + it
final entry = ATParser.parseEntry(line)
final comment = remapComment(entry)
data.add(line + (comment ? ' ' + comment : ''))
}
data.add('#endgroup')
}
}
return data
}
static int accessStr(String access) {
if (access.endsWith('-f') || access.endsWith('+f')) return 4
switch (access.toLowerCase()) {
case 'public': return 3
case 'protected': return 2
case 'default': return 1
case 'private': return 0
default: return -1
}
}
static int accessLevel(int access) {
if ((access & Opcodes.ACC_PUBLIC) !== 0) return 3
if ((access & Opcodes.ACC_PROTECTED) !== 0) return 2
if ((access & Opcodes.ACC_PRIVATE) !== 0) return 0
return 1
}
}
@CompileStatic
class ATParser {
static TreeMap<String, Entry> parse(List<String> lines, CheckTask.Reporter reporter) {
TreeMap<String, Entry> outLines = new TreeMap<>()
Entry group = null
for (final line : lines) {
if (line.isEmpty()) continue
if (line.startsWith('#group ')) {
final entry = parseEntry(line.substring(7))
if (entry.desc != '*' && entry.desc != '*()' && entry.desc != '<init>') {
reporter.report("Invalid group: $line", false)
}
entry.group = true
entry.children = []
entry.existing = []
group = entry
if (outLines.containsKey(entry.key)) {
reporter.report("Duplicate group: $line", false)
}
outLines[entry.key] = group
} else if (group !== null) {
if (line.startsWith('#endgroup')) {
group = null
} else {
final key = parseEntry(line).key
group.existing.add(key)
}
} else if (line.startsWith('#endgroup')) {
reporter.report("Invalid group ending: $line", false)
} else if (line.startsWith('#')) {
//Nom
} else {
final entry = parseEntry(line)
if (outLines.containsKey(entry.key)) {
reporter.report("Found duplicate: $line")
continue
}
outLines[entry.key] = entry
}
}
return outLines
}
static Entry parseEntry(String line) {
final idx = line.indexOf('#')
final String comment = idx === -1 ? null : line.substring(idx)
if (idx !== -1) line = line.substring(0, idx - 1)
final data = (line.trim() + ' ').split(' ', -1)
new Entry(data[0], data[1], data[2], comment)
}
@TupleConstructor
static final class Entry {
String modifier, cls, desc, comment
Set<String> existing
TreeSet<String> children
boolean group = false
@Lazy
String key = {cls + (desc.isEmpty() ? '' : ' ' + desc)}()
Object getAt(String key) {
return getProperty(key)
}
}
}
@@ -0,0 +1,93 @@
package net.minecraftforge.forge.tasks.checks
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
abstract class CheckExcs extends CheckTask {
@InputFile abstract RegularFileProperty getBinary()
@InputFiles abstract ConfigurableFileCollection getExcs()
@Override
void check(Reporter reporter, boolean fix) {
final Set<String> known = []
collectKnown(known)
excs.each { f ->
final lines = []
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) {
return
}
if (idx != -1) line = line.substring(0, idx - 1)
if (!line.contains('=')) {
reporter.report("Invalid: $line")
return
}
def (String key, String value) = line.split('=', 2)
if (!known.contains(key)) {
reporter.report("Unknown: $line")
return
}
String desc = key.split('\\.', 2)[1]
if (!desc.contains('(')) {
reporter.report("Invalid: $line")
return
}
desc = '(' + desc.split('\\(', 2)[1]
def (exceptions, String args) = value.contains('|') ? value.split('|', 2) : [value, '']
if (args.split(',').length !== Type.getArgumentTypes(desc).length) {
reporter.report("Invalid: $line")
return
}
lines.add(line)
}
if (fix) f.text = lines.sort().join('\n')
}
}
private void collectKnown(Collection<String> known) {
binary.get().asFile.withInputStream { i ->
new ZipInputStream(i).withCloseable { zin ->
final visitor = new ClassVisitor(Opcodes.ASM9) {
private String cls
@Override
void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
this.cls = name
}
@Override
MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
known.add(this.cls + '.' + name + descriptor)
super.visitMethod(access, name, descriptor, signature, exceptions)
}
}
ZipEntry zein
while ((zein = zin.nextEntry) !== null) {
if (zein.name.endsWith('.class')) {
ClassReader reader = new ClassReader(zin)
reader.accept(visitor, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
}
}
}
}
}
}
@@ -0,0 +1,9 @@
package net.minecraftforge.forge.tasks.checks
import groovy.transform.CompileStatic
@CompileStatic
enum CheckMode {
CHECK,
FIX
}
@@ -0,0 +1,177 @@
package net.minecraftforge.forge.tasks.checks
import groovy.transform.CompileStatic
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.provider.ListProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.Optional
import java.nio.file.Files
import java.nio.file.Path
import java.util.regex.Pattern
@CompileStatic
abstract class CheckPatches extends CheckTask {
private static final Pattern HUNK_START_PATTERN = Pattern.compile('^@@ -[0-9,]* \\+[0-9,_]* @@$')
private static final Pattern WHITESPACE_PATTERN = Pattern.compile('^[+\\-]\\s*$')
private static final Pattern IMPORT_PATTERN = Pattern.compile('^[+\\-]\\s*import.*')
private static final Pattern FIELD_PATTERN = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$')
private static final Pattern METHOD_PATTERN = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^(]*)[(]([^)]*)?[)]\\s*[{]\\s*$')
private static final Pattern CLASS_PATTERN = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final[\\s]*)?(class|interface)([^{]*)[{]\\s*$')
private static final Map<String, Integer> ACCESS_MAP = [private: 0, protected: 2, public: 3].tap { it.put(null, 1) }
@InputDirectory abstract DirectoryProperty getPatchDir()
@Input @Optional abstract ListProperty<String> getPatchesWithS2SArtifact()
@Override
void check(Reporter reporter, boolean fix) {
final patchDir = getPatchDir().get().asFile.toPath()
Files.walk(patchDir).withCloseable {
it.filter(Files.&isRegularFile).forEach { path ->
final String relativeName = patchDir.relativize(path).toString()
verifyPatch(path, reporter, fix, relativeName, patchesWithS2SArtifact.get().contains(relativeName.replace('\\', '/')))
}
}
}
void verifyPatch(Path patch, Reporter reporter, boolean fix, String patchPath, boolean hasS2SArtifact) {
final oldFixedErrors = reporter.fixed.size()
final lines = Files.readAllLines(patch)
int hunksStart = 0
boolean onlyWhiteSpace = false
final List<String> newLines = []
// First two lines are file name ++/-- and we do not care
newLines.add(lines[0] + '\n')
newLines.add(lines[1] + '\n')
int i
for (i = 2; i < lines.size(); ++i) {
def line = lines[i]
newLines.add(line + '\n')
if (HUNK_START_PATTERN.matcher(line).find()) {
if (onlyWhiteSpace) {
if (!hasS2SArtifact)
reporter.report("Patch contains only white space hunk starting at line ${hunksStart + 1}, file: $patchPath")
int toRemove = i - hunksStart
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
}
hunksStart = i
onlyWhiteSpace = true
continue
}
if (line.startsWithAny('+','-')) {
def prefixChange = false
def prevLine = lines[i - 1]
if (line.charAt(0) == (char)'+' && prevLine.charAt(0) == (char)'-') {
def prevTrim = prevLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (prevTrim == currTrim) {
prefixChange = true
}
def pMatcher = FIELD_PATTERN.matcher(prevLine)
def cMatcher = FIELD_PATTERN.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // = ...
pMatcher.group(5) == cMatcher.group(5) && // field name
pMatcher.group(3) == cMatcher.group(3) && // static
(ACCESS_MAP[pMatcher.group(2)] < ACCESS_MAP[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
reporter.report("Patch contains access changes or final removal at line ${i + 1}, file: $patchPath", false)
}
pMatcher = METHOD_PATTERN.matcher(prevLine)
cMatcher = METHOD_PATTERN.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // params
pMatcher.group(5) == cMatcher.group(5) && // <T> void name
pMatcher.group(3) == cMatcher.group(3) && // static
(ACCESS_MAP[pMatcher.group(2)] < ACCESS_MAP[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
reporter.report("Patch contains access changes or final removal at line ${i + 1}, file: $patchPath", false)
}
pMatcher = CLASS_PATTERN.matcher(prevLine)
cMatcher = CLASS_PATTERN.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // ClassName<> extends ...
pMatcher.group(5) == cMatcher.group(5) && // class | interface
pMatcher.group(3) == cMatcher.group(3) && // static
(ACCESS_MAP[pMatcher.group(2)] < ACCESS_MAP[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
reporter.report("Patch contains access changes or final removal at line ${i + 1}, file: $patchPath", false)
}
}
if (line.charAt(0) == (char)'-' && i + 1 < lines.size()) {
final nextLine = lines[i + 1]
if (nextLine.charAt(0) == (char)'+') {
final nextTrim = nextLine.substring(1).replaceAll("\\s", "")
final currTrim = line.substring(1).replaceAll("\\s", "")
if (nextTrim == currTrim) {
prefixChange = true
}
}
}
final isWhiteSpaceChange = WHITESPACE_PATTERN.matcher(line).find()
if (!prefixChange && !isWhiteSpaceChange) {
onlyWhiteSpace = hasS2SArtifact && IMPORT_PATTERN.matcher(line).find()
} else if (isWhiteSpaceChange) {
final prevLineChange = prevLine.startsWithAny('+','-')
final nextLineChange = i + 1 < lines.size() && lines[i + 1].startsWithAny('+','-')
if (!prevLineChange && !nextLineChange) {
reporter.report("Patch contains white space change in valid hunk at line ${i + 1}, file: $patchPath", false)
}
}
if (line.contains('\t')) {
reporter.report("Patch contains tabs on line ${i + 1}, file: $patchPath")
line = line.replaceAll('\t', ' ')
newLines.remove(newLines.size() - 1)
newLines.add(line + '\n')
}
if (IMPORT_PATTERN.matcher(line).find() && !hasS2SArtifact) {
reporter.report("Patch contains import change on line ${i + 1}, file: $patchPath", false)
}
}
}
if (onlyWhiteSpace) {
if (!hasS2SArtifact)
reporter.report("Patch contains only white space hunk starting at line ${hunksStart + 1}, file: $patchPath")
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
}
if ((reporter.fixed.size() > oldFixedErrors && fix) || hasS2SArtifact) {
if (newLines.size() <= 2) {
logger.lifecycle("Patch is now empty removing, file: {}", patchPath)
Files.delete(patch)
}
else {
if (!hasS2SArtifact)
logger.lifecycle("*** Updating patch file. Please run setup then genPatches again. ***")
Files.newBufferedWriter(patch).withCloseable {
newLines.each { l -> it.write(l) }
}
}
}
}
}
@@ -0,0 +1,110 @@
package net.minecraftforge.forge.tasks.checks
import groovy.transform.CompileStatic
import net.minecraftforge.forge.tasks.Annotatable
import net.minecraftforge.forge.tasks.InheritanceData
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles
@CompileStatic
abstract class CheckSAS extends CheckTask {
@InputFile abstract RegularFileProperty getInheritance()
@InputFiles abstract ConfigurableFileCollection getSass()
@Override
void check(Reporter reporter, boolean fix) {
final inheritance = InheritanceData.parse(this.inheritance.get().asFile)
sass.each { f ->
final lines = []
f.eachLine { line ->
if (line[0] == '\t') return // Skip any tabbed lines, those are ones we add
final 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)
final spl = (line.trim().replace('(', ' (') + ' ').split(' ', -1)
def (String cls, String name, String desc) = [spl[0], spl[1], spl[2]]
cls = cls.replaceAll('\\.', '/')
if (inheritance[cls] === null) {
reporter.report("Invalid: $line")
} else if (name.isEmpty()) { //Class SAS
final toAdd = []
final clsSided = isSided(inheritance[cls])
boolean sided = clsSided
/* TODO: MergeTool doesn't do fields
if (json[cls]['fields'] != null) {
for (entry in json[cls]['fields']) {
if (isSided(entry.value)) {
sided = true
toAdd.add('\t' + cls + ' ' + entry.key)
}
}
} */
final clsInh = inheritance[cls]
if (clsInh.methods) {
for (entry in clsInh.methods) {
if (isSided(entry.value)) {
sided = true
toAdd.add('\t' + cls + ' ' + entry.key.replaceAll(' ', ''))
findChildMethods(inheritance, cls, entry.key).each { lines.add('\t' + it) }
findChildMethods(inheritance, cls, entry.key).each { println(line + ' -- ' + it) }
} else if (clsSided) {
findChildMethods(inheritance, cls, entry.key).each { lines.add('\t' + it) }
findChildMethods(inheritance, cls, entry.key).each { println(line + ' -- ' + it) }
}
}
}
if (sided) {
lines.add(cls + (comment == null ? '' : ' ' + comment))
lines.addAll(toAdd.sort())
} else {
reporter.report("Invalid: $line")
}
} else if (desc.isEmpty()) { // Fields
/* TODO: MergeTool doesn't do fields
if (json[cls]['fields'] != null && isSided(json[cls]['fields'][name]))
lines.add(cls + ' ' + name + (comment == null ? '' : ' ' + comment))
else */
reporter.report("Invalid: $line")
} else { // Methods
final clsInh = inheritance[cls]
if (clsInh.methods === null || !isSided(clsInh.methods[name + ' ' + desc]))
reporter.report("Invalid: $line")
else {
lines.add(cls + ' ' + name + desc + (comment == null ? '' : ' ' + comment))
findChildMethods(inheritance, cls, name + ' ' + desc).each { println(line + ' -- ' + it) }
findChildMethods(inheritance, cls, name + ' ' + desc).each { lines.add('\t' + it) }
}
}
}
if (fix) f.text = lines.join('\n')
}
}
protected static isSided(Annotatable annotatable) {
if (annotatable === null) return false
for (ann in annotatable.annotations) {
if ('Lnet/minecraftforge/api/distmarker/OnlyIn;' == ann.desc)
return true
}
return false
}
protected static findChildMethods(Map<String, InheritanceData> json, String cls, String desc) {
return json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls && isSided(it.methods[desc]) }
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
}
}
@@ -0,0 +1,109 @@
package net.minecraftforge.forge.tasks.checks
import groovy.transform.CompileStatic
import net.minecraftforge.forge.tasks.Util
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.logging.LogLevel
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskContainer
import org.gradle.api.tasks.VerificationTask
@CompileStatic
abstract class CheckTask extends DefaultTask implements VerificationTask {
@Input
abstract Property<CheckMode> getMode()
private boolean ignoreFailures = false
@Input
@Override
boolean getIgnoreFailures() {
return ignoreFailures
}
@Override
void setIgnoreFailures(boolean ignoreFailures) {
this.ignoreFailures = ignoreFailures
}
@TaskAction
void run() {
Util.init()
final doFix = getMode().get() === CheckMode.FIX
final Reporter reporter = new Reporter(doFix)
check(reporter, doFix)
if (reporter.messages) {
if (getMode().get() === CheckMode.CHECK) {
logger.error("Check task '{}' found errors:\n{}", name, reporter.messages.join('\n'))
if (!ignoreFailures) {
throw new IllegalArgumentException("${reporter.messages.size()} errors were found!")
}
} else {
if (logger.isEnabled(LogLevel.DEBUG)) {
logger.warn("Check task '{}' found {} errors and fixed {}:\n{}", name, reporter.messages.size(), reporter.fixed.size(), reporter.fixed.join('\n'))
} else {
logger.warn("Check task '{}' found {} errors and fixed {}.", name, reporter.messages.size(), reporter.fixed.size())
}
if (reporter.notFixed) {
logger.error('{} errors could not be fixed:\n{}', reporter.notFixed.size(), reporter.notFixed.join('\n'))
if (!ignoreFailures) {
throw new IllegalArgumentException("${reporter.notFixed.size()} errors which cannot be fixed were found!")
}
}
}
}
}
abstract void check(Reporter reporter, boolean fix)
@CompileStatic
static final class Reporter {
final boolean trackFixed
Reporter(boolean trackFixed) {
this.trackFixed = trackFixed
}
public final List<String> messages = []
public final List<String> fixed = []
public final List<String> notFixed = []
void report(String message, boolean canBeFixed = true) {
messages.add(message)
if (trackFixed) {
if (canBeFixed) {
fixed.add(message)
} else {
notFixed.add(message)
}
}
}
}
static <T extends CheckTask> void registerTask(TaskContainer tasks, String taskName, @DelegatesTo.Target('type') Class<T> clazz,
@DelegatesTo(genericTypeIndex = 0, target = 'type') Closure configuration) {
taskName = taskName.capitalize()
tasks.register("check$taskName", clazz) { CheckTask task ->
configuration.setDelegate((T) task)
configuration.call(task)
task.mode.set(CheckMode.CHECK)
task.group = 'checks'
}
tasks.named('checkAll').configure { it.dependsOn("check$taskName") }
tasks.register("checkAndFix$taskName", clazz) { CheckTask task ->
configuration.setDelegate((T) task)
configuration.call(task)
task.mode.set(CheckMode.FIX)
task.group = 'checks'
}
tasks.named('checkAllAndFix').configure { it.dependsOn("checkAndFix$taskName") }
}
}
+2 -2
View File
@@ -2,8 +2,8 @@
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.19-&query=$.promos["1.19.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.19.2-&query=$.promos["1.19.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.19.3-&query=$.promos["1.19.3-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.19.3-&query=$.promos["1.19.3-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos)
Forge is a free, open-source modding API all of your favourite mods use!
@@ -66,8 +66,12 @@ public class ConfigTracker {
private void closeConfig(final ModConfig config, final Path configBasePath) {
if (config.getConfigData() != null) {
LOGGER.trace(CONFIG, "Closing config file type {} at {} for {}", config.getType(), config.getFileName(), config.getModId());
config.save();
// stop the filewatcher before we save the file and close it, so reload doesn't fire
config.getHandler().unload(configBasePath, config);
var unloading = IConfigEvent.unloading(config);
if (unloading != null)
config.fireEvent(unloading);
config.save();
config.setConfigData(null);
}
}
@@ -10,8 +10,17 @@ import net.minecraftforge.fml.Bindings;
import java.util.function.Function;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public interface IConfigEvent {
record ConfigConfig(Function<ModConfig, IConfigEvent> loading, Function<ModConfig, IConfigEvent> reloading) {}
record ConfigConfig(Function<ModConfig, IConfigEvent> loading, Function<ModConfig, IConfigEvent> reloading, @Nullable Function<ModConfig, IConfigEvent> unloading) {
@Deprecated(since = "1.19.3", forRemoval = true)
@ApiStatus.Internal
ConfigConfig(Function<ModConfig, IConfigEvent> loading, Function<ModConfig, IConfigEvent> reloading) {
this(loading, reloading, null);
}
}
ConfigConfig CONFIGCONFIG = Bindings.getConfigConfiguration().get();
static IConfigEvent reloading(ModConfig modConfig) {
@@ -20,6 +29,9 @@ public interface IConfigEvent {
static IConfigEvent loading(ModConfig modConfig) {
return CONFIGCONFIG.loading().apply(modConfig);
}
@Nullable static IConfigEvent unloading(ModConfig modConfig) {
return CONFIGCONFIG.unloading() == null ? null : CONFIGCONFIG.unloading().apply(modConfig);
}
ModConfig getConfig();
@SuppressWarnings("unchecked")
@@ -31,7 +31,6 @@ public abstract class CommonDevLaunchHandler extends CommonLaunchHandler {
// The extra jar is on the classpath, so try and pull it out of the legacy classpath
var legacyCP = Objects.requireNonNull(System.getProperty("legacyClassPath"), "Missing legacyClassPath, cannot find client-extra").split(File.pathSeparator);
var extra = findJarOnClasspath(legacyCP, "client-extra");
mcstream.add(extra);
// The MC code/Patcher edits are in exploded directories
final var modstream = Stream.<List<Path>>builder();
@@ -42,6 +41,7 @@ public abstract class CommonDevLaunchHandler extends CommonLaunchHandler {
minecraft.stream().distinct().forEach(mcstream::add);
mods.values().forEach(modstream::add);
mcstream.add(extra);
var mcFilter = getMcFilter(extra, minecraft, modstream);
return new LocatedPaths(mcstream.build().toList(), mcFilter, modstream.build().toList(), getFmlStuff(legacyCP));
}
@@ -42,6 +42,6 @@ public class FMLOnlyBindings implements IBindingsProvider {
@Override
public Supplier<IConfigEvent.ConfigConfig> getConfigConfiguration() {
return ()->new IConfigEvent.ConfigConfig(ModConfigEvent.Loading::new, ModConfigEvent.Reloading::new);
return ()->new IConfigEvent.ConfigConfig(ModConfigEvent.Loading::new, ModConfigEvent.Reloading::new, ModConfigEvent.Unloading::new);
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ minecraft {
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
@@ -58,8 +58,7 @@ public class ExampleMod
MinecraftForge.EVENT_BUS.register(this);
// Register the item to a creative tab
modEventBus.addListener((CreativeModeTabEvent.BuildContents event) -> event.registerSimple(CreativeModeTabs.BUILDING_BLOCKS,
EXAMPLE_BLOCK_ITEM.get()));
modEventBus.addListener(this::addCreative);
}
private void commonSetup(final FMLCommonSetupEvent event)
@@ -69,6 +68,12 @@ public class ExampleMod
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
}
private void addCreative(CreativeModeTabEvent.BuildContents event)
{
if (event.getTab() == CreativeModeTabs.BUILDING_BLOCKS)
event.accept(EXAMPLE_BLOCK_ITEM);
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event)
+1 -1
View File
@@ -22,7 +22,7 @@ modId="examplemod" #mandatory
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 https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
@@ -1,7 +1,7 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
@@ -510,9 +_,16 @@
f_84077_[f_84076_].f_84800_ = false;
@@ -500,9 +_,16 @@
}
+ /* Stores the last values sent into glMultiTexCoord2f */
@@ -9,7 +9,7 @@
if (monitor != null) {
VideoMode videomode = monitor.m_84948_(this.f_85355_ ? this.f_85354_ : Optional.empty());
this.f_85350_ = this.f_85357_ = monitor.m_84951_() + videomode.m_85332_() / 2 - this.f_85359_ / 2;
@@ -263,6 +_,7 @@
@@ -260,6 +_,7 @@
GLFW.glfwGetFramebufferSize(this.f_85349_, aint, aint1);
this.f_85361_ = aint[0] > 0 ? aint[0] : 1;
this.f_85362_ = aint1[0] > 0 ? aint1[0] : 1;
@@ -1,15 +1,15 @@
--- a/com/mojang/math/Transformation.java
+++ b/com/mojang/math/Transformation.java
@@ -12,7 +_,7 @@
@@ -14,7 +_,7 @@
import org.joml.Vector3f;
import org.joml.Vector3fc;
-public final class Transformation {
+public final class Transformation implements net.minecraftforge.client.extensions.IForgeTransformation {
private final Matrix4f f_121078_;
private boolean f_121079_;
@Nullable
@@ -139,6 +_,19 @@
public static final Codec<Transformation> f_268453_ = RecordCodecBuilder.create((p_269604_) -> {
return p_269604_.group(ExtraCodecs.f_252432_.fieldOf("translation").forGetter((p_269599_) -> {
@@ -163,6 +_,19 @@
public int hashCode() {
return Objects.hash(this.f_121078_);
}
@@ -0,0 +1,15 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
@@ -47,9 +_,9 @@
}
};
private final RealmsNotificationsScreen.DataFetcherConfiguration f_273849_ = new RealmsNotificationsScreen.DataFetcherConfiguration() {
- public DataFetcher.Subscription m_274316_(RealmsDataFetcher p_275731_) {
- DataFetcher.Subscription datafetcher$subscription = p_275731_.f_238549_.m_239139_();
- RealmsNotificationsScreen.this.m_274585_(p_275731_, datafetcher$subscription);
+ public DataFetcher.Subscription m_274316_(RealmsDataFetcher p_275318_) {
+ DataFetcher.Subscription datafetcher$subscription = p_275318_.f_238549_.m_239139_();
+ RealmsNotificationsScreen.this.m_274585_(p_275318_, datafetcher$subscription);
return datafetcher$subscription;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
@@ -214,6 +_,7 @@
@@ -205,6 +_,7 @@
}
static {
@@ -9,12 +9,12 @@
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT1 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT2 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+
public static ExecutorService m_183988_() {
return f_137443_;
public static ExecutorService m_183991_() {
return f_137444_;
}
@@ -242,7 +_,7 @@
@@ -238,7 +_,7 @@
try {
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().getWorldVersion())).getChoiceType(p_137552_, p_137553_);
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().m_183476_().m_193006_())).getChoiceType(p_137552_, p_137553_);
} catch (IllegalArgumentException illegalargumentexception) {
- f_137446_.error("No data fixer registered for {}", (Object)p_137553_);
+ f_137446_.debug("No data fixer registered for {}", (Object)p_137553_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/Advancement.java
+++ b/net/minecraft/advancements/Advancement.java
@@ -127,7 +_,7 @@
@@ -144,7 +_,7 @@
return this.f_138305_;
}
@@ -9,7 +9,7 @@
@Nullable
private ResourceLocation f_138332_;
@Nullable
@@ -308,7 +_,14 @@
@@ -325,7 +_,14 @@
return "Task Advancement{parentId=" + this.f_138332_ + ", display=" + this.f_138334_ + ", rewards=" + this.f_138335_ + ", criteria=" + this.f_138336_ + ", requirements=" + Arrays.deepToString(this.f_138337_) + "}";
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/ClientRecipeBook.java
+++ b/net/minecraft/client/ClientRecipeBook.java
@@ -51,7 +_,7 @@
@@ -54,7 +_,7 @@
for(Recipe<?> recipe : p_90643_) {
if (!recipe.m_5598_() && !recipe.m_142505_()) {
RecipeBookCategories recipebookcategories = m_90646_(recipe);
@@ -9,7 +9,7 @@
if (s.isEmpty()) {
map.computeIfAbsent(recipebookcategories, (p_90645_) -> {
return Lists.newArrayList();
@@ -138,6 +_,8 @@
@@ -141,6 +_,8 @@
} else if (recipetype == RecipeType.f_44113_) {
return RecipeBookCategories.SMITHING;
} else {
@@ -1,9 +1,9 @@
--- a/net/minecraft/client/KeyboardHandler.java
+++ b/net/minecraft/client/KeyboardHandler.java
@@ -298,7 +_,9 @@
@@ -328,7 +_,9 @@
}
}
Screen screen = this.f_90867_.f_91080_;
- if (p_90897_ == 1 && (!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) {
+
+ if ((!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) {
@@ -11,7 +11,7 @@
if (this.f_90867_.f_91066_.f_92105_.m_90832_(p_90895_, p_90896_)) {
this.f_90867_.m_91268_().m_85438_();
this.f_90867_.f_91066_.m_231829_().m_231514_(this.f_90867_.m_91268_().m_85440_());
@@ -316,6 +_,8 @@
@@ -346,6 +_,8 @@
});
return;
}
@@ -20,7 +20,7 @@
}
if (this.f_90867_.m_240477_().m_93316_()) {
@@ -338,11 +_,15 @@
@@ -368,11 +_,15 @@
Screen.m_96579_(() -> {
if (p_90897_ != 1 && p_90897_ != 2) {
if (p_90897_ == 0) {
@@ -38,7 +38,7 @@
}
}, "keyPressed event handler", screen.getClass().getCanonicalName());
@@ -395,22 +_,26 @@
@@ -425,22 +_,26 @@
}
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -245,7 +_,7 @@
@@ -247,7 +_,7 @@
import org.slf4j.Logger;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
static Minecraft f_90981_;
private static final Logger f_90982_ = LogUtils.getLogger();
public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX;
@@ -410,7 +_,6 @@
@@ -412,7 +_,6 @@
this.f_231339_ = SignatureValidator.m_216358_(this.f_231338_.getServicesKey());
this.f_90998_ = p_91084_.f_101905_.f_101942_;
f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_());
@@ -17,7 +17,7 @@
this.f_91033_ = p_91084_.f_101908_.f_101926_;
this.f_91034_ = !p_91084_.f_101908_.f_101929_;
this.f_91035_ = !p_91084_.f_101908_.f_101930_;
@@ -459,7 +_,7 @@
@@ -462,7 +_,7 @@
this.f_90990_.m_85380_(this.f_91066_.m_232035_().m_231551_());
this.f_91067_ = new MouseHandler(this);
@@ -26,7 +26,7 @@
this.f_91068_ = new KeyboardHandler(this);
this.f_91068_.m_90887_(this.f_90990_.m_85439_());
RenderSystem.m_69580_(this.f_91066_.f_92035_, false);
@@ -467,6 +_,7 @@
@@ -470,6 +_,7 @@
this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F);
this.f_91042_.m_83954_(f_91002_);
this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES);
@@ -34,7 +34,7 @@
this.f_91038_.m_10506_();
this.f_91066_.m_92145_(this.f_91038_);
this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_);
@@ -511,10 +_,13 @@
@@ -514,10 +_,13 @@
this.f_91063_ = new GameRenderer(this, this.f_90994_.m_234586_(), this.f_91036_, this.f_90993_);
this.f_91036_.m_7217_(this.f_91063_.m_247116_());
this.f_91060_ = new LevelRenderer(this, this.f_90994_, this.f_167845_, this.f_90993_);
@@ -49,7 +49,7 @@
this.f_91036_.m_7217_(this.f_91061_);
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
this.f_91036_.m_7217_(this.f_91053_);
@@ -523,7 +_,9 @@
@@ -526,7 +_,9 @@
this.f_91047_ = new GpuWarnlistManager();
this.f_91036_.m_7217_(this.f_91047_);
this.f_91036_.m_7217_(this.f_205120_);
@@ -60,7 +60,7 @@
this.f_91064_ = new DebugRenderer(this);
this.f_238717_ = new RealmsDataFetcher(RealmsClient.m_239151_(this));
RenderSystem.m_69900_(this::m_91113_);
@@ -542,6 +_,21 @@
@@ -545,6 +_,21 @@
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
}
@@ -82,7 +82,7 @@
this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_());
this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_());
this.f_90990_.m_85426_();
@@ -565,24 +_,24 @@
@@ -568,26 +_,24 @@
}
this.f_167847_.m_168556_();
@@ -117,13 +117,15 @@
-
- this.m_91152_(new TitleScreen(true));
- }, this.m_239210_()));
- } else if (this.f_91066_.f_263744_) {
- this.m_91152_(new AccessibilityOnboardingScreen(this.f_91066_));
- } else {
- this.m_91152_(new TitleScreen(true));
- }
}
@@ -634,6 +_,8 @@
@@ -639,6 +_,8 @@
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
try {
@@ -132,7 +134,7 @@
return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_());
} catch (AuthenticationException authenticationexception) {
f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception);
@@ -646,7 +_,7 @@
@@ -651,7 +_,7 @@
}
private void m_91239_(Throwable p_91240_) {
@@ -141,7 +143,7 @@
this.m_91241_(p_91240_, (Component)null);
} else {
Util.m_137559_(p_91240_);
@@ -723,7 +_,10 @@
@@ -743,7 +_,10 @@
}
public void m_91271_() {
@@ -153,7 +155,7 @@
return new FullTextSearchTree<>((p_210797_) -> {
return p_210797_.m_41651_((Player)null, TooltipFlag.Default.f_256752_.m_257777_()).stream().map((p_210807_) -> {
return ChatFormatting.m_126649_(p_210807_.getString()).trim();
@@ -734,7 +_,8 @@
@@ -754,7 +_,8 @@
return Stream.of(BuiltInRegistries.f_257033_.m_7981_(p_91317_.m_41720_()));
}, p_231451_);
});
@@ -163,7 +165,7 @@
return new IdSearchTree<>((p_231353_) -> {
return p_231353_.m_204131_().map(TagKey::f_203868_);
}, p_231430_);
@@ -754,9 +_,12 @@
@@ -774,9 +_,12 @@
});
}, p_231389_);
});
@@ -179,7 +181,7 @@
});
}
@@ -808,13 +_,13 @@
@@ -828,13 +_,13 @@
Bootstrap.m_135875_(p_91333_.m_127526_());
if (p_91333_.m_127527_() != null) {
Bootstrap.m_135875_("#@!@# Game crashed! Crash report saved to: #@!@# " + p_91333_.m_127527_());
@@ -196,7 +198,7 @@
}
}
@@ -932,10 +_,6 @@
@@ -959,10 +_,6 @@
f_90982_.error("setScreen called from non-game thread");
}
@@ -207,7 +209,7 @@
if (p_91153_ == null && this.f_91073_ == null) {
p_91153_ = new TitleScreen();
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
@@ -946,6 +_,19 @@
@@ -973,6 +_,19 @@
}
}
@@ -225,9 +227,9 @@
+ }
+
this.f_91080_ = p_91153_;
BufferUploader.m_166835_();
if (p_91153_ != null) {
@@ -1091,11 +_,14 @@
if (this.f_91080_ != null) {
this.f_91080_.m_274333_();
@@ -1118,9 +_,12 @@
RenderSystem.m_69481_();
this.f_91026_.m_7238_();
if (!this.f_91079_) {
@@ -235,14 +237,12 @@
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickStart(this.realPartialTick);
this.f_91026_.m_6182_("gameRenderer");
this.f_91063_.m_109093_(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_, i, p_91384_);
this.f_91026_.m_6182_("toasts");
this.f_91003_.m_94920_(new PoseStack());
this.f_91026_.m_7238_();
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(this.realPartialTick);
}
if (this.f_91056_ != null) {
@@ -1223,10 +_,12 @@
@@ -1243,10 +_,12 @@
this.f_90990_.m_85378_((double)i);
if (this.f_91080_ != null) {
this.f_91080_.m_6574_(this, this.f_90990_.m_85445_(), this.f_90990_.m_85446_());
@@ -255,7 +255,7 @@
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
this.f_91067_.m_91599_();
}
@@ -1499,6 +_,7 @@
@@ -1520,6 +_,7 @@
}
public void m_91395_() {
@@ -263,7 +263,7 @@
this.f_91019_ = false;
}
@@ -1528,10 +_,18 @@
@@ -1549,10 +_,18 @@
if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) {
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
BlockPos blockpos = blockhitresult.m_82425_();
@@ -285,7 +285,7 @@
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
}
}
@@ -1560,14 +_,20 @@
@@ -1581,14 +_,20 @@
return false;
} else {
boolean flag = false;
@@ -308,7 +308,7 @@
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
if (this.f_91073_.m_8055_(blockpos).m_60795_()) {
flag = true;
@@ -1580,8 +_,10 @@
@@ -1601,8 +_,10 @@
}
this.f_91074_.m_36334_();
@@ -319,7 +319,7 @@
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
return flag;
}
@@ -1597,6 +_,11 @@
@@ -1618,6 +_,11 @@
}
for(InteractionHand interactionhand : InteractionHand.values()) {
@@ -331,7 +331,7 @@
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
if (!itemstack.m_246617_(this.f_91073_.m_246046_())) {
return;
@@ -1611,13 +_,14 @@
@@ -1632,13 +_,14 @@
return;
}
@@ -347,7 +347,7 @@
this.f_91074_.m_6674_(interactionhand);
}
@@ -1629,7 +_,7 @@
@@ -1650,7 +_,7 @@
int i = itemstack.m_41613_();
InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult);
if (interactionresult1.m_19077_()) {
@@ -356,7 +356,7 @@
this.f_91074_.m_6674_(interactionhand);
if (!itemstack.m_41619_() && (itemstack.m_41613_() != i || this.f_91072_.m_105290_())) {
this.f_91063_.f_109055_.m_109320_(interactionhand);
@@ -1645,6 +_,9 @@
@@ -1666,6 +_,9 @@
}
}
@@ -366,7 +366,7 @@
if (!itemstack.m_41619_()) {
InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand);
if (interactionresult2.m_19077_()) {
@@ -1671,6 +_,8 @@
@@ -1692,6 +_,8 @@
--this.f_91011_;
}
@@ -375,7 +375,23 @@
this.f_91026_.m_6180_("gui");
this.f_240378_.m_240688_();
this.f_91065_.m_193832_(this.f_91012_);
@@ -1800,6 +_,8 @@
@@ -1787,6 +_,7 @@
this.f_91005_.m_120596_();
+ net.minecraftforge.event.ForgeEventFactory.onPreLevelTick(this.f_91073_, () -> true);
try {
this.f_91073_.m_104726_(() -> {
return true;
@@ -1802,6 +_,7 @@
throw new ReportedException(crashreport);
}
+ net.minecraftforge.event.ForgeEventFactory.onPostLevelTick(this.f_91073_, () -> true);
}
this.f_91026_.m_6182_("animateTick");
@@ -1821,6 +_,8 @@
this.f_91026_.m_6182_("keyboard");
this.f_91068_.m_90931_();
this.f_91026_.m_7238_();
@@ -384,7 +400,7 @@
}
private boolean m_91278_() {
@@ -1996,6 +_,7 @@
@@ -2017,6 +_,7 @@
}
public void m_91156_(ClientLevel p_91157_) {
@@ -392,7 +408,7 @@
ProgressScreen progressscreen = new ProgressScreen(true);
progressscreen.m_6309_(Component.m_237115_("connect.joining"));
this.m_91362_(progressscreen);
@@ -2029,10 +_,12 @@
@@ -2050,10 +_,12 @@
IntegratedServer integratedserver = this.f_91007_;
this.f_91007_ = null;
this.f_91063_.m_109150_();
@@ -405,15 +421,15 @@
if (integratedserver != null) {
this.f_91026_.m_6180_("waitForServer");
@@ -2046,6 +_,7 @@
@@ -2067,6 +_,7 @@
this.f_243981_.m_246151_();
this.f_91065_.m_93089_();
this.f_91010_ = false;
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(f_91073_);
this.f_91004_.m_90740_();
}
@@ -2153,6 +_,7 @@
this.f_91073_ = null;
@@ -2173,6 +_,7 @@
private void m_91280_() {
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
@@ -421,7 +437,7 @@
boolean flag = this.f_91074_.m_150110_().f_35937_;
BlockEntity blockentity = null;
HitResult.Type hitresult$type = this.f_91077_.m_6662_();
@@ -2165,10 +_,7 @@
@@ -2185,10 +_,7 @@
}
Block block = blockstate.m_60734_();
@@ -433,7 +449,7 @@
if (flag && Screen.m_96637_() && blockstate.m_155947_()) {
blockentity = this.f_91073_.m_7702_(blockpos);
@@ -2179,7 +_,7 @@
@@ -2199,7 +_,7 @@
}
Entity entity = ((EntityHitResult)this.f_91077_).m_82443_();
@@ -442,7 +458,7 @@
if (itemstack == null) {
return;
}
@@ -2721,6 +_,19 @@
@@ -2737,6 +_,19 @@
public void m_91312_(int p_91313_) {
this.f_91051_.m_119410_(p_91313_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/MouseHandler.java
+++ b/net/minecraft/client/MouseHandler.java
@@ -69,6 +_,7 @@
@@ -73,6 +_,7 @@
this.f_91510_ = -1;
}
@@ -8,7 +8,7 @@
boolean[] aboolean = new boolean[]{false};
if (this.f_91503_.m_91265_() == null) {
if (this.f_91503_.f_91080_ == null) {
@@ -82,11 +_,19 @@
@@ -86,11 +_,19 @@
if (flag) {
screen.m_169415_();
Screen.m_96579_(() -> {
@@ -30,7 +30,7 @@
}, "mouseReleased event handler", screen.getClass().getCanonicalName());
}
}
@@ -110,19 +_,26 @@
@@ -114,19 +_,26 @@
}
}
}
@@ -60,7 +60,7 @@
} else if (this.f_91503_.f_91074_ != null) {
if (this.f_91518_ != 0.0D && Math.signum(d0) != Math.signum(this.f_91518_)) {
this.f_91518_ = 0.0D;
@@ -135,6 +_,7 @@
@@ -139,6 +_,7 @@
}
this.f_91518_ -= (double)i;
@@ -68,7 +68,7 @@
if (this.f_91503_.f_91074_.m_5833_()) {
if (this.f_91503_.f_91065_.m_93085_().m_94768_()) {
this.f_91503_.f_91065_.m_93085_().m_205380_(-i);
@@ -203,7 +_,9 @@
@@ -207,7 +_,9 @@
double d2 = (p_91563_ - this.f_91507_) * (double)this.f_91503_.m_91268_().m_85445_() / (double)this.f_91503_.m_91268_().m_85443_();
double d3 = (p_91564_ - this.f_91508_) * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
Screen.m_96579_(() -> {
@@ -79,7 +79,7 @@
}, "mouseDragged event handler", screen.getClass().getCanonicalName());
}
@@ -286,6 +_,14 @@
@@ -290,6 +_,14 @@
public double m_91594_() {
return this.f_91508_;
@@ -1,16 +1,16 @@
--- a/net/minecraft/client/Options.java
+++ b/net/minecraft/client/Options.java
@@ -507,7 +_,8 @@
@@ -544,7 +_,8 @@
}, new OptionInstance.LazyEnum<>(() -> {
return Stream.concat(Stream.of(""), Minecraft.m_91087_().m_91106_().m_194525_().stream()).toList();
}, (p_232011_) -> {
- return Minecraft.m_91087_().m_91396_() && p_232011_ != "" && !Minecraft.m_91087_().m_91106_().m_194525_().contains(p_232011_) ? Optional.empty() : Optional.of(p_232011_);
+ // FORGE: fix incorrect string comparison - PR #8767
+ return Minecraft.m_91087_().m_91396_() && (p_232011_ == null || !p_232011_.isEmpty()) && !Minecraft.m_91087_().m_91106_().m_194525_().contains(p_232011_) ? Optional.empty() : Optional.of(p_232011_);
}, Codec.STRING), "", (p_231994_) -> {
}, Codec.STRING), "", (p_275584_) -> {
SoundManager soundmanager = Minecraft.m_91087_().m_91106_();
soundmanager.m_194526_();
@@ -788,6 +_,7 @@
@@ -868,6 +_,7 @@
}
public Options(Minecraft p_92138_, File p_92139_) {
@@ -18,9 +18,9 @@
this.f_92060_ = p_92138_;
this.f_92110_ = new File(p_92139_, "options.txt");
boolean flag = p_92138_.m_91103_();
@@ -904,11 +_,20 @@
p_168428_.m_213982_("panoramaScrollSpeed", this.f_244402_);
@@ -989,11 +_,20 @@
p_168428_.m_213982_("telemetryOptInExtra", this.f_260461_);
this.f_263744_ = p_168428_.m_142682_("onboardAccessibility", this.f_263744_);
+ processOptionsForge(p_168428_);
+ }
@@ -41,7 +41,7 @@
}
}
@@ -927,6 +_,9 @@
@@ -1012,6 +_,9 @@
}
public void m_92140_() {
@@ -51,7 +51,7 @@
try {
if (!this.f_92110_.exists()) {
return;
@@ -955,7 +_,8 @@
@@ -1040,7 +_,8 @@
}
}
@@ -61,7 +61,7 @@
@Nullable
private String m_168458_(String p_168459_) {
return compoundtag1.m_128441_(p_168459_) ? compoundtag1.m_128461_(p_168459_) : null;
@@ -1118,6 +_,7 @@
@@ -1203,6 +_,7 @@
}
public void m_92172_() {
@@ -69,7 +69,7 @@
if (this.f_92060_.f_91074_ != null) {
int i = 0;
@@ -1182,6 +_,23 @@
@@ -1267,6 +_,23 @@
}
p_92146_.m_10509_(set);
@@ -10,7 +10,7 @@
private final Map<Block, Set<Property<?>>> f_92572_ = Maps.newHashMap();
public static BlockColors m_92574_() {
@@ -73,11 +_,12 @@
@@ -80,11 +_,12 @@
blockcolors.m_92589_((p_92596_, p_92597_, p_92598_, p_92599_) -> {
return p_92597_ != null && p_92598_ != null ? 2129968 : 7455580;
}, Blocks.f_50196_);
@@ -24,7 +24,7 @@
if (blockcolor != null) {
return blockcolor.m_92566_(p_92583_, (BlockAndTintGetter)null, (BlockPos)null, 0);
} else {
@@ -87,13 +_,15 @@
@@ -94,13 +_,15 @@
}
public int m_92577_(BlockState p_92578_, @Nullable BlockAndTintGetter p_92579_, @Nullable BlockPos p_92580_, int p_92581_) {
@@ -0,0 +1,20 @@
--- a/net/minecraft/client/gui/Font.java
+++ b/net/minecraft/client/gui/Font.java
@@ -33,7 +_,7 @@
import org.joml.Vector3f;
@OnlyIn(Dist.CLIENT)
-public class Font {
+public class Font implements net.minecraftforge.client.extensions.IForgeFont {
private static final float f_168643_ = 0.01F;
private static final Vector3f f_92712_ = new Vector3f(0.0F, 0.0F, 0.03F);
public static final int f_193827_ = 8;
@@ -260,6 +_,8 @@
public StringSplitter m_92865_() {
return this.f_92714_;
}
+
+ @Override public Font self() { return this; }
@OnlyIn(Dist.CLIENT)
public static enum DisplayMode {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/Gui.java
+++ b/net/minecraft/client/gui/Gui.java
@@ -392,6 +_,7 @@
@@ -374,6 +_,7 @@
if (this.f_92986_.f_91076_ != null && this.f_92986_.f_91076_ instanceof LivingEntity && f >= 1.0F) {
flag = this.f_92986_.f_91074_.m_36333_() > 5.0F;
flag &= this.f_92986_.f_91076_.m_6084_();
@@ -8,7 +8,7 @@
}
int j = this.f_92978_ / 2 - 7 + 16;
@@ -444,6 +_,10 @@
@@ -428,6 +_,10 @@
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
MobEffect mobeffect = mobeffectinstance.m_19544_();
@@ -19,15 +19,15 @@
if (mobeffectinstance.m_19575_()) {
int i = this.f_92977_;
int j = 1;
@@ -472,6 +_,7 @@
@@ -456,6 +_,7 @@
}
}
+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, this.m_93252_(), f)) continue;
+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, 0, f)) continue;
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
int l = i;
int i1 = j;
@@ -603,12 +_,13 @@
float f1 = f;
@@ -583,12 +_,13 @@
public void m_93069_(PoseStack p_93070_) {
this.f_92986_.m_91307_().m_6180_("selectedItemName");
if (this.f_92993_ > 0 && !this.f_92994_.m_41619_()) {
@@ -43,9 +43,9 @@
int j = (this.f_92977_ - i) / 2;
int k = this.f_92978_ - 59;
if (!this.f_92986_.f_91072_.m_105205_()) {
@@ -624,7 +_,13 @@
RenderSystem.m_69478_();
RenderSystem.m_69453_();
@@ -602,7 +_,13 @@
if (l > 0) {
m_93172_(p_93070_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0));
- this.m_93082_().m_92763_(p_93070_, mutablecomponent, (float)j, (float)k, 16777215 + (l << 24));
+ Font font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(f_92994_).getFont(f_92994_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.SELECTED_ITEM_NAME);
@@ -55,10 +55,19 @@
+ j = (this.f_92977_ - font.m_92852_(highlightTip)) / 2;
+ font.m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ }
RenderSystem.m_69461_();
}
}
@@ -1138,7 +_,7 @@
@@ -924,7 +_,7 @@
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
}
- public void m_264541_(PoseStack p_265563_, float p_265127_) {
+ protected void m_264541_(PoseStack p_265563_, float p_265127_) {
RenderSystem.m_69465_();
RenderSystem.m_69458_(false);
float f = (float)Math.min(this.f_92977_, this.f_92978_);
@@ -1054,7 +_,7 @@
ItemStack itemstack = this.f_92986_.f_91074_.m_150109_().m_36056_();
if (itemstack.m_41619_()) {
this.f_92993_ = 0;
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/gui/components/AbstractButton.java
+++ b/net/minecraft/client/gui/components/AbstractButton.java
@@ -32,7 +_,7 @@
RenderSystem.m_69482_();
m_275833_(p_275468_, this.m_252754_(), this.m_252907_(), this.m_5711_(), this.m_93694_(), 20, 4, 200, 20, 0, this.m_274533_());
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
- int i = this.f_93623_ ? 16777215 : 10526880;
+ int i = getFGColor();
this.m_274375_(p_275468_, minecraft.f_91062_, i | Mth.m_14167_(this.f_93625_ * 255.0F) << 24);
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/gui/components/AbstractSelectionList.java
+++ b/net/minecraft/client/gui/components/AbstractSelectionList.java
@@ -536,6 +_,13 @@
@@ -515,6 +_,13 @@
return new ScreenRectangle(this.f_93393_, this.f_93390_, this.f_93392_ - this.f_93393_, this.f_93391_ - this.f_93390_);
}
+ public int getWidth() { return this.f_93388_; }
@@ -12,5 +12,5 @@
+ public int getRight() { return this.f_93392_; }
+
@OnlyIn(Dist.CLIENT)
public abstract static class Entry<E extends AbstractSelectionList.Entry<E>> implements GuiEventListener {
protected abstract static class Entry<E extends AbstractSelectionList.Entry<E>> implements GuiEventListener {
/** @deprecated */
@@ -1,15 +1,6 @@
--- a/net/minecraft/client/gui/components/AbstractWidget.java
+++ b/net/minecraft/client/gui/components/AbstractWidget.java
@@ -130,7 +_,7 @@
this.m_93228_(p_93676_, this.m_252754_(), this.m_252907_(), 0, 46 + i * 20, this.f_93618_ / 2, this.f_93619_);
this.m_93228_(p_93676_, this.m_252754_() + this.f_93618_ / 2, this.m_252907_(), 200 - this.f_93618_ / 2, 46 + i * 20, this.f_93618_ / 2, this.f_93619_);
this.m_7906_(p_93676_, minecraft, p_93677_, p_93678_);
- int j = this.f_93623_ ? 16777215 : 10526880;
+ int j = getFGColor();
m_93215_(p_93676_, font, this.m_6035_(), this.m_252754_() + this.f_93618_ / 2, this.m_252907_() + (this.f_93619_ - 8) / 2, j | Mth.m_14167_(this.f_93625_ * 255.0F) << 24);
}
@@ -222,6 +_,10 @@
@@ -231,6 +_,10 @@
this.f_93618_ = p_93675_;
}
@@ -20,9 +11,9 @@
public void m_93650_(float p_93651_) {
this.f_93625_ = p_93651_;
}
@@ -244,6 +_,19 @@
@@ -261,6 +_,19 @@
protected void m_93692_(boolean p_93693_) {
public void m_93692_(boolean p_93693_) {
this.f_93616_ = p_93693_;
+ }
+
@@ -6,10 +6,10 @@
int k = i / 2 - 91;
+ var event = net.minecraftforge.client.ForgeHooksClient.onCustomizeBossEventProgress(p_93705_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_);
+ if (!event.isCanceled()) {
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.m_157456_(0, f_93697_);
this.m_93706_(p_93705_, k, j, lerpingbossevent);
@@ -42,7 +_,8 @@
Component component = lerpingbossevent.m_18861_();
@@ -41,7 +_,8 @@
int i1 = i / 2 - l / 2;
int j1 = j - 9;
this.f_93698_.f_91062_.m_92763_(p_93705_, component, (float)i1, (float)j1, 16777215);
@@ -0,0 +1,29 @@
--- a/net/minecraft/client/gui/components/Button.java
+++ b/net/minecraft/client/gui/components/Button.java
@@ -29,6 +_,11 @@
this.f_252416_ = p_259552_;
}
+ protected Button(Builder builder) {
+ this(builder.f_252538_, builder.f_252462_, builder.f_252510_, builder.f_252447_, builder.f_252401_, builder.f_252468_, builder.f_252431_);
+ m_257544_(builder.f_256855_); // Forge: Make use of the Builder tooltip
+ }
+
public void m_5691_() {
this.f_93717_.m_93750_(this);
}
@@ -92,9 +_,11 @@
}
public Button m_253136_() {
- Button button = new Button(this.f_252538_, this.f_252462_, this.f_252510_, this.f_252447_, this.f_252401_, this.f_252468_, this.f_252431_);
- button.m_257544_(this.f_256855_);
- return button;
+ return build(Button::new);
+ }
+
+ public Button build(java.util.function.Function<Builder, Button> builder) {
+ return builder.apply(this);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/components/toasts/ToastComponent.java
+++ b/net/minecraft/client/gui/components/toasts/ToastComponent.java
@@ -103,6 +_,7 @@
@@ -102,6 +_,7 @@
}
public void m_94922_(Toast p_94923_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/LoadingOverlay.java
+++ b/net/minecraft/client/gui/screens/LoadingOverlay.java
@@ -121,6 +_,7 @@
@@ -119,6 +_,7 @@
int k1 = (int)((double)this.f_96163_.m_91268_().m_85446_() * 0.8325D);
float f6 = this.f_96164_.m_7750_();
this.f_96167_ = Mth.m_14036_(this.f_96167_ * 0.95F + f6 * 0.050000012F, 0.0F, 1.0F);
@@ -8,7 +8,7 @@
if (f < 1.0F) {
this.m_96182_(p_96178_, i / 2 - j1, k1 - 5, i / 2 + j1, k1 + 5, 1.0F - Mth.m_14036_(f, 0.0F, 1.0F));
}
@@ -130,6 +_,7 @@
@@ -128,6 +_,7 @@
}
if (this.f_96168_ == -1L && this.f_96164_.m_7746_() && (!this.f_96166_ || f1 >= 2.0F)) {
@@ -16,7 +16,7 @@
try {
this.f_96164_.m_7748_();
this.f_96165_.accept(Optional.empty());
@@ -137,7 +_,6 @@
@@ -135,7 +_,6 @@
this.f_96165_.accept(Optional.of(throwable));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/MenuScreens.java
+++ b/net/minecraft/client/gui/screens/MenuScreens.java
@@ -40,6 +_,10 @@
@@ -41,6 +_,10 @@
private static final Map<MenuType<?>, MenuScreens.ScreenConstructor<?, ?>> f_96196_ = Maps.newHashMap();
public static <T extends AbstractContainerMenu> void m_96201_(@Nullable MenuType<T> p_96202_, Minecraft p_96203_, int p_96204_, Component p_96205_) {
@@ -11,7 +11,7 @@
if (p_96202_ == null) {
f_96195_.warn("Trying to open invalid screen with name: {}", (Object)p_96205_.getString());
} else {
@@ -47,9 +_,10 @@
@@ -48,9 +_,10 @@
if (screenconstructor == null) {
f_96195_.warn("Failed to create screen for menu type: {}", (Object)BuiltInRegistries.f_256818_.m_7981_(p_96202_));
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/OptionsScreen.java
+++ b/net/minecraft/client/gui/screens/OptionsScreen.java
@@ -168,6 +_,14 @@
@@ -151,6 +_,14 @@
super.m_86412_(p_96249_, p_96250_, p_96251_, p_96252_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/Screen.java
+++ b/net/minecraft/client/gui/screens/Screen.java
@@ -143,7 +_,7 @@
@@ -214,7 +_,7 @@
}
public void m_7379_() {
@@ -9,7 +9,7 @@
}
protected <T extends GuiEventListener & Renderable & NarratableEntry> T m_142416_(T p_169406_) {
@@ -180,15 +_,29 @@
@@ -251,15 +_,29 @@
this.f_169368_.clear();
}
@@ -43,7 +43,7 @@
this.m_262809_(p_169389_, list, p_169392_, p_169393_, DefaultTooltipPositioner.f_262752_);
}
@@ -201,24 +_,48 @@
@@ -272,24 +_,48 @@
}
public void m_96597_(PoseStack p_96598_, List<Component> p_96599_, int p_96600_, int p_96601_) {
@@ -94,18 +94,16 @@
if (k > i) {
i = k;
}
@@ -226,8 +_,8 @@
@@ -297,7 +_,7 @@
j += clienttooltipcomponent.m_142103_();
}
- int k1 = p_263065_ + 12;
- int l1 = p_262996_ - 12;
+ int k1 = preEvent.getX() + 12;
+ int l1 = preEvent.getY() - 12;
Vector2ic vector2ic = p_262920_.m_262814_(this, k1, l1, i, j);
k1 = vector2ic.x();
l1 = vector2ic.y();
@@ -240,6 +_,8 @@
- Vector2ic vector2ic = p_262920_.m_262814_(this, p_263065_, p_262996_, i, j);
+ Vector2ic vector2ic = p_262920_.m_262814_(this, preEvent.getX(), preEvent.getY(), i, j);
int l = vector2ic.x();
int i1 = vector2ic.y();
p_263064_.m_85836_();
@@ -307,6 +_,8 @@
RenderSystem.m_157427_(GameRenderer::m_172811_);
bufferbuilder.m_166779_(VertexFormat.Mode.QUADS, DefaultVertexFormat.f_85815_);
Matrix4f matrix4f = p_263064_.m_85850_().m_252922_();
@@ -113,29 +111,29 @@
+ // net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipColor(this.tooltipStack, p_263064_, k1, l1, preEvent.getFont(), p_262990_);
TooltipRenderUtil.m_262796_((p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_) -> {
GuiComponent.m_93123_(p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_);
}, matrix4f, bufferbuilder, k1, l1, i, j, 400);
@@ -256,7 +_,7 @@
}, matrix4f, bufferbuilder, l, i1, i, j, 400);
@@ -320,7 +_,7 @@
for(int j1 = 0; j1 < p_262990_.size(); ++j1) {
ClientTooltipComponent clienttooltipcomponent1 = p_262990_.get(j1);
- clienttooltipcomponent1.m_142440_(this.f_96547_, k1, i1, matrix4f, multibuffersource$buffersource);
+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), k1, i1, matrix4f, multibuffersource$buffersource);
i1 += clienttooltipcomponent1.m_142103_() + (j1 == 0 ? 2 : 0);
for(int l1 = 0; l1 < p_262990_.size(); ++l1) {
ClientTooltipComponent clienttooltipcomponent1 = p_262990_.get(l1);
- clienttooltipcomponent1.m_142440_(this.f_96547_, l, k1, matrix4f, multibuffersource$buffersource);
+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), l, k1, matrix4f, multibuffersource$buffersource);
k1 += clienttooltipcomponent1.m_142103_() + (l1 == 0 ? 2 : 0);
}
@@ -266,7 +_,7 @@
@@ -329,7 +_,7 @@
for(int i2 = 0; i2 < p_262990_.size(); ++i2) {
ClientTooltipComponent clienttooltipcomponent2 = p_262990_.get(i2);
- clienttooltipcomponent2.m_183452_(this.f_96547_, k1, i1, p_263064_, this.f_96542_, 400);
+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), k1, i1, p_263064_, this.f_96542_, 400);
i1 += clienttooltipcomponent2.m_142103_() + (i2 == 0 ? 2 : 0);
- clienttooltipcomponent2.m_183452_(this.f_96547_, l, k1, p_263064_, this.f_96542_);
+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), k1, i1, p_263064_, this.f_96542_);
k1 += clienttooltipcomponent2.m_142103_() + (i2 == 0 ? 2 : 0);
}
@@ -368,9 +_,19 @@
this.f_96547_ = p_96607_.f_91062_;
this.f_96543_ = p_96608_;
this.f_96544_ = p_96609_;
@@ -438,8 +_,18 @@
}
this.f_267454_ = true;
+ java.util.function.Consumer<GuiEventListener> add = (b) -> {
+ if (b instanceof Renderable r)
+ this.f_169369_.add(r);
@@ -144,7 +142,6 @@
+ f_96540_.add(b);
+ };
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.Init.Pre(this, this.f_96540_, add, this::m_169411_))) {
this.m_232761_();
this.m_169407_(false);
this.m_169378_(f_169370_);
+ }
@@ -152,23 +149,23 @@
}
protected void m_232761_() {
@@ -399,6 +_,7 @@
public void m_96558_(PoseStack p_96559_, int p_96560_) {
@@ -467,6 +_,7 @@
public void m_7333_(PoseStack p_96557_) {
if (this.f_96541_.f_91073_ != null) {
this.m_93179_(p_96559_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_96559_));
m_93179_(p_96557_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_96557_));
} else {
this.m_96626_(p_96560_);
this.m_264065_(p_96557_);
}
@@ -418,6 +_,7 @@
bufferbuilder.m_5483_((double)this.f_96543_, 0.0D, 0.0D).m_7421_((float)this.f_96543_ / 32.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_();
bufferbuilder.m_5483_(0.0D, 0.0D, 0.0D).m_7421_(0.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_();
tesselator.m_85914_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, new PoseStack()));
@@ -479,6 +_,7 @@
int i = 32;
m_93143_(p_265092_, 0, 0, 0, 0.0F, 0.0F, this.f_96543_, this.f_96544_, 32, 32);
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_265092_));
}
public boolean m_7043_() {
@@ -503,6 +_,10 @@
@@ -570,6 +_,10 @@
}
public void m_7400_(List<Path> p_96591_) {
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/gui/screens/TitleScreen.java
+++ b/net/minecraft/client/gui/screens/TitleScreen.java
@@ -68,6 +_,7 @@
private long f_96715_;
@@ -63,6 +_,7 @@
@Nullable
private TitleScreen.WarningLabel f_232768_;
private final LogoRenderer f_263781_;
+ private net.minecraftforge.client.gui.TitleScreenModUpdateIndicator modUpdateNotification;
public TitleScreen() {
this(false);
@@ -112,11 +_,15 @@
@@ -113,11 +_,15 @@
int j = this.f_96543_ - i - 2;
int k = 24;
int l = this.f_96544_ / 4 + 48;
@@ -24,7 +24,7 @@
this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, l + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_96791_) -> {
this.f_96541_.m_91152_(new LanguageSelectScreen(this, this.f_96541_.f_91066_, this.f_96541_.m_91102_()));
@@ -161,7 +_,7 @@
@@ -162,7 +_,7 @@
}).m_252987_(this.f_96543_ / 2 - 100, p_96764_ + p_96765_ * 1, 200, 20).m_257505_(tooltip).m_253136_())).f_93623_ = flag;
(this.m_142416_(Button.m_253074_(Component.m_237115_("menu.online"), (p_210872_) -> {
this.m_96793_();
@@ -33,31 +33,31 @@
}
@Nullable
@@ -267,6 +_,7 @@
this.f_232768_.m_232790_(p_96739_, l);
@@ -245,6 +_,7 @@
this.f_232768_.m_232790_(p_96739_, i);
}
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, l);
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, i);
if (this.f_96721_ != null) {
p_96739_.m_85836_();
p_96739_.m_252880_((float)(this.f_96543_ / 2 + 90), 70.0F, 0.0F);
@@ -289,7 +_,14 @@
@@ -267,7 +_,14 @@
s = s + I18n.m_118938_("menu.modded");
}
- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | l);
- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | i);
+ net.minecraftforge.internal.BrandingControl.forEachLine(true, true, (brdline, brd) ->
+ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | l)
+ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | i)
+ );
+
+ net.minecraftforge.internal.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
+ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | l)
+ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | i)
+ );
+
for(GuiEventListener guieventlistener : this.m_6702_()) {
if (guieventlistener instanceof AbstractWidget) {
@@ -302,6 +_,7 @@
@@ -280,6 +_,7 @@
RenderSystem.m_69482_();
this.f_96726_.m_86412_(p_96739_, p_96740_, p_96741_, p_96742_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
@@ -39,6 +_,7 @@
@@ -38,6 +_,7 @@
private int f_97141_ = Integer.MIN_VALUE;
private float f_97142_;
private boolean f_97143_;
@@ -8,7 +8,7 @@
public AdvancementTab(Minecraft p_97145_, AdvancementsScreen p_97146_, AdvancementTabType p_97147_, int p_97148_, Advancement p_97149_, DisplayInfo p_97150_) {
this.f_97126_ = p_97145_;
@@ -53,6 +_,15 @@
@@ -52,6 +_,15 @@
this.m_97175_(this.f_97134_, p_97149_);
}
@@ -24,7 +24,7 @@
public AdvancementTabType m_169538_() {
return this.f_97128_;
}
@@ -165,8 +_,8 @@
@@ -151,8 +_,8 @@
return null;
} else {
for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
@@ -42,6 +_,7 @@
@@ -41,6 +_,7 @@
@Nullable
private AdvancementTab f_97336_;
private boolean f_97337_;
@@ -8,7 +8,7 @@
public AdvancementsScreen(ClientAdvancements p_97340_) {
super(GameNarrator.f_93310_);
@@ -57,7 +_,15 @@
@@ -56,7 +_,15 @@
} else {
this.f_97334_.m_104401_(this.f_97336_ == null ? null : this.f_97336_.m_97182_(), true);
}
@@ -25,7 +25,7 @@
}
public void m_7861_() {
@@ -75,7 +_,7 @@
@@ -74,7 +_,7 @@
int j = (this.f_96544_ - 140) / 2;
for(AdvancementTab advancementtab : this.f_97335_.values()) {
@@ -34,7 +34,7 @@
this.f_97334_.m_104401_(advancementtab.m_97182_(), true);
break;
}
@@ -99,6 +_,11 @@
@@ -98,6 +_,11 @@
int i = (this.f_96543_ - 252) / 2;
int j = (this.f_96544_ - 140) / 2;
this.m_7333_(p_97361_);
@@ -46,7 +46,7 @@
this.m_97373_(p_97361_, p_97362_, p_97363_, i, j);
this.m_97356_(p_97361_, i, j);
this.m_97381_(p_97361_, p_97362_, p_97363_, i, j);
@@ -149,12 +_,14 @@
@@ -138,10 +_,12 @@
RenderSystem.m_157456_(0, f_97330_);
for(AdvancementTab advancementtab : this.f_97335_.values()) {
@@ -54,14 +54,12 @@
advancementtab.m_97165_(p_97357_, p_97358_, p_97359_, advancementtab == this.f_97336_);
}
RenderSystem.m_69453_();
for(AdvancementTab advancementtab1 : this.f_97335_.values()) {
+ if (advancementtab1.getPage() == tabPage)
advancementtab1.m_97159_(p_97358_, p_97359_, this.f_96542_);
advancementtab1.m_274613_(p_97357_, p_97358_, p_97359_, this.f_96542_);
}
@@ -180,7 +_,7 @@
}
@@ -161,7 +_,7 @@
if (this.f_97335_.size() > 1) {
for(AdvancementTab advancementtab : this.f_97335_.values()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/controls/KeyBindsList.java
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsList.java
@@ -50,7 +_,7 @@
@@ -65,7 +_,7 @@
}
protected int m_5756_() {
@@ -9,48 +9,34 @@
}
public int m_5759_() {
@@ -108,10 +_,11 @@
this.f_193911_ = p_193917_;
this.f_193912_ = Button.m_253074_(p_193917_, (p_193939_) -> {
@@ -130,10 +_,11 @@
this.f_193912_ = Button.m_253074_(p_193917_, (p_269618_) -> {
KeyBindsList.this.f_193858_.f_193975_ = p_193916_;
KeyBindsList.this.m_269130_();
- }).m_252987_(0, 0, 75, 20).m_252778_((p_253311_) -> {
+ }).m_252987_(0, 0, 75 + 20 /* Forge: Add space */, 20).m_252778_((p_253311_) -> {
return p_193916_.m_90862_() ? Component.m_237110_("narrator.controls.unbound", p_193917_) : Component.m_237110_("narrator.controls.bound", p_193917_, p_253311_.get());
}).m_253136_();
this.f_193913_ = Button.m_253074_(Component.m_237115_("controls.reset"), (p_193935_) -> {
this.f_193913_ = Button.m_253074_(Component.m_237115_("controls.reset"), (p_269616_) -> {
+ this.f_193910_.setToDefault();
KeyBindsList.this.f_93386_.f_91066_.m_92159_(p_193916_, p_193916_.m_90861_());
KeyMapping.m_90854_();
KeyBindsList.this.m_269130_();
}).m_252987_(0, 0, 50, 20).m_252778_((p_253313_) -> {
@@ -123,7 +_,7 @@
boolean flag = KeyBindsList.this.f_193858_.f_193975_ == this.f_193910_;
@@ -145,7 +_,7 @@
public void m_6311_(PoseStack p_193923_, int p_193924_, int p_193925_, int p_193926_, int p_193927_, int p_193928_, int p_193929_, int p_193930_, boolean p_193931_, float p_193932_) {
float f = (float)(p_193926_ + 90 - KeyBindsList.this.f_193859_);
KeyBindsList.this.f_93386_.f_91062_.m_92889_(p_193923_, this.f_193911_, f, (float)(p_193925_ + p_193928_ / 2 - 9 / 2), 16777215);
- this.f_193913_.m_252865_(p_193926_ + 190);
+ this.f_193913_.m_252865_(p_193926_ + 190 + 20);
this.f_193913_.m_252888_(p_193925_);
this.f_193913_.f_93623_ = !this.f_193910_.m_90864_();
this.f_193913_.m_253211_(p_193925_);
this.f_193913_.m_86412_(p_193923_, p_193929_, p_193930_, p_193932_);
@@ -131,11 +_,12 @@
this.f_193912_.m_252888_(p_193925_);
this.f_193912_.m_93666_(this.f_193910_.m_90863_());
boolean flag1 = false;
+ boolean keyCodeModifierConflict = true; // gracefully handle conflicts like SHIFT vs SHIFT+G
this.f_193912_.m_252865_(p_193926_ + 105);
@@ -174,7 +_,7 @@
MutableComponent mutablecomponent = Component.m_237119_();
if (!this.f_193910_.m_90862_()) {
for(KeyMapping keymapping : KeyBindsList.this.f_93386_.f_91066_.f_92059_) {
if (keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) {
flag1 = true;
- break;
+ keyCodeModifierConflict &= keymapping.hasKeyModifierConflict(this.f_193910_);
}
}
}
@@ -143,7 +_,7 @@
if (flag) {
this.f_193912_.m_93666_(Component.m_237113_("> ").m_7220_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.YELLOW)).m_130946_(" <").m_130940_(ChatFormatting.YELLOW));
} else if (flag1) {
- this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.RED));
+ this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(keyCodeModifierConflict ? ChatFormatting.GOLD : ChatFormatting.RED));
}
this.f_193912_.m_86412_(p_193923_, p_193929_, p_193930_, p_193932_);
- if (keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) {
+ if ((keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) || keymapping.hasKeyModifierConflict(this.f_193910_)) { // FORGE: gracefully handle conflicts like SHIFT vs SHIFT+G
if (this.f_268447_) {
mutablecomponent.m_130946_(", ");
}
@@ -2,13 +2,13 @@
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java
@@ -31,7 +_,7 @@
this.m_7787_(this.f_193977_);
this.f_193978_ = this.m_142416_(Button.m_253074_(Component.m_237115_("controls.resetAll"), (p_193999_) -> {
this.f_193978_ = this.m_142416_(Button.m_253074_(Component.m_237115_("controls.resetAll"), (p_269619_) -> {
for(KeyMapping keymapping : this.f_96282_.f_92059_) {
- keymapping.m_90848_(keymapping.m_90861_());
+ keymapping.setToDefault();
}
KeyMapping.m_90854_();
this.f_193977_.m_269130_();
@@ -55,11 +_,14 @@
public boolean m_7933_(int p_193987_, int p_193988_, int p_193989_) {
if (this.f_193975_ != null) {
@@ -23,4 +23,4 @@
+ if(!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(this.f_193975_.getKey()))
this.f_193975_ = null;
this.f_193976_ = Util.m_137550_();
KeyMapping.m_90854_();
this.f_193977_.m_269130_();
@@ -1,19 +1,19 @@
--- a/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
@@ -89,6 +_,7 @@
@@ -88,6 +_,7 @@
int i = this.f_97735_;
int j = this.f_97736_;
this.m_7286_(p_97795_, p_97798_, p_97796_, p_97797_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Background(this, p_97795_, p_97796_, p_97797_));
RenderSystem.m_69465_();
super.m_86412_(p_97795_, p_97796_, p_97797_, p_97798_);
PoseStack posestack = RenderSystem.m_157191_();
@@ -110,11 +_,12 @@
p_97795_.m_85836_();
@@ -104,11 +_,12 @@
this.f_97734_ = slot;
int l = slot.f_40220_;
int i1 = slot.f_40221_;
- m_169606_(p_97795_, l, i1, this.m_93252_());
+ renderSlotHighlight(p_97795_, l, i1, this.m_93252_(), this.getSlotColor(k));
- m_169606_(p_97795_, l, i1, 0);
+ renderSlotHighlight(p_97795_, l, i1, 0, this.getSlotColor(k));
}
}
@@ -22,7 +22,7 @@
ItemStack itemstack = this.f_97711_.m_41619_() ? this.f_97732_.m_142621_() : this.f_97711_;
if (!itemstack.m_41619_()) {
int l1 = 8;
@@ -154,9 +_,13 @@
@@ -147,9 +_,13 @@
}
public static void m_169606_(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) {
@@ -37,19 +37,17 @@
RenderSystem.m_69444_(true, true, true, true);
RenderSystem.m_69482_();
}
@@ -174,8 +_,10 @@
RenderSystem.m_157182_();
this.m_93250_(200);
this.f_96542_.f_115093_ = 200.0F;
+ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_97783_).getFont(p_97783_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT);
+ if (font == null) font = this.f_96547_;
this.f_96542_.m_115203_(p_97783_, p_97784_, p_97785_);
- this.f_96542_.m_115174_(this.f_96547_, p_97783_, p_97784_, p_97785_ - (this.f_97711_.m_41619_() ? 0 : 8), p_97786_);
+ this.f_96542_.m_115174_(font, p_97783_, p_97784_, p_97785_ - (this.f_97711_.m_41619_() ? 0 : 8), p_97786_);
this.m_93250_(0);
this.f_96542_.f_115093_ = 0.0F;
@@ -165,7 +_,8 @@
p_275498_.m_85836_();
p_275498_.m_252880_(0.0F, 0.0F, 232.0F);
this.f_96542_.m_274369_(p_275498_, p_275341_, p_275289_, p_275690_);
- this.f_96542_.m_274364_(p_275498_, this.f_96547_, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_);
+ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_275341_).getFont(p_275341_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT);
+ this.f_96542_.m_274364_(p_275498_, font == null ? this.f_96547_ : font, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_);
p_275498_.m_85849_();
}
@@ -285,7 +_,8 @@
@@ -272,7 +_,8 @@
if (super.m_6375_(p_97748_, p_97749_, p_97750_)) {
return true;
} else {
@@ -59,7 +57,7 @@
Slot slot = this.m_97744_(p_97748_, p_97749_);
long i = Util.m_137550_();
this.f_97723_ = this.f_97709_ == slot && i - this.f_97721_ < 250L && this.f_97722_ == p_97750_;
@@ -296,6 +_,7 @@
@@ -283,6 +_,7 @@
int j = this.f_97735_;
int k = this.f_97736_;
boolean flag1 = this.m_7467_(p_97748_, p_97749_, j, k, p_97750_);
@@ -67,7 +65,7 @@
int l = -1;
if (slot != null) {
l = slot.f_40219_;
@@ -321,7 +_,7 @@
@@ -308,7 +_,7 @@
}
} else if (!this.f_97738_) {
if (this.f_97732_.m_142621_().m_41619_()) {
@@ -76,7 +74,7 @@
this.m_6597_(slot, l, p_97750_, ClickType.CLONE);
} else {
boolean flag2 = l != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344));
@@ -345,7 +_,7 @@
@@ -332,7 +_,7 @@
this.f_97717_ = 0;
} else if (p_97750_ == 1) {
this.f_97717_ = 1;
@@ -85,7 +83,7 @@
this.f_97717_ = 2;
}
}
@@ -414,10 +_,13 @@
@@ -401,10 +_,13 @@
}
public boolean m_6348_(double p_97812_, double p_97813_, int p_97814_) {
@@ -99,7 +97,7 @@
int k = -1;
if (slot != null) {
k = slot.f_40219_;
@@ -431,7 +_,7 @@
@@ -418,7 +_,7 @@
if (m_96638_()) {
if (!this.f_97724_.m_41619_()) {
for(Slot slot2 : this.f_97732_.f_38839_) {
@@ -108,7 +106,7 @@
this.m_6597_(slot2, slot2.f_40219_, p_97814_, ClickType.QUICK_MOVE);
}
}
@@ -494,7 +_,7 @@
@@ -481,7 +_,7 @@
this.m_6597_((Slot)null, -999, AbstractContainerMenu.m_38930_(2, this.f_97717_), ClickType.QUICK_CRAFT);
} else if (!this.f_97732_.m_142621_().m_41619_()) {
@@ -117,7 +115,7 @@
this.m_6597_(slot, k, p_97814_, ClickType.CLONE);
} else {
boolean flag1 = k != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344));
@@ -541,34 +_,39 @@
@@ -528,34 +_,39 @@
}
public boolean m_7933_(int p_97765_, int p_97766_, int p_97767_) {
@@ -164,7 +162,7 @@
this.m_6597_(this.f_97734_, this.f_97734_.f_40219_, i, ClickType.SWAP);
return true;
}
@@ -603,6 +_,18 @@
@@ -590,6 +_,18 @@
public T m_6262_() {
return this.f_97732_;
@@ -18,7 +18,7 @@
this.m_98630_();
} else {
(this.f_97732_).f_98639_.addAll(p_261591_);
@@ -273,6 +_,30 @@
@@ -273,6 +_,34 @@
protected void m_7856_() {
if (this.f_96541_.f_91072_.m_105290_()) {
super.m_7856_();
@@ -45,6 +45,10 @@
+ if (this.pages.size() > 1) {
+ m_142416_(net.minecraft.client.gui.components.Button.m_253074_(Component.m_237113_("<"), b -> setCurrentPage(this.pages.get(Math.max(this.pages.indexOf(this.currentPage) - 1, 0)))).m_252794_(f_97735_, f_97736_ - 50).m_253046_(20, 20).m_253136_());
+ m_142416_(net.minecraft.client.gui.components.Button.m_253074_(Component.m_237113_(">"), b -> setCurrentPage(this.pages.get(Math.min(this.pages.indexOf(this.currentPage) + 1, this.pages.size() - 1)))).m_252794_(f_97735_ + f_97726_ - 20, f_97736_ - 50).m_253046_(20, 20).m_253136_());
+ }
+ this.currentPage = this.pages.stream().filter(page -> page.getVisibleTabs().contains(f_98507_)).findFirst().orElse(this.currentPage);
+ if (!this.currentPage.getVisibleTabs().contains(f_98507_)) {
+ f_98507_ = this.currentPage.getVisibleTabs().get(0);
+ }
this.f_98510_ = new EditBox(this.f_96547_, this.f_97735_ + 82, this.f_97736_ + 6, 80, 9, Component.m_237115_("itemGroup.search"));
this.f_98510_.m_94199_(50);
@@ -80,24 +84,25 @@
if (s.startsWith("#")) {
s = s.substring(1);
- searchtree = this.f_96541_.m_231372_(SearchRegistry.f_119942_);
+ searchtree = this.f_96541_.m_231372_(net.minecraftforge.client.CreativeModeTabSearchRegistry.getNameSearchKey(f_98507_));
+ searchtree = this.f_96541_.m_231372_(net.minecraftforge.client.CreativeModeTabSearchRegistry.getTagSearchKey(f_98507_));
this.m_98619_(s);
} else {
- searchtree = this.f_96541_.m_231372_(SearchRegistry.f_119941_);
+ searchtree = this.f_96541_.m_231372_(net.minecraftforge.client.CreativeModeTabSearchRegistry.getTagSearchKey(f_98507_));
+ searchtree = this.f_96541_.m_231372_(net.minecraftforge.client.CreativeModeTabSearchRegistry.getNameSearchKey(f_98507_));
}
(this.f_97732_).f_98639_.addAll(searchtree.m_6293_(s.toLowerCase(Locale.ROOT)));
@@ -416,7 +_,7 @@
@@ -415,7 +_,8 @@
protected void m_7027_(PoseStack p_98616_, int p_98617_, int p_98618_) {
if (f_98507_.m_40789_()) {
RenderSystem.m_69461_();
- this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, 4210752);
+ RenderSystem.m_69461_();
+ this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, f_98507_.getLabelColor());
}
}
@@ -426,7 +_,7 @@
@@ -425,7 +_,7 @@
double d0 = p_98531_ - (double)this.f_97735_;
double d1 = p_98532_ - (double)this.f_97736_;
@@ -106,7 +111,7 @@
if (this.m_98562_(creativemodetab, d0, d1)) {
return true;
}
@@ -447,7 +_,7 @@
@@ -446,7 +_,7 @@
double d1 = p_98623_ - (double)this.f_97736_;
this.f_98509_ = false;
@@ -115,7 +120,7 @@
if (this.m_98562_(creativemodetab, d0, d1)) {
this.m_98560_(creativemodetab);
return true;
@@ -465,6 +_,7 @@
@@ -464,6 +_,7 @@
private void m_98560_(CreativeModeTab p_98561_) {
CreativeModeTab creativemodetab = f_98507_;
f_98507_ = p_98561_;
@@ -123,7 +128,7 @@
this.f_97737_.clear();
(this.f_97732_).f_98639_.clear();
this.m_238391_();
@@ -541,13 +_,15 @@
@@ -540,13 +_,15 @@
this.f_98511_ = null;
}
@@ -131,7 +136,7 @@
+ if (f_98507_.hasSearchBar()) {
this.f_98510_.m_94194_(true);
this.f_98510_.m_94190_(false);
this.f_98510_.m_94178_(true);
this.f_98510_.m_93692_(true);
if (creativemodetab != p_98561_) {
this.f_98510_.m_94144_("");
}
@@ -140,7 +145,7 @@
this.m_98630_();
} else {
@@ -604,7 +_,7 @@
@@ -603,7 +_,7 @@
this.m_7333_(p_98577_);
super.m_86412_(p_98577_, p_98578_, p_98579_, p_98580_);
@@ -149,23 +154,22 @@
if (this.m_98584_(p_98577_, creativemodetab, p_98578_, p_98579_)) {
break;
}
@@ -614,6 +_,15 @@
@@ -613,13 +_,22 @@
this.m_96602_(p_98577_, f_98506_, p_98578_, p_98579_);
}
+ if (this.pages.size() != 1) {
+ Component page = Component.m_237113_(String.format("%d / %d", this.pages.indexOf(this.currentPage) + 1, this.pages.size()));
+ this.m_93250_(300);
+ this.f_96542_.f_115093_ = 300.0F;
+ p_98577_.m_85836_();
+ p_98577_.m_252880_(0F, 0F, 300F);
+ f_96547_.m_92744_(p_98577_, page.m_7532_(), f_97735_ + (f_97726_ / 2f) - (f_96547_.m_92852_(page) / 2f), f_97736_ - 44, -1);
+ this.m_93250_(0);
+ this.f_96542_.f_115093_ = 0.0F;
+ p_98577_.m_85849_();
+ }
+
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
+ RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
this.m_7025_(p_98577_, p_98578_, p_98579_);
}
@@ -621,7 +_,7 @@
protected void m_6057_(PoseStack p_98590_, ItemStack p_98591_, int p_98592_, int p_98593_) {
boolean flag = this.f_97734_ != null && this.f_97734_ instanceof CreativeModeInventoryScreen.CustomCreativeSlot;
boolean flag1 = f_98507_.m_257962_() == CreativeModeTab.Type.CATEGORY;
@@ -174,7 +178,7 @@
TooltipFlag.Default tooltipflag$default = this.f_96541_.f_91066_.f_92125_ ? TooltipFlag.Default.f_256730_ : TooltipFlag.Default.f_256752_;
TooltipFlag tooltipflag = flag ? tooltipflag$default.m_257777_() : tooltipflag$default;
List<Component> list = p_98591_.m_41651_(this.f_96541_.f_91074_, tooltipflag);
@@ -641,8 +_,8 @@
@@ -639,35 +_,36 @@
int i = 1;
@@ -185,34 +189,39 @@
list1.add(i++, creativemodetab.m_40786_().m_6881_().m_130940_(ChatFormatting.BLUE));
}
}
@@ -654,7 +_,7 @@
protected void m_7286_(PoseStack p_98572_, float p_98573_, int p_98574_, int p_98575_) {
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
- for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
+ for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) {
RenderSystem.m_157427_(GameRenderer::m_172817_);
RenderSystem.m_157456_(0, f_98504_);
if (creativemodetab != f_98507_) {
@@ -663,7 +_,7 @@
}
RenderSystem.m_157427_(GameRenderer::m_172817_);
- this.m_169388_(p_98590_, list1, p_98591_.m_150921_(), p_98592_, p_98593_);
+ this.renderTooltip(p_98590_, list1, p_98591_.m_150921_(), p_98592_, p_98593_, null, p_98591_);
}
protected void m_7286_(PoseStack p_98572_, float p_98573_, int p_98574_, int p_98575_) {
- for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
+ for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) {
RenderSystem.m_157456_(0, f_98504_);
if (creativemodetab != f_98507_) {
this.m_98581_(p_98572_, creativemodetab);
}
}
- RenderSystem.m_157456_(0, new ResourceLocation("textures/gui/container/creative_inventory/tab_" + f_98507_.m_40788_()));
+ RenderSystem.m_157456_(0, f_98507_.getBackgroundLocation());
this.m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
this.f_98510_.m_86412_(p_98572_, p_98574_, p_98575_, p_98573_);
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
@@ -671,7 +_,7 @@
int j = this.f_97735_ + 175;
int k = this.f_97736_ + 18;
int i = k + 112;
RenderSystem.m_157427_(GameRenderer::m_172817_);
- RenderSystem.m_157456_(0, f_98504_);
+ RenderSystem.m_157456_(0, f_98507_.getTabsImage());
if (f_98507_.m_40791_()) {
this.m_93228_(p_98572_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15);
m_93228_(p_98572_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15);
}
@@ -684,7 +_,7 @@
+ if (currentPage.getVisibleTabs().contains(f_98507_)) //Forge: only display tab selection when the selected tab is on the current page
this.m_98581_(p_98572_, f_98507_);
if (f_98507_.m_257962_() == CreativeModeTab.Type.INVENTORY) {
InventoryScreen.m_274545_(p_98572_, this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_98574_), (float)(this.f_97736_ + 45 - 30 - p_98575_), this.f_96541_.f_91074_);
@@ -676,7 +_,7 @@
}
private int m_258094_(CreativeModeTab p_260136_) {
@@ -221,7 +230,7 @@
int j = 27;
int k = 27 * i;
if (p_260136_.m_6563_()) {
@@ -696,7 +_,7 @@
@@ -688,7 +_,7 @@
private int m_257995_(CreativeModeTab p_260181_) {
int i = 0;
@@ -230,7 +239,7 @@
i -= 32;
} else {
i += this.f_97727_;
@@ -724,8 +_,8 @@
@@ -716,8 +_,8 @@
protected void m_98581_(PoseStack p_98582_, CreativeModeTab p_98583_) {
boolean flag = p_98583_ == f_98507_;
@@ -241,15 +250,15 @@
int j = i * 26;
int k = 0;
int l = this.f_97735_ + this.m_258094_(p_98583_);
@@ -742,6 +_,7 @@
@@ -734,6 +_,7 @@
i1 += this.f_97727_ - 4;
}
+ RenderSystem.m_69478_(); //Forge: Make sure blend is enabled else tabs show a white border.
this.m_93228_(p_98582_, l, i1, j, k, 26, 32);
this.f_96542_.f_115093_ = 100.0F;
l += 5;
@@ -784,6 +_,15 @@
m_93228_(p_98582_, l, i1, j, k, 26, 32);
p_98582_.m_85836_();
p_98582_.m_252880_(0.0F, 0.0F, 100.0F);
@@ -777,6 +_,14 @@
}
@@ -259,13 +268,12 @@
+
+ public void setCurrentPage(net.minecraftforge.client.gui.CreativeTabsScreenPage currentPage) {
+ this.currentPage = currentPage;
+ this.m_98560_(currentPage.getDefaultTab());
+ }
+
@OnlyIn(Dist.CLIENT)
static class CustomCreativeSlot extends Slot {
public CustomCreativeSlot(Container p_98633_, int p_98634_, int p_98635_, int p_98636_) {
@@ -947,6 +_,22 @@
@@ -944,6 +_,22 @@
public boolean m_8010_(Player p_98665_) {
return this.f_98655_.m_8010_(p_98665_);
@@ -1,8 +1,8 @@
--- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
@@ -42,12 +_,17 @@
Collection<MobEffectInstance> collection = this.f_96541_.f_91074_.m_21220_();
if (!collection.isEmpty() && j >= 32) {
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
boolean flag = j >= 120;
+ var event = net.minecraftforge.client.ForgeHooksClient.onScreenPotionSize(this, j, !flag, i);
+ if (event.isCanceled()) return;
@@ -19,27 +19,27 @@
this.m_194002_(p_194015_, i, k, iterable, flag);
this.m_194008_(p_194015_, i, k, iterable, flag);
if (flag) {
@@ -95,6 +_,11 @@
@@ -94,6 +_,11 @@
int i = this.f_97736_;
for(MobEffectInstance mobeffectinstance : p_194012_) {
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_194009_, p_194010_ + (p_194013_ ? 6 : 7), i, this.m_93252_())) {
+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_194009_, p_194010_ + (p_194013_ ? 6 : 7), i, 0)) {
+ i += p_194011_;
+ continue;
+ }
MobEffect mobeffect = mobeffectinstance.m_19544_();
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
RenderSystem.m_157456_(0, textureatlassprite.m_247685_());
@@ -108,6 +_,11 @@
@@ -107,6 +_,11 @@
int i = this.f_97736_;
for(MobEffectInstance mobeffectinstance : p_98726_) {
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
+ if (renderer.renderInventoryText(mobeffectinstance, this, p_98723_, p_98724_, i, this.m_93252_())) {
+ if (renderer.renderInventoryText(mobeffectinstance, this, p_98723_, p_98724_, i, 0)) {
+ i += p_98725_;
+ continue;
+ }
Component component = this.m_194000_(mobeffectinstance);
this.f_96547_.m_92763_(p_98723_, component, (float)(p_98724_ + 10 + 18), (float)(i + 6), 16777215);
String s = MobEffectUtil.m_19581_(mobeffectinstance, 1.0F);
Component component1 = MobEffectUtil.m_267641_(mobeffectinstance, 1.0F);
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
@@ -147,7 +_,7 @@
@@ -140,7 +_,7 @@
int i2 = 86 - this.f_96547_.m_92895_(s);
FormattedText formattedtext = EnchantmentNames.m_98734_().m_98737_(this.f_96547_, i2);
int j2 = 6839882;
- if ((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) {
+ if (((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) || this.f_97732_.f_39447_[i1] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
this.m_93228_(p_98762_, j1, j + 14 + 19 * i1, 0, 185, 108, 19);
this.m_93228_(p_98762_, j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16);
this.f_96547_.m_92857_(formattedtext, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1);
@@ -186,10 +_,13 @@
m_93228_(p_98762_, j1, j + 14 + 19 * i1, 0, 185, 108, 19);
m_93228_(p_98762_, j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16);
this.f_96547_.m_274535_(p_98762_, formattedtext, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1);
@@ -179,10 +_,13 @@
Enchantment enchantment = Enchantment.m_44697_((this.f_97732_).f_39447_[j]);
int l = (this.f_97732_).f_39448_[j];
int i1 = j + 1;
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
@@ -17,7 +_,7 @@
private static final Vector3f f_243728_ = new Vector3f(1.0F, 1.0F, 1.0F);
private static final int f_244604_ = 16;
private static final int f_244207_ = 16;
- private final ResourceLocation f_243720_ = new ResourceLocation("textures/gui/hanging_signs/" + this.f_244069_.f_61839_() + ".png");
+ private final ResourceLocation f_243720_ = new ResourceLocation(this.f_244069_.f_61839_() + ".png").m_246208_("textures/gui/hanging_signs/");
public HangingSignEditScreen(SignBlockEntity p_249425_, boolean p_250356_) {
super(p_249425_, p_250356_, Component.m_237115_("hanging_sign.edit"));
@@ -1,14 +1,16 @@
--- a/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
@@ -99,6 +_,11 @@
public static void m_98850_(int p_98851_, int p_98852_, int p_98853_, float p_98854_, float p_98855_, LivingEntity p_98856_) {
float f = (float)Math.atan((double)(p_98854_ / 40.0F));
float f1 = (float)Math.atan((double)(p_98855_ / 40.0F));
+ renderEntityInInventoryRaw(p_98851_, p_98852_, p_98853_, f, f1, p_98856_);
@@ -98,6 +_,13 @@
public static void m_274545_(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float p_275604_, float p_275546_, LivingEntity p_275689_) {
float f = (float)Math.atan((double)(p_275604_ / 40.0F));
float f1 = (float)Math.atan((double)(p_275546_ / 40.0F));
+ // Forge: Allow passing in direct angle components instead of mouse position
+ renderEntityInInventoryFollowsAngle(p_275396_, p_275688_, p_275245_, p_275535_, f, f1, p_275689_);
+ }
+ public static void renderEntityInInventoryRaw(int p_98851_, int p_98852_, int p_98853_, float angleXComponent, float angleYComponent, LivingEntity p_98856_) {
+
+ public static void renderEntityInInventoryFollowsAngle(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float angleXComponent, float angleYComponent, LivingEntity p_275689_) {
+ float f = angleXComponent;
+ float f1 = angleYComponent;
PoseStack posestack = RenderSystem.m_157191_();
posestack.m_85836_();
posestack.m_252880_((float)p_98851_, (float)p_98852_, 1050.0F);
Quaternionf quaternionf = (new Quaternionf()).rotateZ((float)Math.PI);
Quaternionf quaternionf1 = (new Quaternionf()).rotateX(f1 * 20.0F * ((float)Math.PI / 180F));
quaternionf.mul(quaternionf1);
@@ -1,16 +1,16 @@
--- a/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
@@ -240,7 +_,12 @@
this.f_96542_.m_115169_(this.f_96547_, p_99164_, p_99166_, p_99167_);
@@ -234,7 +_,12 @@
this.f_96542_.m_274412_(p_99163_, this.f_96547_, p_99164_, p_99166_, p_99167_);
} else {
this.f_96542_.m_115174_(this.f_96547_, p_99165_, p_99166_, p_99167_, p_99165_.m_41613_() == 1 ? "1" : null);
- this.f_96542_.m_115174_(this.f_96547_, p_99164_, p_99166_ + 14, p_99167_, p_99164_.m_41613_() == 1 ? "1" : null);
this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99165_, p_99166_, p_99167_, p_99165_.m_41613_() == 1 ? "1" : null);
- this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99164_, p_99166_ + 14, p_99167_, p_99164_.m_41613_() == 1 ? "1" : null);
+ // Forge: fixes Forge-8806, code for count rendering taken from ItemRenderer#renderGuiItemDecorations
+ PoseStack posestack = new PoseStack();
+ posestack.m_85837_(0.0D, 0.0D, (f_96542_.f_115093_ + 200.0F));
+ posestack.m_85837_(0.0D, 0.0D, 200F);
+ net.minecraft.client.renderer.MultiBufferSource.BufferSource bufferSource = net.minecraft.client.renderer.MultiBufferSource.m_109898_(com.mojang.blaze3d.vertex.Tesselator.m_85913_().m_85915_());
+ f_96547_.m_252905_(String.valueOf(p_99164_.m_41613_()), (p_99166_ + 14) + 19 - 2 - f_96547_.m_92895_(String.valueOf(p_99164_.m_41613_())), p_99167_ + 6 + 3, 0xFFFFFF, true, posestack.m_85850_().m_252922_(), bufferSource, false, 0, 15728880);
+ f_96547_.m_272078_(String.valueOf(p_99164_.m_41613_()), (float) (p_99166_ + 14) + 19 - 2 - f_96547_.m_92895_(String.valueOf(p_99164_.m_41613_())), (float)p_99167_ + 6 + 3, 0xFFFFFF, true, posestack.m_85850_().m_252922_(), bufferSource, net.minecraft.client.gui.Font.DisplayMode.NORMAL, 0, 15728880, false);
+ bufferSource.m_109911_();
RenderSystem.m_157427_(GameRenderer::m_172817_);
RenderSystem.m_157456_(0, f_99113_);
this.m_93250_(this.m_93252_() + 300);
p_99163_.m_85836_();
p_99163_.m_252880_(0.0F, 0.0F, 300.0F);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
+++ b/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
@@ -259,6 +_,11 @@
@@ -281,6 +_,11 @@
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
+++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
@@ -321,6 +_,8 @@
@@ -330,6 +_,8 @@
this.f_99855_.m_99707_(list1);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/packs/PackSelectionModel.java
+++ b/net/minecraft/client/gui/screens/packs/PackSelectionModel.java
@@ -102,6 +_,8 @@
@@ -110,6 +_,8 @@
boolean m_7802_();
boolean m_7803_();
@@ -9,7 +9,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -176,6 +_,11 @@
@@ -198,6 +_,11 @@
public void m_7845_() {
this.m_99938_(1);
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java
+++ b/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java
@@ -130,7 +_,7 @@
private void m_100013_(TransferableSelectionList p_100014_, Stream<PackSelectionModel.Entry> p_100015_) {
p_100014_.m_6702_().clear();
TransferableSelectionList.PackEntry transferableselectionlist$packentry = p_100014_.m_93511_();
String s = transferableselectionlist$packentry == null ? "" : transferableselectionlist$packentry.m_264411_();
p_100014_.m_6987_((TransferableSelectionList.PackEntry)null);
- p_100015_.forEach((p_170000_) -> {
+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_170000_) -> {
p_100014_.m_6702_().add(new TransferableSelectionList.PackEntry(this.f_96541_, p_100014_, this, p_170000_));
});
}
- p_100015_.forEach((p_264692_) -> {
+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_264692_) -> {
TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.f_96541_, p_100014_, p_264692_);
p_100014_.m_6702_().add(transferableselectionlist$packentry1);
if (p_264692_.m_264249_().equals(s)) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java
+++ b/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java
@@ -108,7 +_,7 @@
@@ -106,7 +_,7 @@
this.m_5674_();
this.f_100279_.clear();
@@ -9,7 +9,7 @@
this.f_100279_.add(new RecipeBookTabButton(recipebookcategories));
}
@@ -305,7 +_,7 @@
@@ -297,7 +_,7 @@
}
if (itemstack != null && this.f_100272_.f_91080_ != null) {
@@ -5,7 +5,7 @@
public void m_100417_(PoseStack p_100418_, int p_100419_, int p_100420_) {
if (this.f_100397_.f_91080_ != null && this.f_100395_ != null && !this.f_100396_.m_100212_()) {
- this.f_100397_.f_91080_.m_96597_(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_);
+ this.f_100397_.f_91080_.renderComponentTooltip(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_, this.f_100395_.m_100488_().m_8043_());
+ this.f_100397_.f_91080_.renderComponentTooltip(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_, this.f_100395_.m_100488_().m_8043_(f_100397_.f_91073_.m_9598_()));
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
@@ -113,7 +_,8 @@
@@ -119,7 +_,8 @@
public static void m_232896_(Minecraft p_232897_, @Nullable Screen p_232898_) {
m_232899_(p_232897_, f_232866_);
PackRepository packrepository = new PackRepository(new ServerPacksSource());
@@ -10,28 +10,28 @@
CompletableFuture<WorldCreationContext> completablefuture = WorldLoader.m_214362_(worldloader$initconfig, (p_247792_) -> {
return new WorldLoader.DataLoadOutput<>(new CreateWorldScreen.DataPackReloadCookie(new WorldGenSettings(WorldOptions.m_247394_(), WorldPresets.m_246552_(p_247792_.f_244104_())), p_247792_.f_244127_()), p_247792_.f_243759_());
}, (p_247798_, p_247799_, p_247800_, p_247801_) -> {
@@ -121,7 +_,10 @@
@@ -127,7 +_,10 @@
return new WorldCreationContext(p_247801_.f_243966_(), p_247800_, p_247799_, p_247801_.f_243979_());
}, Util.m_183991_(), p_232897_);
p_232897_.m_18701_(completablefuture::isDone);
- p_232897_.m_91152_(new CreateWorldScreen(p_232898_, WorldDataConfiguration.f_244649_, new WorldGenSettingsComponent(completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty())));
- p_232897_.m_91152_(new CreateWorldScreen(p_232897_, p_232898_, completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty()));
+ // FORGE: Force load mods' datapacks after setting screen and ensure datapack selection reverts to vanilla if invalid.
+ CreateWorldScreen createWorldScreen = new CreateWorldScreen(p_232898_, new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_), new WorldGenSettingsComponent(completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty()));
+ CreateWorldScreen createWorldScreen = new CreateWorldScreen(p_232897_, p_232898_, completablefuture.join().withDataConfiguration(new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_)), Optional.of(WorldPresets.f_226437_), OptionalLong.empty());
+ p_232897_.m_91152_(createWorldScreen);
+ createWorldScreen.m_100878_(packrepository);
+ createWorldScreen.m_269443_(packrepository, true, createWorldScreen::m_267734_);
}
public static CreateWorldScreen m_247077_(@Nullable Screen p_249522_, LevelSettings p_249091_, WorldCreationContext p_249742_, @Nullable Path p_252076_) {
@@ -491,7 +_,7 @@
if (p_232949_) {
this.m_100975_();
} else {
- this.f_244371_ = WorldDataConfiguration.f_244649_;
+ this.f_244371_ = new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_); // FORGE: Revert to *actual* vanilla data
this.f_96541_.m_91152_(this);
}
public static CreateWorldScreen m_275847_(Minecraft p_276017_, @Nullable Screen p_276029_, LevelSettings p_276055_, WorldCreationContext p_276028_, @Nullable Path p_276040_) {
@@ -368,7 +_,7 @@
if (p_269627_) {
p_270552_.accept(this.f_267389_.m_267573_().f_243842_());
} else {
- p_270552_.accept(WorldDataConfiguration.f_244649_);
+ p_270552_.accept(new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_)); // FORGE: Revert to *actual* vanilla data
}
@@ -612,6 +_,7 @@
}, Component.m_237115_("dataPack.validation.failed"), CommonComponents.f_237098_, Component.m_237115_("dataPack.validation.back"), Component.m_237115_("dataPack.validation.reset")));
@@ -482,6 +_,7 @@
if (path != null) {
if (this.f_100832_ == null) {
this.f_100832_ = ServerPacksSource.m_245786_(path);
@@ -0,0 +1,13 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java
@@ -38,6 +_,10 @@
return new WorldCreationContext(this.f_244272_, this.f_244375_, p_250676_.apply(this.m_246480_(), this.f_243796_), this.f_243708_, this.f_232990_, this.f_243842_);
}
+ public WorldCreationContext withDataConfiguration(WorldDataConfiguration dataConfiguration) {
+ return new WorldCreationContext(this.f_244272_, this.f_244375_, this.f_243796_, this.f_243708_, this.f_232990_, dataConfiguration);
+ }
+
public RegistryAccess.Frozen m_246480_() {
return this.f_243708_.m_247579_();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
@@ -158,13 +_,23 @@
@@ -159,13 +_,23 @@
}
private void m_233145_(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_) {
@@ -23,8 +23,8 @@
+ }
} catch (Exception exception) {
f_233088_.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception);
this.f_233089_.m_91152_(new DatapackLoadFailureScreen(() -> {
@@ -177,7 +_,9 @@
if (!p_233148_) {
@@ -185,7 +_,9 @@
WorldData worlddata = worldstem.f_206895_();
boolean flag = worlddata.m_246337_().m_247070_();
boolean flag1 = worlddata.m_5754_() != Lifecycle.stable();
@@ -35,7 +35,7 @@
this.f_233089_.m_247489_().m_247400_(levelstoragesource$levelstorageaccess).thenApply((p_233177_) -> {
return true;
}).exceptionallyComposeAsync((p_233183_) -> {
@@ -199,9 +_,11 @@
@@ -207,9 +_,11 @@
return null;
});
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
@@ -65,6 +_,7 @@
@@ -63,6 +_,7 @@
static final DateFormat f_101646_ = new SimpleDateFormat();
static final ResourceLocation f_101647_ = new ResourceLocation("textures/misc/unknown_server.png");
static final ResourceLocation f_101648_ = new ResourceLocation("textures/gui/world_selection.png");
@@ -8,7 +8,7 @@
static final Component f_101649_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion1").m_130940_(ChatFormatting.RED);
static final Component f_101650_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion2").m_130940_(ChatFormatting.RED);
static final Component f_101651_ = Component.m_237115_("selectWorld.tooltip.snapshot1").m_130940_(ChatFormatting.GOLD);
@@ -325,6 +_,7 @@
@@ -313,6 +_,7 @@
RenderSystem.m_69478_();
GuiComponent.m_93133_(p_101721_, p_101724_, p_101723_, 0.0F, 0.0F, 32, 32, 32, 32);
RenderSystem.m_69461_();
@@ -16,7 +16,7 @@
if (this.f_101693_.f_91066_.m_231828_().m_231551_() || p_101729_) {
RenderSystem.m_157456_(0, WorldSelectionList.f_101648_);
GuiComponent.m_93172_(p_101721_, p_101724_, p_101723_, p_101724_ + 32, p_101723_ + 32, -1601138544);
@@ -560,6 +_,21 @@
@@ -545,6 +_,21 @@
public boolean m_214209_() {
return !this.f_101695_.m_164916_();
@@ -1,15 +1,6 @@
--- a/net/minecraft/client/main/Main.java
+++ b/net/minecraft/client/main/Main.java
@@ -48,7 +_,7 @@
@DontObfuscate
public static void main(String[] p_129642_) {
- m_239872_(p_129642_, true);
+ m_239872_(p_129642_, !net.minecraftforge.fml.loading.FMLConfig.isOptimizedDFUDisabled());
}
public static void m_239872_(String[] p_239873_, boolean p_239874_) {
@@ -142,7 +_,7 @@
@@ -135,7 +_,7 @@
}
CrashReport.m_127529_();
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/model/HumanoidModel.java
+++ b/net/minecraft/client/model/HumanoidModel.java
@@ -264,6 +_,8 @@
@@ -270,6 +_,8 @@
case TOOT_HORN:
this.f_102811_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F;
this.f_102811_.f_104204_ = this.f_102808_.f_104204_ - ((float)Math.PI / 6F);
@@ -9,7 +9,7 @@
}
}
@@ -304,6 +_,8 @@
@@ -314,6 +_,8 @@
case TOOT_HORN:
this.f_102812_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F;
this.f_102812_.f_104204_ = this.f_102808_.f_104204_ + ((float)Math.PI / 6F);
@@ -18,7 +18,7 @@
}
}
@@ -396,7 +_,7 @@
@@ -406,7 +_,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -27,7 +27,7 @@
EMPTY(false),
ITEM(false),
BLOCK(false),
@@ -411,10 +_,29 @@
@@ -422,10 +_,29 @@
private ArmPose(boolean p_102896_) {
this.f_102890_ = p_102896_;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/model/geom/LayerDefinitions.java
+++ b/net/minecraft/client/model/geom/LayerDefinitions.java
@@ -313,6 +_,7 @@
@@ -319,6 +_,7 @@
WoodType.m_61843_().forEach((p_247864_) -> {
builder.put(ModelLayers.m_247439_(p_247864_), layerdefinition24);
});
@@ -1,17 +1,17 @@
--- a/net/minecraft/client/model/geom/ModelLayers.java
+++ b/net/minecraft/client/model/geom/ModelLayers.java
@@ -217,11 +_,13 @@
@@ -220,11 +_,13 @@
}
public static ModelLayerLocation m_171291_(WoodType p_171292_) {
- return m_171300_("sign/" + p_171292_.m_61846_(), "main");
+ ResourceLocation location = new ResourceLocation(p_171292_.m_61846_());
- return m_171300_("sign/" + p_171292_.f_61839_(), "main");
+ ResourceLocation location = new ResourceLocation(p_171292_.f_61839_());
+ return new ModelLayerLocation(new ResourceLocation(location.m_135827_(), "sign/" + location.m_135815_()), "main");
}
public static ModelLayerLocation m_247439_(WoodType p_252225_) {
- return m_171300_("hanging_sign/" + p_252225_.m_61846_(), "main");
+ ResourceLocation location = new ResourceLocation(p_252225_.m_61846_());
- return m_171300_("hanging_sign/" + p_252225_.f_61839_(), "main");
+ ResourceLocation location = new ResourceLocation(p_252225_.f_61839_());
+ return new ModelLayerLocation(new ResourceLocation(location.m_135827_(), "hanging_sign/" + location.m_135815_()), "main");
}
@@ -8,7 +8,7 @@
this.f_104410_.m_104487_(i, levelchunk, (LevelChunk)null);
}
@@ -100,6 +_,7 @@
@@ -115,6 +_,7 @@
}
this.f_104411_.m_171649_(chunkpos);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientLevel.java
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
@@ -117,12 +_,15 @@
@@ -116,12 +_,15 @@
p_194170_.put(BiomeColors.f_108791_, new BlockTintCache((p_194168_) -> {
return this.m_104762_(p_194168_, BiomeColors.f_108791_);
}));
@@ -16,7 +16,7 @@
public void m_233651_(int p_233652_) {
this.f_233599_.m_233856_(p_233652_, this);
@@ -176,6 +_,8 @@
@@ -175,6 +_,8 @@
this.f_194123_ = p_205510_;
this.m_46465_();
this.m_46466_();
@@ -25,7 +25,7 @@
}
public void m_194171_(Runnable p_194172_) {
@@ -262,6 +_,7 @@
@@ -261,6 +_,7 @@
this.m_46473_().m_6521_(() -> {
return BuiltInRegistries.f_256780_.m_7981_(p_104640_.m_6095_()).toString();
});
@@ -33,7 +33,7 @@
p_104640_.m_8119_();
this.m_46473_().m_7238_();
@@ -324,8 +_,10 @@
@@ -323,8 +_,10 @@
}
private void m_104739_(int p_104740_, Entity p_104741_) {
@@ -44,7 +44,7 @@
}
public void m_171642_(int p_171643_, Entity.RemovalReason p_171644_) {
@@ -452,6 +_,12 @@
@@ -451,6 +_,12 @@
}
public void m_262808_(@Nullable Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder<SoundEvent> p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) {
@@ -57,7 +57,7 @@
if (p_263381_ == this.f_104565_.f_91074_) {
this.m_233602_(p_263372_, p_263404_, p_263365_, p_263335_.m_203334_(), p_263417_, p_263416_, p_263349_, false, p_263408_);
}
@@ -459,6 +_,12 @@
@@ -458,6 +_,12 @@
}
public void m_213890_(@Nullable Player p_263514_, Entity p_263536_, Holder<SoundEvent> p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) {
@@ -70,7 +70,7 @@
if (p_263514_ == this.f_104565_.f_91074_) {
this.f_104565_.m_91106_().m_120367_(new EntityBoundSoundInstance(p_263518_.m_203334_(), p_263487_, p_263538_, p_263524_, p_263536_, p_263509_));
}
@@ -907,6 +_,7 @@
@@ -902,6 +_,7 @@
}
public void m_104851_(Difficulty p_104852_) {
@@ -78,7 +78,7 @@
this.f_104840_ = p_104852_;
}
@@ -944,14 +_,46 @@
@@ -939,14 +_,46 @@
ClientLevel.this.f_104566_.add((AbstractClientPlayer)p_171712_);
}
@@ -1,33 +1,33 @@
--- a/net/minecraft/client/multiplayer/ClientPacketListener.java
+++ b/net/minecraft/client/multiplayer/ClientPacketListener.java
@@ -398,6 +_,7 @@
@@ -411,6 +_,7 @@
this.f_104888_.f_91064_.m_113434_();
this.f_104888_.f_91074_.m_172530_();
+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogin(this.f_104888_.f_91072_, this.f_104888_.f_91074_, this.f_104888_.m_91403_().m_6198_());
+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogin(this.f_104888_.f_91072_, this.f_104888_.f_91074_, this.f_104888_.m_91403_().f_104885_);
int i = p_105030_.f_132360_();
this.f_104888_.f_91074_.m_20234_(i);
this.f_104889_.m_104630_(i, this.f_104888_.f_91074_);
@@ -410,6 +_,7 @@
@@ -423,6 +_,7 @@
this.f_104888_.f_91074_.m_219749_(p_105030_.f_238174_());
this.f_104888_.f_91072_.m_171805_(p_105030_.f_132363_(), p_105030_.f_132364_());
this.f_104888_.f_91066_.m_193770_(p_105030_.f_132370_());
+ net.minecraftforge.network.NetworkHooks.sendMCRegistryPackets(f_104885_, "PLAY_TO_SERVER");
this.f_104888_.f_91066_.m_92172_();
this.f_104885_.m_129512_(new ServerboundCustomPayloadPacket(ServerboundCustomPayloadPacket.f_133979_, (new FriendlyByteBuf(Unpooled.buffer())).m_130070_(ClientBrandRetriever.m_129629_())));
this.f_244346_ = new LastSeenMessagesTracker(20);
@@ -1003,8 +_,10 @@
this.f_252517_ = null;
@@ -1055,8 +_,10 @@
localplayer1.m_21204_().m_22159_(localplayer.m_21204_());
}
+ localplayer1.updateSyncFields(localplayer); // Forge: fix MC-10657
localplayer1.m_172530_();
localplayer1.m_108748_(s);
+ net.minecraftforge.client.ForgeHooksClient.firePlayerRespawn(this.f_104888_.f_91072_, localplayer, localplayer1, localplayer1.f_108617_.m_6198_());
+ net.minecraftforge.client.ForgeHooksClient.firePlayerRespawn(this.f_104888_.f_91072_, localplayer, localplayer1, localplayer1.f_108617_.f_104885_);
this.f_104889_.m_104630_(i, localplayer1);
localplayer1.m_146922_(-180.0F);
localplayer1.f_108618_ = new KeyboardInput(this.f_104888_.f_91066_);
@@ -1109,10 +_,7 @@
@@ -1161,10 +_,7 @@
PacketUtils.m_131363_(p_104976_, this, this.f_104888_);
BlockPos blockpos = p_104976_.m_131704_();
this.f_104888_.f_91073_.m_141902_(blockpos, p_104976_.m_195645_()).ifPresent((p_205557_) -> {
@@ -39,7 +39,7 @@
if (p_205557_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_();
@@ -1257,7 +_,9 @@
@@ -1310,7 +_,9 @@
public void m_7443_(ClientboundCommandsPacket p_104990_) {
PacketUtils.m_131363_(p_104990_, this, this.f_104888_);
@@ -50,15 +50,15 @@
}
public void m_7183_(ClientboundStopSoundPacket p_105116_) {
@@ -1276,6 +_,7 @@
@@ -1329,6 +_,7 @@
ClientRecipeBook clientrecipebook = this.f_104888_.f_91074_.m_108631_();
clientrecipebook.m_90625_(this.f_104900_.m_44051_());
clientrecipebook.m_266394_(this.f_104900_.m_44051_(), this.f_104888_.f_91073_.m_9598_());
this.f_104888_.m_231374_(SearchRegistry.f_119943_, clientrecipebook.m_90639_());
+ net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.f_104900_);
}
public void m_7244_(ClientboundPlayerLookAtPacket p_105054_) {
@@ -1368,7 +_,8 @@
@@ -1424,7 +_,8 @@
Blocks.m_50758_();
}
@@ -68,7 +68,7 @@
}
public void m_241155_(ClientboundUpdateEnabledFeaturesPacket p_251591_) {
@@ -1753,6 +_,7 @@
@@ -1826,6 +_,7 @@
}
public void m_7413_(ClientboundCustomPayloadPacket p_105004_) {
@@ -76,7 +76,7 @@
PacketUtils.m_131363_(p_105004_, this, this.f_104888_);
ResourceLocation resourcelocation = p_105004_.m_132042_();
FriendlyByteBuf friendlybytebuf = null;
@@ -1950,7 +_,7 @@
@@ -2023,7 +_,7 @@
int j5 = friendlybytebuf.m_130242_();
this.f_104888_.f_91064_.f_173815_.m_173830_(positionsource, j5);
} else {
@@ -85,7 +85,7 @@
}
} finally {
if (friendlybytebuf != null) {
@@ -2284,6 +_,8 @@
@@ -2370,6 +_,8 @@
}
public void m_246175_(String p_249888_) {
@@ -94,7 +94,7 @@
Instant instant = Instant.now();
long i = Crypt.SaltSupplier.m_216113_();
LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.f_244346_.m_246442_();
@@ -2292,6 +_,7 @@
@@ -2378,6 +_,7 @@
}
public void m_246623_(String p_250092_) {
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/multiplayer/ServerData.java
+++ b/net/minecraft/client/multiplayer/ServerData.java
@@ -26,6 +_,7 @@
private String f_105372_;
@@ -32,6 +_,7 @@
private byte[] f_271511_;
private boolean f_105373_;
private boolean f_242950_;
+ public net.minecraftforge.client.ExtendedServerListData forgeData = null;
@@ -1,9 +1,9 @@
--- a/net/minecraft/client/multiplayer/ServerStatusPinger.java
+++ b/net/minecraft/client/multiplayer/ServerStatusPinger.java
@@ -124,6 +_,7 @@
p_105461_.run();
}
@@ -116,6 +_,7 @@
}
});
+ net.minecraftforge.client.ForgeHooksClient.processForgeListPingData(serverstatus, p_105460_);
this.f_105477_ = Util.m_137550_();
connection.m_129512_(new ServerboundPingRequestPacket(this.f_105477_));
@@ -30,3 +30,12 @@
this.m_241119_(p_251766_, component);
}
}
@@ -159,6 +_,8 @@
public void m_240494_(Component p_240522_, boolean p_240642_) {
if (!this.f_240348_.f_91066_.m_231833_().m_231551_() || !this.f_240348_.m_91246_(this.m_240473_(p_240522_))) {
+ p_240522_ = net.minecraftforge.client.ForgeHooksClient.onClientSystemChat(p_240522_, p_240642_);
+ if (p_240522_ == null) return;
if (p_240642_) {
this.f_240348_.f_91065_.m_93063_(p_240522_, false);
} else {
@@ -14,7 +14,7 @@
private final Queue<Particle> f_107294_ = Queues.newArrayDeque();
private final Map<ResourceLocation, ParticleEngine.MutableSpriteSet> f_107295_ = Maps.newHashMap();
private final TextureAtlas f_107296_;
@@ -188,14 +_,18 @@
@@ -191,10 +_,14 @@
this.m_107378_(ParticleTypes.f_235901_, ShriekParticle.Provider::new);
}
@@ -25,6 +25,15 @@
+ this.f_107293_.put(BuiltInRegistries.f_257034_.m_7981_(p_107382_), p_107383_);
}
+ /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */
+ @Deprecated
public <T extends ParticleOptions> void m_272137_(ParticleType<T> p_273423_, ParticleProvider.Sprite<T> p_273134_) {
this.m_107378_(p_273423_, (p_272320_) -> {
return (p_272323_, p_272324_, p_272325_, p_272326_, p_272327_, p_272328_, p_272329_, p_272330_) -> {
@@ -208,10 +_,12 @@
});
}
+ /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */
+ @Deprecated
public <T extends ParticleOptions> void m_107378_(ParticleType<T> p_107379_, ParticleEngine.SpriteParticleRegistration<T> p_107380_) {
@@ -35,7 +44,7 @@
}
public CompletableFuture<Void> m_5540_(PreparableReloadListener.PreparationBarrier p_107305_, ResourceManager p_107306_, ProfilerFiller p_107307_, ProfilerFiller p_107308_, Executor p_107309_, Executor p_107310_) {
@@ -313,7 +_,7 @@
@@ -310,7 +_,7 @@
@Nullable
private <T extends ParticleOptions> Particle m_107395_(T p_107396_, double p_107397_, double p_107398_, double p_107399_, double p_107400_, double p_107401_, double p_107402_) {
@@ -44,7 +53,7 @@
return particleprovider == null ? null : particleprovider.m_6966_(p_107396_, this.f_107287_, p_107397_, p_107398_, p_107399_, p_107400_, p_107401_, p_107402_);
}
@@ -394,15 +_,25 @@
@@ -391,15 +_,24 @@
}
}
@@ -58,7 +67,6 @@
p_107339_.m_109896_();
RenderSystem.m_69482_();
+ RenderSystem.m_69388_(org.lwjgl.opengl.GL13.GL_TEXTURE2);
+ RenderSystem.m_69493_();
+ RenderSystem.m_69388_(org.lwjgl.opengl.GL13.GL_TEXTURE0);
PoseStack posestack = RenderSystem.m_157191_();
posestack.m_85836_();
@@ -71,7 +79,7 @@
Iterable<Particle> iterable = this.f_107289_.get(particlerendertype);
if (iterable != null) {
RenderSystem.m_157427_(GameRenderer::m_172829_);
@@ -412,6 +_,7 @@
@@ -408,6 +_,7 @@
particlerendertype.m_6505_(bufferbuilder, this.f_107291_);
for(Particle particle : iterable) {
@@ -79,7 +87,7 @@
try {
particle.m_5744_(bufferbuilder, p_107340_, p_107341_);
} catch (Throwable throwable) {
@@ -441,7 +_,7 @@
@@ -437,7 +_,7 @@
}
public void m_107355_(BlockPos p_107356_, BlockState p_107357_) {
@@ -88,7 +96,7 @@
VoxelShape voxelshape = p_107357_.m_60808_(this.f_107287_, p_107356_);
double d0 = 0.25D;
voxelshape.m_83286_((p_172273_, p_172274_, p_172275_, p_172276_, p_172277_, p_172278_) -> {
@@ -461,7 +_,7 @@
@@ -457,7 +_,7 @@
double d7 = d4 * d1 + p_172273_;
double d8 = d5 * d2 + p_172274_;
double d9 = d6 * d3 + p_172275_;
@@ -97,7 +105,7 @@
}
}
}
@@ -505,12 +_,18 @@
@@ -501,12 +_,18 @@
d0 = (double)i + aabb.f_82291_ + (double)0.1F;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/AbstractClientPlayer.java
+++ b/net/minecraft/client/player/AbstractClientPlayer.java
@@ -136,6 +_,6 @@
@@ -147,6 +_,6 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/LocalPlayer.java
+++ b/net/minecraft/client/player/LocalPlayer.java
@@ -150,6 +_,7 @@
@@ -149,6 +_,7 @@
}
public boolean m_6469_(DamageSource p_108662_, float p_108663_) {
@@ -8,7 +8,15 @@
return false;
}
@@ -462,7 +_,14 @@
@@ -275,6 +_,7 @@
public boolean m_108700_(boolean p_108701_) {
ServerboundPlayerActionPacket.Action serverboundplayeractionpacket$action = p_108701_ ? ServerboundPlayerActionPacket.Action.DROP_ALL_ITEMS : ServerboundPlayerActionPacket.Action.DROP_ITEM;
+ if (m_6117_() && m_7655_() == InteractionHand.MAIN_HAND && (p_108701_ || m_21211_().m_41613_() == 1)) m_5810_(); // Forge: fix MC-231097 on the clientside
ItemStack itemstack = this.m_150109_().m_182403_(p_108701_);
this.f_108617_.m_104955_(new ServerboundPlayerActionPacket(serverboundplayeractionpacket$action, BlockPos.f_121853_, Direction.DOWN));
return !itemstack.m_41619_();
@@ -456,7 +_,14 @@
}
public void m_5496_(SoundEvent p_108651_, float p_108652_, float p_108653_) {
@@ -24,7 +32,7 @@
}
public void m_6330_(SoundEvent p_108655_, SoundSource p_108656_, float p_108657_, float p_108658_) {
@@ -634,6 +_,7 @@
@@ -627,6 +_,7 @@
this.f_108601_ = !this.m_150110_().f_35935_ && !this.m_6069_() && this.m_20175_(Pose.CROUCHING) && (this.m_6144_() || !this.m_5803_() && !this.m_20175_(Pose.STANDING));
float f = Mth.m_14036_(0.3F + EnchantmentHelper.m_220302_(this), 0.0F, 1.0F);
this.f_108618_.m_214106_(this.m_108635_(), f);
@@ -32,37 +40,37 @@
this.f_108619_.m_91301_().m_120586_(this.f_108618_);
if (this.m_6117_() && !this.m_20159_()) {
this.f_108618_.f_108566_ *= 0.2F;
@@ -660,7 +_,7 @@
}
boolean flag4 = this.m_255269_();
- if ((this.f_19861_ || this.m_5842_() || this.m_20159_() && this.m_20202_().m_20096_()) && !flag1 && !flag2 && this.m_108733_() && !this.m_20142_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_)) {
+ if ((this.f_19861_ || this.m_5842_() || this.m_20159_() && this.m_20202_().m_20096_() || this.canStartSwimming()) && !flag1 && !flag2 && this.m_108733_() && !this.m_20142_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_)) {
@@ -655,7 +_,7 @@
boolean flag4 = this.m_264082_();
boolean flag5 = this.m_20159_() ? this.m_20202_().m_20096_() : this.f_19861_;
boolean flag6 = !flag1 && !flag2;
- if ((flag5 || this.m_5842_()) && flag6 && flag4) {
+ if ((flag5 || this.m_5842_() || this.canStartSwimming()) && flag6 && flag4) {
if (this.f_108583_ <= 0 && !this.f_108619_.f_91066_.f_92091_.m_90857_()) {
this.f_108583_ = 7;
} else {
@@ -668,15 +_,15 @@
@@ -663,15 +_,15 @@
}
}
- if (!this.m_20142_() && (!this.m_20069_() || this.m_5842_()) && this.m_108733_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_) && this.f_108619_.f_91066_.f_92091_.m_90857_()) {
- if ((!this.m_20069_() || this.m_5842_()) && flag4 && this.f_108619_.f_91066_.f_92091_.m_90857_()) {
+ if (!this.m_20142_() && (!(this.m_20069_() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType))) || (this.m_5842_() || this.canStartSwimming())) && this.m_108733_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_) && this.f_108619_.f_91066_.f_92091_.m_90857_()) {
this.m_6858_(true);
}
if (this.m_20142_()) {
boolean flag5 = !this.f_108618_.m_108577_() || !flag4;
- boolean flag6 = flag5 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_();
+ boolean flag6 = flag5 || this.f_19862_ && !this.f_185931_ || (this.m_20069_() && !this.m_5842_()) || (this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)) && !this.canStartSwimming());
boolean flag7 = !this.f_108618_.m_108577_() || !this.m_255269_();
- boolean flag8 = flag7 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_();
+ boolean flag8 = flag7 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_() || (this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)) && !this.canStartSwimming());
if (this.m_6069_()) {
- if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag5 || !this.m_20069_()) {
- if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag7 || !this.m_20069_()) {
+ if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag5 || !(this.m_20069_() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)))) {
this.m_6858_(false);
}
} else if (flag6) {
@@ -706,14 +_,15 @@
} else if (flag8) {
@@ -701,14 +_,15 @@
if (this.f_108618_.f_108572_ && !flag7 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) {
if (this.f_108618_.f_108572_ && !flag9 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) {
ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST);
- if (itemstack.m_150930_(Items.f_42741_) && ElytraItem.m_41140_(itemstack) && this.m_36319_()) {
+ if (itemstack.canElytraFly(this) && this.m_36319_()) {
@@ -79,15 +87,15 @@
}
if (this.m_204029_(FluidTags.f_13131_)) {
@@ -824,6 +_,7 @@
@@ -819,6 +_,7 @@
public void m_6083_() {
super.m_6083_();
+ if (this.m_36342_() && this.m_20159_()) this.f_108618_.f_108573_ = false;
this.f_108611_ = false;
if (this.m_20202_() instanceof Boat) {
Boat boat = (Boat)this.m_20202_();
@@ -1041,6 +_,18 @@
Entity entity = this.m_275832_();
if (entity instanceof Boat boat) {
@@ -1044,6 +_,18 @@
} else {
return super.m_7398_(p_108758_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/RemotePlayer.java
+++ b/net/minecraft/client/player/RemotePlayer.java
@@ -28,6 +_,7 @@
@@ -32,6 +_,7 @@
}
public boolean m_6469_(DamageSource p_108772_, float p_108773_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/GameRenderer.java
+++ b/net/minecraft/client/renderer/GameRenderer.java
@@ -299,6 +_,8 @@
@@ -304,6 +_,8 @@
this.m_109128_(new ResourceLocation("shaders/post/spider.json"));
} else if (p_109107_ instanceof EnderMan) {
this.m_109128_(new ResourceLocation("shaders/post/invert.json"));
@@ -9,7 +9,7 @@
}
}
@@ -586,6 +_,7 @@
@@ -597,6 +_,7 @@
list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_crumbling", DefaultVertexFormat.f_85811_), (p_234230_) -> {
f_172607_ = p_234230_;
}));
@@ -17,7 +17,7 @@
} catch (IOException ioexception) {
list1.forEach((p_172729_) -> {
p_172729_.getFirst().close();
@@ -667,19 +_,21 @@
@@ -678,19 +_,21 @@
boolean flag = false;
int i = 3;
double d1 = d0;
@@ -42,16 +42,16 @@
d1 = this.f_109059_.f_91077_.m_82450_().m_82557_(vec3);
}
@@ -694,7 +_,7 @@
@@ -705,7 +_,7 @@
Entity entity1 = entityhitresult.m_82443_();
Vec3 vec33 = entityhitresult.m_82450_();
double d2 = vec3.m_82557_(vec33);
- if (flag && d2 > 9.0D) {
+ if (false && flag && d2 > 9.0D) { //Forge: Always keep the entity result to allow for extended reach interactions.
this.f_109059_.f_91077_ = BlockHitResult.m_82426_(vec33, Direction.m_122366_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_), new BlockPos(vec33));
this.f_109059_.f_91077_ = BlockHitResult.m_82426_(vec33, Direction.m_122366_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_), BlockPos.m_274446_(vec33));
} else if (d2 < d1 || this.f_109059_.f_91077_ == null) {
this.f_109059_.f_91077_ = entityhitresult;
@@ -748,7 +_,7 @@
@@ -759,7 +_,7 @@
d0 *= Mth.m_14139_(this.f_109059_.f_91066_.m_231925_().m_231551_(), 1.0D, (double)0.85714287F);
}
@@ -60,7 +60,7 @@
}
}
@@ -883,11 +_,11 @@
@@ -894,12 +_,12 @@
Window window = this.f_109059_.m_91268_();
RenderSystem.m_69421_(256, Minecraft.f_91002_);
@@ -68,13 +68,14 @@
+ Matrix4f matrix4f = (new Matrix4f()).setOrtho(0.0F, (float)((double)window.m_85441_() / window.m_85449_()), (float)((double)window.m_85442_() / window.m_85449_()), 0.0F, 1000.0F, net.minecraftforge.client.ForgeHooksClient.getGuiFarPlane());
RenderSystem.m_252934_(matrix4f);
PoseStack posestack = RenderSystem.m_157191_();
posestack.m_85836_();
posestack.m_166856_();
- posestack.m_252880_(0.0F, 0.0F, -2000.0F);
+ posestack.m_85837_(0.0D, 0.0D, 1000F-net.minecraftforge.client.ForgeHooksClient.getGuiFarPlane());
RenderSystem.m_157182_();
Lighting.m_84931_();
PoseStack posestack1 = new PoseStack();
@@ -923,7 +_,7 @@
@@ -935,7 +_,7 @@
}
} else if (this.f_109059_.f_91080_ != null) {
try {
@@ -83,7 +84,7 @@
} catch (Throwable throwable1) {
CrashReport crashreport1 = CrashReport.m_127521_(throwable1, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.m_127514_("Screen render details");
@@ -1068,12 +_,19 @@
@@ -1085,12 +_,19 @@
Matrix4f matrix4f = posestack.m_85850_().m_252922_();
this.m_252879_(matrix4f);
camera.m_90575_(this.f_109059_.f_91073_, (Entity)(this.f_109059_.m_91288_() == null ? this.f_109059_.f_91074_ : this.f_109059_.m_91288_()), !this.f_109059_.f_91066_.m_92176_().m_90612_(), this.f_109059_.f_91066_.m_92176_().m_90613_(), p_109090_);
@@ -5,18 +5,18 @@
@OnlyIn(Dist.CLIENT)
public class ItemBlockRenderTypes {
+ @Deprecated
private static final Map<Block, RenderType> f_109275_ = Util.m_137469_(Maps.newHashMap(), (p_109296_) -> {
private static final Map<Block, RenderType> f_109275_ = Util.m_137469_(Maps.newHashMap(), (p_272331_) -> {
RenderType rendertype = RenderType.m_110503_();
p_109296_.put(Blocks.f_50267_, rendertype);
@@ -298,6 +_,7 @@
p_109296_.put(Blocks.f_50628_, rendertype3);
p_109296_.put(Blocks.f_152498_, rendertype3);
p_272331_.put(Blocks.f_50267_, rendertype);
@@ -307,6 +_,7 @@
p_272331_.put(Blocks.f_50628_, rendertype3);
p_272331_.put(Blocks.f_152498_, rendertype3);
});
+ @Deprecated
private static final Map<Fluid, RenderType> f_109276_ = Util.m_137469_(Maps.newHashMap(), (p_109290_) -> {
RenderType rendertype = RenderType.m_110466_();
p_109290_.put(Fluids.f_76192_, rendertype);
@@ -305,6 +_,8 @@
@@ -314,6 +_,8 @@
});
private static boolean f_109277_;
@@ -25,7 +25,7 @@
public static RenderType m_109282_(BlockState p_109283_) {
Block block = p_109283_.m_60734_();
if (block instanceof LeavesBlock) {
@@ -315,6 +_,8 @@
@@ -324,6 +_,8 @@
}
}
@@ -34,7 +34,7 @@
public static RenderType m_109293_(BlockState p_109294_) {
Block block = p_109294_.m_60734_();
if (block instanceof LeavesBlock) {
@@ -329,6 +_,8 @@
@@ -338,6 +_,8 @@
}
}
@@ -43,7 +43,7 @@
public static RenderType m_109284_(BlockState p_109285_, boolean p_109286_) {
RenderType rendertype = m_109282_(p_109285_);
if (rendertype == RenderType.m_110466_()) {
@@ -342,6 +_,8 @@
@@ -351,6 +_,8 @@
}
}
@@ -52,7 +52,7 @@
public static RenderType m_109279_(ItemStack p_109280_, boolean p_109281_) {
Item item = p_109280_.m_41720_();
if (item instanceof BlockItem) {
@@ -353,8 +_,73 @@
@@ -362,8 +_,73 @@
}
public static RenderType m_109287_(FluidState p_109288_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/ItemInHandRenderer.java
+++ b/net/minecraft/client/renderer/ItemInHandRenderer.java
@@ -286,12 +_,14 @@
@@ -312,12 +_,14 @@
if (iteminhandrenderer$handrenderselection.f_172921_) {
float f4 = interactionhand == InteractionHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - Mth.m_14179_(p_109315_, this.f_109303_, this.f_109302_);
@@ -15,7 +15,7 @@
this.m_109371_(p_109318_, p_109315_, f1, InteractionHand.OFF_HAND, f6, this.f_109301_, f7, p_109316_, p_109317_, p_109319_);
}
@@ -342,7 +_,7 @@
@@ -368,7 +_,7 @@
} else {
this.m_109353_(p_109379_, p_109380_, p_109381_, p_109378_, humanoidarm, p_109376_, p_109377_);
}
@@ -24,15 +24,15 @@
boolean flag1 = CrossbowItem.m_40932_(p_109377_);
boolean flag2 = humanoidarm == HumanoidArm.RIGHT;
int i = flag2 ? 1 : -1;
@@ -384,6 +_,7 @@
this.m_109322_(p_109372_, p_109377_, flag2 ? ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND : ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag2, p_109379_, p_109380_, p_109381_);
@@ -410,6 +_,7 @@
this.m_269530_(p_109372_, p_109377_, flag2 ? ItemDisplayContext.FIRST_PERSON_RIGHT_HAND : ItemDisplayContext.FIRST_PERSON_LEFT_HAND, !flag2, p_109379_, p_109380_, p_109381_);
} else {
boolean flag3 = humanoidarm == HumanoidArm.RIGHT;
+ if (!net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_109377_).applyForgeHandTransform(p_109379_, f_109299_.f_91074_, humanoidarm, p_109377_, p_109373_, p_109378_, p_109376_)) // FORGE: Allow items to define custom arm animation
if (p_109372_.m_6117_() && p_109372_.m_21212_() > 0 && p_109372_.m_7655_() == p_109375_) {
int k = flag3 ? 1 : -1;
switch (p_109377_.m_41780_()) {
@@ -487,8 +_,16 @@
@@ -516,8 +_,16 @@
this.f_109304_ = Mth.m_14036_(this.f_109304_ - 0.4F, 0.0F, 1.0F);
} else {
float f = localplayer.m_36403_(1.0F);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/LevelRenderer.java
+++ b/net/minecraft/client/renderer/LevelRenderer.java
@@ -264,6 +_,8 @@
@@ -265,6 +_,8 @@
}
private void m_109703_(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
@@ -18,7 +18,7 @@
float f = this.f_109461_.f_91073_.m_46722_(1.0F) / (Minecraft.m_91405_() ? 1.0F : 2.0F);
if (!(f <= 0.0F)) {
RandomSource randomsource = RandomSource.m_216335_((long)this.f_109477_ * 312987231L);
@@ -1141,11 +_,13 @@
@@ -1144,11 +_,13 @@
RenderSystem.m_69421_(16640, Minecraft.f_91002_);
float f = p_109605_.m_109152_();
boolean flag2 = this.f_109461_.f_91073_.m_104583_().m_5781_(Mth.m_14107_(d0), Mth.m_14107_(d1)) || this.f_109461_.f_91065_.m_93090_().m_93715_();
@@ -32,7 +32,7 @@
profilerfiller.m_6182_("fog");
FogRenderer.m_234172_(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f, 32.0F), flag2, p_109601_);
profilerfiller.m_6182_("terrain_setup");
@@ -1154,7 +_,9 @@
@@ -1157,7 +_,9 @@
this.m_194370_(p_109604_);
profilerfiller.m_6182_("terrain");
this.m_172993_(RenderType.m_110451_(), p_109600_, d0, d1, d2, p_254120_);
@@ -42,7 +42,7 @@
this.m_172993_(RenderType.m_110463_(), p_109600_, d0, d1, d2, p_254120_);
if (this.f_109465_.m_104583_().m_108885_()) {
Lighting.m_252995_(p_109600_.m_85850_().m_252922_());
@@ -1186,7 +_,7 @@
@@ -1189,7 +_,7 @@
for(Entity entity : this.f_109465_.m_104735_()) {
if (this.f_109463_.m_114397_(entity, frustum, d0, d1, d2) || entity.m_20367_(this.f_109461_.f_91074_)) {
BlockPos blockpos = entity.m_20183_();
@@ -51,9 +51,9 @@
++this.f_109439_;
if (entity.f_19797_ == 0) {
entity.f_19790_ = entity.m_20185_();
@@ -1206,6 +_,9 @@
int i1 = i & 255;
outlinebuffersource.m_109929_(k, l, i1, 255);
@@ -1205,6 +_,9 @@
int i = entity.m_19876_();
outlinebuffersource.m_109929_(FastColor.ARGB32.m_13665_(i), FastColor.ARGB32.m_13667_(i), FastColor.ARGB32.m_13669_(i), 255);
} else {
+ if (this.m_109817_() && entity.hasCustomOutlineRendering(this.f_109461_.f_91074_)) { // FORGE: allow custom outline rendering
+ flag3 = true;
@@ -61,7 +61,14 @@
multibuffersource = multibuffersource$buffersource;
}
@@ -1226,6 +_,7 @@
@@ -1219,12 +_,14 @@
multibuffersource$buffersource.m_109912_(RenderType.m_110452_(TextureAtlas.f_118259_));
multibuffersource$buffersource.m_109912_(RenderType.m_110458_(TextureAtlas.f_118259_));
multibuffersource$buffersource.m_109912_(RenderType.m_110476_(TextureAtlas.f_118259_));
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderStage(net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_ENTITIES, this, p_109600_, p_254120_, this.f_109477_, p_109604_, frustum);
profilerfiller.m_6182_("blockentities");
for(LevelRenderer.RenderChunkInfo levelrenderer$renderchunkinfo : this.f_194297_) {
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
if (!list.isEmpty()) {
for(BlockEntity blockentity1 : list) {
@@ -69,7 +76,7 @@
BlockPos blockpos4 = blockentity1.m_58899_();
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
p_109600_.m_85836_();
@@ -1242,6 +_,9 @@
@@ -1241,6 +_,9 @@
};
}
}
@@ -79,7 +86,7 @@
this.f_172946_.m_112267_(blockentity1, p_109601_, p_109600_, multibuffersource1);
p_109600_.m_85849_();
@@ -1251,9 +_,13 @@
@@ -1250,9 +_,13 @@
synchronized(this.f_109468_) {
for(BlockEntity blockentity : this.f_109468_) {
@@ -93,17 +100,25 @@
this.f_172946_.m_112267_(blockentity, p_109601_, p_109600_, multibuffersource$buffersource);
p_109600_.m_85849_();
}
@@ -1291,7 +_,8 @@
@@ -1275,6 +_,7 @@
this.f_109461_.m_91385_().m_83947_(false);
}
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderStage(net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_BLOCK_ENTITIES, this, p_109600_, p_254120_, this.f_109477_, p_109604_, frustum);
profilerfiller.m_6182_("destroyProgress");
for(Long2ObjectMap.Entry<SortedSet<BlockDestructionProgress>> entry : this.f_109409_.long2ObjectEntrySet()) {
@@ -1290,7 +_,8 @@
p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2);
PoseStack.Pose posestack$pose = p_109600_.m_85850_();
VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.f_109464_.m_110108_().m_6299_(ModelBakery.f_119229_.get(k1)), posestack$pose.m_252922_(), posestack$pose.m_252943_(), 1.0F);
PoseStack.Pose posestack$pose1 = p_109600_.m_85850_();
VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.f_109464_.m_110108_().m_6299_(ModelBakery.f_119229_.get(k)), posestack$pose1.m_252922_(), posestack$pose1.m_252943_(), 1.0F);
- this.f_109461_.m_91289_().m_110918_(this.f_109465_.m_8055_(blockpos2), blockpos2, this.f_109465_, p_109600_, vertexconsumer1);
+ net.minecraftforge.client.model.data.ModelData modelData = f_109465_.getModelDataManager().getAt(blockpos2);
+ this.f_109461_.m_91289_().renderBreakingTexture(this.f_109465_.m_8055_(blockpos2), blockpos2, this.f_109465_, p_109600_, vertexconsumer1, modelData == null ? net.minecraftforge.client.model.data.ModelData.EMPTY : modelData);
p_109600_.m_85849_();
}
}
@@ -1303,10 +_,13 @@
@@ -1302,10 +_,13 @@
profilerfiller.m_6182_("outline");
BlockPos blockpos1 = ((BlockHitResult)hitresult).m_82425_();
BlockState blockstate = this.f_109465_.m_8055_(blockpos1);
@@ -116,8 +131,8 @@
+ net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource);
}
PoseStack posestack = RenderSystem.m_157191_();
@@ -1341,7 +_,8 @@
this.f_109461_.f_91064_.m_113457_(p_109600_, multibuffersource$buffersource, d0, d1, d2);
@@ -1337,7 +_,8 @@
this.f_109415_.m_83945_(this.f_109461_.m_91385_());
RenderStateShard.f_110126_.m_110185_();
profilerfiller.m_6182_("particles");
@@ -127,7 +142,7 @@
RenderStateShard.f_110126_.m_110188_();
} else {
profilerfiller.m_6182_("translucent");
@@ -1355,7 +_,8 @@
@@ -1351,7 +_,8 @@
profilerfiller.m_6182_("string");
this.m_172993_(RenderType.m_110503_(), p_109600_, d0, d1, d2, p_254120_);
profilerfiller.m_6182_("particles");
@@ -137,7 +152,7 @@
}
posestack.m_85836_();
@@ -1379,6 +_,7 @@
@@ -1375,6 +_,7 @@
RenderStateShard.f_110127_.m_110185_();
profilerfiller.m_6182_("weather");
this.m_109703_(p_109606_, p_109601_, d0, d1, d2);
@@ -145,7 +160,7 @@
this.m_173012_(p_109604_);
RenderStateShard.f_110127_.m_110188_();
this.f_109418_.m_110023_(p_109601_);
@@ -1387,6 +_,7 @@
@@ -1383,6 +_,7 @@
RenderSystem.m_69458_(false);
profilerfiller.m_6182_("weather");
this.m_109703_(p_109606_, p_109601_, d0, d1, d2);
@@ -153,7 +168,7 @@
this.m_173012_(p_109604_);
RenderSystem.m_69458_(true);
}
@@ -1521,6 +_,7 @@
@@ -1526,6 +_,7 @@
shaderinstance.m_173362_();
VertexBuffer.m_85931_();
this.f_109461_.m_91307_().m_7238_();
@@ -161,7 +176,7 @@
p_172994_.m_110188_();
}
@@ -1782,6 +_,8 @@
@@ -1740,6 +_,8 @@
}
public void m_202423_(PoseStack p_202424_, Matrix4f p_254034_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) {
@@ -170,7 +185,7 @@
p_202429_.run();
if (!p_202428_) {
FogType fogtype = p_202427_.m_167685_();
@@ -1914,6 +_,8 @@
@@ -1861,6 +_,8 @@
}
public void m_253054_(PoseStack p_254145_, Matrix4f p_254537_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) {
@@ -179,7 +194,7 @@
float f = this.f_109465_.m_104583_().m_108871_();
if (!Float.isNaN(f)) {
RenderSystem.m_69464_();
@@ -2100,7 +_,7 @@
@@ -2047,7 +_,7 @@
boolean flag = false;
if (this.f_109461_.f_91066_.m_232080_().m_231551_() == PrioritizeChunkUpdates.NEARBY) {
BlockPos blockpos1 = chunkrenderdispatcher$renderchunk.m_112839_().m_7918_(8, 8, 8);
@@ -188,7 +203,7 @@
} else if (this.f_109461_.f_91066_.m_232080_().m_231551_() == PrioritizeChunkUpdates.PLAYER_AFFECTED) {
flag = chunkrenderdispatcher$renderchunk.m_112842_();
}
@@ -2400,7 +_,12 @@
@@ -2354,7 +_,12 @@
this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_);
}
@@ -201,7 +216,7 @@
SoundInstance soundinstance = this.f_109410_.get(p_109516_);
if (soundinstance != null) {
this.f_109461_.m_91106_().m_120399_(soundinstance);
@@ -2408,7 +_,7 @@
@@ -2362,7 +_,7 @@
}
if (p_109515_ != null) {
@@ -210,16 +225,7 @@
if (recorditem != null) {
this.f_109461_.f_91065_.m_93055_(recorditem.m_43050_());
}
@@ -2548,7 +_,7 @@
break;
case 1010:
if (Item.m_41445_(p_234307_) instanceof RecordItem) {
- this.m_109514_(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_);
+ this.playStreamingMusic(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_, (RecordItem) Item.m_41445_(p_234307_));
} else {
this.m_109514_((SoundEvent)null, p_234306_);
}
@@ -2700,7 +_,7 @@
@@ -2656,7 +_,7 @@
case 2001:
BlockState blockstate = Block.m_49803_(p_234307_);
if (!blockstate.m_60795_()) {
@@ -228,7 +234,16 @@
this.f_109465_.m_245747_(p_234306_, soundtype.m_56775_(), SoundSource.BLOCKS, (soundtype.m_56773_() + 1.0F) / 2.0F, soundtype.m_56774_() * 0.8F, false);
}
@@ -2915,7 +_,7 @@
@@ -2751,7 +_,7 @@
break;
case 3002:
if (p_234307_ >= 0 && p_234307_ < Direction.Axis.f_122448_.length) {
- ParticleUtils.m_144967_(Direction.Axis.f_122448_[p_234307_], this.f_109465_, p_234306_, 0.125D, ParticleTypes.f_175830_, UniformInt.m_146622_(10, 19));
+ this.playStreamingMusic(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_, (RecordItem) Item.m_41445_(p_234307_));
} else {
ParticleUtils.m_216313_(this.f_109465_, p_234306_, ParticleTypes.f_175830_, UniformInt.m_146622_(3, 5));
}
@@ -2875,7 +_,7 @@
} else {
int i = p_109538_.m_45517_(LightLayer.SKY, p_109540_);
int j = p_109538_.m_45517_(LightLayer.BLOCK, p_109540_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/LightTexture.java
+++ b/net/minecraft/client/renderer/LightTexture.java
@@ -136,6 +_,8 @@
@@ -135,6 +_,8 @@
}
}
@@ -9,7 +9,7 @@
if (f5 > 0.0F) {
float f13 = Math.max(vector3f1.x(), Math.max(vector3f1.y(), vector3f1.z()));
if (f13 < 1.0F) {
@@ -193,7 +_,7 @@
@@ -192,7 +_,7 @@
}
public static int m_109883_(int p_109884_) {
@@ -1,26 +1,21 @@
--- a/net/minecraft/client/renderer/RenderType.java
+++ b/net/minecraft/client/renderer/RenderType.java
@@ -301,27 +_,27 @@
}
public static RenderType m_110497_(ResourceLocation p_110498_) {
- return f_173173_.apply(p_110498_);
+ return net.minecraftforge.client.ForgeRenderTypes.getText(p_110498_);
@@ -316,19 +_,19 @@
}
public static RenderType m_173237_(ResourceLocation p_173238_) {
- return f_173174_.apply(p_173238_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensity(p_173238_);
+ return net.minecraftforge.client.ForgeRenderTypes.getText(p_173238_);
}
public static RenderType m_181444_(ResourceLocation p_181445_) {
- return f_181442_.apply(p_181445_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextPolygonOffset(p_181445_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensity(p_181445_);
}
public static RenderType m_181446_(ResourceLocation p_181447_) {
- return f_181443_.apply(p_181447_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensityPolygonOffset(p_181447_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextPolygonOffset(p_181447_);
}
public static RenderType m_110500_(ResourceLocation p_110501_) {
@@ -28,13 +23,17 @@
+ return net.minecraftforge.client.ForgeRenderTypes.getTextSeeThrough(p_110501_);
}
public static RenderType m_269508_() {
@@ -336,7 +_,7 @@
}
public static RenderType m_173240_(ResourceLocation p_173241_) {
- return f_173176_.apply(p_173241_);
+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensitySeeThrough(p_173241_);
}
public static RenderType m_110502_() {
@@ -608,4 +_,17 @@
@@ -635,4 +_,17 @@
return this.f_110696_;
}
}
@@ -47,7 +47,7 @@
}
}
@@ -90,9 +_,13 @@
@@ -90,8 +_,12 @@
}
private static void m_110725_(Minecraft p_110726_, PoseStack p_110727_) {
@@ -56,9 +56,8 @@
+
+ public static void renderFluid(Minecraft p_110726_, PoseStack p_110727_, ResourceLocation texture) {
RenderSystem.m_157427_(GameRenderer::m_172817_);
RenderSystem.m_69493_();
- RenderSystem.m_157456_(0, f_110714_);
+ RenderSystem.m_157456_(0, texture);
BufferBuilder bufferbuilder = Tesselator.m_85913_().m_85915_();
BlockPos blockpos = new BlockPos(p_110726_.f_91074_.m_20185_(), p_110726_.f_91074_.m_20188_(), p_110726_.f_91074_.m_20189_());
BlockPos blockpos = BlockPos.m_274561_(p_110726_.f_91074_.m_20185_(), p_110726_.f_91074_.m_20188_(), p_110726_.f_91074_.m_20189_());
float f = LightTexture.m_234316_(p_110726_.f_91074_.f_19853_.m_6042_(), p_110726_.f_91074_.f_19853_.m_46803_(blockpos));
Loaded 100 of 501 files, more files were not shown because too many files have changed in this diff. Show more