Compare commits

...
109 Commits
Author SHA1 Message Date
LexManos fe43088c96 Initial 1.16.2 Update 2020-08-13 00:35:08 -07:00
David Quintana a3c4ffd2c1 Fix ModelRegistryEvent firing every time resources reload instead of just once. 2020-08-09 22:04:44 +02:00
David Quintana a8e68328c4 Move ModelRegistryEvent invocation to when the model loading is about to start.
Freeze the ModelLoaderRegistry right after this event happens, just before model loading actually begins.
This means ModelRegistryEvent is now the correct place to register loaders, as it was intended.
This is a slight breaking change, but any mod that used FMLClientSetupEvent before will need to be updated regardless due to the existing race condition.
2020-08-08 03:00:15 +02:00
Take Weiland 8bad5b1f13 Fix wrong BlockState param passed into canSustainPlant from FarmlandBlock (#7212) 2020-08-03 17:19:12 -07:00
sciwhiz12 54b4089afd Add harvest levels for hoes and new 1.16 blocks for pickaxes Fixes #7187 (#7189) 2020-08-03 17:06:36 -07:00
sciwhiz12 493608e1b5 Fix debug world not generating modded blocks (#6926) 2020-08-03 17:00:31 -07:00
ChampionAsh5357 0984777c98 New IForgeBlock#getToolModifiedState hook allow better control over tools interacting with blocks. (#7176) 2020-08-03 16:49:26 -07:00
Xerousso 97a2b9a448 Added new hook to allow Biomes to control their Edge biomes (#7000) 2020-08-03 16:21:13 -07:00
brandon3055 399bc6c9c3 Add support for custom elytra (#7202) 2020-08-03 15:55:10 -07:00
Take Weiland 20702456ac Re-introduce "outdated" notification on Mods button in main menu (#7123) 2020-08-03 15:11:06 -07:00
sciwhiz12 b4a6d186de Fix RenderTickEvent using wrong partial ticks value when game is paused. Fixes #6991 (#7208) 2020-08-03 11:53:21 -07:00
tterrag 8f9e52c260 Implement forge IBakedModel methods in vanilla wrapper models 2020-07-29 23:10:40 -04:00
LexManos e62805f1d7 Fix another case of swallowed errors not shutting down mods. 2020-07-28 16:44:29 -07:00
LexManos 7592bbe87e Shut down all other mod handlers if the loading cycle errors.
This prevents other mods from throwing errors and being blamed for initial cause.
This is a temporary hack until cpw re-writes the mod event dispatcher.
2020-07-28 14:39:53 -07:00
LexManos 30bad1e26d Properly shutdown FMLModContainer's event bus when an error in a lifecycle event is detected. 2020-07-28 12:01:15 -07:00
LexManos 5104824a1b Enable EventBus type check during ForgeDev, and add IModBusEvent marker to ModelRegistryEvent. 2020-07-28 10:24:52 -07:00
LexManos 4ffcdaa6da Make license toml entry optional during 1.16.1
There are to many existing mods to make this required.
Yes, we are technically before a RB and can do breaking changes. However this is too large.
2020-07-28 00:16:18 -07:00
cpw 95d2b6ae89 Missed one event. NewRegistry needs the marker.
Signed-off-by: cpw <[email protected]>
2020-07-27 21:13:53 -04:00
cpw d21c05b9ea Update MDK license to default to All rights reserved, and offer a link to chooseyourlicense.com as a place to research appropriate licenses.
Note: the license field _is_ backwards compatible and will simply be ignored on older forge versions.
Signed-off-by: cpw <[email protected]>
2020-07-27 21:06:48 -04:00
cpw 97dfcbc52b Update coremods and spi, include mandatory license field in metadata. Added at top level of mods.toml file.
Signed-off-by: cpw <[email protected]>
2020-07-27 20:21:39 -04:00
cpw 532d153d33 Update modlauncher, eventbus, accesstransformers and more to use a newer mechanism for generating ASM.
Introduced IModBusEvent as a marker interface for events on the ModBus. Expect exceptions if you use
the modbus for events not listened there.

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

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

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

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

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

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

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

* Split get patch into two lines

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

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

No files matched your search

+4 -1
View File
@@ -27,7 +27,6 @@
/projects/**/run/
/projects/**/*.launch
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
@@ -43,3 +42,7 @@ changelog.txt
gradle.properties
!/mdk/gradle.properties
/projects/forge/rejects/
# Srg2Source causes import bugs on these patches. If you intentionnally change these, remove the ignore.
/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.java.patch
/patches/minecraft/net/minecraft/data/BlockModelDefinition.java.patch
+1 -1
View File
@@ -1,5 +1,5 @@
Minecraft Forge
Copyright (c) 2016-2019.
Copyright (c) 2016-2020.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
+248 -60
View File
@@ -10,7 +10,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.178'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.179'
classpath 'org.ow2.asm:asm:7.2'
classpath 'org.ow2.asm:asm-tree:7.2'
}
@@ -29,6 +29,7 @@ import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream
import java.security.MessageDigest
import java.net.URL
import net.minecraftforge.forge.tasks.*
import net.minecraftforge.gradle.common.task.ArchiveChecksum
import net.minecraftforge.gradle.common.task.DownloadMavenArtifact
import net.minecraftforge.gradle.common.task.ExtractInheritance
@@ -43,6 +44,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import org.objectweb.asm.ClassReader
import org.objectweb.asm.Opcodes
plugins {
id 'net.minecrell.licenser' version '0.4'
@@ -52,7 +54,7 @@ plugins {
}
apply plugin: 'eclipse'
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version'))
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
ext {
JAR_SIGNER = null
@@ -65,8 +67,8 @@ ext {
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20200514-1.16'
MC_VERSION = '1.16.1'
MCP_VERSION = '20200625.134731'
MC_VERSION = '1.16.2'
MCP_VERSION = '20200812.004259'
}
project(':mcp') {
@@ -122,7 +124,7 @@ project(':clean') {
clean_server {
taskName 'clean_server'
main 'net.minecraft.server.MinecraftServer'
main 'net.minecraft.server.Main'
workingDirectory project.file('run')
}
}
@@ -137,7 +139,7 @@ project(':forge') {
apply plugin: 'net.minecraftforge.gradle.patcher'
apply plugin: 'net.minecrell.licenser'
apply plugin: 'de.undercouch.download'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
group = 'net.minecraftforge'
@@ -209,7 +211,7 @@ project(':forge') {
}
ext {
SPEC_VERSION = '31.2' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '33.0' // This is overwritten by git tag, but here so dev time doesnt explode
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
// ForgeMC is a unique identifier for every MC version we have supported.
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
@@ -217,6 +219,7 @@ project(':forge') {
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5'
VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar'
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.11'
}
def getVersion = {
@@ -266,6 +269,7 @@ project(':forge') {
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev"
@@ -300,6 +304,7 @@ project(':forge') {
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev"
@@ -439,12 +444,14 @@ project(':forge') {
installer 'org.ow2.asm:asm:7.2'
installer 'org.ow2.asm:asm-commons:7.2'
installer 'org.ow2.asm:asm-tree:7.2'
installer 'cpw.mods:modlauncher:5.1.+'
installer 'org.ow2.asm:asm-util:7.2'
installer 'org.ow2.asm:asm-analysis:7.2'
installer 'cpw.mods:modlauncher:6.1.+'
installer 'cpw.mods:grossjava9hacks:1.3.+'
installer 'net.minecraftforge:accesstransformers:2.1.+:shadowed'
installer 'net.minecraftforge:eventbus:2.2.+:service'
installer 'net.minecraftforge:forgespi:3.0.+'
installer 'net.minecraftforge:coremods:2.0.+'
installer 'net.minecraftforge:accesstransformers:2.2.+:shadowed'
installer 'net.minecraftforge:eventbus:3.0.+:service'
installer 'net.minecraftforge:forgespi:3.1.+'
installer 'net.minecraftforge:coremods:3.0.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.2'
installer 'com.electronwill.night-config:toml:3.6.2'
@@ -455,12 +462,13 @@ project(':forge') {
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
installer 'net.minecrell:terminalconsoleappender:1.2.+'
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
installer 'org.spongepowered:mixin:0.8'
fmllauncherImplementation 'com.google.guava:guava:21.0'
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
fmllauncherImplementation "org.lwjgl:lwjgl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-glfw:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-opengl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-stb:3.2.2"
fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-glfw:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-opengl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-stb:3.2.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.+'
testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5
@@ -621,6 +629,7 @@ project(':forge') {
}
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
tool = INSTALLER_TOOLS + ':fatjar'
input { genJoinedBinPatches.cleanJar }
doFirst {
def json = new JsonSlurper().parseText(VERSION_JSON.text)
@@ -634,51 +643,220 @@ project(':forge') {
}
}
}
task checkATs(dependsOn: genJoinedBinPatches) {
inputs.file { genJoinedBinPatches.cleanJar }
task checkATs(dependsOn: extractInheritance) {
inputs.file { extractInheritance.output }
inputs.files patcher.accessTransformers
doLast {
def vanilla = [:]
def zip = new java.util.zip.ZipFile(genJoinedBinPatches.cleanJar)
zip.entries().findAll { !it.directory && it.name.endsWith('.class') }.each { entry ->
new ClassReader(zip.getInputStream(entry)).accept(new org.objectweb.asm.ClassVisitor(org.objectweb.asm.Opcodes.ASM7) {
String name
void visit(int version, int access, String name, String sig, String superName, String[] interfaces) {
this.name = name
vanilla[name] = access
}
org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String sig, Object value) {
vanilla[this.name + ' ' + name] = access
return null
}
org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String desc, String sig, String[] excs) {
vanilla[this.name + ' ' + name + desc] = access
return null
}
}, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
def parse = { line ->
def idx = line.indexOf('#')
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
return [modifier, cls, desc, comment, key]
}
def accessLevel = { access ->
if ((access & Opcodes.ACC_PUBLIC) != 0) return 3
if ((access & Opcodes.ACC_PROTECTED) != 0) return 2
if ((access & Opcodes.ACC_PRIVATE) != 0) return 0
return 1
}
def accessStr = { access ->
if (access.endsWith('-f') || access.endsWith('+f'))
return 4
switch (access.toLowerCase()) {
case 'public': return 3
case 'protected': return 2
case 'default': return 1
case 'private': return 0
default: return -1
}
}
def json = new JsonSlurper().parseText(extractInheritance.output.text)
patcher.accessTransformers.each { f ->
TreeMap lines = [:]
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) return
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
def access = vanilla[key.replace('.', '/')]
if (access == null) {
if ((desc.equals('*') || desc.equals('*()')) && vanilla[cls.replace('.', '/')] != null)
println('Warning: ' + line)
else {
println('Invalid: ' + line)
return
def group = null
for (def line : f.readLines()) {
if (line.isEmpty()) continue
if (line.startsWith('#group ')) {
def (modifier, cls, desc, comment, key) = parse.call(line.substring(7))
if (!desc.equals('*') && !desc.equals('*()') && !desc.equals('<init>'))
throw new IllegalStateException('Invalid group: ' + line)
group = [modifier: modifier, cls: cls, desc: desc, comment: comment,
'existing': [] as Set,
'children': [] as TreeSet,
group: true
]
if (lines.containsKey(key))
throw new IllegalStateException('Duplicate group: ' + line)
lines[key] = group
} else if (group != null) {
if (line.startsWith('#endgroup')) {
group = null
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
group['existing'].add(key)
}
} else if (line.startsWith('#endgroup')) {
throw new IllegalStateException('Invalid group ending: ' + line)
} else if (line.startsWith('#')) {
//Nom
} else {
def (modifier, cls, desc, comment, key) = parse.call(line)
if (lines.containsKey(key)) {
println('Duplicate: ' + line)
continue
}
lines[key] = [modifier: modifier, cls: cls, desc: desc, comment: comment, group: false]
}
}
// Process Groups, this will remove any entries outside the group that is covered by the group
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid Group: ' + key)
} else if ('*'.equals(entry['desc'])) {
if (!jcls.containsKey('fields')) {
lines.remove(key)
println('Invalid Group, Class has no fields: ' + key)
} else {
jcls['fields'].each { field, value ->
def fkey = cls + ' ' + field
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(fkey)) {
lines.remove(fkey)
} else if (!entry['existing'].contains(fkey)) {
println('Added: ' + fkey)
}
entry['children'].add(fkey)
} else if (lines.containsKey(fkey)) {
lines.remove(fkey)
println('Removed: ' + fkey)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('*()'.equals(entry['desc'])) {
if (!jcls.containsKey('methods')) {
lines.remove(key)
println('Invalid Group, Class has no methods: ' + key)
} else {
jcls['methods'].each{ mtd, value ->
if (mtd.startsWith('<clinit>'))
return
key = cls + ' ' + mtd.replace(' ', '')
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
if (lines.containsKey(key)) {
lines.remove(key)
} else if (!entry['existing'].contains(key)) {
println('Added: ' + key)
}
entry['children'].add(key)
} else if (lines.containsKey(key)) {
lines.remove(key)
println('Removed: ' + key)
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
} else if ('<init>'.equals(entry['desc'])) { //Make all public non-abstract subclasses
json.each{ tcls,value ->
if (!value.containsKey('methods') || ((value['access'] & Opcodes.ACC_ABSTRACT) != 0))
return
def parents = [] as Set
def parent = tcls
while (parent != null && json.containsKey(parent)) {
parents.add(parent)
def p = json[parent]
parent = p == null ? null : p['superName']
}
if (parents.contains(cls.replaceAll('\\.', '/'))) {
value['methods'].each{ mtd, v ->
if (mtd.startsWith('<init>')) {
def child = tcls.replaceAll('/', '\\.') + ' ' + mtd.replace(' ', '')
if (accessLevel.call(v['access']) < 3) {
if (lines.containsKey(child)) {
lines.remove(child)
} else if (!entry['existing'].contains(child)) {
println('Added: ' + child)
}
entry['children'].add(child)
} else if (lines.containsKey(child)) {
lines.remove(child)
println('Removed: ' + child)
}
}
}
}
}
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
}
}
//TODO: Check access actually changes, and expand inheretence?
lines[key] = [modifier: modifier, comment: comment]
}
f.text = lines.collect{ it.value.modifier + ' ' + it.key + (it.value.comment == null ? '' : ' ' + it.value.comment) }.join('\n')
// Process normal lines, remove invalid and remove narrowing
for (def key : new ArrayList<>(lines.keySet())) {
def entry = lines.get(key)
if (entry != null && !entry['group']) {
def cls = entry['cls']
def jcls = json.get(cls.replaceAll('\\.', '/'))
if (jcls == null) {
lines.remove(key)
println('Invalid: ' + key)
} else if (entry['desc'] == '') {
if (accessLevel.call(jcls['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
} else if (!entry['desc'].contains('(')) {
if (!jcls.containsKey('fields') || !jcls['fields'].containsKey(entry['desc'])) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['fields'][entry['desc']]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
println(entry.comment)
}
}
} else {
def jdesc = entry['desc'].replace('(', ' (')
if (!jcls.containsKey('methods') || !jcls['methods'].containsKey(jdesc)) {
lines.remove(key)
println('Invalid: ' + key)
} else {
def value = jcls['methods'][jdesc]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key)
println('Invalid Narrowing: ' + key)
}
}
}
}
}
def data = []
lines.each { key,value ->
if (!value.group) {
data.add(value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
} else {
data.add('#group ' + value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
value.children.each{ data.add(value.modifier + ' ' + it) }
data.add('#endgroup')
}
}
f.text = data.join('\n')
}
}
}
@@ -720,6 +898,17 @@ project(':forge') {
}
}
task checkPatchesAndFix(type: CheckPatches) {
patchDir = file("$rootDir/patches")
autoFix = true
}
task checkPatches(type: CheckPatches) {
patchDir = file("$rootDir/patches")
autoFix = false
}
project(':forge').getTasks().getByName('genPatches').finalizedBy(checkPatches)
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
inputs.file universalJar.archivePath
inputs.file { launcherJar.archivePath }
@@ -779,7 +968,6 @@ project(':forge') {
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches/*, createClientSRG, createServerSRG*/]) {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.2'
}
doFirst {
@@ -829,16 +1017,16 @@ project(':forge') {
server: '/data/server.lzma'
],
MC_SLIM: [
client: "[net.minecraft:client:${MC_VERSION}:slim]",
server: "[net.minecraft:server:${MC_VERSION}:slim]"
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:slim]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:slim]"
],
MC_SLIM_SHA: [
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
],
MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}:extra]"
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:extra]"
],
MC_EXTRA_SHA: [
client: "'${sha1(tasks.getByName('downloadClientExtra').output)}'",
@@ -926,7 +1114,7 @@ project(':forge') {
['slim', 'extra'].each { type ->
def name = "download${side.capitalize()}${type.capitalize()}"
task "${name}"(type: DownloadMavenArtifact) {
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
artifact = "net.minecraft:${side}:${MC_VERSION}-${MCP_VERSION}:${type}"
}
installerJson.dependsOn(name)
installerJson.inputs.file(tasks.getByName(name).output)
@@ -979,7 +1167,7 @@ project(':forge') {
artifacts.each { key, lib ->
classpath += "libraries/${lib.downloads.artifact.path} "
}
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
classpath += "libraries/net/minecraft/server/${MC_VERSION}-${MCP_VERSION}/server-${MC_VERSION}-${MCP_VERSION}-extra.jar"
MANIFESTS.each{ pkg, values ->
if (pkg == '/') {
+2
View File
@@ -0,0 +1,2 @@
/.gradle/
/build/
@@ -0,0 +1,218 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.TaskAction
import java.nio.file.Files
import java.nio.file.Paths
import java.util.regex.Pattern
public class CheckPatches extends DefaultTask {
@InputDirectory File patchDir
@Input boolean autoFix = false
@TaskAction
protected void exec() {
def hasS2SArtifact = [
Paths.get("patches/minecraft/net/minecraft/client/renderer/ViewFrustum.java.patch"),
Paths.get("patches/minecraft/net/minecraft/data/BlockModelDefinition.java.patch")
]
def verified = true;
project.fileTree(patchDir).each { patch ->
def patchPath = project.rootDir.toPath().relativize(patch.toPath())
verified &= verifyPatch(patch, autoFix, patchPath.toString(), hasS2SArtifact.contains(patchPath))
}
if (!verified)
throw new RuntimeException('One or more patches failed verification. Check the log for errors.')
}
def verifyPatch(patch, fix, patchPath, hasS2SArtifact) {
def hunk_start_pattern = Pattern.compile('^@@ -[0-9,]* \\+[0-9,]* @@$')
def white_space_pattern = Pattern.compile('^[+\\-]\\s*$')
def import_pattern = Pattern.compile('^[+\\-]\\s*import.*')
def field_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$')
def method_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^(]*)[(]([^)]*)?[)]\\s*[{]\\s*$')
def class_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final[\\s]*)?(class|interface)([^{]*)[{]\\s*$')
def accessMap = [("private"):0, (null):1, ("protected"):2, ("public"):3]
def hasProblem = false;
def lines = patch.readLines()
def hunksStart = 0
def onlyWhiteSpace = false
def didFix = false
def newLines = []
def whiteSpaceErrors = []
// First two lines are file name ++/-- and we do not care
newLines.add(lines[0] + '\n')
newLines.add(lines[1] + '\n')
int i = 2
for (; i < lines.size(); ++i) {
def line = lines[i]
newLines.add(line + '\n')
if (hunk_start_pattern.matcher(line).find()) {
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
whiteSpaceErrors.clear()
}
hunksStart = i
onlyWhiteSpace = true
continue
}
if (line.startsWithAny('+','-')) {
def prefixChange = false
def prevLine = lines[i - 1]
if (line.charAt(0) == (char)'+' && prevLine.charAt(0) == (char)'-') {
def prevTrim = prevLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (prevTrim.equals(currTrim)) {
prefixChange = true
}
def pMatcher = field_pattern.matcher(prevLine)
def cMatcher = field_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // = ...
pMatcher.group(5) == cMatcher.group(5) && // field name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = method_pattern.matcher(prevLine)
cMatcher = method_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // params
pMatcher.group(5) == cMatcher.group(5) && // <T> void name
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
pMatcher = class_pattern.matcher(prevLine)
cMatcher = class_pattern.matcher(line)
if (pMatcher.find() && cMatcher.find() &&
pMatcher.group(6) == cMatcher.group(6) && // ClassName<> extends ...
pMatcher.group(5) == cMatcher.group(5) && // class | interface
pMatcher.group(3) == cMatcher.group(3) && // static
(accessMap[pMatcher.group(2)] < accessMap[cMatcher.group(2)] || pMatcher.group(4) != cMatcher.group(4))) {
logger.lifecycle("Patch contains access changes or final removal at line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
if (line.charAt(0) == (char)'-' && i + 1 < lines.size()) {
def nextLine = lines[i + 1]
if (nextLine.charAt(0) == (char)'+') {
def nextTrim = nextLine.substring(1).replaceAll("\\s", "")
def currTrim = line.substring(1).replaceAll("\\s", "")
if (nextTrim.equals(currTrim)) {
prefixChange = true
}
}
}
def isWhiteSpaceChange = white_space_pattern.matcher(line).find()
if (!prefixChange && !isWhiteSpaceChange) {
onlyWhiteSpace = hasS2SArtifact && import_pattern.matcher(line).find()
}
else if (isWhiteSpaceChange) {
def prevLineChange = prevLine.startsWithAny('+','-')
def nextLineChange = i + 1 < lines.size() && lines[i + 1].startsWithAny('+','-')
if (!prevLineChange && !nextLineChange) {
whiteSpaceErrors.add(String.format("Patch contains white space change in valid hunk at line %d (cannot auto fix), file: %s", i + 1, patchPath))
}
}
if (line.contains("\t")) {
if (!fix) {
logger.lifecycle("Patch contains tabs on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
else {
logger.lifecycle("Fixing tabs on line {}, file: {}", i + 1, patchPath)
line = line.replaceAll('\t', ' ')
newLines.remove(newLines.size() - 1)
newLines.add(line + '\n')
didFix = true
}
}
if (import_pattern.matcher(line).find() && !hasS2SArtifact) {
logger.lifecycle("Patch contains import change on line {}, file: {}", i + 1, patchPath)
hasProblem = true
}
}
}
if (onlyWhiteSpace) {
if (fix || hasS2SArtifact) {
logger.lifecycle("Removing white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
def toRemove = i - hunksStart;
while (toRemove-- > 0)
newLines.remove(newLines.size() - 1)
didFix = true
}
else {
logger.lifecycle("Patch contains only white space hunk starting at line {}, file: {}", hunksStart + 1, patchPath)
hasProblem = true
}
}
else {
if (!whiteSpaceErrors.empty)
hasProblem = true
whiteSpaceErrors.each { error -> logger.lifecycle(error) }
}
if (didFix) {
if (newLines.size() <= 2) {
logger.lifecycle("Patch is now empty removing, file: {}", patchPath)
Files.delete(patch.toPath())
}
else {
if (!hasS2SArtifact)
logger.lifecycle("*** Updating patch file. Please run setup then genPatches again. ***")
patch.withWriter('UTF-8') { writer ->
newLines.each { l -> writer.write(l) }
}
}
}
return !hasProblem
}
}
+6 -6
View File
@@ -2,16 +2,16 @@
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.15.2-&query=$.promos["1.15.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.15.2-&query=$.promos["1.15.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/Flocker-Merch-blueviolet.svg)](https://forgedev.flocker.tv/)
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.16.1-&query=$.promos["1.16.1-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.16.1-&query=$.promos["1.16.1-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.15.x | Active |
| 1.14.x | LTS |
| 1.16.x | Active |
| 1.15.x | LTS |
* [Download]
* [Forum]
@@ -60,7 +60,7 @@ We require all contributors to acknowledge the [Forge Contributor
signed it, you should be OK.
#### Donate
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos) or buying some [cool merch](https://forgedev.flocker.tv/).*
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos).*
[Download]: https://files.minecraftforge.net/
[Forum]: https://www.minecraftforge.net/forum/
+1
View File
@@ -19,6 +19,7 @@ archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
+6 -3
View File
@@ -6,7 +6,10 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[32,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="All rights reserved"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
@@ -42,7 +45,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[31,)" #mandatory
versionRange="[32,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
@@ -51,6 +54,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.15.2]"
versionRange="[1.16.1]"
ordering="NONE"
side="BOTH"
@@ -15,4 +15,4 @@
+
public void func_230430_a_(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) {
this.func_230446_a_(p_230430_1_);
this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215);
func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215);
@@ -4,8 +4,8 @@
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
p_192113_1_.func_195068_e(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
boolean flag = false;
for(ResourceLocation resourcelocation : this.field_192116_c) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractBlock.java
+++ b/net/minecraft/block/AbstractBlock.java
@@ -59,7 +59,8 @@
@@ -60,7 +60,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -10,15 +10,7 @@
protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
protected final Material field_149764_J;
protected final boolean field_235688_at_;
@@ -71,6 +72,7 @@
protected final float field_226887_g_;
protected final boolean field_208621_p;
protected final AbstractBlock.Properties field_235684_aB_;
+
@Nullable
protected ResourceLocation field_220085_g;
@@ -86,6 +88,8 @@
@@ -87,6 +88,8 @@
this.field_226887_g_ = p_i241196_1_.field_226894_k_;
this.field_208621_p = p_i241196_1_.field_208772_j;
this.field_235684_aB_ = p_i241196_1_;
@@ -27,7 +19,7 @@
}
@Deprecated
@@ -128,7 +132,7 @@
@@ -129,7 +132,7 @@
@Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
@@ -36,7 +28,7 @@
p_196243_2_.func_175713_t(p_196243_3_);
}
@@ -190,7 +194,7 @@
@@ -191,7 +194,7 @@
@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
@@ -45,16 +37,18 @@
}
@Deprecated
@@ -293,7 +297,7 @@
@@ -294,8 +297,8 @@
if (f == -1.0F) {
return 0.0F;
} else {
- int i = p_180647_2_.func_234569_d_(p_180647_1_) ? 30 : 100;
- return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
+ int i = net.minecraftforge.common.ForgeHooks.canHarvestBlock(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_) ? 30 : 100;
return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
+ return p_180647_2_.getDigSpeed(p_180647_1_, p_180647_4_) / f / (float)i;
}
}
@@ -320,14 +324,14 @@
@@ -321,14 +324,14 @@
return 0;
}
@@ -71,7 +65,7 @@
}
return this.field_220085_g;
@@ -345,6 +349,10 @@
@@ -346,6 +349,10 @@
return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P());
}
@@ -82,7 +76,7 @@
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
private final int field_215708_d;
private final boolean field_215709_e;
@@ -427,6 +435,8 @@
@@ -428,6 +435,8 @@
return this.field_215708_d;
}
@@ -91,7 +85,7 @@
public boolean func_196958_f() {
return this.field_235702_f_;
}
@@ -435,6 +445,8 @@
@@ -436,6 +445,8 @@
return this.field_235704_h_;
}
@@ -100,11 +94,56 @@
public BlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
}
@@ -786,6 +798,7 @@
@@ -802,6 +813,9 @@
private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true;
private boolean field_235813_o_;
+ private int harvestLevel = -1;
+ private net.minecraftforge.common.ToolType harvestTool;
+ private java.util.function.Supplier<ResourceLocation> lootTableSupplier;
private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> {
return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14;
};
@@ -863,6 +877,8 @@
abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_;
abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_;
abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_;
+ abstractblock$properties.harvestLevel = p_200950_0_.field_235684_aB_.harvestLevel;
+ abstractblock$properties.harvestTool = p_200950_0_.field_235684_aB_.harvestTool;
return abstractblock$properties;
}
@@ -877,6 +893,24 @@
return this;
}
+ public AbstractBlock.Properties harvestLevel(int harvestLevel) {
+ this.harvestLevel = harvestLevel;
+ return this;
+ }
+
+ public AbstractBlock.Properties harvestTool(net.minecraftforge.common.ToolType harvestTool) {
+ this.harvestTool = harvestTool;
+ return this;
+ }
+
+ public int getHarvestLevel() {
+ return this.harvestLevel;
+ }
+
+ public net.minecraftforge.common.ToolType getHarvestTool() {
+ return this.harvestTool;
+ }
+
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -933,7 +967,7 @@
}
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
- this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this;
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/block/AbstractFireBlock.java
+++ b/net/minecraft/block/AbstractFireBlock.java
@@ -124,6 +124,7 @@
if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) {
if (func_242649_a(p_220082_2_)) {
Optional<PortalSize> optional = PortalSize.func_242964_a(p_220082_2_, p_220082_3_, Direction.Axis.X);
+ optional = net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_220082_2_, p_220082_3_, optional);
if (optional.isPresent()) {
optional.get().func_150859_c();
return;
@@ -20,13 +20,13 @@
@@ -61,7 +62,7 @@
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (!p_220069_2_.field_72995_K) {
if (!p_220069_2_.field_72995_K && p_220069_2_.func_180495_p(p_220069_3_).func_203425_a(this)) {
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
if (func_235328_a_(p_220069_3_, p_220069_2_, railshape) && !p_220069_2_.func_175623_d(p_220069_3_)) {
if (!p_220069_6_) {
func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_);
@@ -113,7 +114,7 @@
if (func_235328_a_(p_220069_3_, p_220069_2_, railshape)) {
func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_);
p_220069_2_.func_217377_a(p_220069_3_, p_220069_6_);
@@ -110,7 +111,7 @@
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
@@ -35,7 +35,7 @@
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
}
@@ -132,5 +133,20 @@
@@ -129,5 +130,20 @@
return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractTopPlantBlock.java
+++ b/net/minecraft/block/AbstractTopPlantBlock.java
@@ -39,10 +39,11 @@
@@ -32,10 +32,11 @@
}
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java
@@ -101,8 +101,9 @@
@@ -102,8 +102,9 @@
if (p_225542_1_.func_177229_b(field_220266_f) == 0) {
if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
int i = this.func_220260_b(p_225542_2_, p_225542_3_) + 1;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Block.java
+++ b/net/minecraft/block/Block.java
@@ -52,9 +52,10 @@
@@ -54,9 +54,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -13,25 +13,34 @@
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
public Boolean load(VoxelShape p_load_1_) {
return !VoxelShapes.func_197879_c(VoxelShapes.func_197868_b(), p_load_1_, IBooleanFunction.field_223236_g_);
@@ -270,7 +271,7 @@
@@ -151,6 +152,8 @@
super(p_i48440_1_);
StateContainer.Builder<Block, BlockState> builder = new StateContainer.Builder<>(this);
this.func_206840_a(builder);
+ this.harvestLevel = p_i48440_1_.getHarvestLevel();
+ this.harvestTool = p_i48440_1_.getHarvestTool();
this.field_176227_L = builder.func_235882_a_(Block::func_176223_P, BlockState::new);
this.func_180632_j(this.field_176227_L.func_177621_b());
}
@@ -261,7 +264,7 @@
}
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && p_180635_0_.restoringBlockSnapshots) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180635_0_.restoringBlockSnapshots) {
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -282,7 +283,7 @@
@@ -273,7 +276,7 @@
}
public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && p_180637_1_.restoringBlockSnapshots) {
public void func_180637_b(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
- if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) {
while(p_180637_3_ > 0) {
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
p_180637_3_ -= i;
@@ -292,6 +293,7 @@
@@ -283,6 +286,7 @@
}
@@ -39,7 +48,7 @@
public float func_149638_a() {
return this.field_235689_au_;
}
@@ -341,6 +343,7 @@
@@ -332,6 +336,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
}
@@ -47,7 +56,7 @@
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
return new ItemStack(this);
}
@@ -372,6 +375,7 @@
@@ -363,6 +368,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
}
@@ -55,7 +64,7 @@
public boolean func_149659_a(Explosion p_149659_1_) {
return true;
}
@@ -391,6 +395,7 @@
@@ -382,6 +388,7 @@
return this.field_196275_y;
}
@@ -63,7 +72,7 @@
public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H;
}
@@ -400,7 +405,7 @@
@@ -391,7 +398,7 @@
this.field_220086_i = Item.func_150898_a(this);
}
@@ -72,7 +81,7 @@
}
public boolean func_208619_r() {
@@ -408,7 +413,7 @@
@@ -399,7 +406,7 @@
}
public String toString() {
@@ -81,7 +90,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -419,6 +424,83 @@
@@ -410,6 +417,83 @@
return this;
}
@@ -128,7 +137,7 @@
+ } else if (net.minecraftforge.common.PlantType.CROP.equals(type)) {
+ return state.func_203425_a(Blocks.field_150458_ak);
+ } else if (net.minecraftforge.common.PlantType.CAVE.equals(type)) {
+ return Block.func_220056_d(state, world, pos, Direction.UP);
+ return state.func_224755_d(world, pos, Direction.UP);
+ } else if (net.minecraftforge.common.PlantType.PLAINS.equals(type)) {
+ return this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || this.getBlock() == Blocks.field_150458_ak;
+ } else if (net.minecraftforge.common.PlantType.WATER.equals(type)) {
@@ -1,14 +1,14 @@
--- a/net/minecraft/block/Blocks.java
+++ b/net/minecraft/block/Blocks.java
@@ -26,6 +26,7 @@
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.HugeFungusConfig;
@@ -25,6 +25,7 @@
import net.minecraft.world.IBlockReader;
import net.minecraft.world.gen.feature.Features;
[email protected]("minecraft")
public class Blocks {
public static final Block field_150350_a = func_222382_a("air", new AirBlock(AbstractBlock.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e().func_235859_g_()));
public static final Block field_150348_b = func_222382_a("stone", new Block(AbstractBlock.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_235861_h_().func_200948_a(1.5F, 6.0F)));
@@ -120,7 +121,7 @@
@@ -119,7 +120,7 @@
public static final Block field_196601_az = func_222382_a("green_bed", func_235422_a_(DyeColor.GREEN));
public static final Block field_196550_aA = func_222382_a("red_bed", func_235422_a_(DyeColor.RED));
public static final Block field_196551_aB = func_222382_a("black_bed", func_235422_a_(DyeColor.BLACK));
@@ -17,7 +17,7 @@
public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
public static final Block field_150320_F = func_222382_a("sticky_piston", func_235432_a_(true));
public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(AbstractBlock.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_235861_h_().func_200943_b(4.0F)));
@@ -938,15 +939,4 @@
@@ -937,15 +938,4 @@
public static void func_235419_a_() {
Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c);
}
@@ -6,7 +6,7 @@
-public class BushBlock extends Block {
+public class BushBlock extends Block implements net.minecraftforge.common.IPlantable {
protected BushBlock(AbstractBlock.Properties p_i48437_1_) {
public BushBlock(AbstractBlock.Properties p_i48437_1_) {
super(p_i48437_1_);
}
@@ -22,6 +22,8 @@
@@ -8,4 +8,4 @@
+public class DeadBushBlock extends BushBlock implements net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected DeadBushBlock(AbstractBlock.Properties p_i48418_1_) {
public DeadBushBlock(AbstractBlock.Properties p_i48418_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DetectorRailBlock.java
+++ b/net/minecraft/block/DetectorRailBlock.java
@@ -129,6 +129,8 @@
@@ -131,6 +131,8 @@
}
List<AbstractMinecartEntity> list1 = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, EntityPredicates.field_96566_b);
@@ -9,7 +9,7 @@
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -88,9 +88,9 @@
@@ -88,9 +88,10 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
}
@@ -17,12 +17,13 @@
- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c();
- return block instanceof CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock;
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
+ BlockState plant = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_);
+ return plant.func_177230_c() instanceof net.minecraftforge.common.IPlantable && state.canSustainPlant(p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)plant.func_177230_c());
}
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -100,7 +100,7 @@
@@ -100,7 +101,7 @@
}
}
@@ -1,11 +1,11 @@
--- a/net/minecraft/block/FireBlock.java
+++ b/net/minecraft/block/FireBlock.java
@@ -76,13 +76,13 @@
@@ -92,13 +92,13 @@
protected BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
BlockPos blockpos = p_196448_2_.func_177977_b();
BlockState blockstate = p_196448_1_.func_180495_p(blockpos);
- if (!this.func_196446_i(blockstate) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) {
+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) {
+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) {
BlockState blockstate1 = this.func_176223_P();
for(Direction direction : Direction.values()) {
@@ -16,7 +16,7 @@
}
}
@@ -105,7 +105,7 @@
@@ -121,7 +121,7 @@
}
BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b());
@@ -25,7 +25,7 @@
int i = p_225534_1_.func_177229_b(field_176543_a);
if (!flag && p_225534_2_.func_72896_J() && this.func_176537_d(p_225534_2_, p_225534_3_) && p_225534_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_225534_2_.func_217377_a(p_225534_3_, false);
@@ -126,7 +126,7 @@
@@ -142,7 +142,7 @@
return;
}
@@ -34,7 +34,7 @@
p_225534_2_.func_217377_a(p_225534_3_, false);
return;
}
@@ -134,12 +134,12 @@
@@ -150,12 +150,12 @@
boolean flag1 = p_225534_2_.func_180502_D(p_225534_3_);
int k = flag1 ? -50 : 0;
@@ -53,7 +53,7 @@
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
for(int l = -1; l <= 1; ++l) {
@@ -177,15 +177,17 @@
@@ -193,16 +193,18 @@
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
}
@@ -68,14 +68,17 @@
}
- private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_) {
- int i = this.func_220274_q(p_176536_1_.func_180495_p(p_176536_2_));
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, Direction face) {
int i = this.func_220274_q(p_176536_1_.func_180495_p(p_176536_2_));
+ int i = p_176536_1_.func_180495_p(p_176536_2_).getFlammability(p_176536_1_, p_176536_2_, face);
if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -197,10 +199,7 @@
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -212,11 +214,7 @@
p_176536_1_.func_217377_a(p_176536_2_, false);
}
Block block = blockstate.func_177230_c();
- Block block = blockstate.func_177230_c();
- if (block instanceof TNTBlock) {
- TNTBlock tntblock = (TNTBlock)block;
- TNTBlock.func_196534_a(p_176536_1_, p_176536_2_);
@@ -84,7 +87,7 @@
}
}
@@ -212,7 +211,7 @@
@@ -228,7 +226,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) {
@@ -93,7 +96,7 @@
return true;
}
}
@@ -228,13 +227,14 @@
@@ -244,13 +242,14 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -109,7 +112,7 @@
protected boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0;
}
@@ -253,10 +253,23 @@
@@ -269,10 +268,23 @@
}
private void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FlowingFluidBlock.java
+++ b/net/minecraft/block/FlowingFluidBlock.java
@@ -31,10 +31,11 @@
@@ -29,10 +29,11 @@
public class FlowingFluidBlock extends Block implements IBucketPickupHandler {
public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag;
@@ -10,10 +10,10 @@
public static final VoxelShape field_235510_c_ = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
+ @Deprecated // Forge: Use the constructor that takes a supplier
protected FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) {
public FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) {
super(p_i49014_2_);
this.field_204517_c = p_i49014_1_;
@@ -47,8 +48,21 @@
@@ -45,8 +46,21 @@
this.field_212565_c.add(p_i49014_1_.func_207207_a(8, true));
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0)));
@@ -35,7 +35,7 @@
public VoxelShape func_220071_b(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, ISelectionContext p_220071_4_) {
return p_220071_4_.func_216378_a(field_235510_c_, p_220071_3_, true) && p_220071_1_.func_177229_b(field_176367_b) == 0 && p_220071_4_.func_230426_a_(p_220071_2_.func_204610_c(p_220071_3_.func_177984_a()), this.field_204517_c) ? field_235510_c_ : VoxelShapes.func_197880_a();
}
@@ -71,6 +85,7 @@
@@ -69,6 +83,7 @@
public FluidState func_204507_t(BlockState p_204507_1_) {
int i = p_204507_1_.func_177229_b(field_176367_b);
@@ -43,7 +43,7 @@
return this.field_212565_c.get(Math.min(i, 8));
}
@@ -122,13 +137,13 @@
@@ -120,13 +135,13 @@
BlockPos blockpos = p_204515_2_.func_177972_a(direction);
if (p_204515_1_.func_204610_c(blockpos).func_206884_a(FluidTags.field_206959_a)) {
Block block = p_204515_1_.func_204610_c(p_204515_2_).func_206889_d() ? Blocks.field_150343_Z : Blocks.field_150347_e;
@@ -59,9 +59,9 @@
this.func_180688_d(p_204515_1_, p_204515_2_);
return false;
}
@@ -166,4 +181,23 @@
@@ -153,4 +168,23 @@
return Fluids.field_204541_a;
}
}
+
+ // Forge start
@@ -1,11 +1,11 @@
--- a/net/minecraft/block/MushroomBlock.java
+++ b/net/minecraft/block/MushroomBlock.java
@@ -63,7 +63,7 @@
BlockPos blockpos = p_196260_3_.func_177977_b();
BlockState blockstate = p_196260_2_.func_180495_p(blockpos);
if (!blockstate.func_203425_a(Blocks.field_150391_bh) && !blockstate.func_203425_a(Blocks.field_196661_l)) {
@@ -64,7 +64,7 @@
if (blockstate.func_235714_a_(BlockTags.field_242171_aD)) {
return true;
} else {
- return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && this.func_200014_a_(blockstate, p_196260_2_, blockpos);
+ return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && blockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.Direction.UP, this);
} else {
return true;
}
}
@@ -1,47 +0,0 @@
--- a/net/minecraft/block/NetherPortalBlock.java
+++ b/net/minecraft/block/NetherPortalBlock.java
@@ -70,7 +70,7 @@
public static boolean func_176548_d(IWorld p_176548_0_, BlockPos p_176548_1_) {
NetherPortalBlock.Size netherportalblock$size = func_201816_b(p_176548_0_, p_176548_1_);
- if (netherportalblock$size != null) {
+ if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_0_, p_176548_1_, netherportalblock$size)) {
netherportalblock$size.func_150859_c();
return true;
} else {
@@ -241,12 +241,12 @@
int i;
for(i = 0; i < 22; ++i) {
BlockPos blockpos = p_180120_1_.func_177967_a(p_180120_2_, i);
- if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).isPortalFrame(field_150867_a, blockpos.func_177977_b())) {
break;
}
}
- return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_203425_a(Blocks.field_150343_Z) ? i : 0;
+ return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).isPortalFrame(field_150867_a, p_180120_1_.func_177967_a(p_180120_2_, i)) ? i : 0;
}
public int func_181100_a() {
@@ -272,17 +272,17 @@
}
if (i == 0) {
- if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150863_d))) {
break label56;
}
- } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_203425_a(Blocks.field_150343_Z)) {
+ } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150866_c))) {
break label56;
}
}
}
for(int j = 0; j < this.field_150868_h; ++j) {
- if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).func_203425_a(Blocks.field_150343_Z)) {
+ if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).isPortalFrame(field_150867_a, this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g))) {
this.field_150862_g = 0;
break;
}
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/OreBlock.java
@@ -31,12 +31,10 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) {
- int i = this.func_220281_a(p_220062_2_.field_73012_v);
@@ -24,16 +24,16 @@
return true;
}
@@ -230,7 +233,7 @@
@@ -234,7 +237,7 @@
return false;
}
- return !p_185646_0_.func_177230_c().func_235695_q_();
+ return !p_185646_0_.hasTileEntity();
} else {
return false;
}
@@ -271,7 +274,7 @@
} else {
return false;
@@ -273,7 +276,7 @@
for(int k = list2.size() - 1; k >= 0; --k) {
BlockPos blockpos2 = list2.get(k);
BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2);
@@ -42,7 +42,7 @@
func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity);
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
ablockstate[j++] = blockstate1;
@@ -335,6 +338,10 @@
@@ -337,6 +340,10 @@
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/PortalSize.java
+++ b/net/minecraft/block/PortalSize.java
@@ -16,7 +16,7 @@
public class PortalSize {
private static final AbstractBlock.IPositionPredicate field_242962_a = (p_242966_0_, p_242966_1_, p_242966_2_) -> {
- return p_242966_0_.func_203425_a(Blocks.field_150343_Z);
+ return p_242966_0_.isPortalFrame(p_242966_1_, p_242966_2_);
};
private final IWorld field_150867_a;
private final Direction.Axis field_150865_b;
@@ -6,7 +6,7 @@
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
+ private final boolean isActivator; // TRUE for an Activator Rail, FALSE for Powered Rail
protected PoweredRailBlock(AbstractBlock.Properties p_i48349_1_) {
public PoweredRailBlock(AbstractBlock.Properties p_i48349_1_) {
- super(true, p_i48349_1_);
+ this(p_i48349_1_, false);
+ }
@@ -35,7 +35,17 @@
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else {
return false;
@@ -255,4 +261,8 @@
@@ -156,6 +162,9 @@
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST);
+ case NORTH_SOUTH: //Forge fix: MC-196102
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) {
@@ -255,4 +264,8 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176568_b, field_176569_M);
}
@@ -0,0 +1,12 @@
--- a/net/minecraft/block/RailBlock.java
+++ b/net/minecraft/block/RailBlock.java
@@ -49,6 +49,9 @@
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST);
+ case NORTH_SOUTH: //Forge fix: MC-196102
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176565_b)) {
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/RedstoneOreBlock.java
@@ -71,11 +71,11 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) {
- int i = 1 + p_220062_2_.field_73012_v.nextInt(5);
@@ -8,4 +8,4 @@
+public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer, net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_207798_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
protected SeaGrassBlock(AbstractBlock.Properties p_i48780_1_) {
public SeaGrassBlock(AbstractBlock.Properties p_i48780_1_) {
@@ -2,7 +2,7 @@
+++ b/net/minecraft/block/SpawnerBlock.java
@@ -18,10 +18,13 @@
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15);
- this.func_180637_b(p_220062_2_, p_220062_3_, i);
@@ -5,7 +5,7 @@
}
+ @Deprecated // Forge: Use the other constructor that takes a Supplier
protected StairsBlock(BlockState p_i48321_1_, AbstractBlock.Properties p_i48321_2_) {
public StairsBlock(BlockState p_i48321_1_, AbstractBlock.Properties p_i48321_2_) {
super(p_i48321_2_);
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false)));
this.field_150149_b = p_i48321_1_.func_177230_c();
@@ -8,4 +8,4 @@
+public class TallGrassBlock extends BushBlock implements IGrowable, net.minecraftforge.common.IForgeShearable {
protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected TallGrassBlock(AbstractBlock.Properties p_i48310_1_) {
public TallGrassBlock(AbstractBlock.Properties p_i48310_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/VineBlock.java
+++ b/net/minecraft/block/VineBlock.java
@@ -19,7 +19,7 @@
@@ -22,7 +22,7 @@
import net.minecraft.world.IWorldReader;
import net.minecraft.world.server.ServerWorld;
@@ -9,7 +9,7 @@
public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z;
public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a;
public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b;
@@ -143,14 +143,14 @@
@@ -152,14 +152,14 @@
}
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -26,7 +26,7 @@
Direction direction3 = direction.func_176746_e();
Direction direction4 = direction.func_176735_f();
boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3));
@@ -207,7 +207,7 @@
@@ -216,7 +216,7 @@
if (p_225542_3_.func_177956_o() > 0) {
BlockPos blockpos1 = p_225542_3_.func_177977_b();
BlockState blockstate = p_225542_2_.func_180495_p(blockpos1);
@@ -35,7 +35,7 @@
BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate;
BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_);
if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) {
@@ -313,4 +313,7 @@
@@ -322,4 +322,7 @@
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
return field_196546_A.get(p_176267_0_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/GameSettings.java
+++ b/net/minecraft/client/GameSettings.java
@@ -164,6 +164,7 @@
@@ -167,6 +167,7 @@
public boolean field_241568_aS_;
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
@@ -8,7 +8,7 @@
this.field_74317_L = p_i46326_1_;
this.field_74354_ai = new File(p_i46326_2_, "options.txt");
if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
@@ -507,7 +508,11 @@
@@ -518,7 +519,11 @@
for(KeyBinding keybinding : this.field_74324_K) {
if (s.equals("key_" + keybinding.func_151464_g())) {
@@ -21,7 +21,7 @@
}
}
@@ -554,6 +559,7 @@
@@ -565,6 +570,7 @@
}
public void func_74303_b() {
@@ -29,7 +29,7 @@
try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) {
printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion());
printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this));
@@ -635,7 +641,7 @@
@@ -648,7 +654,7 @@
printwriter.println("syncChunkWrites:" + this.field_241568_aS_);
for(KeyBinding keybinding : this.field_74324_K) {
@@ -38,11 +38,10 @@
}
for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -733,4 +739,22 @@
@@ -747,6 +753,23 @@
p_198017_1_.func_198985_a(set);
}
+
+ private void setForgeKeybindProperties() {
+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
+ field_74351_w.setKeyConflictContext(inGame);
@@ -58,6 +57,8 @@
+ field_74323_J.setKeyConflictContext(inGame);
+ field_151457_aa.setKeyConflictContext(inGame);
+ field_151458_ab.setKeyConflictContext(inGame);
+ field_186718_X.setKeyConflictContext(inGame);
+ }
}
+
public PointOfView func_243230_g() {
return this.field_243228_bb;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/KeyboardListener.java
+++ b/net/minecraft/client/KeyboardListener.java
@@ -256,7 +256,9 @@
@@ -255,7 +255,9 @@
}
INestedGuiEventHandler inestedguieventhandler = this.field_197972_a.field_71462_r;
@@ -11,7 +11,7 @@
if (this.field_197972_a.field_71474_y.field_152395_am.func_197976_a(p_197961_3_, p_197961_4_)) {
this.field_197972_a.func_228018_at_().func_198077_g();
this.field_197972_a.field_71474_y.field_74353_u = this.field_197972_a.func_228018_at_().func_198113_j();
@@ -275,6 +277,8 @@
@@ -274,6 +276,8 @@
});
return;
}
@@ -20,7 +20,7 @@
}
boolean flag = inestedguieventhandler == null || !(inestedguieventhandler.func_241217_q_() instanceof TextFieldWidget) || !((TextFieldWidget)inestedguieventhandler.func_241217_q_()).func_212955_f();
@@ -294,10 +298,14 @@
@@ -289,10 +293,14 @@
Screen.func_231153_a_(() -> {
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
if (p_197961_5_ == 0) {
@@ -37,7 +37,7 @@
}
}, "keyPressed event handler", inestedguieventhandler.getClass().getCanonicalName());
@@ -350,7 +358,7 @@
@@ -345,7 +353,7 @@
}
}
}
@@ -46,7 +46,7 @@
}
}
@@ -360,12 +368,16 @@
@@ -355,12 +363,16 @@
if (iguieventlistener != null && this.field_197972_a.func_213250_au() == null) {
if (Character.charCount(p_197963_3_) == 1) {
Screen.func_231153_a_(() -> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -358,6 +358,7 @@
@@ -357,6 +357,7 @@
public Minecraft(GameConfiguration p_i45547_1_) {
super("Client");
field_71432_P = this;
@@ -8,7 +8,7 @@
this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
File file1 = p_i45547_1_.field_178744_c.field_178759_c;
this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
@@ -370,7 +371,6 @@
@@ -369,7 +370,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
@@ -16,7 +16,7 @@
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_238175_ae_ = !p_i45547_1_.field_178741_d.field_239099_d_;
this.field_238176_af_ = !p_i45547_1_.field_178741_d.field_239100_e_;
@@ -416,13 +416,13 @@
@@ -415,14 +415,15 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
@@ -29,9 +29,11 @@
this.field_110451_am = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES);
+ net.minecraftforge.fml.client.ClientModLoader.begin(this, this.field_110448_aq, this.field_110451_am, this.field_195554_ax);
this.field_110448_aq.func_198983_a();
+ DatapackCodec.field_234880_a_.addModPacks(net.minecraftforge.common.ForgeHooks.getModPacks());
this.field_71474_y.func_198017_a(this.field_110448_aq);
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
@@ -463,6 +463,7 @@
this.field_110451_am.func_219534_a(this.field_135017_as);
@@ -462,6 +463,7 @@
this.func_193986_ar();
this.field_110451_am.func_219534_a(this.field_193995_ae);
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -39,7 +41,7 @@
this.field_110451_am.func_219534_a(this.field_71452_i);
this.field_213272_aL = new PaintingSpriteUploader(this.field_71446_o);
this.field_110451_am.func_219534_a(this.field_213272_aL);
@@ -470,7 +471,8 @@
@@ -469,7 +471,8 @@
this.field_110451_am.func_219534_a(this.field_213273_aM);
this.field_241557_ar_ = new GPUWarning();
this.field_110451_am.func_219534_a(this.field_241557_ar_);
@@ -49,7 +51,7 @@
this.field_184132_p = new DebugRenderer(this);
RenderSystem.setErrorCallback(this::func_195545_a);
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
@@ -482,11 +484,6 @@
@@ -481,11 +484,6 @@
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
this.field_195558_d.func_227801_c_();
this.func_213226_a();
@@ -61,7 +63,7 @@
ResourceLoadProgressGui.func_212970_a(this);
List<IResourcePack> list = this.field_110448_aq.func_232623_f_();
@@ -495,7 +492,14 @@
@@ -494,7 +492,14 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
@@ -77,7 +79,7 @@
});
}, false));
}
@@ -534,7 +538,7 @@
@@ -533,7 +538,7 @@
}
private void func_229988_a_(Throwable p_229988_1_) {
@@ -86,7 +88,7 @@
ITextComponent itextcomponent;
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_241203_a().func_195762_a());
@@ -618,7 +622,7 @@
@@ -621,7 +626,7 @@
return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b()));
});
SearchTreeReloadable<ItemStack> searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> {
@@ -95,7 +97,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -688,13 +692,13 @@
@@ -691,13 +696,13 @@
Bootstrap.func_179870_a(p_71377_0_.func_71502_e());
if (p_71377_0_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f());
@@ -112,7 +114,7 @@
}
}
@@ -703,6 +707,7 @@
@@ -706,6 +711,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -120,7 +122,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -791,10 +796,6 @@
@@ -794,10 +800,6 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -131,7 +133,7 @@
if (p_147108_1_ == null && this.field_71441_e == null) {
p_147108_1_ = new MainMenuScreen();
} else if (p_147108_1_ == null && this.field_71439_g.func_233643_dh_()) {
@@ -805,6 +806,14 @@
@@ -808,6 +810,14 @@
}
}
@@ -146,30 +148,29 @@
if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) {
this.field_71474_y.field_74330_P = false;
this.field_71456_v.func_146158_b().func_146231_a(true);
@@ -936,11 +945,13 @@
@@ -939,11 +949,13 @@
RenderSystem.enableCull();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71428_T.field_194147_b);
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b);
this.field_71424_I.func_219895_b("gameRenderer");
this.field_71460_t.func_195458_a(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b, i, p_195542_1_);
this.field_71424_I.func_219895_b("toasts");
this.field_193034_aS.func_238541_a_(new MatrixStack());
this.field_71424_I.func_76319_b();
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71428_T.field_194147_b);
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b);
}
if (this.field_238174_aV_ != null) {
@@ -1039,7 +1050,7 @@
@@ -1042,6 +1054,7 @@
Framebuffer framebuffer = this.func_147110_a();
framebuffer.func_216491_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), field_142025_a);
- this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
+ if (this.field_71460_t!=null) this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
+ if (this.field_71460_t != null)
this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
this.field_71417_B.func_198021_g();
}
@@ -1227,11 +1238,21 @@
@@ -1230,11 +1243,21 @@
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -193,7 +194,7 @@
}
}
@@ -1250,6 +1271,8 @@
@@ -1253,6 +1276,8 @@
}
} else if (!this.field_71439_g.func_184838_M()) {
@@ -202,7 +203,7 @@
switch(this.field_71476_x.func_216346_c()) {
case ENTITY:
this.field_71442_b.func_78764_a(this.field_71439_g, ((EntityRayTraceResult)this.field_71476_x).func_216348_a());
@@ -1257,7 +1280,7 @@
@@ -1260,7 +1285,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -211,7 +212,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1267,8 +1290,10 @@
@@ -1270,8 +1295,10 @@
}
this.field_71439_g.func_184821_cY();
@@ -222,7 +223,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1283,6 +1308,11 @@
@@ -1286,6 +1313,11 @@
}
for(Hand hand : Hand.values()) {
@@ -234,7 +235,7 @@
ItemStack itemstack = this.field_71439_g.func_184586_b(hand);
if (this.field_71476_x != null) {
switch(this.field_71476_x.func_216346_c()) {
@@ -1296,6 +1326,7 @@
@@ -1299,6 +1331,7 @@
if (actionresulttype.func_226246_a_()) {
if (actionresulttype.func_226247_b_()) {
@@ -242,7 +243,7 @@
this.field_71439_g.func_184609_a(hand);
}
@@ -1308,6 +1339,7 @@
@@ -1311,6 +1344,7 @@
ActionResultType actionresulttype1 = this.field_71442_b.func_217292_a(this.field_71439_g, this.field_71441_e, hand, blockraytraceresult);
if (actionresulttype1.func_226246_a_()) {
if (actionresulttype1.func_226247_b_()) {
@@ -250,7 +251,7 @@
this.field_71439_g.func_184609_a(hand);
if (!itemstack.func_190926_b() && (itemstack.func_190916_E() != i || this.field_71442_b.func_78758_h())) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
@@ -1323,6 +1355,9 @@
@@ -1326,6 +1360,9 @@
}
}
@@ -260,7 +261,7 @@
if (!itemstack.func_190926_b()) {
ActionResultType actionresulttype2 = this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand);
if (actionresulttype2.func_226246_a_()) {
@@ -1349,6 +1384,8 @@
@@ -1352,6 +1389,8 @@
--this.field_71467_ac;
}
@@ -269,7 +270,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1465,6 +1502,8 @@
@@ -1468,6 +1507,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -278,18 +279,7 @@
}
private void func_184117_aA() {
@@ -1676,6 +1715,10 @@
this.field_71424_I.func_76320_a("waitForServer");
while(!this.field_71437_Z.func_71200_ad()) {
+ if (!net.minecraftforge.fml.StartupQuery.check() || this.field_71437_Z.func_71241_aa()) {
+ this.func_147108_a(null);
+ return;
+ } else if (this.field_71462_r == null) // if we're showing nothing, put the working screen back again
worldloadprogressscreen.func_231023_e_();
this.func_195542_b(false);
@@ -1696,7 +1739,12 @@
@@ -1697,7 +1738,12 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -303,7 +293,7 @@
this.field_71453_ak = networkmanager;
} else {
this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> {
@@ -1770,6 +1818,7 @@
@@ -1771,6 +1817,7 @@
}
public void func_71403_a(ClientWorld p_71403_1_) {
@@ -311,7 +301,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1801,10 +1850,12 @@
@@ -1802,10 +1849,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -324,7 +314,7 @@
if (integratedserver != null) {
this.field_71424_I.func_76320_a("waitForServer");
@@ -1819,6 +1870,7 @@
@@ -1820,6 +1869,7 @@
this.field_71456_v.func_181029_i();
this.field_71422_O = null;
this.field_71455_al = false;
@@ -332,7 +322,7 @@
this.field_213274_aO.func_216815_b();
}
@@ -1849,6 +1901,7 @@
@@ -1850,6 +1900,7 @@
this.field_71452_i.func_78870_a(p_213257_1_);
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
this.func_230150_b_();
@@ -340,7 +330,7 @@
}
public boolean func_238216_r_() {
@@ -1894,112 +1947,9 @@
@@ -1895,112 +1946,9 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@@ -456,7 +446,7 @@
}
}
@@ -2081,6 +2031,7 @@
@@ -2090,6 +2038,7 @@
return field_71432_P;
}
@@ -464,16 +454,16 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> {
return p_229993_0_;
@@ -2388,7 +2339,7 @@
@@ -2397,7 +2346,7 @@
supplier = func_228022_c_(supplier);
}
- return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_);
+ return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden());
- return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_);
+ return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden());
}
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
@@ -2407,6 +2358,14 @@
@@ -2416,6 +2365,14 @@
this.field_175617_aL.func_229355_a_(p_228020_1_);
}
@@ -487,4 +477,4 @@
+
@OnlyIn(Dist.CLIENT)
public static final class PackManager implements AutoCloseable {
private final ResourcePackList<ResourcePackInfo> field_238221_a_;
private final ResourcePackList field_238221_a_;
@@ -4,7 +4,7 @@
this.field_148622_c = p_i50892_1_;
this.field_148619_d = p_i50892_2_;
this.field_217939_i = new AudioStreamManager(p_i50892_3_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this));
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
}
public void func_148596_a() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
+++ b/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
@@ -113,7 +113,7 @@
@@ -114,7 +114,7 @@
f = 1.0F;
}
@@ -9,11 +9,11 @@
int i = this.func_184612_cw();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F) {
@@ -125,6 +125,6 @@
@@ -126,6 +126,6 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
- return MathHelper.func_219799_g(Minecraft.func_71410_x().field_71474_y.field_243227_aN, 1.0F, f);
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/entity/player/ClientPlayerEntity.java
+++ b/net/minecraft/client/entity/player/ClientPlayerEntity.java
@@ -133,6 +133,7 @@
@@ -134,6 +134,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -8,7 +8,7 @@
return false;
}
@@ -479,6 +480,11 @@
@@ -457,6 +458,11 @@
}
public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
@@ -20,7 +20,7 @@
this.field_70170_p.func_184134_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false);
}
@@ -617,6 +623,7 @@
@@ -595,6 +601,7 @@
boolean flag2 = this.func_223110_ee();
this.field_239203_ch_ = !this.field_71075_bZ.field_75100_b && !this.func_203007_ba() && this.func_213298_c(Pose.CROUCHING) && (this.func_225608_bj_() || !this.func_70608_bn() && !this.func_213298_c(Pose.STANDING));
this.field_71158_b.func_225607_a_(this.func_228354_I_());
@@ -28,26 +28,17 @@
this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b);
if (this.func_184587_cr() && !this.func_184218_aH()) {
this.field_71158_b.field_78902_a *= 0.2F;
@@ -631,11 +638,12 @@
this.field_71158_b.field_78901_c = true;
}
@@ -667,7 +674,7 @@
- if (!this.field_70145_X) {
- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this);
+ if (!this.field_70145_X && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D);
+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D);
if (this.field_71158_b.field_78901_c && !flag7 && !flag && !this.field_71075_bZ.field_75100_b && !this.func_184218_aH() && !this.func_70617_f_()) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack) && this.func_226566_ei_()) {
+ if (itemstack.canElytraFly(this) && this.func_226566_ei_()) {
this.field_71174_a.func_147297_a(new CEntityActionPacket(this, CEntityActionPacket.Action.START_FALL_FLYING));
}
}
if (flag1) {
@@ -985,4 +993,16 @@
return this.field_204230_bP;
@@ -975,4 +982,16 @@
return super.func_241843_o(p_241843_1_);
}
}
+
@@ -1,6 +1,15 @@
--- a/net/minecraft/client/gui/IngameGui.java
+++ b/net/minecraft/client/gui/IngameGui.java
@@ -416,6 +416,9 @@
@@ -78,7 +78,7 @@
protected static final ResourceLocation field_110329_b = new ResourceLocation("textures/misc/vignette.png");
protected static final ResourceLocation field_110330_c = new ResourceLocation("textures/gui/widgets.png");
protected static final ResourceLocation field_110328_d = new ResourceLocation("textures/misc/pumpkinblur.png");
- protected static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired");
+ private static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired");
protected final Random field_73842_c = new Random();
protected final Minecraft field_73839_d;
protected final ItemRenderer field_73841_b;
@@ -414,6 +414,9 @@
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
Effect effect = effectinstance.func_188419_a();
@@ -10,7 +19,7 @@
if (effectinstance.func_205348_f()) {
int k = this.field_194811_H;
int l = 1;
@@ -453,6 +456,7 @@
@@ -451,6 +454,7 @@
RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);
func_238470_a_(p_238444_1_, j1 + 3, k1 + 3, this.func_230927_p_(), 18, 18, textureatlassprite);
});
@@ -18,7 +27,7 @@
}
}
@@ -577,7 +581,8 @@
@@ -575,7 +579,8 @@
iformattabletextcomponent.func_240699_a_(TextFormatting.ITALIC);
}
@@ -28,22 +37,22 @@
int j = (this.field_194811_H - i) / 2;
int k = this.field_194812_I - 59;
if (!this.field_73839_d.field_71442_b.func_78755_b()) {
@@ -594,7 +599,13 @@
@@ -592,7 +597,13 @@
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
func_238467_a_(p_238453_1_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0));
- this.func_175179_f().func_238407_a_(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24));
- this.func_175179_f().func_243246_a(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24));
+ FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l);
+ if (font == null) {
+ this.func_175179_f().func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ this.func_175179_f().func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ } else {
+ j = (this.field_194811_H - font.func_238414_a_(highlightTip)) / 2;
+ font.func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ font.func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
+ }
RenderSystem.disableBlend();
RenderSystem.popMatrix();
}
@@ -1057,7 +1068,7 @@
@@ -1055,7 +1066,7 @@
ItemStack itemstack = this.field_73839_d.field_71439_g.field_71071_by.func_70448_g();
if (itemstack.func_190926_b()) {
this.field_92017_k = 0;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/advancements/AdvancementsScreen.java
+++ b/net/minecraft/client/gui/advancements/AdvancementsScreen.java
@@ -25,6 +25,7 @@
@@ -29,6 +29,7 @@
private final Map<Advancement, AdvancementTabGui> field_191947_i = Maps.newLinkedHashMap();
private AdvancementTabGui field_191940_s;
private boolean field_191944_v;
@@ -8,7 +8,7 @@
public AdvancementsScreen(ClientAdvancementManager p_i47383_1_) {
super(NarratorChatListener.field_216868_a);
@@ -40,7 +41,13 @@
@@ -44,7 +45,13 @@
} else {
this.field_191946_h.func_194230_a(this.field_191940_s == null ? null : this.field_191940_s.func_193935_c(), true);
}
@@ -23,7 +23,7 @@
}
public void func_231164_f_() {
@@ -58,7 +65,7 @@
@@ -62,7 +69,7 @@
int j = (this.field_230709_l_ - 140) / 2;
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -32,7 +32,7 @@
this.field_191946_h.func_194230_a(advancementtabgui.func_193935_c(), true);
break;
}
@@ -82,6 +89,12 @@
@@ -86,6 +93,12 @@
int i = (this.field_230708_k_ - 252) / 2;
int j = (this.field_230709_l_ - 140) / 2;
this.func_230446_a_(p_230430_1_);
@@ -40,12 +40,12 @@
+ net.minecraft.util.text.ITextComponent page = new net.minecraft.util.text.StringTextComponent(String.format("%d / %d", tabPage + 1, maxPages + 1));
+ int width = this.field_230712_o_.func_238414_a_(page);
+ RenderSystem.disableLighting();
+ this.field_230712_o_.func_238407_a_(p_230430_1_, page, i + (252 / 2) - (width / 2), j - 44, -1);
+ this.field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), i + (252 / 2) - (width / 2), j - 44, -1);
+ }
this.func_238696_c_(p_230430_1_, p_230430_2_, p_230430_3_, i, j);
this.func_238695_a_(p_230430_1_, i, j);
this.func_238697_d_(p_230430_1_, p_230430_2_, p_230430_3_, i, j);
@@ -129,6 +142,7 @@
@@ -132,6 +145,7 @@
this.field_230706_i_.func_110434_K().func_110577_a(field_191945_g);
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -53,7 +53,7 @@
advancementtabgui.func_238683_a_(p_238695_1_, p_238695_2_, p_238695_3_, advancementtabgui == this.field_191940_s);
}
@@ -136,6 +150,7 @@
@@ -139,6 +153,7 @@
RenderSystem.defaultBlendFunc();
for(AdvancementTabGui advancementtabgui1 : this.field_191947_i.values()) {
@@ -61,7 +61,7 @@
advancementtabgui1.func_191796_a(p_238695_2_, p_238695_3_, this.field_230707_j_);
}
@@ -158,7 +173,7 @@
@@ -161,7 +176,7 @@
if (this.field_191947_i.size() > 1) {
for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) {
@@ -13,7 +13,7 @@
@@ -40,7 +43,9 @@
int i1 = i / 2 - l / 2;
int j1 = j - 9;
this.field_184059_f.field_71466_p.func_238407_a_(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215);
this.field_184059_f.field_71466_p.func_243246_a(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215);
- j += 10 + 9;
+ }
+ j += event.getIncrement();
@@ -4,7 +4,7 @@
list.add(this.func_211534_a(entry));
}
- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_199717_a().func_199913_a(blockstate.func_177230_c())) {
- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_241835_a().func_199913_a(blockstate.func_177230_c())) {
+ for(ResourceLocation resourcelocation : blockstate.func_177230_c().getTags()) {
list.add("#" + resourcelocation);
}
@@ -13,7 +13,7 @@
list.add(this.func_211534_a(entry1));
}
- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_205704_c().func_199913_a(fluidstate.func_206886_c())) {
- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_241837_c().func_199913_a(fluidstate.func_206886_c())) {
+ for(ResourceLocation resourcelocation1 : fluidstate.func_206886_c().getTags()) {
list.add("#" + resourcelocation1);
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/recipebook/RecipeBookGui.java
+++ b/net/minecraft/client/gui/recipebook/RecipeBookGui.java
@@ -92,7 +92,7 @@
@@ -95,7 +95,7 @@
this.func_205702_a();
this.field_193018_j.clear();
- for(RecipeBookCategories recipebookcategories : ClientRecipeBook.func_216769_b(this.field_201522_g)) {
- for(RecipeBookCategories recipebookcategories : RecipeBookCategories.func_243236_a(this.field_201522_g.func_241850_m())) {
+ for(RecipeBookCategories recipebookcategories : this.field_201522_g.getRecipeBookCategories()) {
this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories));
}
@@ -425,7 +425,7 @@
@@ -433,7 +433,7 @@
languagemanager.func_135045_a(language);
this.field_191888_F.field_71474_y.field_74363_ab = language.getCode();
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/screen/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screen/CreateWorldScreen.java
@@ -542,6 +542,7 @@
File file1 = path.toFile();
if (this.field_243416_G == null) {
this.field_243416_G = new ResourcePackList(new ServerPackFinder(), new FolderPackFinder(file1, IPackNameDecorator.field_232625_a_));
+ net.minecraftforge.fml.packs.ResourcePackLoader.loadResourcePacks(this.field_243416_G, net.minecraftforge.fml.server.ServerLifecycleHooks::buildPackFinder);
this.field_243416_G.func_198983_a();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/LanguageScreen.java
+++ b/net/minecraft/client/gui/screen/LanguageScreen.java
@@ -43,7 +43,7 @@
@@ -45,7 +45,7 @@
if (languagescreen$list$languageentry != null && !languagescreen$list$languageentry.field_214398_b.getCode().equals(this.field_146454_h.func_135041_c().getCode())) {
this.field_146454_h.func_135045_a(languagescreen$list$languageentry.field_214398_b);
this.field_228183_b_.field_74363_ab = languagescreen$list$languageentry.field_214398_b.getCode();
@@ -34,7 +34,7 @@
this.func_140005_i();
}, button$itooltip))).field_230693_o_ = flag;
}
@@ -222,6 +228,7 @@
@@ -229,6 +235,7 @@
this.field_230706_i_.func_110434_K().func_110577_a(field_194400_H);
func_238463_a_(p_230430_1_, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
@@ -42,22 +42,23 @@
if (this.field_73975_c != null) {
RenderSystem.pushMatrix();
RenderSystem.translatef((float)(this.field_230708_k_ / 2 + 90), 70.0F, 0.0F);
@@ -244,7 +251,13 @@
@@ -251,7 +258,14 @@
s = s + I18n.func_135052_a("menu.modded");
}
- this.func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l);
- func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l);
+ net.minecraftforge.fml.BrandingControl.forEachLine(true, true, (brdline, brd) ->
+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ );
+
+ net.minecraftforge.fml.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l)
+ );
this.func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l);
+
func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l);
if (p_230430_2_ > this.field_193979_N && p_230430_2_ < this.field_193979_N + this.field_193978_M && p_230430_3_ > this.field_230709_l_ - 10 && p_230430_3_ < this.field_230709_l_) {
func_238467_a_(p_230430_1_, this.field_193979_N, this.field_230709_l_ - 1, this.field_193979_N + this.field_193978_M, this.field_230709_l_, 16777215 | l);
@@ -258,6 +271,7 @@
@@ -265,6 +279,7 @@
if (this.func_183501_a() && f1 >= 1.0F) {
this.field_183503_M.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_);
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/gui/screen/OptionsScreen.java
+++ b/net/minecraft/client/gui/screen/OptionsScreen.java
@@ -146,4 +146,12 @@
this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215);
func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215);
super.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_);
}
+
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/PackLoadingManager.java
+++ b/net/minecraft/client/gui/screen/PackLoadingManager.java
@@ -135,6 +135,11 @@
@@ -134,6 +134,11 @@
public void func_230468_k_() {
this.func_238879_a_(1);
}
@@ -12,7 +12,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -230,5 +235,7 @@
@@ -229,5 +234,7 @@
boolean func_230469_o_();
boolean func_230470_p_();
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/gui/screen/PackScreen.java
+++ b/net/minecraft/client/gui/screen/PackScreen.java
@@ -84,7 +84,7 @@
@@ -129,7 +129,7 @@
private void func_238899_a_(ResourcePackList p_238899_1_, Stream<PackLoadingManager.IPack> p_238899_2_) {
private void func_238899_a_(net.minecraft.client.gui.widget.list.ResourcePackList p_238899_1_, Stream<PackLoadingManager.IPack> p_238899_2_) {
p_238899_1_.func_231039_at__().clear();
- p_238899_2_.forEach((p_238898_2_) -> {
+ p_238899_2_.filter(PackLoadingManager.IPack::notHidden).forEach((p_238898_2_) -> {
p_238899_1_.func_231039_at__().add(new ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_));
p_238899_1_.func_231039_at__().add(new net.minecraft.client.gui.widget.list.ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_));
});
}
@@ -4,28 +4,26 @@
}
protected void func_230457_a_(MatrixStack p_230457_1_, ItemStack p_230457_2_, int p_230457_3_, int p_230457_4_) {
- this.func_238654_b_(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_);
- this.func_243308_b(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_);
+ FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
+ this.func_238654_b_(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ this.renderToolTip(p_230457_1_, Lists.transform(this.func_231151_a_(p_230457_2_), ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
}
public List<ITextComponent> func_231151_a_(ItemStack p_231151_1_) {
@@ -125,7 +128,11 @@
@@ -129,6 +132,10 @@
}
public void func_238654_b_(MatrixStack p_238654_1_, List<? extends ITextProperties> p_238654_2_, int p_238654_3_, int p_238654_4_) {
- if (!p_238654_2_.isEmpty()) {
+
public void func_238654_b_(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_) {
+ this.renderToolTip(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230712_o_);
+ }
+ public void func_238654_b_(MatrixStack p_238654_1_, List<? extends ITextProperties> p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) {
+ net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font);
+ if (false && !p_238654_2_.isEmpty()) {
+ public void renderToolTip(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) {
+ //net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font);
if (!p_238654_2_.isEmpty()) {
int i = 0;
for(ITextProperties itextproperties : p_238654_2_) {
@@ -285,9 +292,12 @@
@@ -289,9 +296,12 @@
}
public void func_231159_b_(String p_231159_1_, boolean p_231159_2_) {
@@ -38,7 +36,7 @@
this.field_230706_i_.field_71439_g.func_71165_d(p_231159_1_);
}
@@ -298,10 +308,17 @@
@@ -302,10 +312,17 @@
this.field_230712_o_ = p_231158_1_.field_71466_p;
this.field_230708_k_ = p_231158_2_;
this.field_230709_l_ = p_231158_3_;
@@ -56,23 +54,23 @@
}
public List<? extends IGuiEventListener> func_231039_at__() {
@@ -324,6 +341,7 @@
@@ -328,6 +345,7 @@
public void func_238651_a_(MatrixStack p_238651_1_, int p_238651_2_) {
if (this.field_230706_i_.field_71441_e != null) {
this.func_238468_a_(p_238651_1_, 0, 0, this.field_230708_k_, this.field_230709_l_, -1072689136, -804253680);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, p_238651_1_));
} else {
this.func_231165_f_(p_238651_2_);
}
@@ -342,6 +360,7 @@
@@ -346,6 +364,7 @@
bufferbuilder.func_225582_a_((double)this.field_230708_k_, 0.0D, 0.0D).func_225583_a_((float)this.field_230708_k_ / 32.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
bufferbuilder.func_225582_a_(0.0D, 0.0D, 0.0D).func_225583_a_(0.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
tessellator.func_78381_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, new MatrixStack()));
}
public boolean func_231177_au__() {
@@ -428,4 +447,8 @@
@@ -432,4 +451,8 @@
public void func_230476_a_(List<Path> p_230476_1_) {
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/ServerSelectionList.java
+++ b/net/minecraft/client/gui/screen/ServerSelectionList.java
@@ -302,6 +302,8 @@
@@ -310,6 +310,8 @@
this.field_148303_c.func_238854_b_(list1);
}
@@ -105,19 +105,20 @@
this.func_184098_a(slot, k, p_231048_5_, ClickType.CLONE);
} else {
boolean flag1 = k != -999 && (InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 340) || InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 344));
@@ -534,19 +544,26 @@
@@ -530,34 +540,39 @@
}
public boolean func_231046_a_(int p_231046_1_, int p_231046_2_, int p_231046_3_) {
+ InputMappings.Input mouseKey = InputMappings.func_197954_a(p_231046_1_, p_231046_2_);
if (super.func_231046_a_(p_231046_1_, p_231046_2_, p_231046_3_)) {
return true;
- } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) {
- } else if (this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) {
+ } else if (this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) {
this.func_231175_as__();
return true;
} else {
- this.func_195363_d(p_231046_1_, p_231046_2_);
+ } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) {
+ boolean handled = false;// Forge MC-146650: Needs to return true when the key is handled.
+ if (this.func_195363_d(p_231046_1_, p_231046_2_))
+ handled = true;
+ boolean handled = this.func_195363_d(p_231046_1_, p_231046_2_);// Forge MC-146650: Needs to return true when the key is handled
if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) {
- if (this.field_230706_i_.field_71474_y.field_74322_I.func_197976_a(p_231046_1_, p_231046_2_)) {
+ if (this.field_230706_i_.field_71474_y.field_74322_I.isActiveAndMatches(mouseKey)) {
@@ -129,15 +130,13 @@
+ handled = true;
}
+ } else if (this.field_230706_i_.field_71474_y.field_74316_C.isActiveAndMatches(mouseKey)) {
+ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item.
+ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item.
}
- return true;
+ return handled;
} else {
this.field_230706_i_.field_71439_g.func_71053_j();
return true;
@@ -555,13 +572,13 @@
}
}
protected boolean func_195363_d(int p_195363_1_, int p_195363_2_) {
if (this.field_230706_i_.field_71439_g.field_71071_by.func_70445_o().func_190926_b() && this.field_147006_u != null) {
@@ -153,11 +152,10 @@
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP);
return true;
}
@@ -592,4 +609,16 @@
public T func_212873_a_() {
@@ -589,6 +604,18 @@
return this.field_147002_h;
}
+
+ @javax.annotation.Nullable
+ public Slot getSlotUnderMouse() { return this.field_147006_u; }
+ public int getGuiLeft() { return field_147003_i; }
@@ -169,4 +167,7 @@
+ public int getSlotColor(int index) {
+ return slotColor;
+ }
}
+
public void func_231175_as__() {
this.field_230706_i_.field_71439_g.func_71053_j();
super.func_231175_as__();
@@ -9,19 +9,19 @@
private boolean field_199506_G;
private final Map<ResourceLocation, ITag<Item>> field_214085_w = Maps.newTreeMap();
@@ -233,6 +235,12 @@
@@ -234,6 +236,12 @@
protected void func_231160_c_() {
if (this.field_230706_i_.field_71442_b.func_78758_h()) {
super.func_231160_c_();
+ int tabCount = ItemGroup.field_78032_a.length;
+ if (tabCount > 12) {
+ func_230480_a_(new net.minecraft.client.gui.widget.button.Button(field_147003_i, field_147009_r - 50, 20, 20, new StringTextComponent("<"), b -> tabPage = Math.max(tabPage - 1, 0 )));
+ func_230480_a_(new net.minecraft.client.gui.widget.button.Button(field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, new StringTextComponent(">"), b -> tabPage = Math.min(tabPage + 1, maxPages)));
+ maxPages = (int) Math.ceil((tabCount - 12) / 10D);
+ }
super.func_231160_c_();
this.field_230706_i_.field_195559_v.func_197967_a(true);
this.field_147062_A = new TextFieldWidget(this.field_230712_o_, this.field_147003_i + 82, this.field_147009_r + 6, 80, 9, new TranslationTextComponent("itemGroup.search"));
this.field_147062_A.func_146203_f(50);
@@ -275,7 +283,7 @@
public boolean func_231042_a_(char p_231042_1_, int p_231042_2_) {
if (this.field_195377_F) {
@@ -80,8 +80,8 @@
- if (itemgroup.func_78019_g()) {
+ if (itemgroup != null && itemgroup.func_78019_g()) {
RenderSystem.disableBlend();
- this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, 4210752);
+ this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, itemgroup.getLabelColor());
- this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, 4210752);
+ this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, itemgroup.getLabelColor());
}
}
@@ -154,11 +154,11 @@
break;
}
}
+ if (!rendered && !func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_))
+ func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_);
+ if (!rendered && !this.func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_))
+ this.func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_);
if (this.field_147064_C != null && field_147058_w == ItemGroup.field_78036_m.func_78021_a() && this.func_195359_a(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, (double)p_230430_2_, (double)p_230430_3_)) {
this.func_238652_a_(p_230430_1_, new TranslationTextComponent("inventory.binSlot"), p_230430_2_, p_230430_3_);
this.func_238652_a_(p_230430_1_, field_243345_D, p_230430_2_, p_230430_3_);
}
+ if (maxPages != 0) {
@@ -166,7 +166,7 @@
+ RenderSystem.disableLighting();
+ this.func_230926_e_(300);
+ this.field_230707_j_.field_77023_b = 300.0F;
+ field_230712_o_.func_238407_a_(p_230430_1_, page, field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1);
+ field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1);
+ this.func_230926_e_(0);
+ this.field_230707_j_.field_77023_b = 0.0F;
+ }
@@ -175,13 +175,13 @@
this.func_230459_a_(p_230430_1_, p_230430_2_, p_230430_3_);
}
@@ -612,7 +670,10 @@
list1.add(1, (new TranslationTextComponent(itemgroup.func_78024_c())).func_240699_a_(TextFormatting.BLUE));
list1.add(1, itemgroup.func_242392_c().func_230532_e_().func_240699_a_(TextFormatting.BLUE));
}
- this.func_238654_b_(p_230457_1_, list1, p_230457_3_, p_230457_4_);
- this.func_243308_b(p_230457_1_, list1, p_230457_3_, p_230457_4_);
+ net.minecraft.client.gui.FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
+ this.func_238654_b_(p_230457_1_, list1, p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ this.renderToolTip(p_230457_1_, Lists.transform(list1, ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
} else {
super.func_230457_a_(p_230457_1_, p_230457_2_, p_230457_3_, p_230457_4_);
@@ -6,7 +6,7 @@
this.func_230441_a_(p_230431_1_, minecraft, p_230431_2_, p_230431_3_);
- int j = this.field_230693_o_ ? 16777215 : 10526880;
+ int j = getFGColor();
this.func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24);
func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24);
}
@@ -206,6 +206,14 @@
@@ -29,7 +29,7 @@
@@ -114,7 +115,7 @@
public void func_230432_a_(MatrixStack p_230432_1_, int p_230432_2_, int p_230432_3_, int p_230432_4_, int p_230432_5_, int p_230432_6_, int p_230432_7_, int p_230432_8_, boolean p_230432_9_, float p_230432_10_) {
boolean flag = KeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b;
KeyBindingList.this.field_230668_b_.field_71466_p.func_238422_b_(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215);
KeyBindingList.this.field_230668_b_.field_71466_p.func_243248_b(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215);
- this.field_148281_e.field_230690_l_ = p_230432_4_ + 190;
+ this.field_148281_e.field_230690_l_ = p_230432_4_ + 190 + 20;
this.field_148281_e.field_230691_m_ = p_230432_3_;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/PlayerController.java
+++ b/net/minecraft/client/multiplayer/PlayerController.java
@@ -94,6 +94,7 @@
@@ -93,6 +93,7 @@
}
public boolean func_187103_a(BlockPos p_187103_1_) {
@@ -8,7 +8,7 @@
if (this.field_78776_a.field_71439_g.func_223729_a(this.field_78776_a.field_71441_e, p_187103_1_, this.field_78779_k)) {
return false;
} else {
@@ -105,12 +106,11 @@
@@ -104,12 +105,11 @@
Block block = blockstate.func_177230_c();
if ((block instanceof CommandBlockBlock || block instanceof StructureBlock || block instanceof JigsawBlock) && !this.field_78776_a.field_71439_g.func_195070_dx()) {
return false;
@@ -23,7 +23,7 @@
if (flag) {
block.func_176206_d(world, p_187103_1_, blockstate);
}
@@ -131,21 +131,25 @@
@@ -130,21 +130,25 @@
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, blockstate, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_);
@@ -50,7 +50,7 @@
if (flag && blockstate1.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) {
this.func_187103_a(p_180511_1_);
} else {
@@ -185,22 +189,24 @@
@@ -184,22 +188,24 @@
BlockState blockstate1 = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate1, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -77,7 +77,7 @@
if (this.field_78770_f >= 1.0F) {
this.field_78778_j = false;
this.func_225324_a(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -219,7 +225,8 @@
@@ -218,7 +224,8 @@
}
public float func_78757_d() {
@@ -87,7 +87,7 @@
}
public void func_78765_e() {
@@ -236,7 +243,7 @@
@@ -235,7 +242,7 @@
ItemStack itemstack = this.field_78776_a.field_71439_g.func_184614_ca();
boolean flag = this.field_85183_f.func_190926_b() && itemstack.func_190926_b();
if (!this.field_85183_f.func_190926_b() && !itemstack.func_190926_b()) {
@@ -96,7 +96,7 @@
}
return p_178893_1_.equals(this.field_178895_c) && flag;
@@ -258,13 +265,27 @@
@@ -257,13 +264,27 @@
return ActionResultType.FAIL;
} else {
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
@@ -126,7 +126,7 @@
ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
if (actionresulttype.func_226246_a_()) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -273,8 +294,8 @@
@@ -272,8 +293,8 @@
}
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -136,7 +136,7 @@
ActionResultType actionresulttype1;
if (this.field_78779_k.func_77145_d()) {
int i = itemstack.func_190916_E();
@@ -302,11 +323,14 @@
@@ -301,11 +322,14 @@
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
return ActionResultType.PASS;
} else {
@@ -151,7 +151,7 @@
}
return actionresult.func_188397_a();
@@ -335,6 +359,9 @@
@@ -334,6 +358,9 @@
public ActionResultType func_187097_a(PlayerEntity p_187097_1_, Entity p_187097_2_, Hand p_187097_3_) {
this.func_78750_j();
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187097_2_, p_187097_3_, p_187097_1_.func_225608_bj_()));
@@ -161,7 +161,7 @@
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
}
@@ -342,6 +369,9 @@
@@ -341,6 +368,9 @@
this.func_78750_j();
Vector3d vector3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.func_226277_ct_(), p_187102_2_.func_226278_cu_(), p_187102_2_.func_226281_cx_());
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vector3d, p_187102_1_.func_225608_bj_()));
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/login/ClientLoginNetHandler.java
+++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java
@@ -98,6 +98,7 @@
@@ -99,6 +99,7 @@
this.field_209525_d.accept(new TranslationTextComponent("connect.joining"));
this.field_175091_e = p_147390_1_.func_179730_a();
this.field_147393_d.func_150723_a(ProtocolType.PLAY);
@@ -8,7 +8,7 @@
this.field_147393_d.func_150719_a(new ClientPlayNetHandler(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e));
}
@@ -126,6 +127,7 @@
@@ -127,6 +128,7 @@
}
public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/play/ClientPlayNetHandler.java
+++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java
@@ -388,6 +388,7 @@
@@ -384,6 +384,7 @@
this.field_147299_f.field_184132_p.func_217737_a();
this.field_147299_f.field_71439_g.func_70065_x();
@@ -8,7 +8,7 @@
int i = p_147282_1_.func_149197_c();
this.field_147300_g.func_217408_a(i, this.field_147299_f.field_71439_g);
this.field_147299_f.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y);
@@ -399,6 +400,7 @@
@@ -395,6 +396,7 @@
this.field_147299_f.field_71439_g.func_228355_a_(p_147282_1_.func_229743_k_());
this.field_147299_f.field_71442_b.func_78746_a(p_147282_1_.func_149198_e());
this.field_147299_f.field_71442_b.func_241675_a_(p_147282_1_.func_241786_f_());
@@ -16,7 +16,7 @@
this.field_147299_f.field_71474_y.func_82879_c();
this.field_147302_e.func_179290_a(new CCustomPayloadPacket(CCustomPayloadPacket.field_210344_a, (new PacketBuffer(Unpooled.buffer())).func_180714_a(ClientBrandRetriever.getClientModName())));
this.field_147299_f.func_213229_ar().func_216814_a();
@@ -745,7 +747,7 @@
@@ -734,7 +736,7 @@
BlockPos blockpos = new BlockPos(compoundnbt.func_74762_e("x"), compoundnbt.func_74762_e("y"), compoundnbt.func_74762_e("z"));
TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos);
if (tileentity != null) {
@@ -25,18 +25,18 @@
}
}
@@ -844,7 +846,9 @@
@@ -815,7 +817,9 @@
public void func_147251_a(SChatPacket p_147251_1_) {
PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f);
- this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c(), p_147251_1_.func_240810_e_());
+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c());
+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c(), p_147251_1_.func_240810_e_());
+ if (message == null) return;
+ this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), message, p_147251_1_.func_240810_e_());
}
public void func_147279_a(SAnimateHandPacket p_147279_1_) {
@@ -1034,8 +1038,10 @@
@@ -1004,8 +1008,10 @@
clientplayerentity1.func_233645_dx_().func_233784_a_(clientplayerentity.func_233645_dx_());
}
@@ -47,7 +47,7 @@
this.field_147300_g.func_217408_a(i, clientplayerentity1);
clientplayerentity1.field_70177_z = -180.0F;
clientplayerentity1.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y);
@@ -1161,6 +1167,12 @@
@@ -1131,6 +1137,12 @@
if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) {
((CommandBlockScreen)this.field_147299_f.field_71462_r).func_184075_a();
@@ -60,15 +60,15 @@
}
}
@@ -1329,6 +1341,7 @@
clientrecipebook.func_199644_c();
@@ -1299,6 +1311,7 @@
clientrecipebook.func_243196_a(this.field_199528_o.func_199510_b());
clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a);
imutablesearchtree.func_194040_a();
+ net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.field_199528_o);
}
public void func_200232_a(SPlayerLookPacket p_200232_1_) {
@@ -1409,7 +1422,7 @@
@@ -1376,7 +1389,7 @@
PacketThreadUtil.func_218797_a(p_147260_1_, this, this.field_147299_f);
Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d());
if (entity instanceof LivingEntity) {
@@ -77,15 +77,7 @@
if (effect != null) {
EffectInstance effectinstance = new EffectInstance(effect, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h());
effectinstance.func_100012_b(p_147260_1_.func_149429_c());
@@ -1426,6 +1439,7 @@
}
this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.field_199725_m));
}
public void func_175098_a(SCombatPacket p_175098_1_) {
@@ -1909,10 +1923,12 @@
@@ -1883,10 +1896,12 @@
int l5 = packetbuffer.readInt();
this.field_147299_f.field_184132_p.field_229018_q_.func_229022_a_(blockpos8, l3, s10, l5);
} else {
@@ -34,7 +34,7 @@
return iparticlefactory == null ? null : iparticlefactory.func_199234_a(p_199927_1_, this.field_78878_a, p_199927_2_, p_199927_4_, p_199927_6_, p_199927_8_, p_199927_10_, p_199927_12_);
}
@@ -315,14 +315,18 @@
@@ -315,14 +315,21 @@
public void func_228345_a_(MatrixStack p_228345_1_, IRenderTypeBuffer.Impl p_228345_2_, LightTexture p_228345_3_, ActiveRenderInfo p_228345_4_, float p_228345_5_) {
p_228345_3_.func_205109_c();
@@ -43,6 +43,9 @@
RenderSystem.defaultAlphaFunc();
RenderSystem.enableDepthTest();
RenderSystem.enableFog();
+ RenderSystem.activeTexture(org.lwjgl.opengl.GL13.GL_TEXTURE2);
+ RenderSystem.enableTexture();
+ RenderSystem.activeTexture(org.lwjgl.opengl.GL13.GL_TEXTURE0);
+ };
RenderSystem.pushMatrix();
RenderSystem.multMatrix(p_228345_1_.func_227866_c_().func_227870_a_());
@@ -54,7 +57,7 @@
Iterable<Particle> iterable = this.field_78876_b.get(iparticlerendertype);
if (iterable != null) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -362,7 +366,7 @@
@@ -362,7 +369,7 @@
}
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
@@ -63,7 +66,7 @@
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_228348_3_, p_228348_5_, p_228348_7_, p_228348_9_, p_228348_11_, p_228348_13_) -> {
@@ -434,6 +438,12 @@
@@ -434,6 +441,12 @@
return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum());
}
@@ -81,7 +81,7 @@
- int i = WorldRenderer.func_228420_a_(p_228806_1_, p_228806_3_, p_228806_4_.func_177972_a(direction));
- this.func_228798_a_(p_228806_1_, p_228806_3_, p_228806_4_, i, p_228806_11_, false, p_228806_5_, p_228806_6_, list, bitset);
+ randomIn.setSeed(rand);
+ List<BakedQuad> list = modelIn.func_200117_a(stateIn, direction, randomIn);
+ List<BakedQuad> list = modelIn.getQuads(stateIn, direction, randomIn, modelData);
+ if (!list.isEmpty() && (!checkSides || Block.func_176225_a(stateIn, worldIn, posIn, direction))) {
+ int i = WorldRenderer.func_228420_a_(worldIn, stateIn, posIn.func_177972_a(direction));
+ this.func_228798_a_(worldIn, stateIn, posIn, i, combinedOverlayIn, false, matrixStackIn, buffer, list, bitset);
@@ -1,14 +1,6 @@
--- a/net/minecraft/client/renderer/BufferBuilder.java
+++ b/net/minecraft/client/renderer/BufferBuilder.java
@@ -121,7 +121,6 @@
bitset.set(l);
}
-
}
private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
@@ -297,6 +296,7 @@
@@ -297,6 +297,7 @@
}
ByteBuffer bytebuffer = this.field_179001_a.slice();
@@ -16,7 +8,7 @@
((Buffer)this.field_179001_a).clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
@@ -364,4 +364,15 @@
@@ -364,4 +365,15 @@
this.field_179018_e = p_i225907_2_;
}
}
@@ -81,10 +81,3 @@
}
if (this.field_187469_f < 0.1F) {
@@ -430,6 +440,5 @@
} else {
this.field_187471_h = 0.0F;
}
-
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
@@ -158,17 +158,28 @@
@@ -156,17 +156,28 @@
}
float f9 = Math.min(1.0F / field_205093_c, Math.min(1.0F / field_205094_d, 1.0F / field_205095_e));
@@ -29,33 +29,30 @@
RenderSystem.clearColor(field_205093_c, field_205094_d, field_205095_e, 0.0F);
}
@@ -177,10 +188,18 @@
@@ -174,10 +185,17 @@
RenderSystem.fogDensity(0.0F);
RenderSystem.fogMode(GlStateManager.FogMode.EXP2);
}
- public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ @Deprecated // FORGE: Pass in partialTicks
+ public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0);
+ }
-
+ @Deprecated // FORGE: Pass in partialTicks
public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0);
+ }
+
+ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) {
+ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) {
FluidState fluidstate = p_228372_0_.func_216771_k();
Entity entity = p_228372_0_.func_216773_g();
boolean flag = fluidstate.func_206886_c() != Fluids.field_204541_a;
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(p_228372_1_, p_228372_0_, partialTicks, 0.1F);
+ if (hook >= 0) RenderSystem.fogDensity(hook);
+ else
if (fluidstate.func_206884_a(FluidTags.field_206959_a)) {
float f = 1.0F;
f = 0.05F;
@@ -231,8 +250,8 @@
@@ -228,6 +246,7 @@
RenderSystem.fogEnd(f3);
RenderSystem.fogMode(GlStateManager.FogMode.LINEAR);
RenderSystem.setupNvFogDistance();
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(p_228372_1_, p_228372_0_, partialTicks, f3);
}
-
}
public static void func_228373_b_() {
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/GameRenderer.java
+++ b/net/minecraft/client/renderer/GameRenderer.java
@@ -132,6 +132,8 @@
@@ -135,6 +135,8 @@
this.func_175069_a(new ResourceLocation("shaders/post/spider.json"));
} else if (p_175066_1_ instanceof EndermanEntity) {
this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
@@ -9,7 +9,7 @@
}
}
@@ -307,7 +309,7 @@
@@ -310,7 +312,7 @@
d0 = d0 * 60.0D / 70.0D;
}
@@ -18,7 +18,7 @@
}
}
@@ -476,7 +478,7 @@
@@ -486,7 +488,7 @@
}
} else if (this.field_78531_r.field_71462_r != null) {
try {
@@ -27,10 +27,10 @@
} catch (Throwable throwable) {
CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details");
@@ -589,9 +591,16 @@
@@ -595,9 +597,16 @@
Matrix4f matrix4f = matrixstack.func_227866_c_().func_227870_a_();
this.func_228379_a_(matrix4f);
activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), this.field_78531_r.field_71474_y.field_74320_O > 0, this.field_78531_r.field_71474_y.field_74320_O == 2, p_228378_1_);
activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), !this.field_78531_r.field_71474_y.func_243230_g().func_243192_a(), this.field_78531_r.field_71474_y.func_243230_g().func_243193_b(), p_228378_1_);
+
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(this, activerenderinfo, p_228378_1_);
+ activerenderinfo.setAnglesInternal(cameraSetup.getYaw(), cameraSetup.getPitch());
@@ -44,7 +44,7 @@
this.field_78531_r.func_213239_aq().func_219895_b("hand");
if (this.field_175074_C) {
RenderSystem.clear(256, Minecraft.field_142025_a);
@@ -671,4 +680,9 @@
@@ -709,4 +718,9 @@
public OverlayTexture func_228385_m_() {
return this.field_228375_t_;
}
@@ -18,16 +18,28 @@
p_229111_4_.func_227861_a_(-0.5D, -0.5D, -0.5D);
if (!p_229111_8_.func_188618_c() && (p_229111_1_.func_77973_b() != Items.field_203184_eO || flag)) {
boolean flag1;
@@ -132,7 +132,7 @@
@@ -105,7 +105,8 @@
} else {
flag1 = true;
}
-
+ if (p_229111_8_.isLayered()) { net.minecraftforge.client.ForgeHooksClient.drawItemLayered(this, p_229111_8_, p_229111_1_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_, flag1); }
+ else {
RenderType rendertype = RenderTypeLookup.func_239219_a_(p_229111_1_, flag1);
IVertexBuilder ivertexbuilder;
if (p_229111_1_.func_77973_b() == Items.field_151111_aL && p_229111_1_.func_77962_s()) {
@@ -131,8 +132,9 @@
}
this.func_229114_a_(p_229111_8_, p_229111_1_, p_229111_6_, p_229111_7_, p_229111_4_, ivertexbuilder);
+ }
} else {
- ItemStackTileEntityRenderer.field_147719_a.func_239207_a_(p_229111_1_, p_229111_2_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_);
+ p_229111_1_.func_77973_b().getItemStackTileEntityRenderer().func_239207_a_(p_229111_1_, p_229111_2_, p_229111_4_, p_229111_5_, p_229111_6_, p_229111_7_);
}
p_229111_4_.func_227865_b_();
@@ -172,7 +172,7 @@
@@ -176,7 +178,7 @@
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@@ -36,7 +48,7 @@
}
}
@@ -263,6 +263,7 @@
@@ -267,6 +269,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_239387_2_.func_77973_b());
});
@@ -44,7 +56,7 @@
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_239387_2_.func_77952_i());
});
@@ -294,18 +295,16 @@
@@ -298,18 +301,16 @@
irendertypebuffer$impl.func_228461_a_();
}
@@ -67,7 +79,7 @@
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
RenderSystem.enableBlend();
@@ -343,4 +342,9 @@
@@ -347,4 +348,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/renderer/RenderState.java
+++ b/net/minecraft/client/renderer/RenderState.java
@@ -255,7 +255,7 @@
private final float field_228574_Q_;
public AlphaState(float p_i225974_1_) {
- super("alpha", () -> {
+ super("alpha", () -> { // FORGE: fix MC-167447
if (p_i225974_1_ > 0.0F) {
RenderSystem.enableAlphaTest();
RenderSystem.alphaFunc(516, p_i225974_1_);
@@ -32,7 +32,17 @@
public static RenderType func_239221_b_(BlockState p_239221_0_) {
Block block = p_239221_0_.func_177230_c();
if (block instanceof LeavesBlock) {
@@ -317,11 +321,60 @@
@@ -295,8 +299,7 @@
}
public static RenderType func_239220_a_(BlockState p_239220_0_, boolean p_239220_1_) {
- RenderType rendertype = func_228390_a_(p_239220_0_);
- if (rendertype == RenderType.func_228645_f_()) {
+ if (canRenderInLayer(p_239220_0_, RenderType.func_228645_f_())) {
if (!Minecraft.func_238218_y_()) {
return Atlases.func_228785_j_();
} else {
@@ -317,11 +320,60 @@
}
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/renderer/ViewFrustum.java
+++ b/net/minecraft/client/renderer/ViewFrustum.java
@@ -8,6 +8,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.ChunkRender;
+
@OnlyIn(Dist.CLIENT)
public class ViewFrustum {
protected final WorldRenderer field_178169_a;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/WorldRenderer.java
+++ b/net/minecraft/client/renderer/WorldRenderer.java
@@ -812,7 +812,7 @@
@@ -830,7 +830,7 @@
this.field_147595_R = true;
BlockPos blockpos2 = chunkrenderdispatcher$chunkrender4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag1 = blockpos2.func_177951_i(blockpos) < 768.0D;
@@ -9,7 +9,7 @@
this.field_175009_l.add(chunkrenderdispatcher$chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -897,13 +897,13 @@
@@ -915,13 +915,13 @@
float f = p_228426_7_.func_205001_m();
boolean flag1 = this.field_72777_q.field_71441_e.func_239132_a_().func_230493_a_(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d1)) || this.field_72777_q.field_71456_v.func_184046_j().func_184056_f();
if (this.field_72777_q.field_71474_y.field_151451_c >= 4) {
@@ -25,7 +25,7 @@
iprofiler.func_219895_b("terrain_setup");
this.func_228437_a_(p_228426_6_, clippinghelper, flag, this.field_228409_ai_++, this.field_72777_q.field_71439_g.func_175149_v());
iprofiler.func_219895_b("updatechunks");
@@ -924,7 +924,9 @@
@@ -942,7 +942,9 @@
this.func_174967_a(p_228426_3_ + l1);
iprofiler.func_219895_b("terrain");
this.func_228441_a_(RenderType.func_228639_c_(), p_228426_1_, d0, d1, d2);
@@ -35,7 +35,7 @@
this.func_228441_a_(RenderType.func_228643_e_(), p_228426_1_, d0, d1, d2);
if (this.field_72769_h.func_239132_a_().func_239217_c_()) {
RenderHelper.func_237533_a_(p_228426_1_.func_227866_c_().func_227870_a_());
@@ -994,6 +996,7 @@
@@ -1010,6 +1012,7 @@
List<TileEntity> list = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b();
if (!list.isEmpty()) {
for(TileEntity tileentity1 : list) {
@@ -43,7 +43,7 @@
BlockPos blockpos3 = tileentity1.func_174877_v();
IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl;
p_228426_1_.func_227860_a_();
@@ -1019,6 +1022,7 @@
@@ -1035,6 +1038,7 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity : this.field_181024_n) {
@@ -51,7 +51,7 @@
BlockPos blockpos2 = tileentity.func_174877_v();
p_228426_1_.func_227860_a_();
p_228426_1_.func_227861_a_((double)blockpos2.func_177958_n() - d0, (double)blockpos2.func_177956_o() - d1, (double)blockpos2.func_177952_p() - d2);
@@ -1069,7 +1073,8 @@
@@ -1084,7 +1088,8 @@
iprofiler.func_219895_b("outline");
BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
@@ -61,7 +61,7 @@
IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.func_228659_m_());
this.func_228429_a_(p_228426_1_, ivertexbuilder2, p_228426_6_.func_216773_g(), d0, d1, d2, blockpos, blockstate);
}
@@ -2056,7 +2061,12 @@
@@ -2076,7 +2081,12 @@
this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_);
}
@@ -74,7 +74,7 @@
ISound isound = this.field_147593_P.get(p_184377_2_);
if (isound != null) {
this.field_72777_q.func_147118_V().func_147683_b(isound);
@@ -2064,7 +2074,7 @@
@@ -2084,7 +2094,7 @@
}
if (p_184377_1_ != null) {
@@ -83,7 +83,7 @@
if (musicdiscitem != null) {
this.field_72777_q.field_71456_v.func_238451_a_(musicdiscitem.func_234801_g_());
}
@@ -2212,7 +2222,7 @@
@@ -2232,7 +2242,7 @@
break;
case 1010:
if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) {
@@ -92,7 +92,7 @@
} else {
this.func_184377_a((SoundEvent)null, p_180439_3_);
}
@@ -2362,8 +2372,8 @@
@@ -2382,8 +2392,8 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
@@ -103,7 +103,7 @@
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}
@@ -2511,7 +2521,7 @@
@@ -2531,7 +2541,7 @@
} else {
int i = p_228420_0_.func_226658_a_(LightType.SKY, p_228420_2_);
int j = p_228420_0_.func_226658_a_(LightType.BLOCK, p_228420_2_);
@@ -112,7 +112,7 @@
if (j < k) {
j = k;
}
@@ -2550,6 +2560,11 @@
@@ -2570,6 +2580,11 @@
return this.field_239226_J_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/EntityRendererManager.java
+++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java
@@ -187,13 +187,15 @@
@@ -188,7 +188,10 @@
this.field_178637_m = new PlayerRenderer(this);
this.field_178636_l.put("default", this.field_178637_m);
this.field_178636_l.put("slim", new PlayerRenderer(this, true));
@@ -11,13 +11,7 @@
for(EntityType<?> entitytype : Registry.field_212629_r) {
if (entitytype != EntityType.field_200729_aH && !this.field_78729_o.containsKey(entitytype)) {
throw new IllegalStateException("No renderer registered for " + Registry.field_212629_r.func_177774_c(entitytype));
}
}
-
}
public <T extends Entity> EntityRenderer<? super T> func_78713_a(T p_78713_1_) {
@@ -449,4 +451,8 @@
@@ -450,4 +453,8 @@
public FontRenderer func_78716_a() {
return this.field_78736_p;
}
@@ -0,0 +1,54 @@
--- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
+++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
@@ -30,7 +30,7 @@
public void func_225628_a_(MatrixStack p_225628_1_, IRenderTypeBuffer p_225628_2_, int p_225628_3_, T p_225628_4_, float p_225628_5_, float p_225628_6_, float p_225628_7_, float p_225628_8_, float p_225628_9_, float p_225628_10_) {
ItemStack itemstack = p_225628_4_.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR) {
+ if (shouldRender(itemstack, p_225628_4_)) {
ResourceLocation resourcelocation;
if (p_225628_4_ instanceof AbstractClientPlayerEntity) {
AbstractClientPlayerEntity abstractclientplayerentity = (AbstractClientPlayerEntity)p_225628_4_;
@@ -39,10 +39,10 @@
} else if (abstractclientplayerentity.func_152122_n() && abstractclientplayerentity.func_110303_q() != null && abstractclientplayerentity.func_175148_a(PlayerModelPart.CAPE)) {
resourcelocation = abstractclientplayerentity.func_110303_q();
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
p_225628_1_.func_227860_a_();
@@ -54,4 +54,29 @@
p_225628_1_.func_227865_b_();
}
}
+
+ /**
+ * Determines if the ElytraLayer should render.
+ * ItemStack and Entity are provided for modder convenience,
+ * For example, using the same ElytraLayer for multiple custom Elytra.
+ *
+ * @param stack The Elytra ItemStack
+ * @param entity The entity being rendered.
+ * @return If the ElytraLayer should render.
+ */
+ public boolean shouldRender(ItemStack stack, T entity) {
+ return stack.func_77973_b() == Items.field_185160_cR;
+ }
+
+ /**
+ * Gets the texture to use with this ElytraLayer.
+ * This assumes the vanilla Elytra model.
+ *
+ * @param stack The Elytra ItemStack.
+ * @param entity The entity being rendered.
+ * @return The texture.
+ */
+ public ResourceLocation getElytraTexture(ItemStack stack, T entity) {
+ return field_188355_a;
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/model/ModelBakery.java
+++ b/net/minecraft/client/renderer/model/ModelBakery.java
@@ -146,8 +146,16 @@
@@ -146,8 +146,17 @@
});
public ModelBakery(IResourceManager p_i226056_1_, BlockColors p_i226056_2_, IProfiler p_i226056_3_, int p_i226056_4_) {
@@ -14,10 +14,11 @@
+ }
+
+ protected void processLoading(IProfiler p_i226056_3_, int p_i226056_4_) {
+ net.minecraftforge.client.model.ModelLoaderRegistry.onModelLoadingStart();
p_i226056_3_.func_76320_a("missing_model");
try {
@@ -180,12 +188,16 @@
@@ -180,12 +189,16 @@
p_i226056_3_.func_219895_b("special");
this.func_217843_a(new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
@@ -34,7 +35,7 @@
set.stream().filter((p_229346_0_) -> {
return !p_229346_0_.getSecond().equals(field_229321_r_);
}).forEach((p_229330_0_) -> {
@@ -224,6 +236,7 @@
@@ -224,6 +237,7 @@
try {
ibakedmodel = this.func_217845_a(p_229350_1_, ModelRotation.X0_Y0);
} catch (Exception exception) {
@@ -42,7 +43,7 @@
field_177603_c.warn("Unable to bake model: '{}': {}", p_229350_1_, exception);
}
@@ -442,6 +455,13 @@
@@ -442,6 +456,13 @@
this.field_217848_D.addAll(p_209593_2_.func_187965_e());
}
@@ -56,7 +57,7 @@
private void func_217843_a(ModelResourceLocation p_217843_1_) {
IUnbakedModel iunbakedmodel = this.func_209597_a(p_217843_1_);
this.field_217849_F.put(p_217843_1_, iunbakedmodel);
@@ -456,7 +476,13 @@
@@ -456,7 +477,13 @@
}
@Nullable
@@ -70,7 +71,7 @@
Triple<ResourceLocation, TransformationMatrix, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.func_225615_b_(), p_217845_2_.func_188049_c());
if (this.field_217850_G.containsKey(triple)) {
return this.field_217850_G.get(triple);
@@ -467,11 +493,11 @@
@@ -467,11 +494,11 @@
if (iunbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)iunbakedmodel;
if (blockmodel.func_178310_f() == field_177606_o) {
@@ -84,7 +85,7 @@
this.field_217850_G.put(triple, ibakedmodel);
return ibakedmodel;
}
@@ -524,6 +550,10 @@
@@ -524,6 +551,10 @@
return this.field_225367_M;
}
@@ -95,7 +96,7 @@
@OnlyIn(Dist.CLIENT)
static class BlockStateDefinitionException extends RuntimeException {
public BlockStateDefinitionException(String p_i49526_1_) {
@@ -531,6 +561,10 @@
@@ -531,6 +562,10 @@
}
}
@@ -0,0 +1,79 @@
--- a/net/minecraft/client/renderer/model/MultipartBakedModel.java
+++ b/net/minecraft/client/renderer/model/MultipartBakedModel.java
@@ -18,7 +18,7 @@
import org.apache.commons.lang3.tuple.Pair;
@OnlyIn(Dist.CLIENT)
-public class MultipartBakedModel implements IBakedModel {
+public class MultipartBakedModel implements net.minecraftforge.client.model.data.IDynamicBakedModel {
private final List<Pair<Predicate<BlockState>, IBakedModel>> field_188626_f;
protected final boolean field_188621_a;
protected final boolean field_188622_b;
@@ -27,10 +27,12 @@
protected final ItemCameraTransforms field_188624_d;
protected final ItemOverrideList field_188625_e;
private final Map<BlockState, BitSet> field_210277_g = new Object2ObjectOpenCustomHashMap<>(Util.func_212443_g());
+ private final IBakedModel defaultModel;
public MultipartBakedModel(List<Pair<Predicate<BlockState>, IBakedModel>> p_i48273_1_) {
this.field_188626_f = p_i48273_1_;
IBakedModel ibakedmodel = p_i48273_1_.iterator().next().getRight();
+ this.defaultModel = ibakedmodel;
this.field_188621_a = ibakedmodel.func_177555_b();
this.field_188622_b = ibakedmodel.func_177556_c();
this.field_230185_c_ = ibakedmodel.func_230044_c_();
@@ -39,7 +41,8 @@
this.field_188625_e = ibakedmodel.func_188617_f();
}
- public List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_) {
+ // FORGE: Implement our overloads (here and below) so child models can have custom logic
+ public List<BakedQuad> getQuads(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_, net.minecraftforge.client.model.data.IModelData modelData) {
if (p_200117_1_ == null) {
return Collections.emptyList();
} else {
@@ -62,7 +65,7 @@
for(int j = 0; j < bitset.length(); ++j) {
if (bitset.get(j)) {
- list.addAll(this.field_188626_f.get(j).getRight().func_200117_a(p_200117_1_, p_200117_2_, new Random(k)));
+ list.addAll(this.field_188626_f.get(j).getRight().getQuads(p_200117_1_, p_200117_2_, new Random(k), modelData));
}
}
@@ -74,6 +77,10 @@
return this.field_188621_a;
}
+ public boolean isAmbientOcclusion(BlockState state) {
+ return this.defaultModel.isAmbientOcclusion(state);
+ }
+
public boolean func_177556_c() {
return this.field_188622_b;
}
@@ -86,14 +93,24 @@
return false;
}
+ @Deprecated
public TextureAtlasSprite func_177554_e() {
return this.field_188623_c;
}
+ public TextureAtlasSprite getParticleTexture(net.minecraftforge.client.model.data.IModelData modelData) {
+ return this.defaultModel.getParticleTexture(modelData);
+ }
+
+ @Deprecated
public ItemCameraTransforms func_177552_f() {
return this.field_188624_d;
}
+ public IBakedModel handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType transformType, com.mojang.blaze3d.matrix.MatrixStack matrixStack) {
+ return this.defaultModel.handlePerspective(transformType, matrixStack);
+ }
+
public ItemOverrideList func_188617_f() {
return this.field_188625_e;
}
@@ -1,12 +1,53 @@
--- a/net/minecraft/client/renderer/model/WeightedBakedModel.java
+++ b/net/minecraft/client/renderer/model/WeightedBakedModel.java
@@ -31,6 +31,9 @@
@@ -12,7 +12,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public class WeightedBakedModel implements IBakedModel {
+public class WeightedBakedModel implements net.minecraftforge.client.model.data.IDynamicBakedModel {
private final int field_177567_a;
private final List<WeightedBakedModel.WeightedModel> field_177565_b;
private final IBakedModel field_177566_c;
@@ -23,14 +23,20 @@
this.field_177566_c = (p_i46073_1_.get(0)).field_185281_b;
}
- public List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_) {
- return (WeightedRandom.func_180166_a(this.field_177565_b, Math.abs((int)p_200117_3_.nextLong()) % this.field_177567_a)).field_185281_b.func_200117_a(p_200117_1_, p_200117_2_, p_200117_3_);
+ // FORGE: Implement our overloads (here and below) so child models can have custom logic
+ public List<BakedQuad> getQuads(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_, net.minecraftforge.client.model.data.IModelData modelData) {
+ return (WeightedRandom.func_180166_a(this.field_177565_b, Math.abs((int)p_200117_3_.nextLong()) % this.field_177567_a)).field_185281_b.getQuads(p_200117_1_, p_200117_2_, p_200117_3_, modelData);
}
public boolean func_177555_b() {
return this.field_177566_c.func_177555_b();
}
+ @Override
+ public boolean isAmbientOcclusion(BlockState state) { return this.field_177566_c.isAmbientOcclusion(state); }
+ public boolean isAmbientOcclusion(BlockState state) {
+ return this.field_177566_c.isAmbientOcclusion(state);
+ }
+
public boolean func_177556_c() {
return this.field_177566_c.func_177556_c();
}
@@ -47,10 +53,18 @@
return this.field_177566_c.func_177554_e();
}
+ public TextureAtlasSprite getParticleTexture(net.minecraftforge.client.model.data.IModelData modelData) {
+ return this.field_177566_c.getParticleTexture(modelData);
+ }
+
public ItemCameraTransforms func_177552_f() {
return this.field_177566_c.func_177552_f();
}
+ public IBakedModel handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType transformType, com.mojang.blaze3d.matrix.MatrixStack matrixStack) {
+ return this.field_177566_c.handlePerspective(transformType, matrixStack);
+ }
+
public ItemOverrideList func_188617_f() {
return this.field_177566_c.func_188617_f();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/TextureManager.java
+++ b/net/minecraft/client/renderer/texture/TextureManager.java
@@ -145,6 +145,7 @@
@@ -157,6 +157,7 @@
public void func_147645_c(ResourceLocation p_147645_1_) {
Texture texture = this.func_229267_b_(p_147645_1_);
if (texture != null) {
@@ -1,10 +1,10 @@
--- a/net/minecraft/client/resources/ClientLanguageMap.java
+++ b/net/minecraft/client/resources/ClientLanguageMap.java
@@ -116,4 +116,9 @@
return p_239500_1_;
}
@@ -78,4 +78,9 @@
public IReorderingProcessor func_241870_a(ITextProperties p_241870_1_) {
return BidiReorderer.func_243508_a(p_241870_1_, this.field_239496_d_);
}
+
+
+ @Override
+ public Map<String, String> getLanguageData() {
+ return field_239495_c_;
@@ -1,28 +0,0 @@
--- a/net/minecraft/client/resources/ClientResourcePackInfo.java
+++ b/net/minecraft/client/resources/ClientResourcePackInfo.java
@@ -24,13 +24,23 @@
@Nullable
private ResourceLocation field_195810_b;
+ @Deprecated
public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier<IResourcePack> p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_) {
- super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_);
+ this(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, false);
+ }
+
+ public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier<IResourcePack> p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_, boolean hidden) {
+ super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, hidden);
this.field_195809_a = func_239491_a_(p_i232485_4_);
}
+ @Deprecated
public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier<IResourcePack> p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_) {
- super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_);
+ this(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, p_i232486_10_, false);
+ }
+
+ public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier<IResourcePack> p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_, boolean hidden) {
+ super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, hidden);
this.field_195809_a = p_i232486_10_;
}
@@ -4,7 +4,7 @@
this.field_135037_b = p_i1303_2_;
this.field_135038_c = p_i1303_3_;
this.field_135036_d = p_i1303_4_;
+ String[] splitLangCode = field_135038_c.split("_", 2);
+ String[] splitLangCode = field_135039_a.split("_", 2);
+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores
+ this.javaLocale = new java.util.Locale(field_135039_a);
+ } else {
@@ -11,22 +11,25 @@
}
this.func_147607_a(9728);
@@ -127,7 +130,10 @@
@@ -127,7 +130,14 @@
GlStateManager.func_227727_h_(FramebufferConstants.field_227592_a_, this.field_147616_f);
GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227594_c_, 3553, this.field_147617_g, 0);
if (this.field_147619_e) {
+ if(!stencilEnabled)
GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227595_d_, 3553, this.field_147624_h, 0);
+ else
+ GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.field_147624_h, 0);
+ else if(net.minecraftforge.common.ForgeConfig.CLIENT.useCombinedDepthStencilAttachment.get()) {
+ GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.field_147624_h, 0);
+ } else {
+ GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.GL30.GL_DEPTH_ATTACHMENT, 3553, this.field_147624_h, 0);
+ GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.field_147624_h, 0);
+ }
}
this.func_147611_b();
@@ -280,4 +286,30 @@
GlStateManager.func_227658_a_(i, p_216493_1_);
@@ -281,6 +291,32 @@
this.func_147609_e();
}
+
+
+ /*================================ FORGE START ================================================*/
+ private boolean stencilEnabled = false;
@@ -52,4 +55,7 @@
+ return this.stencilEnabled;
+ }
+ /*================================ FORGE END ================================================*/
}
+
public int func_242996_f() {
return this.field_147617_g;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/shader/ShaderGroup.java
+++ b/net/minecraft/client/shader/ShaderGroup.java
@@ -157,7 +157,8 @@
@@ -164,7 +164,8 @@
throw new JSONException("Render target '" + s4 + "' can't be used as depth buffer");
}
@@ -10,7 +10,7 @@
this.field_216556_l = p_i50988_2_;
IResource iresource = null;
@@ -142,7 +143,8 @@
@@ -149,7 +150,8 @@
public static ShaderLoader func_216542_a(IResourceManager p_216542_0_, ShaderLoader.ShaderType p_216542_1_, String p_216542_2_) throws IOException {
ShaderLoader shaderloader = p_216542_1_.func_148064_d().get(p_216542_2_);
if (shaderloader == null) {
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/world/ClientWorld.java
+++ b/net/minecraft/client/world/ClientWorld.java
@@ -103,6 +103,8 @@
this.func_239136_a_(new BlockPos(8, 64, 8));
@@ -104,6 +104,8 @@
this.func_239136_a_(new BlockPos(8, 64, 8), 0.0F);
this.func_72966_v();
this.func_72947_a();
+ //this.gatherCapabilities(dimension.initCapabilities()); //TODO
+ this.gatherCapabilities();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this));
}
public DimensionRenderInfo func_239132_a_() {
@@ -185,6 +187,7 @@
@@ -186,6 +188,7 @@
this.func_217381_Z().func_194340_a(() -> {
return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString();
});
@@ -17,7 +17,7 @@
p_217418_1_.func_70071_h_();
this.func_217381_Z().func_76319_b();
}
@@ -284,9 +287,11 @@
@@ -285,9 +288,11 @@
}
private void func_217424_b(int p_217424_1_, Entity p_217424_2_) {
@@ -29,15 +29,16 @@
}
public void func_217413_d(int p_217413_1_) {
@@ -305,6 +310,7 @@
@@ -306,6 +311,8 @@
}
this.field_217431_w.remove(p_217414_1_);
+ p_217414_1_.onRemovedFromWorld();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityLeaveWorldEvent(p_217414_1_, this));
}
public void func_217417_b(Chunk p_217417_1_) {
@@ -447,6 +453,11 @@
@@ -448,6 +455,11 @@
}
public void func_184148_a(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) {
@@ -49,7 +50,7 @@
if (p_184148_1_ == this.field_73037_M.field_71439_g) {
this.func_184134_a(p_184148_2_, p_184148_4_, p_184148_6_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_, false);
}
@@ -454,6 +465,11 @@
@@ -455,6 +467,11 @@
}
public void func_217384_a(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) {
@@ -1,6 +1,14 @@
--- a/net/minecraft/command/Commands.java
+++ b/net/minecraft/command/Commands.java
@@ -202,6 +202,14 @@
@@ -186,6 +186,7 @@
if (p_i232148_1_.field_237219_d_) {
PublishCommand.func_198581_a(this.field_197062_b);
}
+ net.minecraftforge.event.ForgeEventFactory.onCommandRegister(this.field_197062_b, p_i232148_1_);
this.field_197062_b.findAmbiguities((p_201302_1_, p_201302_2_, p_201302_3_, p_201302_4_) -> {
field_197061_a.warn("Ambiguity between arguments {} and {} with inputs: {}", this.field_197062_b.getPath(p_201302_2_), this.field_197062_b.getPath(p_201302_3_), p_201302_4_);
@@ -205,6 +206,14 @@
try {
try {
@@ -1,15 +1,15 @@
--- a/net/minecraft/command/arguments/BlockStateParser.java
+++ b/net/minecraft/command/arguments/BlockStateParser.java
@@ -170,7 +170,7 @@
@@ -169,7 +169,7 @@
private boolean func_212598_k(TagCollection<Block> p_212598_1_) {
private boolean func_212598_k(ITagCollection<Block> p_212598_1_) {
if (this.field_197270_l != null) {
- return this.field_197270_l.func_177230_c().func_235695_q_();
+ return this.field_197270_l.hasTileEntity();
} else {
if (this.field_199833_p != null) {
ITag<Block> itag = p_212598_1_.func_199910_a(this.field_199833_p);
@@ -293,7 +293,7 @@
@@ -283,7 +283,7 @@
p_197255_1_.suggest(String.valueOf('['));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/command/impl/LocateCommand.java
+++ b/net/minecraft/command/impl/LocateCommand.java
@@ -25,12 +25,19 @@
@@ -25,11 +25,18 @@
return p_198533_0_.func_197034_c(2);
});
@@ -10,13 +10,12 @@
return func_241053_a_(p_241056_1_.getSource(), entry.getValue());
}));
}
+ else {
+ for (Structure<?> structureFeature : net.minecraftforge.registries.ForgeRegistries.STRUCTURE_FEATURES) {
+ String name = structureFeature.getRegistryName().toString().replace("minecraft:", "");
+ literalargumentbuilder = literalargumentbuilder.then(Commands.func_197057_a(name))
+ .executes(ctx -> func_241053_a_(ctx.getSource(), structureFeature));
+ }
+
+ literalargumentbuilder = literalargumentbuilder.then(Commands.func_197057_a(name)
+ .executes(ctx -> func_241053_a_(ctx.getSource(), structureFeature)));
+ }}
p_198528_0_.register(literalargumentbuilder);
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/data/BlockModelDefinition.java
+++ b/net/minecraft/data/BlockModelDefinition.java
@@ -8,6 +8,8 @@
import java.util.Map;
import java.util.function.Supplier;
+import net.minecraft.data.BlockModeInfo.Field;
+
public class BlockModelDefinition implements Supplier<JsonElement> {
private final Map<BlockModeInfo<?>, BlockModeInfo<?>.Field> field_240193_a_ = Maps.newLinkedHashMap();
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/loot/EntityLootTables.java
+++ b/net/minecraft/data/loot/EntityLootTables.java
@@ -51,7 +51,7 @@
@@ -50,7 +50,7 @@
return LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(p_218583_0_))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(TableLootEntry.func_216171_a(EntityType.field_200737_ac.func_220348_g())));
}
@@ -9,48 +9,36 @@
this.func_218582_a(EntityType.field_200789_c, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_200791_e, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_226289_e_, LootTable.func_216119_b());
@@ -141,8 +141,12 @@
this.func_218582_a(EntityType.field_233588_G_, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151147_al).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(2.0F, 4.0F))).func_212841_b_(Smelt.func_215953_b().func_212840_b_(EntityHasProperty.func_215999_a(LootContext.EntityTarget.THIS, field_218586_a))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151116_aA).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 1.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))));
@@ -141,11 +141,15 @@
this.func_218582_a(EntityType.field_233591_ai_, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_242287_aj, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_200727_aF, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151078_bh).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 2.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151042_j)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151172_bF)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151174_bG)).func_212840_b_(KilledByPlayer.func_215994_b()).func_212840_b_(RandomChanceWithLooting.func_216003_a(0.025F, 0.01F))));
+ }
+
+ public void accept(BiConsumer<ResourceLocation, LootTable.Builder> p_accept_1_) {
+ this.addTables();
Set<ResourceLocation> set = Sets.newHashSet();
- Iterator iterator = Registry.field_212629_r.iterator();
+ Iterator iterator = getKnownEntities().iterator();
EntityType<?> entitytype;
ResourceLocation resourcelocation;
@@ -154,7 +158,7 @@
entitytype = (EntityType)iterator.next();
resourcelocation = entitytype.func_220348_g();
- for(EntityType<?> entitytype : Registry.field_212629_r) {
+ for(EntityType<?> entitytype : getKnownEntities()) {
ResourceLocation resourcelocation = entitytype.func_220348_g();
- if (!field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC) {
+ if (isNonLiving(entitytype)) {
if (resourcelocation != LootTables.field_186419_a && this.field_218587_b.remove(resourcelocation) != null) {
break;
throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.field_212629_r.func_177774_c(entitytype)));
}
@@ -171,11 +175,19 @@
throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.field_212629_r.func_177774_c(entitytype)));
@@ -162,6 +166,14 @@
this.field_218587_b.forEach(p_accept_1_::accept);
}
- protected void func_218582_a(EntityType<?> p_218582_1_, LootTable.Builder p_218582_2_) {
+ protected Iterable<EntityType<?>> getKnownEntities() {
+ return Registry.field_212629_r;
+ }
+
+ protected boolean isNonLiving(EntityType<?> entitytype) {
+ return !field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC;
+ return !field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC;
+ }
+
+ private void func_218582_a(EntityType<?> p_218582_1_, LootTable.Builder p_218582_2_) {
protected void func_218582_a(EntityType<?> p_218582_1_, LootTable.Builder p_218582_2_) {
this.func_218585_a(p_218582_1_.func_220348_g(), p_218582_2_);
}
- protected void func_218585_a(ResourceLocation p_218585_1_, LootTable.Builder p_218585_2_) {
+ private void func_218585_a(ResourceLocation p_218585_1_, LootTable.Builder p_218585_2_) {
this.field_218587_b.put(p_218585_1_, p_218585_2_);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/dispenser/IDispenseItemBehavior.java
+++ b/net/minecraft/dispenser/IDispenseItemBehavior.java
@@ -371,8 +371,9 @@
@@ -373,8 +373,9 @@
world.func_175656_a(blockpos, AbstractFireBlock.func_235326_a_(world, blockpos));
} else if (CampfireBlock.func_241470_h_(blockstate)) {
world.func_175656_a(blockpos, blockstate.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)));
@@ -23,7 +23,7 @@
for(Enchantment enchantment : Registry.field_212628_q) {
- if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.field_77351_y.func_77557_a(item) || flag)) {
+ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag || enchantment.isAllowedOnBooks()))) {
+ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
list.add(new EnchantmentData(enchantment, i));
@@ -9,7 +9,7 @@
BlockState blockstate2 = p_185266_1_.func_180495_p(blockpos);
- if (blockstate2.func_185904_a() == Material.field_151586_h && blockstate2.func_177229_b(FlowingFluidBlock.field_176367_b) == 0 && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a())) {
+ boolean isFull = blockstate2.func_177230_c() == Blocks.field_150355_j && blockstate2.func_177229_b(FlowingFluidBlock.field_176367_b) == 0; //TODO: Forge, modded waters?
+ if (blockstate2.func_185904_a() == Material.field_151586_h && isFull && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, new net.minecraftforge.common.util.BlockSnapshot(p_185266_1_, blockpos, blockstate2), net.minecraft.util.Direction.UP)) {
+ if (blockstate2.func_185904_a() == Material.field_151586_h && isFull && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, net.minecraftforge.common.util.BlockSnapshot.create(p_185266_1_.func_234923_W_(), p_185266_1_, blockpos), net.minecraft.util.Direction.UP)) {
p_185266_1_.func_175656_a(blockpos, blockstate);
p_185266_1_.func_205220_G_().func_205360_a(blockpos, Blocks.field_185778_de, MathHelper.func_76136_a(p_185266_0_.func_70681_au(), 60, 120));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/Entity.java
+++ b/net/minecraft/entity/Entity.java
@@ -107,12 +107,13 @@
@@ -109,12 +109,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -15,7 +15,7 @@
private final EntityType<?> field_200606_g;
private int field_145783_c = field_213331_b.incrementAndGet();
public boolean field_70156_m;
@@ -138,6 +139,7 @@
@@ -140,6 +141,7 @@
public boolean field_70124_G;
public boolean field_70133_I;
protected Vector3d field_213328_B = Vector3d.field_186680_a;
@@ -23,7 +23,7 @@
public boolean field_70128_L;
public float field_70141_P;
public float field_70140_Q;
@@ -198,6 +200,7 @@
@@ -195,6 +197,7 @@
private float field_213326_aJ;
public Entity(EntityType<?> p_i48580_1_, World p_i48580_2_) {
@@ -31,7 +31,7 @@
this.field_200606_g = p_i48580_1_;
this.field_70170_p = p_i48580_2_;
this.field_213325_aI = p_i48580_1_.func_220334_j();
@@ -213,7 +216,9 @@
@@ -211,7 +214,9 @@
this.field_70180_af.func_187214_a(field_189655_aD, false);
this.field_70180_af.func_187214_a(field_213330_X, Pose.STANDING);
this.func_70088_a();
@@ -42,7 +42,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -305,7 +310,13 @@
@@ -317,7 +322,13 @@
}
public void func_70106_y() {
@@ -58,13 +58,13 @@
public void func_213301_b(Pose p_213301_1_) {
@@ -330,6 +341,7 @@
public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
this.func_226288_n_(p_70107_1_, p_70107_3_, p_70107_5_);
public boolean func_233562_a_(Entity p_233562_1_, double p_233562_2_) {
double d0 = p_233562_1_.field_233557_ao_.field_72450_a - this.field_233557_ao_.field_72450_a;
+ if (this.isAddedToWorld() && !this.field_70170_p.field_72995_K && field_70170_p instanceof ServerWorld) ((ServerWorld)this.field_70170_p).func_217464_b(this); // Forge - Process chunk registration after moving.
float f = this.field_213325_aI.field_220315_a / 2.0F;
float f1 = this.field_213325_aI.field_220316_b;
this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f));
@@ -542,7 +554,7 @@
double d1 = p_233562_1_.field_233557_ao_.field_72448_b - this.field_233557_ao_.field_72448_b;
double d2 = p_233562_1_.field_233557_ao_.field_72449_c - this.field_233557_ao_.field_72449_c;
return d0 * d0 + d1 * d1 + d2 * d2 < p_233562_2_ * p_233562_2_;
@@ -560,7 +572,7 @@
this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vector3d)) * 0.6D);
this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2) * 0.6D);
@@ -73,7 +73,7 @@
this.field_70150_b = this.func_203009_ad();
if (this.func_70090_H()) {
Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this;
@@ -557,7 +569,7 @@
@@ -575,7 +587,7 @@
} else {
this.func_180429_a(blockpos, blockstate);
}
@@ -82,7 +82,7 @@
this.field_191959_ay = this.func_191954_d(this.field_82151_R);
}
}
@@ -574,8 +586,9 @@
@@ -591,8 +603,9 @@
float f2 = this.func_225515_ai_();
this.func_213317_d(this.func_213322_ci().func_216372_d((double)f2, 1.0D, (double)f2));
@@ -94,7 +94,7 @@
}) && this.field_190534_ay <= 0) {
this.func_241209_g_(-this.func_190531_bD());
}
@@ -594,11 +607,10 @@
@@ -611,11 +624,10 @@
int j = MathHelper.func_76128_c(this.field_233557_ao_.field_72448_b - (double)0.2F);
int k = MathHelper.func_76128_c(this.field_233557_ao_.field_72449_c);
BlockPos blockpos = new BlockPos(i, j, k);
@@ -108,7 +108,7 @@
return blockpos1;
}
}
@@ -784,6 +796,7 @@
@@ -801,6 +813,7 @@
public void func_174829_m() {
AxisAlignedBB axisalignedbb = this.func_174813_aQ();
this.func_226288_n_((axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D, axisalignedbb.field_72338_b, (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D);
@@ -116,7 +116,7 @@
}
protected SoundEvent func_184184_Z() {
@@ -832,7 +845,7 @@
@@ -849,7 +862,7 @@
protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) {
if (!p_180429_2_.func_185904_a().func_76224_d()) {
BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a());
@@ -125,7 +125,7 @@
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -1048,9 +1061,10 @@
@@ -1056,9 +1069,10 @@
int k = MathHelper.func_76128_c(this.func_226281_cx_());
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -137,7 +137,7 @@
}
}
@@ -1356,6 +1370,7 @@
@@ -1377,6 +1391,7 @@
if (this.field_184238_ar) {
p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
}
@@ -145,7 +145,7 @@
if (!this.field_184236_aF.isEmpty()) {
ListNBT listnbt = new ListNBT();
@@ -1367,6 +1382,10 @@
@@ -1388,6 +1403,10 @@
p_189511_1_.func_218657_a("Tags", listnbt);
}
@@ -156,7 +156,7 @@
this.func_213281_b(p_189511_1_);
if (this.func_184207_aI()) {
ListNBT listnbt1 = new ListNBT();
@@ -1437,6 +1456,9 @@
@@ -1458,6 +1477,9 @@
this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
@@ -166,7 +166,7 @@
if (p_70020_1_.func_150297_b("Tags", 9)) {
this.field_184236_aF.clear();
ListNBT listnbt3 = p_70020_1_.func_150295_c("Tags", 8);
@@ -1525,6 +1547,8 @@
@@ -1546,6 +1568,8 @@
} else {
ItemEntity itementity = new ItemEntity(this.field_70170_p, this.func_226277_ct_(), this.func_226278_cu_() + (double)p_70099_2_, this.func_226281_cx_(), p_70099_1_);
itementity.func_174869_p();
@@ -175,7 +175,7 @@
this.field_70170_p.func_217376_c(itementity);
return itementity;
}
@@ -1558,6 +1582,7 @@
@@ -1582,6 +1606,7 @@
public void func_70098_U() {
this.func_213317_d(Vector3d.field_186680_a);
@@ -183,7 +183,7 @@
this.func_70071_h_();
if (this.func_184218_aH()) {
this.func_184187_bx().func_184232_k(this);
@@ -1603,6 +1628,7 @@
@@ -1627,6 +1652,7 @@
}
}
@@ -191,7 +191,7 @@
if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
if (this.func_184218_aH()) {
this.func_184210_p();
@@ -1635,6 +1661,7 @@
@@ -1659,6 +1685,7 @@
public void func_233575_bb_() {
if (this.field_184239_as != null) {
Entity entity = this.field_184239_as;
@@ -199,7 +199,7 @@
this.field_184239_as = null;
entity.func_184225_p(this);
}
@@ -1799,6 +1826,7 @@
@@ -1816,6 +1843,7 @@
return !this.func_184188_bt().isEmpty();
}
@@ -207,7 +207,7 @@
public boolean func_205710_ba() {
return true;
}
@@ -2015,7 +2043,7 @@
@@ -2032,7 +2060,7 @@
}
protected ITextComponent func_225513_by_() {
@@ -216,20 +216,48 @@
}
public boolean func_70028_i(Entity p_70028_1_) {
@@ -2159,10 +2187,12 @@
}
@@ -2087,6 +2115,10 @@
public Vector3d func_181014_aG() {
+ if (this.field_181017_ao == null) return Vector3d.field_186680_a;
return this.field_181017_ao;
}
@Nullable
public Entity func_241206_a_(ServerWorld p_241206_1_) {
+ return this.changeDimension(p_241206_1_, p_241206_1_.func_85176_s());
+ }
+ @Nullable
+ public Entity changeDimension(ServerWorld p_241206_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
if (this.field_70170_p instanceof ServerWorld && !this.field_70128_L) {
this.field_70170_p.func_217381_Z().func_76320_a("changeDimension");
this.func_213319_R();
@@ -2095,6 +2127,7 @@
if (portalinfo == null) {
return null;
} else {
+ Entity transportedEntity = teleporter.placeEntity(this, (ServerWorld) this.field_70170_p, p_241206_1_, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic
this.field_70170_p.func_217381_Z().func_219895_b("reloading");
Entity entity = this.func_200600_R().func_200721_a(p_241206_1_);
if (entity != null) {
@@ -2102,17 +2135,19 @@
entity.func_70012_b(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c, portalinfo.field_242960_c, entity.field_70125_A);
entity.func_213317_d(portalinfo.field_222506_b);
p_241206_1_.func_217460_e(entity);
- if (p_241206_1_.func_234923_W_() == World.field_234920_i_) {
+ if (spawnPortal && p_241206_1_.func_234923_W_() == World.field_234920_i_) {
ServerWorld.func_241121_a_(p_241206_1_);
}
}
+ return entity;
+ }); //Forge: End vanilla logic
public Direction func_181012_aH() {
+ if (this.field_181018_ap == null) return Direction.NORTH;
return this.field_181018_ap;
}
@@ -2295,7 +2325,7 @@
this.func_241204_bJ_();
this.field_70170_p.func_217381_Z().func_76319_b();
((ServerWorld)this.field_70170_p).func_82742_i();
p_241206_1_.func_82742_i();
this.field_70170_p.func_217381_Z().func_76319_b();
- return entity;
+ return transportedEntity;
}
} else {
return null;
@@ -2322,7 +2357,7 @@
Pose pose = this.func_213283_Z();
EntitySize entitysize1 = this.func_213305_a(pose);
this.field_213325_aI = entitysize1;
@@ -238,7 +266,7 @@
if (entitysize1.field_220315_a < entitysize.field_220315_a) {
double d0 = (double)entitysize1.field_220315_a / 2.0D;
this.func_174826_a(new AxisAlignedBB(this.func_226277_ct_() - d0, this.func_226278_cu_(), this.func_226281_cx_() - d0, this.func_226277_ct_() + d0, this.func_226278_cu_() + (double)entitysize1.field_220316_b, this.func_226281_cx_() + d0));
@@ -2769,6 +2799,7 @@
@@ -2796,6 +2831,7 @@
this.field_233555_aA_ = true;
}
@@ -246,7 +274,7 @@
}
@@ -2779,4 +2810,69 @@
@@ -2811,4 +2847,69 @@
public interface IMoveCallback {
void accept(Entity p_accept_1_, double p_accept_2_, double p_accept_4_, double p_accept_6_);
}
@@ -1,10 +1,19 @@
--- a/net/minecraft/entity/EntityClassification.java
+++ b/net/minecraft/entity/EntityClassification.java
@@ -6,7 +6,7 @@
import java.util.stream.Collectors;
import net.minecraft.util.IStringSerializable;
-public enum EntityClassification implements IStringSerializable {
+public enum EntityClassification implements IStringSerializable, net.minecraftforge.common.IExtensibleEnum {
MONSTER("monster", 70, false, false, 128),
CREATURE("creature", 10, true, true, 128),
AMBIENT("ambient", 15, true, false, 128),
@@ -57,6 +57,10 @@
return this.field_82707_i;
}
+ public static EntityClassification create(String name, String p_i50381_3_, int p_i50381_4_, boolean p_i50381_5_, boolean p_i50381_6_) {
+ public static EntityClassification create(String name, String id, int maxNumberOfCreatureIn, boolean isPeacefulCreatureIn, boolean isAnimalIn, int despawnDistance) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
@@ -1,7 +1,7 @@
--- a/net/minecraft/entity/EntitySpawnPlacementRegistry.java
+++ b/net/minecraft/entity/EntitySpawnPlacementRegistry.java
@@ -147,10 +147,26 @@
boolean test(EntityType<T> p_test_1_, IWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_);
boolean test(EntityType<T> p_test_1_, IServerWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_);
}
- public static enum PlacementType {
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/EntityType.java
+++ b/net/minecraft/entity/EntityType.java
@@ -141,7 +141,7 @@
@@ -143,7 +143,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,7 +9,7 @@
private static final Logger field_200731_aJ = LogManager.getLogger();
public static final EntityType<AreaEffectCloudEntity> field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.<AreaEffectCloudEntity>func_220322_a(AreaEffectCloudEntity::new, EntityClassification.MISC).func_220320_c().func_220321_a(6.0F, 0.5F).func_233606_a_(10).func_233608_b_(Integer.MAX_VALUE));
public static final EntityType<ArmorStandEntity> field_200789_c = func_200712_a("armor_stand", EntityType.Builder.<ArmorStandEntity>func_220322_a(ArmorStandEntity::new, EntityClassification.MISC).func_220321_a(0.5F, 1.975F).func_233606_a_(10));
@@ -267,6 +267,12 @@
@@ -270,6 +270,12 @@
private ResourceLocation field_220358_bg;
private final EntitySize field_220359_bi;
@@ -22,7 +22,7 @@
private static <T extends Entity> EntityType<T> func_200712_a(String p_200712_0_, EntityType.Builder<T> p_200712_1_) {
return Registry.func_218325_a(Registry.field_212629_r, p_200712_0_, p_200712_1_.func_206830_a(p_200712_0_));
}
@@ -280,6 +286,9 @@
@@ -283,6 +289,9 @@
}
public EntityType(EntityType.IFactory<T> p_i231489_1_, EntityClassification p_i231489_2_, boolean p_i231489_3_, boolean p_i231489_4_, boolean p_i231489_5_, boolean p_i231489_6_, ImmutableSet<Block> p_i231489_7_, EntitySize p_i231489_8_, int p_i231489_9_, int p_i231489_10_) {
@@ -32,7 +32,7 @@
this.field_200732_aK = p_i231489_1_;
this.field_220355_ba = p_i231489_2_;
this.field_225438_be = p_i231489_6_;
@@ -290,6 +299,10 @@
@@ -293,6 +302,10 @@
this.field_220359_bi = p_i231489_8_;
this.field_233594_bl_ = p_i231489_9_;
this.field_233595_bm_ = p_i231489_10_;
@@ -43,15 +43,15 @@
}
@Nullable
@@ -300,6 +313,7 @@
@Nullable
public T func_220342_a(World p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_) {
@@ -304,6 +317,7 @@
public T func_220342_a(ServerWorld p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_) {
T t = this.func_220349_b(p_220342_1_, p_220342_2_, p_220342_3_, p_220342_4_, p_220342_5_, p_220342_6_, p_220342_7_, p_220342_8_);
+ if (t instanceof net.minecraft.entity.MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((net.minecraft.entity.MobEntity) t, p_220342_1_, p_220342_5_.func_177958_n(), p_220342_5_.func_177956_o(), p_220342_5_.func_177952_p(), null, p_220342_6_)) return null;
p_220342_1_.func_217376_c(t);
return t;
}
@@ -498,14 +512,23 @@
if (t != null) {
+ if (t instanceof net.minecraft.entity.MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((net.minecraft.entity.MobEntity) t, p_220342_1_, p_220342_5_.func_177958_n(), p_220342_5_.func_177956_o(), p_220342_5_.func_177952_p(), null, p_220342_6_)) return null;
p_220342_1_.func_242417_l(t);
}
@@ -504,14 +518,23 @@
}
public int func_233602_m_() {
@@ -75,7 +75,7 @@
return this != field_200729_aH && this != field_200770_J && this != field_200760_az && this != field_200791_e && this != field_200766_F && this != field_200768_H && this != field_200782_V && this != field_200801_o && this != field_200805_s;
}
@@ -513,6 +536,19 @@
@@ -519,6 +542,19 @@
return p_220341_1_.func_230235_a_(this);
}
@@ -95,7 +95,7 @@
public static class Builder<T extends Entity> {
private final EntityType.IFactory<T> field_200709_a;
private final EntityClassification field_220324_b;
@@ -525,6 +561,11 @@
@@ -531,6 +567,11 @@
private int field_233605_i_ = 3;
private EntitySize field_220326_f = EntitySize.func_220314_b(0.6F, 1.8F);
@@ -107,7 +107,7 @@
private Builder(EntityType.IFactory<T> p_i50479_1_, EntityClassification p_i50479_2_) {
this.field_200709_a = p_i50479_1_;
this.field_220324_b = p_i50479_2_;
@@ -581,12 +622,36 @@
@@ -587,12 +628,36 @@
return this;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/LivingEntity.java
+++ b/net/minecraft/entity/LivingEntity.java
@@ -116,7 +116,9 @@
@@ -117,7 +117,9 @@
public abstract class LivingEntity extends Entity {
private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
private static final UUID field_233625_c_ = UUID.fromString("87f46a96-686f-4796-b035-22e16ee9e038");
@@ -10,7 +10,7 @@
protected static final DataParameter<Byte> field_184621_as = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187191_a);
private static final DataParameter<Float> field_184632_c = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187193_c);
private static final DataParameter<Integer> field_184633_f = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187192_b);
@@ -244,7 +246,7 @@
@@ -245,7 +247,7 @@
}
public static AttributeModifierMap.MutableAttribute func_233639_cI_() {
@@ -19,7 +19,7 @@
}
protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, BlockState p_184231_4_, BlockPos p_184231_5_) {
@@ -259,9 +261,10 @@
@@ -260,9 +262,10 @@
if (!this.field_70170_p.field_72995_K && this.field_70143_R > 3.0F && p_184231_3_) {
float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F);
@@ -31,7 +31,7 @@
((ServerWorld)this.field_70170_p).func_195598_a(new BlockParticleData(ParticleTypes.field_197611_d, p_184231_4_), this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), i, 0.0D, 0.0D, 0.0D, (double)0.15F);
}
}
@@ -329,7 +332,7 @@
@@ -330,7 +333,7 @@
}
}
@@ -40,7 +40,7 @@
this.func_184210_p();
}
} else if (this.func_70086_ai() < this.func_205010_bg()) {
@@ -474,7 +477,7 @@
@@ -475,7 +478,7 @@
protected void func_70609_aI() {
++this.field_70725_aQ;
if (this.field_70725_aQ == 20) {
@@ -49,7 +49,7 @@
for(int i = 0; i < 20; ++i) {
double d0 = this.field_70146_Z.nextGaussian() * 0.02D;
@@ -667,7 +670,7 @@
@@ -668,7 +671,7 @@
if (!effectinstance.func_76455_a(this, () -> {
this.func_70695_b(effectinstance, true);
})) {
@@ -58,7 +58,7 @@
iterator.remove();
this.func_70688_c(effectinstance);
}
@@ -716,8 +719,10 @@
@@ -717,8 +720,10 @@
this.func_82142_c(false);
} else {
Collection<EffectInstance> collection = this.field_70713_bf.values();
@@ -71,7 +71,7 @@
this.func_82142_c(this.func_70644_a(Effects.field_76441_p));
}
@@ -781,7 +786,9 @@
@@ -782,7 +787,9 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
@@ -82,7 +82,7 @@
iterator.remove();
}
@@ -811,6 +818,7 @@
@@ -812,6 +819,7 @@
return false;
} else {
EffectInstance effectinstance = this.field_70713_bf.get(p_195064_1_.func_188419_a());
@@ -90,7 +90,7 @@
if (effectinstance == null) {
this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_);
this.func_70670_a(p_195064_1_);
@@ -825,6 +833,9 @@
@@ -826,6 +834,9 @@
}
public boolean func_70687_e(EffectInstance p_70687_1_) {
@@ -100,7 +100,7 @@
if (this.func_70668_bt() == CreatureAttribute.field_223223_b_) {
Effect effect = p_70687_1_.func_188419_a();
if (effect == Effects.field_76428_l || effect == Effects.field_76436_u) {
@@ -858,6 +869,7 @@
@@ -859,6 +870,7 @@
}
public boolean func_195063_d(Effect p_195063_1_) {
@@ -108,7 +108,7 @@
EffectInstance effectinstance = this.func_184596_c(p_195063_1_);
if (effectinstance != null) {
this.func_70688_c(effectinstance);
@@ -894,6 +906,8 @@
@@ -895,6 +907,8 @@
}
public void func_70691_i(float p_70691_1_) {
@@ -117,7 +117,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -914,6 +928,7 @@
@@ -915,6 +929,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -125,7 +125,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -980,8 +995,8 @@
@@ -981,8 +996,8 @@
if (entity1 instanceof PlayerEntity) {
this.field_70718_bc = 100;
this.field_70717_bb = (PlayerEntity)entity1;
@@ -136,7 +136,7 @@
if (wolfentity.func_70909_n()) {
this.field_70718_bc = 100;
LivingEntity livingentity = wolfentity.func_70902_q();
@@ -1163,6 +1178,7 @@
@@ -1165,6 +1180,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -144,7 +144,7 @@
if (!this.field_70128_L && !this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
LivingEntity livingentity = this.func_94060_bK();
@@ -1194,10 +1210,10 @@
@@ -1196,10 +1212,10 @@
if (!this.field_70170_p.field_72995_K) {
boolean flag = false;
if (p_226298_1_ instanceof WitherEntity) {
@@ -157,7 +157,7 @@
this.field_70170_p.func_180501_a(blockpos, blockstate, 3);
flag = true;
}
@@ -1214,13 +1230,10 @@
@@ -1216,13 +1232,10 @@
protected void func_213345_d(DamageSource p_213345_1_) {
Entity entity = p_213345_1_.func_76346_g();
@@ -174,7 +174,7 @@
boolean flag = this.field_70718_bc > 0;
if (this.func_230282_cS_() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e)) {
this.func_213354_a(p_213345_1_, flag);
@@ -1229,6 +1242,10 @@
@@ -1231,6 +1244,10 @@
this.func_213337_cE();
this.func_226294_cV_();
@@ -185,7 +185,7 @@
}
protected void func_213337_cE() {
@@ -1238,6 +1255,7 @@
@@ -1240,6 +1257,7 @@
if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e))) {
int i = this.func_70693_a(this.field_70717_bb);
@@ -193,7 +193,7 @@
while(i > 0) {
int j = ExperienceOrbEntity.func_70527_a(i);
i -= j;
@@ -1258,7 +1276,8 @@
@@ -1260,7 +1278,8 @@
ResourceLocation resourcelocation = this.func_213346_cF();
LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(resourcelocation);
LootContext.Builder lootcontext$builder = this.func_213363_a(p_213354_2_, p_213354_1_);
@@ -203,12 +203,11 @@
}
protected LootContext.Builder func_213363_a(boolean p_213363_1_, DamageSource p_213363_2_) {
@@ -1271,6 +1290,12 @@
@@ -1273,6 +1292,11 @@
}
public void func_233627_a_(float p_233627_1_, double p_233627_2_, double p_233627_4_) {
+ //TODO, Vanilla removed the attacker entity from this method, 1.15-mcp: knockBack
+ net.minecraftforge.event.entity.living.LivingKnockBackEvent event = net.minecraftforge.common.ForgeHooks.onLivingKnockBack(this, null, p_233627_1_, p_233627_2_, p_233627_4_);
+ net.minecraftforge.event.entity.living.LivingKnockBackEvent event = net.minecraftforge.common.ForgeHooks.onLivingKnockBack(this, p_233627_1_, p_233627_2_, p_233627_4_);
+ if(event.isCanceled()) return;
+ p_233627_1_ = event.getStrength();
+ p_233627_2_ = event.getRatioX();
@@ -216,7 +215,7 @@
p_233627_1_ = (float)((double)p_233627_1_ * (1.0D - this.func_233637_b_(Attributes.field_233820_c_)));
if (!(p_233627_1_ <= 0.0F)) {
this.field_70160_al = true;
@@ -1320,16 +1345,7 @@
@@ -1322,16 +1346,7 @@
} else {
BlockPos blockpos = this.func_233580_cy_();
BlockState blockstate = this.func_213339_cH();
@@ -234,7 +233,7 @@
}
}
@@ -1353,6 +1369,11 @@
@@ -1355,6 +1370,11 @@
}
public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) {
@@ -246,7 +245,7 @@
boolean flag = super.func_225503_b_(p_225503_1_, p_225503_2_);
int i = this.func_225508_e_(p_225503_1_, p_225503_2_);
if (i > 0) {
@@ -1376,9 +1397,10 @@
@@ -1378,9 +1398,10 @@
int i = MathHelper.func_76128_c(this.func_226277_ct_());
int j = MathHelper.func_76128_c(this.func_226278_cu_() - (double)0.2F);
int k = MathHelper.func_76128_c(this.func_226281_cx_());
@@ -260,7 +259,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
@@ -1446,6 +1468,8 @@
@@ -1448,6 +1469,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -269,7 +268,7 @@
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f2 = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F);
@@ -1455,10 +1479,11 @@
@@ -1457,10 +1480,11 @@
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f * 10.0F));
}
@@ -282,7 +281,7 @@
this.func_110149_m(this.func_110139_bj() - f2);
}
}
@@ -1512,6 +1537,8 @@
@@ -1514,6 +1538,8 @@
}
public void func_226292_a_(Hand p_226292_1_, boolean p_226292_2_) {
@@ -291,7 +290,7 @@
if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
this.field_110158_av = -1;
this.field_82175_bq = true;
@@ -1846,15 +1873,16 @@
@@ -1848,15 +1874,16 @@
}
this.field_70160_al = true;
@@ -301,7 +300,7 @@
@OnlyIn(Dist.CLIENT)
protected void func_203010_cG() {
- this.func_213317_d(this.func_213322_ci().func_72441_c(0.0D, (double)-0.04F, 0.0D));
+ this.func_213317_d(this.func_213322_ci().func_72441_c(0.0D, (double)0.04F * this.func_110148_a(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).func_111126_e(), 0.0D));
+ this.func_213317_d(this.func_213322_ci().func_72441_c(0.0D, (double)-0.04F * this.func_110148_a(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).func_111126_e(), 0.0D));
}
protected void func_180466_bG(ITag<Fluid> p_180466_1_) {
@@ -310,11 +309,11 @@
}
protected float func_189749_co() {
@@ -1868,16 +1896,20 @@
@@ -1870,11 +1897,15 @@
public void func_213352_e(Vector3d p_213352_1_) {
if (this.func_70613_aW() || this.func_184186_bw()) {
double d0 = 0.08D;
+ ModifiableAttributeInstance gravity = this.func_110148_a(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get());
+ ModifiableAttributeInstance gravity = this.func_110148_a(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get());
boolean flag = this.func_213322_ci().field_72448_b <= 0.0D;
if (flag && this.func_70644_a(Effects.field_204839_B)) {
- d0 = 0.01D;
@@ -327,13 +326,7 @@
FluidState fluidstate = this.field_70170_p.func_204610_c(this.func_233580_cy_());
if (this.func_70090_H() && this.func_241208_cS_() && !this.func_230285_a_(fluidstate.func_206886_c())) {
double d8 = this.func_226278_cu_();
- float f5 = this.func_70051_ag() ? 0.9F : this.func_189749_co();
+ float f5 = this.field_70170_p.func_180495_p(this.func_226270_aj_()).getSlipperiness(field_70170_p, this.func_226270_aj_(), this);
float f6 = 0.02F;
float f7 = (float)EnchantmentHelper.func_185294_d(this);
if (f7 > 3.0F) {
@@ -1897,6 +1929,7 @@
@@ -1899,6 +1930,7 @@
f5 = 0.96F;
}
@@ -341,7 +334,16 @@
this.func_213309_a(f6, p_213352_1_);
this.func_213315_a(MoverType.SELF, this.func_213322_ci());
Vector3d vector3d6 = this.func_213322_ci();
@@ -2075,6 +2108,7 @@
@@ -1977,7 +2009,7 @@
}
} else {
BlockPos blockpos = this.func_226270_aj_();
- float f3 = this.field_70170_p.func_180495_p(blockpos).func_177230_c().func_208618_m();
+ float f3 = this.field_70170_p.func_180495_p(this.func_226270_aj_()).getSlipperiness(field_70170_p, this.func_226270_aj_(), this);
float f4 = this.field_70122_E ? f3 * 0.91F : 0.91F;
Vector3d vector3d5 = this.func_233633_a_(p_213352_1_, f3);
double d2 = vector3d5.field_72448_b;
@@ -2077,6 +2109,7 @@
}
public void func_70071_h_() {
@@ -349,16 +351,24 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -2230,6 +2264,8 @@
@@ -2232,6 +2265,7 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
+ if (!itemstack1.equals(itemstack1, true))
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent(this, equipmentslottype, itemstack, itemstack1));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent(this, equipmentslottype, itemstack, itemstack1));
if (map == null) {
map = Maps.newEnumMap(EquipmentSlotType.class);
}
@@ -2658,8 +2694,16 @@
@@ -2436,6 +2470,8 @@
boolean flag = this.func_70083_f(7);
if (flag && !this.field_70122_E && !this.func_184218_aH() && !this.func_70644_a(Effects.field_188424_y)) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
+ flag = itemstack.canElytraFly(this) && itemstack.elytraFlightTick(this, this.field_184629_bo);
+ if (false) //Forge: Moved to ElytraItem
if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack)) {
flag = true;
if (!this.field_70170_p.field_72995_K && (this.field_184629_bo + 1) % 20 == 0) {
@@ -2668,8 +2704,16 @@
private void func_184608_ct() {
if (this.func_184587_cr()) {
@@ -377,7 +387,7 @@
this.field_184627_bm.func_222121_b(this.field_70170_p, this, this.func_184605_cv());
if (this.func_226299_p_()) {
this.func_226293_b_(this.field_184627_bm, 5);
@@ -2707,8 +2751,10 @@
@@ -2717,8 +2761,10 @@
public void func_184598_c(Hand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@@ -389,7 +399,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND);
@@ -2768,6 +2814,9 @@
@@ -2778,6 +2824,9 @@
vector3d1 = vector3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vector3d1 = vector3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vector3d1 = vector3d1.func_72441_c(this.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_());
@@ -399,18 +409,17 @@
this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vector3d1.field_72450_a, vector3d1.field_72448_b, vector3d1.field_72449_c, vector3d.field_72450_a, vector3d.field_72448_b + 0.05D, vector3d.field_72449_c);
}
@@ -2779,7 +2828,9 @@
@@ -2790,7 +2839,8 @@
} else {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_226293_b_(this.field_184627_bm, 16);
- this.func_184611_a(this.func_184600_cs(), this.field_184627_bm.func_77950_b(this.field_70170_p, this));
- ItemStack itemstack = this.field_184627_bm.func_77950_b(this.field_70170_p, this);
+ ItemStack copy = this.field_184627_bm.func_77946_l();
+ ItemStack stack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, func_184605_cv(), this.field_184627_bm.func_77950_b(this.field_70170_p, this));
+ this.func_184611_a(this.func_184600_cs(), stack);
this.func_184602_cy();
}
@@ -2800,7 +2851,11 @@
+ ItemStack itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, func_184605_cv(), this.field_184627_bm.func_77950_b(this.field_70170_p, this));
if (itemstack != this.field_184627_bm) {
this.func_184611_a(hand, itemstack);
}
@@ -2815,7 +2865,11 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -422,7 +431,18 @@
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
}
@@ -2966,14 +3021,14 @@
@@ -2964,8 +3018,8 @@
}
BlockState blockstate = this.field_70170_p.func_180495_p(p_213342_1_);
- if (blockstate.func_177230_c() instanceof BedBlock) {
- this.field_70170_p.func_180501_a(p_213342_1_, blockstate.func_206870_a(BedBlock.field_176471_b, Boolean.valueOf(true)), 3);
+ if (blockstate.isBed(field_70170_p, p_213342_1_, this)) {
+ blockstate.setBedOccupied(field_70170_p, p_213342_1_, this, true);
}
this.func_213301_b(Pose.SLEEPING);
@@ -2981,15 +3035,15 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_241350_1_) -> {
@@ -435,11 +455,13 @@
this.func_213374_dv().filter(this.field_70170_p::func_175667_e).ifPresent((p_241348_1_) -> {
BlockState blockstate = this.field_70170_p.func_180495_p(p_241348_1_);
- if (blockstate.func_177230_c() instanceof BedBlock) {
+ if (blockstate.isBed(field_70170_p, func_226270_aj_(), this)) {
this.field_70170_p.func_180501_a(p_241348_1_, blockstate.func_206870_a(BedBlock.field_176471_b, Boolean.valueOf(false)), 3);
Vector3d vector3d1 = BedBlock.func_220172_a(this.func_200600_R(), this.field_70170_p, p_241348_1_, 0).orElseGet(() -> {
- this.field_70170_p.func_180501_a(p_241348_1_, blockstate.func_206870_a(BedBlock.field_176471_b, Boolean.valueOf(false)), 3);
+ if (blockstate.isBed(field_70170_p, p_241348_1_, this)) {
+ blockstate.setBedOccupied(field_70170_p, p_241348_1_, this, false);
Vector3d vector3d1 = BedBlock.func_242652_a(this.func_200600_R(), this.field_70170_p, p_241348_1_, this.field_70177_z).orElseGet(() -> {
BlockPos blockpos = p_241348_1_.func_177984_a();
@@ -2993,7 +3048,9 @@
return new Vector3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D);
@@ -3012,7 +3066,9 @@
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
BlockPos blockpos = this.func_213374_dv().orElse((BlockPos)null);
@@ -450,11 +472,10 @@
}
public boolean func_70094_T() {
@@ -3062,4 +3119,58 @@
public void func_213334_d(Hand p_213334_1_) {
@@ -3082,6 +3138,60 @@
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}
+
+ /* ==== FORGE START ==== */
+ /***
+ * Removes all potion effects that have curativeItem as a curative item for its effect
@@ -508,4 +529,7 @@
+ handlers[x].invalidate();
+ }
+ }
}
+
@OnlyIn(Dist.CLIENT)
public AxisAlignedBB func_184177_bl() {
if (this.func_184582_a(EquipmentSlotType.HEAD).func_77973_b() == Items.field_196151_dA) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/MobEntity.java
+++ b/net/minecraft/entity/MobEntity.java
@@ -197,6 +197,7 @@
@@ -198,6 +198,7 @@
public void func_70624_b(@Nullable LivingEntity p_70624_1_) {
this.field_70696_bz = p_70624_1_;
@@ -8,7 +8,7 @@
}
public boolean func_213358_a(EntityType<?> p_213358_1_) {
@@ -485,7 +486,7 @@
@@ -486,7 +487,7 @@
public void func_70636_d() {
super.func_70636_d();
this.field_70170_p.func_217381_Z().func_76320_a("looting");
@@ -17,7 +17,7 @@
for(ItemEntity itementity : this.field_70170_p.func_217357_a(ItemEntity.class, this.func_174813_aQ().func_72314_b(1.0D, 0.0D, 1.0D))) {
if (!itementity.field_70128_L && !itementity.func_92059_d().func_190926_b() && !itementity.func_174874_s() && this.func_230293_i_(itementity.func_92059_d())) {
this.func_175445_a(itementity);
@@ -638,6 +639,14 @@
@@ -639,6 +640,14 @@
this.func_70106_y();
} else if (!this.func_104002_bU() && !this.func_213392_I()) {
Entity entity = this.field_70170_p.func_217362_a(this, -1.0D);
@@ -32,7 +32,7 @@
if (entity != null) {
double d0 = entity.func_70068_e(this);
int i = this.func_200600_R().func_220339_d().func_233671_f_();
@@ -877,6 +886,8 @@
@@ -878,6 +887,8 @@
}
public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) {
@@ -41,7 +41,7 @@
Item item = p_184640_0_.func_77973_b();
if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) {
if (item instanceof ArmorItem) {
@@ -884,7 +895,7 @@
@@ -885,7 +896,7 @@
} else if (item == Items.field_185160_cR) {
return EquipmentSlotType.CHEST;
} else {
Loaded 100 of 1042 files, more files were not shown because too many files have changed in this diff. Show more