Compare commits

..
125 Commits
Author SHA1 Message Date
cpw 27afdc8a27 Provisional update to 1.14.4. Missing a lot of playerinteractionmanager patches because everything moved and I'm tired.
Fix up immediate problems.

bump to 28.
2019-07-20 00:35:40 -04:00
cpw eff42f6066 Update mappings to 20190719 in prep for 1.14.4..
Signed-off-by: cpw <[email protected]>
2019-07-19 11:55:30 -04:00
CJ Miller 9f5ce12754 Remove OnlyIn Client Distribution from Effect and EffectType methods. (#5925) 2019-07-18 14:15:31 -07:00
LexManos cb21e95e0b Change default BrewingRecipe to use an Ingredient for the input instead of ItemStack. Closes #5944
Add AT for GameRules.register Closes #5946
Fix Forge Blockstate loader model path is inconsistent with vanilla blockstates Closes #5892
Fix client crashing when opting not to load a world when there's missing blocks Closes #5886
2019-07-18 14:13:20 -07:00
LexManos e6f032db1b Fix CheckSpawn event logic for natural spawns. 2019-07-16 22:38:11 -07:00
LexManos 86e9425638 Fixed item breaking particles not capturing current state of the ItemStack. Closes #5934 2019-07-16 16:02:52 -07:00
ewewukek 53ac33a84c Fix RenderSpecificHandEvent firing with wrong hand stack (#5927) 2019-07-16 12:42:33 -07:00
its_meow 5cf2af569f [1.14.x] Fix text positioning issues caused by scaling loading screen (#5932) 2019-07-16 12:41:21 -07:00
LexManos a46b7cb67a Fixed PlayerSleepInBedEvent pos is always null Closes #5936
Fixed decompile error causing Endless Loop in ModelBackery if model errors exist.
Fixed NPEs related to teleporting players without portals.
2019-07-16 11:52:51 -07:00
LexManos 3d78f30d18 Add simple concurrency protection to Server world list. Closes #5938 and #5739 2019-07-16 09:59:33 -07:00
cpw ad64d383e1 Update modlauncher to the 3.x series.
Signed-off-by: cpw <[email protected]>
2019-07-14 22:48:30 -04:00
tterrag1098 0a7f5ff9fa Rework GuiModList mod info to use custom scrolling panel impl 2019-07-10 20:13:33 -07:00
LexManos ce28c5794d Cleanup Forge's Access Transformer, and add ATs for Block.Properties#noDrop, and AxeItem/PickaxeItem. Closes #5866 and Closes #5921 2019-07-10 17:39:19 -07:00
LexManos e55c7c889b Fix race condition in client mouse handler. Closes #5888 2019-07-10 17:35:53 -07:00
LexManos 0633e8218f Added LootPool.Builder#bonusRolls setter. Closes #5887 2019-07-09 18:21:05 -07:00
LexManos 0fdfe1fd59 Implemented Item.get/setDamage hooks. Closes #5899 2019-07-09 18:03:19 -07:00
LexManos 2cc264645b Implement Item.isRepairable in Crafting and Grindstone. Closes #5917 2019-07-09 18:02:47 -07:00
LexManos 983e0a93db Re-implement state.onBlockExploded() Closes #5914 2019-07-09 17:07:09 -07:00
Vincent Lee d88e4fbf36 Add general damage hook for items. Closes #5502 (#5670) 2019-07-08 20:43:02 -07:00
LexManos f79da3edf7 Fix syntax error in IRenderHandler. 2019-07-08 20:14:41 -07:00
LexManos 8742d74e93 Pass tick counter to custom render handlers (#5744) 2019-07-08 19:55:47 -07:00
Cadiboo ff80ab6a23 Fire Loading event (#5795) 2019-07-08 19:49:47 -07:00
Dirk "YouDirk" Lehmann 8c37d642fe Fix logoFile not working properly (#5775) 2019-07-08 19:49:31 -07:00
ichttt 06a30e9f23 Adds some explanatory javadocs and check world in ModelDataManager (#5762) 2019-07-08 19:47:18 -07:00
Antoine Lucas 650e7dc16e Add InputEvent documentation (#5698) 2019-07-08 19:47:06 -07:00
ichttt d41fad51c2 Add IModelData to getParticleTexture (#5756) 2019-07-08 19:46:32 -07:00
ichttt 0463949ac3 Fixed BakedModelWrapper not delegating new methods (#5761) 2019-07-08 19:45:27 -07:00
Sargun Vohra 5f0fd4b706 Throw exception when a mod returns null from a dispatched capability provider (#5646) 2019-07-08 19:45:10 -07:00
Benjamin K 201c368325 Add isServer and isClient methods to LogicalSide (#5606)
* Add helper methods to LogicalSide.

* Fix backwards docs.
2019-07-08 19:44:35 -07:00
Cadiboo 3fe08f149d Added documentation to ObfuscationReflectionHelper adn deprecated index based functions. (#5893) 2019-07-08 19:44:21 -07:00
LexManos 61bea2bfda Fixed EntityJoinWorldEvent not being fired when player is added to ServerWorld. #5827
Fixed wrong example path for the access transformer in the MDK build.gradle. #5891
Added getters for mouse x/y velocity and if the middle-mouse button is being held down. #5776
Modify issue template for better clarity. #5874
Fixed grindstone not using ItemStack-sensitive getMaxDamage. #5831
Added ParticleManager.registerFactory to Forge's AT. #5896
Fixed NPE in SidedInvWrapper when side was null. #5787
Moved EndermanEntity.setAttackTarget super call to allow LivingSetAttackTargetEvent the ability to override default behavior. #5778
Added field to make "Looking at" debug info maximum distance configurable #5714
2019-07-08 18:42:12 -07:00
DaemonUmbra f720140481 Disable Config Button when no mods are selected (#5905)
Closes #5889
2019-07-08 15:56:49 -07:00
Tedstar 66a2d38ab8 Fix MC-258 on mod list screen, enable sorting, minor tweaks. (#5846) 2019-07-08 15:50:05 -07:00
DaemonUmbra bed266f310 Fixed #5895: Shearing via Displenser drops Shears (#5906) 2019-07-08 15:47:34 -07:00
Cloudhunter 719f08ea5e Fix link applying to whole component in chat if component starts with link (#5909) 2019-07-08 15:46:49 -07:00
Suppergerrie2 3992ea5c59 Added harvestLevel and harvestTool setter to the Block.Properties. (#5916) 2019-07-08 15:45:53 -07:00
LexManos a01c1cdc3a Fix installer realms issue on server.
Uptake EventBus changes to fix some potential dead locks.
2019-07-05 13:26:23 -07:00
m00nl1ght-dev 7a8ae9f56b Fix old entity not being removed on dimension change (#5833) 2019-07-04 13:03:45 -07:00
primetoxinz 765efc3c72 Update TextureStitchEvent.Pre to give access to the list of ResourceLocations that will be loaded as textures. (#5870) 2019-07-03 12:26:51 -07:00
LexManos bc23c1ddb2 Add installer processor to deobfuscate Mincraft's Realms library.
This task will processes the current realms library from the json, so the installer must be re-ran every time they update it.
2019-07-03 01:08:20 -07:00
David Quintana 87e2fcb4e5 Redirect a method to the recipe book container, to allow modded screens to have a recipe book. (#5873) 2019-07-02 13:05:03 -07:00
Take Weiland 478b7e7ccc Fix WorldEvent.Unload not firing on the client (fixes #5880) (#5884) 2019-07-02 12:58:45 -07:00
Take Weiland 0574db134c Fix TickEvent.PlayerTickEvent firing twice for tick end (fixes #5878) (#5885) 2019-07-02 12:57:06 -07:00
LexManos 358211ca66 Fix type cast issues in ForgeConfig values. Closes #5894
Added config value set and save functions.
By default mod configs are auto-saved, so you do not need to call save unless you create your own Config object.
2019-07-02 11:54:59 -07:00
cpw c8e5007913 Remove legacy StartupProgress.
Implement properly scalable progress thanks to @gigaherz. Closes #5863.
Implement API for pushing messages to the startup screen from mods.
Add memory display.

Signed-off-by: cpw <[email protected]>
2019-06-30 23:48:54 -04:00
cpw 943fedb073 Update coremods to newer version, with support for new targets.
Signed-off-by: cpw <[email protected]>
2019-06-29 17:05:18 -04:00
LexManos 13ae8e41ee Fix duplicate WorldEvent.Unload call in client key handler.
Add recipe generator to replace vanilla recipes with Forge tags.
2019-06-27 17:23:23 -07:00
LexManos ac8b196b8c Fix dimension save data invalid cache being to aggressive. 2019-06-27 10:57:03 -07:00
ある 2c3183bdae Fix garbled "µs" (#5818) 2019-06-26 13:23:47 -07:00
LexManos 53349603e2 Fix fmluserdevdata not being a valid launch target. 2019-06-25 18:16:10 -07:00
LexManos c284de366b Split userdev data entry point into it's own provider to fix duplicate mod issue. 2019-06-25 18:03:51 -07:00
tterrag e81c330694 Fix configs correcting numeric values when the primitive type differs
Fix configs with range not clamping the corrected value, and instead
just replacing with the default

Closes #5855
2019-06-25 19:56:31 -04:00
Ben Staddon 790da699dd Fix item placement losing NBT data in creative mode (#5757) 2019-06-25 13:59:10 -07:00
MajorTuvok 7915397377 Add extension to write entry id's to PacketBuffer's (#5812) 2019-06-25 13:55:24 -07:00
Someone b2a5d34679 Add isItemValid check for ItemStackHandler (#5850) 2019-06-25 13:50:08 -07:00
Johannes 73bb18e78b Fix leather armor dye recipe (#5836) 2019-06-25 13:48:49 -07:00
Tedstar 9701148819 [1.14.x] Replace dye items in Forge tags. (#5843) 2019-06-25 13:44:54 -07:00
Unnoen f1dbc8b117 Update readme and issue template. (#5773) 2019-06-25 13:38:32 -07:00
bl4ckscor3 b8131e6e67 implement Ingredient.getSerializer for custom ingredients (#5813) 2019-06-25 10:25:33 -07:00
LexManos f4598a97f7 Fix vines and scaffolding not being climbable.
Fix powered rails not spreading power correctly. Closes: #5854
2019-06-24 20:05:50 -07:00
LexManos c90d42973d Fix misaligned ServerWorld initCapabilities patch. 2019-06-24 19:37:02 -07:00
LexManos ff0bb8c83c Initial 1.14.3 update. 2019-06-24 19:01:03 -07:00
cpw e5acea60e6 Fix too many registries being sent from server to client
Signed-off-by: cpw <[email protected]>
2019-06-23 19:54:55 -04:00
tterrag 216b536967 Remove OnlyIn on TagCollection#getOwningTags
Fixes Block#getTags crashing on servers
2019-06-23 18:36:27 -04:00
cpw 0a819da0e7 Reorganize sided event dispatch slightly. Dispatch model and entityrenderer
functions at more appropriate times.

Signed-off-by: cpw <[email protected]>
2019-06-23 16:01:20 -04:00
cpw bdad2af27b Tweak for lowercase handling.
Signed-off-by: cpw <[email protected]>
2019-06-23 14:51:58 -04:00
cpw 60513446fa Merge branch 'pull/5793' into 1.14.x 2019-06-23 14:42:32 -04:00
cpw be415091cd Fix crash when crashing during modloading. Fix GuiModList being weird.
Signed-off-by: cpw <[email protected]>
2019-06-23 14:37:05 -04:00
cpw 9067dbf6a0 Process the main modloading work on the async thread, but still
do deferred work on the main thread by passing in the executor.

Signed-off-by: cpw <[email protected]>
2019-06-23 12:26:45 -04:00
tterrag 359be1a880 Clean up config comments, make comment array nonnull 2019-06-23 02:57:00 -04:00
tterrag 99624bf3b5 Fix forge event bus never starting up 2019-06-23 02:17:51 -04:00
tterrag 252b94a110 Automatically add range to config comments 2019-06-23 02:17:28 -04:00
cpw 448d996a45 First pass of adding text to the loading progress UI. It deliberately uses the very primitive STB
generated font, so can only render basic ASCII text, and also only renders pre-defined strings,
as translations aren't available either.

Signed-off-by: cpw <[email protected]>
2019-06-22 23:39:00 -04:00
JoJoDeveloping b9e5dfd286 Add mod failure identification 2019-06-23 03:14:05 +02:00
cpw d966746fbf Moved some events to the Mod's event bus. You'll need to update which bus
you're listening to for these. (The Mod event bus is the only one actively
dispatching events during model loading).

ModelRegistryEvent, ModelBakeEvent, TextureStitchEvent.Pre, TextureStitchEvent.Post, ColourHandlerEvent.Block, ColourHandlerEvent.Item

Signed-off-by: cpw <[email protected]>
2019-06-22 20:36:07 -04:00
cpw 89baeb3d5d Fix StartupQuery, and put tests back.
Signed-off-by: cpw <[email protected]>
2019-06-22 19:58:10 -04:00
cpw 89006458a2 Fix stupid bug introduced with the refactor..
Signed-off-by: cpw <[email protected]>
2019-06-22 19:08:49 -04:00
cpw 389bc1ecea Tidy up mod loading a bit more, and also crash if the [[mods]] list isn't
a list.

Signed-off-by: cpw <[email protected]>
2019-06-22 12:52:22 -04:00
cpw 1e0437208b Merge remote-tracking branch 'origin/1.14.x' into 1.14.x 2019-06-22 12:33:46 -04:00
cpw 256bd01e0c Fix server side loading, tweak mods command.
Signed-off-by: cpw <[email protected]>
2019-06-22 12:31:27 -04:00
tterrag ef7b035f02 Fix ModelDataTest 2019-06-21 23:35:08 -04:00
cpw 83a0dc2ef9 Merge remote-tracking branch 'origin/1.14.x' into 1.14.x 2019-06-21 22:42:33 -04:00
cpw c10174d50d Update mappings, move mod initialization to the async loader.
Signed-off-by: cpw <[email protected]>
2019-06-21 22:42:16 -04:00
tterrag 5a3b375147 Fix #5612 add entity to ISelectionContext 2019-06-21 21:15:56 -04:00
tterrag 656ff25ae1 Fix #5768 add access to MainWindow object in RenderGameOverlayEvent 2019-06-21 20:29:04 -04:00
tterrag 19059b054e Fix #5810 incorrect cullface on some models 2019-06-21 20:23:32 -04:00
tterrag 45bc487fc0 Fix #5686 ArmorLayer still calls deprecated getArmorResource 2019-06-21 19:48:00 -04:00
tterrag 9c74a31ca2 Fix bad patch breaking armor dyeing 2019-06-21 19:47:23 -04:00
tterrag 8c3e511538 Make sure test mods load, fix BlockstateRetextureTest 2019-06-21 19:35:32 -04:00
tterrag 5fb948fb35 Fix #5805 ModelBakeEvent does not fire 2019-06-21 19:34:58 -04:00
LexManos a14c2233e0 Fix lighting not being sent to client when large amounts of blocks change at once. Closes #5839
Remove RecipeType/VanillaRecipeTypes, as 1.14 has a vanilla system for this.
2019-06-19 18:10:02 -07:00
LexManos f01b87fac7 Fix some compile errors in test classes. 2019-06-19 18:07:58 -07:00
LexManos 40bdde2043 Fix Vanilla resources loading from classpath, instead of the extra jar. Causing issues in dev time, and Forge replacements. Closes #5824 2019-06-17 14:08:16 -07:00
LexManos 0a8a601877 Add temporary hard crash when mods error until we can load our error screen. 2019-06-16 00:48:38 -07:00
LexManos 002e29958e Make ReverseTagWrapper unmodifiable, fix error in log when mods folder doesn't exist initial scan. 2019-06-16 00:47:40 -07:00
cpw 604987a005 Skip running the datagenerator on unrequested mods.
Add a run config for the data task for modders to use

Signed-off-by: cpw <[email protected]>
2019-06-16 00:47:50 -04:00
cpw 7e3e6b1969 Remove paulscode hack. It is not needed in 1.14, since paulscode is
no longer used.

Signed-off-by: cpw <[email protected]>
2019-06-15 21:51:51 -04:00
cpw d821514372 Modify lex's data handler to use proper mod lifecycle event mechanisms
instead. New Lifecycle Event for requesting data harvesting. Mods will
be constructed, the registry will fire, and then a new Data event will
fire. Submit new data tag files to the data gatherer if you wish.
The game will shutdown after this. No other mod elements will happen.

Signed-off-by: cpw <[email protected]>
2019-06-15 21:24:45 -04:00
cpw 37a896fe1b Add params for the exception message
Signed-off-by: cpw <[email protected]>

tweak logging

Signed-off-by: cpw <[email protected]>
2019-06-15 19:47:08 -04:00
LexManos e1cdb2e558 Expose the data entry point and generate Forge's Tags using it. 2019-06-13 20:58:03 -07:00
LexManos c30b27fcfe Add reverse tag cache, to make looking up tags for items/blocks/etc.. less costly. 2019-06-12 19:28:10 -07:00
marcus8448 9542f51cd0 Update Example Mod (#5781) 2019-06-12 16:49:20 -07:00
its_meow a7b56f0975 Fix AT for EntitySpawnPlacementRegistry.register (#5799) 2019-06-12 16:17:25 -07:00
Johannes ed3dc8c7d3 Implement getValue in ClearableRegistry fixing DimensionArgument. (#5809)
Fix DimensionArgument
2019-06-12 16:16:32 -07:00
SquidDev ed6ce87c22 Fix RenderSpecificHandEvent firing with wrong hand (#5789) 2019-06-12 01:05:27 -04:00
kashike 4bd7427b70 Use dragon_immune block tag instead of manually checking blocks (#5792) 2019-06-12 01:04:13 -04:00
tterrag 0b1196db3f Fix #5806 sheep drop shears instead of wool
lol
2019-06-12 00:57:27 -04:00
tterrag b25ed7ef91 Fix incorrect method used in ShrubFeature patch 2019-06-12 00:51:45 -04:00
tterrag dc95130526 Rework AbstractTreeFeature patches to reduce impact and avoid name conflicts 2019-06-12 00:48:11 -04:00
tterrag d5ee80a70a Add IContainerFactory for reading custom container data on the client 2019-06-10 18:14:49 -04:00
LexManos 5dc944c1c3 Fix Fishing and Mineshaft Minecarts loot tables erroring. #5785
Fix Client block breaking speed not matching the server. #5790
Fix Village Siege event location, and MC-154328 preventing Sieges starting. #5800
Fix EntityJoinWorldEvent not firing on client, or some server code paths. #5786
2019-06-10 14:03:51 -07:00
tterrag da22fd40bf Adjust NetworkEvent#enqueueWork to match vanilla logic
In singleplayer our packet work could get delayed until the next tick,
breaking the expectation of packet read order. Fixes that using
NetworkHooks.openGui would result in missing inventory data on the client
2019-06-10 00:13:27 -04:00
LexManos 1434419e47 Fix gameDir argument error on dedicated server. 2019-06-09 11:19:01 -07:00
tterrag 3385e62aa7 Add forge registries for most vanilla registries
Made all registry names consistent with their vanilla counterparts
Also added a system for legacy registry names, so no data will be lost
Cleaned up formatting in GameData and ForgeRegistries
2019-06-09 04:23:39 -04:00
tterrag 40f2276e88 Add registry flag for syncing 2019-06-09 00:55:42 -04:00
tterrag 35cd89c00c Fix issues preventing test mods loading 2019-06-09 00:19:29 -04:00
tterrag 892fea3df9 Add forge registry for container types, expose ScreenManager.registerFactory 2019-06-09 00:19:17 -04:00
cpw 2d32929dc5 Don't NPE during construction of ModLoadingException..
Signed-off-by: cpw <[email protected]>
2019-06-08 14:30:15 -04:00
LexManos 728b4857c3 Fix misobfed methods due to mapping conflict. 2019-06-08 09:22:03 -07:00
cpw 9fa4641cb0 Update mappings
Signed-off-by: cpw <[email protected]>
2019-06-08 10:45:28 -04:00
tterrag fc04a65a0f Fix block activation not occurring serverside
Missing block of code from the old patch caused it to be skipped
2019-06-08 01:32:53 -04:00
tterrag a93d7d20ee Rework model patches/classes for new bake signature 2019-06-08 01:02:29 -04:00
LexManos b74b72e44c Fix NamespacedWrapper not delegating a new getter. Fixing data loading spam at world start.
Update red/yellow/green tags with new vanilla item names.
Reenabled test source directory in project and made ModelDataTest compile.
2019-06-07 19:34:16 -07:00
cpw 850c73b73f and userdev
Signed-off-by: cpw <[email protected]>
2019-06-07 17:34:25 -04:00
cpw d736e26e0c Fix realms class name
Signed-off-by: cpw <[email protected]>
2019-06-07 17:32:33 -04:00
634 changed files with 8634 additions and 5389 deletions

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
<!-- Thank you for reporting! -->
<!-- Please go to the forum first for support with crashes and issues. -->
<!-- http://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
+13
View File
@@ -0,0 +1,13 @@
---
name: Feature request
about: Want to request a feature?
title: ''
labels: Feature
assignees: ''
---
<!-- Please note, feature requests that are submitted as GitHub issues here are rarely implemented. -->
<!-- If you'd like to see something in Forge, you should be ready to implement it as a PR. -->
<!-- If you're not sure, open a Draft PR or discuss it in the Discord server. -->
<!-- Discord: https://discord.gg/UvedJ9m -->
+26
View File
@@ -0,0 +1,26 @@
---
name: Issue report
about: Visit the forum first for issues with crashes.
title: ''
labels: Triage
assignees: ''
---
<!-- Thank you for reporting! -->
<!-- For support with crashes and issues, please create a post on the forum instead: -->
<!-- https://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
**Minecraft Version:** {Minecraft version}
**Forge Version:** {Forge version. *Version number, not latest/rb*}
**Logs:** {Link(s) to GitHub Gist with full latest.log and/or crash report}
**Steps to Reproduce:**
1. Do this
2. Then do that
3. ...
**Description of issue:**
+1
View File
@@ -28,6 +28,7 @@
/projects/**/*.launch
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
/patches-/
-37
View File
@@ -1,37 +0,0 @@
# How to install Forge: For Players
Go to [the Forge website](http://files.minecraftforge.net)
and select the minecraft version you wish to get forge for from the list.
You can download the installer for the *Recommended Build* or the
*Latest build* there. Latest builds may have newer features but may be
more unstable as a result. The installer will attempt to install forge
into your vanilla launcher environment, where you can then create a new
profile using that version and play the game!
For support and questions, visit [the Support Forum](http://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
Here is a short video from Rorax showing how to install and setup Forge:
[![HOWTO Install Forge](https://img.youtube.com/vi/lB3ArN_-3Oc/0.jpg)](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
# How to install Forge: For Modders
[See the "Getting Started" section in the Forge Documentation](http://mcforge.readthedocs.io/en/latest/gettingstarted/).
# How to install Forge: For those wishing to work on Forge itself
If you wish to actually inspect Forge, submit PRs or otherwise work
with Forge itself, you're in the right place!
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
## Pull requests
[See the "Making Changes and Pull Requests" section in the Forge documentation](http://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
### Contributor License Agreement
We require all contributors to acknowledge the [Forge Contributor
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
associated with your github account to do this. If you have previously
signed it, you should be OK.
+149 -22
View File
@@ -7,6 +7,7 @@ buildscript {
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath 'org.ow2.asm:asm:7.1'
}
}
import groovy.json.JsonSlurper
@@ -20,10 +21,12 @@ import net.minecraftforge.gradle.common.task.ArchiveChecksum
import net.minecraftforge.gradle.common.task.DownloadMavenArtifact
import net.minecraftforge.gradle.common.task.SignJar
import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import net.minecraftforge.gradle.userdev.tasks.RenameJar
import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import org.objectweb.asm.ClassReader
import java.util.stream.Collectors
@@ -45,9 +48,9 @@ ext {
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20190526-1.13.2'
MC_VERSION = '1.14.2'
MCP_VERSION = '20190603.175704'
MAPPING_VERSION = '20190719-1.14.3'
MC_VERSION = '1.14.4'
MCP_VERSION = '20190719.173545'
}
project(':mcp') {
@@ -130,7 +133,10 @@ project(':forge') {
srcDirs = ["$rootDir/src/main/java"]
}
resources {
srcDirs = ["$rootDir/src/main/resources"]
srcDirs = [
"$rootDir/src/main/resources",
"$rootDir/src/generated/resources"
]
}
}
test {
@@ -138,8 +144,8 @@ project(':forge') {
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
java {
srcDirs = [
//"$rootDir/src/test/java",
//"$rootDir/src/fmllaunchertest/java"
"$rootDir/src/test/java",
"$rootDir/src/fmllaunchertest/java"
]
}
resources {
@@ -166,11 +172,12 @@ project(':forge') {
}
ext {
SPEC_VERSION = '26.0' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '28.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.
MCP_ARTIFACT = project(':mcp').mcp.config
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5'
}
def getVersion = {
@@ -268,6 +275,29 @@ project(':forge') {
TestMods { sources sourceSets.test }
}
}
forge_data {
taskName 'forge_data'
main 'net.minecraftforge.userdev.LaunchTesting'
workingDirectory project.file('run')
environment 'target', 'fmldevdata'
environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main
source sourceSets.userdev
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/')
}
}
}
@@ -309,6 +339,14 @@ project(':forge') {
'Implementation-Title': 'FML Launcher',
'Implementation-Version': SPEC_VERSION,
'Implementation-Vendor': 'Forge'
] as LinkedHashMap,
'net/minecraftforge/fml/userdev/': [
'Specification-Title': 'Forge User Development',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': SPEC_VERSION,
'Implementation-Title': project.group,
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
'Implementation-Vendor': 'Forge Development LLC'
] as LinkedHashMap
]
}
@@ -329,12 +367,12 @@ project(':forge') {
installer 'org.ow2.asm:asm:6.2'
installer 'org.ow2.asm:asm-commons:6.2'
installer 'org.ow2.asm:asm-tree:6.2'
installer 'cpw.mods:modlauncher:2.1.+'
installer 'cpw.mods:modlauncher:3.0.+'
installer 'cpw.mods:grossjava9hacks:1.1.+'
installer 'net.minecraftforge:accesstransformers:0.16.+:shadowed'
installer 'net.minecraftforge:eventbus:0.9.+:service'
installer 'net.minecraftforge:eventbus:0.10.+:service'
installer 'net.minecraftforge:forgespi:0.13.+'
installer 'net.minecraftforge:coremods:0.5.+'
installer 'net.minecraftforge:coremods:0.6.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.0'
installer 'com.electronwill.night-config:toml:3.6.0'
@@ -423,6 +461,21 @@ project(':forge') {
clean = { genJoinedBinPatches.cleanJar }
input = genJoinedBinPatches.output
}
// Create SRG named Vanilla jars, using the SpecialSource we have in the installer
task createClientSRG(type: RenameJar, dependsOn: genClientBinPatches) {
tool = SPECIAL_SOURCE + ':shaded'
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
mappings = { genClientBinPatches.srg }
input = { genClientBinPatches.cleanJar }
output = file('build/createClientSRG/output.jar')
}
task createServerSRG(type: RenameJar, dependsOn: genServerBinPatches) {
tool = SPECIAL_SOURCE + ':shaded'
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
mappings = { genServerBinPatches.srg }
input = { genServerBinPatches.cleanJar }
output = file('build/createServerSRG/output.jar')
}
// Checksum tasks so that we can know if the vanilla classes are what we expect them to do!
task clientBaseChecksum(type: ArchiveChecksum, dependsOn: genClientBinPatches) {
input = { genClientBinPatches.cleanJar} //Lazy because Patcher Plugin sets the value afterEvaluate
@@ -465,9 +518,58 @@ project(':forge') {
}
}
}
task checkATs(dependsOn: genJoinedBinPatches) {
inputs.file { genJoinedBinPatches.cleanJar }
inputs.files patcher.accessTransformers
doLast {
def vanilla = [:]
def zip = new java.util.zip.ZipFile(genJoinedBinPatches.cleanJar)
zip.entries().findAll { !it.directory && it.name.endsWith('.class') }.each { entry ->
new ClassReader(zip.getInputStream(entry)).accept(new org.objectweb.asm.ClassVisitor(org.objectweb.asm.Opcodes.ASM7) {
String name
void visit(int version, int access, String name, String sig, String superName, String[] interfaces) {
this.name = name
vanilla[name] = access
}
org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String sig, Object value) {
vanilla[this.name + ' ' + name] = access
return null
}
org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String desc, String sig, String[] excs) {
vanilla[this.name + ' ' + name + desc] = access
return null
}
}, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
}
patcher.accessTransformers.each { f ->
TreeMap lines = [:]
f.eachLine { line ->
def idx = line.indexOf('#')
if (idx == 0 || line.isEmpty()) return
def comment = idx == -1 ? null : line.substring(idx)
if (idx != -1) line = line.substring(0, idx - 1)
def (modifier, cls, desc) = (line.trim() + ' ').split(' ', -1)
def key = cls + (desc.isEmpty() ? '' : ' ' + desc)
def access = vanilla[key.replace('.', '/')]
if (access == null) {
if ((desc.equals('*') || desc.equals('*()')) && vanilla[cls.replace('.', '/')] != null)
println('Warning: ' + line)
else {
println('Invalid: ' + line)
return
}
}
//TODO: Check access actually changes, and expand inheretence?
lines[key] = [modifier: modifier, comment: comment]
}
f.text = lines.collect{ it.value.modifier + ' ' + it.key + (it.value.comment == null ? '' : ' ' + it.value.comment) }.join('\n')
}
}
}
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
inputs.file universalJar.archivePath
inputs.file { launcherJar.archivePath }
ext {
output = file('build/version.json')
vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
@@ -521,10 +623,10 @@ project(':forge') {
}
}
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches]) {
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches/*, createClientSRG, createServerSRG*/]) {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
}
doFirst {
@@ -534,6 +636,10 @@ project(':forge') {
inputs.file applyServerBinPatches.output
inputs.file genClientBinPatches.toolJar
inputs.file launcherJson.output
/*
inputs.file createClientSRG.output
inputs.file createServerSRG.output
*/
outputs.file output
doLast {
def libs = [
@@ -588,6 +694,10 @@ project(':forge') {
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:srg]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:srg]"
],
/*MC_SRG_SHA: [
client: "'${sha1(createClientSRG.output)}'",
server: "'${sha1(createServerSRG.output)}'"
],*/
PATCHED: [
client: "[${project.group}:${project.name}:${project.version}:client]",
server: "[${project.group}:${project.name}:${project.version}:server]"
@@ -595,6 +705,10 @@ project(':forge') {
PATCHED_SHA: [
client: "'${sha1(applyClientBinPatches.output)}'",
server: "'${sha1(applyServerBinPatches.output)}'"
],
MCP_VERSION: [
client: "'${MCP_VERSION}'",
server: "'${MCP_VERSION}'"
]
],
processors: [
@@ -620,21 +734,19 @@ project(':forge') {
'{MC_SLIM}': '{MC_SLIM_SHA}',
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
]
], [ // SpecialSource has a bug where it won't create the nessasary directories, remove when they fix that.
jar: INSTALLER_TOOLS,
classpath: getClasspath(project, libs, INSTALLER_TOOLS),
args: [
'--task', 'CREATE_PARENTS',
'--target', '{MC_SRG}'
]
], [
jar: 'net.md-5:SpecialSource:1.8.3',
classpath: getClasspath(project, libs, 'net.md-5:SpecialSource:1.8.3'),
jar: SPECIAL_SOURCE,
classpath: getClasspath(project, libs, SPECIAL_SOURCE),
args: [
//'--stable', Java 9 Is borked, https://bugs.openjdk.java.net/browse/JDK-8184940 TODO: find a fix.
'--in-jar', '{MC_SLIM}',
'--out-jar', '{MC_SRG}',
'--srg-in', '{MAPPINGS}'
]/*,
outputs: [
'{MC_SRG}': '{MC_SRG_SHA}'
]
*/
], [
jar: BIN_PATCHER,
classpath: getClasspath(project, libs, BIN_PATCHER),
@@ -677,6 +789,7 @@ project(':forge') {
dependsOn fixAnnotationsJson
*/
/* We do not actually check this anywhere, so it's 400KB of uselless data
// Add checksum files of clean and patched vanilla classes.
['client', 'server'].each { side ->
['Base', 'Patched'].each { type ->
@@ -686,6 +799,7 @@ project(':forge') {
}
}
dependsOn checksums
*/
// add crowdin locales
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
@@ -851,6 +965,19 @@ project(':forge') {
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
data {
main 'net.minecraftforge.userdev.LaunchTesting'
environment 'target', 'fmluserdevdata'
environment 'MC_VERSION', "${MC_VERSION}"
environment 'FORGE_GROUP', "${project.group}"
environment 'MCP_VERSION', "${MCP_VERSION}"
environment 'MOD_CLASSES', '{source_roots}'
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
}
}
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
+65
View File
@@ -0,0 +1,65 @@
<img src="assets/Forge_logo.svg">
MinecraftForge [![Latest Release](https://img.shields.io/maven-metadata/v/https/files.minecraftforge.net/maven/net/minecraftforge/forge/maven-metadata.xml.svg?label=latest)](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)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/flocker-merch-blueviolet.svg)](https://forgedev.flocker.tv/)
=============
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.14.x | Active (latest) |
| 1.12.x | Active (stable) |
* [Download]
* [Forum]
* [Discord]
* [Documentation]
#### Notes:
- Introduced in 1.13 was a new FML, information found [here](NewFML.md).
# Installing Forge
Go to [the Forge website](https://files.minecraftforge.net)
and select the Minecraft version you wish to get Forge for from the list.
You can download the installer for the *Recommended Build* or the
*Latest build* there. Latest builds may have newer features but may be
more unstable as a result. The installer will attempt to install Forge
into your vanilla launcher environment, where you can then create a new
profile using that version and play the game!
For support and questions, visit [the Support Forum](https://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
[Here is a short video from Rorax showing how to install and setup Forge.](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
# Creating Mods
[See the "Getting Started" section in the Forge Documentation](https://mcforge.readthedocs.io/en/latest/gettingstarted/).
# Contribute to Forge
If you wish to actually inspect Forge, submit PRs or otherwise work
with Forge itself, you're in the right place!
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
### Pull requests
[See the "Making Changes and Pull Requests" section in the Forge documentation](https://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
Please read the contributing guidelines found [here](CONTRIBUTING.md) before making a pull request.
### Contributor License Agreement
We require all contributors to acknowledge the [Forge Contributor
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
associated with your GitHub account to do this. If you have previously
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/).*
[Download]: https://files.minecraftforge.net/
[Forum]: https://www.minecraftforge.net/forum/
[Discord]: https://discord.gg/UvedJ9m
[Documentation]: https://mcforge.readthedocs.io
View File
File renamed without changes.
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 164.072 372.466 294.41 46.56" version="1.1" viewBox="164.072 372.466 294.41 46.56" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="#DFA86A">
<polygon points="266.16 417.99 277.12 417.99 277.12 401.05 295.09 401.05 295.09 390.78 277.12 390.78 277.12 383.77 296.18 383.77 296.18 373.5 266.16 373.5"/>
<path d="m337.33 378.7c-2.103-2.057-4.629-3.64-7.51-4.704-2.743-1.015-5.786-1.528-9.041-1.528l-0.356 2e-3c-3.362 0-6.503 0.556-9.338 1.651-2.857 1.106-5.357 2.707-7.434 4.761-2.073 2.052-3.714 4.559-4.877 7.45-1.158 2.876-1.748 6.104-1.748 9.59 0 3.417 0.59 6.582 1.753 9.403 1.163 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.834 1.096 5.975 1.651 9.339 1.651h0.023c3.402-0.043 6.57-0.639 9.42-1.772 2.863-1.142 5.375-2.757 7.465-4.804 2.091-2.051 3.742-4.524 4.91-7.358 1.162-2.823 1.75-5.987 1.75-9.402 0-3.487-0.588-6.705-1.748-9.568-1.168-2.874-2.82-5.371-4.913-7.425zm-4.644 16.762c0 1.96-0.302 3.782-0.896 5.413-0.587 1.607-1.42 3.011-2.479 4.167-1.05 1.147-2.335 2.065-3.821 2.728-1.479 0.656-3.164 0.99-5.008 0.99-1.84 0-3.514-0.333-4.973-0.988-1.47-0.662-2.747-1.578-3.799-2.729-1.062-1.156-1.895-2.559-2.479-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.298-3.497 0.887-5.044 0.584-1.536 1.419-2.894 2.479-4.037 1.048-1.132 2.323-2.03 3.792-2.674 1.465-0.642 3.145-0.968 4.988-0.968 1.848 0 3.539 0.326 5.025 0.971 1.481 0.643 2.766 1.541 3.812 2.671 1.062 1.143 1.896 2.501 2.479 4.036 0.589 1.548 0.889 3.245 0.889 5.044z"/>
<path d="m376.27 395.65c1.902-2.327 2.867-5.221 2.867-8.603 0-2.614-0.508-4.84-1.506-6.613-0.997-1.762-2.354-3.188-4.035-4.234-1.603-0.995-3.445-1.705-5.482-2.114-1.938-0.388-3.969-0.583-6.037-0.583h-16.021v44.487h10.961v-17.282h2.35l9.447 17.282h13.127l-11.199-18.646c2.262-0.728 4.116-1.964 5.528-3.694zm-19.254-12.223h4.426c0.844 0 1.73 0.054 2.636 0.16 0.784 0.094 1.503 0.283 2.132 0.568 0.496 0.225 0.888 0.553 1.193 0.998 0.283 0.415 0.428 1.031 0.428 1.836 0 0.931-0.16 1.643-0.459 2.06-0.34 0.472-0.771 0.813-1.32 1.046-0.686 0.289-1.459 0.477-2.301 0.554-0.975 0.089-1.963 0.136-2.938 0.136h-3.795l-2e-3 -7.358z"/>
<path d="m394.82 386.38c1.05-1.132 2.325-2.03 3.793-2.674 1.464-0.642 3.144-0.968 4.988-0.968 1.843 0 3.611 0.311 5.26 0.921 1.609 0.599 2.992 1.449 4.107 2.531l1.314 1.278 8.019-8.105-1.454-1.298c-2.355-2.103-5.066-3.586-8.058-4.407-2.879-0.789-5.987-1.189-9.247-1.189-3.361 0-6.503 0.556-9.339 1.651-2.856 1.106-5.355 2.707-7.431 4.761-2.074 2.052-3.716 4.559-4.88 7.45-1.158 2.876-1.746 6.104-1.746 9.59 0 3.417 0.59 6.582 1.752 9.403 1.164 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.832 1.096 5.975 1.651 9.339 1.651 6.501 0 12.475-1.432 17.751-4.25l0.979-0.522v-23.814h-19.313v10.27h8.354v6.639c-0.871 0.397-1.834 0.709-2.881 0.933-1.5 0.314-3.127 0.478-4.83 0.478-1.841 0-3.514-0.333-4.973-0.988-1.472-0.662-2.748-1.578-3.801-2.729-1.06-1.156-1.893-2.559-2.478-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.299-3.497 0.887-5.044 0.586-1.54 1.421-2.897 2.479-4.041z"/>
<polygon points="437.69 407.72 437.69 400.36 456.41 400.36 456.41 390.09 437.69 390.09 437.69 383.77 457.44 383.77 457.44 373.5 426.72 373.5 426.72 417.99 458.48 417.99 458.48 407.72"/>
</g>
<path d="m243.63 379.09l-37.842-1.852 46.229-0.034v-3.727h-52.125l-1e-3 7.798v6.201c0 0.115-1.52-9.144-1.87-11.734h-4.098v13.029c0 0.123-1.753-10.888-1.939-12.264h-27.914c1.902 1.648 12.401 10.598 19.865 14.28 3.741 1.846 8.33 1.86 12.414 1.974 2.075 0.06 4.25 0.217 5.803 1.754 2.255 2.236 2.758 5.704 0.814 8.33-1.922 2.594-7.335 3.156-7.335 3.156l-4.509 5.531v6.424h10.251l0.319-6.348 8.863-6.285c-0.946 0.757-3.058 2.783-6.229 7.666-0.717 1.102-1.275 2.306-1.711 3.49 2.238-1.896 6.84-3.194 12.153-3.194 5.307 0 9.903 1.295 12.146 3.188-0.437-1.185-0.994-2.385-1.709-3.483-3.172-4.883-5.284-6.909-6.229-7.666l8.863 6.285 0.32 6.348h9.565v-6.424l-4.507-5.531s-6.675-0.425-8.423-3.156c-5.032-7.869 2.115-20.082 18.836-23.756z" fill="#1E2D41"/>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

+19 -1
View File
@@ -28,7 +28,7 @@ minecraft {
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
@@ -64,6 +64,24 @@ minecraft {
}
}
}
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
@@ -1,7 +1,7 @@
package com.example.examplemod;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
+3 -3
View File
@@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[25,)" #mandatory (24 is current forge version)
loaderVersion="[26,)" #mandatory (26 is current forge version)
# 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 +42,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="[25,)" #mandatory
versionRange="[27,)" #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 +51,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.13.2]"
versionRange="[1.14.3]"
ordering="NONE"
side="BOTH"
@@ -11,7 +11,7 @@
public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) {
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938));
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936));
@@ -909,6 +913,10 @@
@@ -913,6 +917,10 @@
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
}
@@ -1,14 +0,0 @@
--- a/com/mojang/blaze3d/platform/TextureUtil.java
+++ b/com/mojang/blaze3d/platform/TextureUtil.java
@@ -44,7 +44,10 @@
}
public static void prepareImage(NativeImage.PixelFormatGLCode p_prepareImage_0_, int p_prepareImage_1_, int p_prepareImage_2_, int p_prepareImage_3_, int p_prepareImage_4_) {
- bind(p_prepareImage_1_);
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
+ {
+ bind(p_prepareImage_1_);
+ }
if (p_prepareImage_2_ >= 0) {
GlStateManager.texParameter(3553, 33085, p_prepareImage_2_);
GlStateManager.texParameter(3553, 33082, 0);
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -186,6 +186,8 @@
@@ -187,6 +187,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
@@ -9,8 +9,8 @@
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -198,6 +200,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_82766_b("announceAdvancements")) {
@@ -199,6 +201,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Block.java
+++ b/net/minecraft/block/Block.java
@@ -74,9 +74,10 @@
@@ -75,9 +75,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -13,7 +13,16 @@
private static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
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_) {
@@ -290,7 +291,7 @@
@@ -246,6 +247,8 @@
this.field_149765_K = p_i48440_1_.field_200961_i;
this.field_208621_p = p_i48440_1_.field_208772_j;
this.field_220085_g = p_i48440_1_.field_222381_j;
+ this.harvestLevel = p_i48440_1_.harvestLevel;
+ this.harvestTool = p_i48440_1_.harvestTool;
this.field_176227_L = builder.func_206893_a(BlockState::new);
this.func_180632_j(this.field_176227_L.func_177621_b());
}
@@ -291,7 +294,7 @@
@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
@@ -22,7 +31,7 @@
}
@Deprecated
@@ -302,8 +303,9 @@
@@ -303,8 +306,9 @@
return this.field_149789_z;
}
@@ -33,7 +42,7 @@
}
@Deprecated
@@ -314,7 +316,7 @@
@@ -315,7 +319,7 @@
@Deprecated
@OnlyIn(Dist.CLIENT)
public int func_220058_a(BlockState p_220058_1_, IEnviromentBlockReader p_220058_2_, BlockPos p_220058_3_) {
@@ -42,7 +51,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -459,10 +461,9 @@
@@ -460,10 +464,9 @@
@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_) {
@@ -54,7 +63,7 @@
}
@Deprecated
@@ -471,8 +472,8 @@
@@ -472,8 +475,8 @@
if (f == -1.0F) {
return 0.0F;
} else {
@@ -65,25 +74,25 @@
}
}
@@ -552,7 +553,7 @@
@@ -553,7 +556,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_82766_b("doTileDrops")) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
- 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) { // do not drop items while restoring blockstates, prevents item dupe
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;
@@ -564,7 +565,7 @@
@@ -565,7 +568,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_82766_b("doTileDrops")) {
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops") && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
- 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) { // do not drop items while restoring blockstates, prevents item dupe
while(p_180637_3_ > 0) {
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
p_180637_3_ -= i;
@@ -574,6 +575,7 @@
@@ -575,6 +578,7 @@
}
@@ -91,7 +100,7 @@
public float func_149638_a() {
return this.field_149781_w;
}
@@ -676,6 +678,7 @@
@@ -677,6 +681,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
}
@@ -99,7 +108,7 @@
@OnlyIn(Dist.CLIENT)
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
return new ItemStack(this);
@@ -690,6 +693,7 @@
@@ -691,6 +696,7 @@
return Fluids.field_204541_a.func_207188_f();
}
@@ -107,7 +116,7 @@
public float func_208618_m() {
return this.field_149765_K;
}
@@ -710,6 +714,7 @@
@@ -711,6 +717,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
}
@@ -115,7 +124,7 @@
public boolean func_149659_a(Explosion p_149659_1_) {
return true;
}
@@ -754,6 +759,7 @@
@@ -755,6 +762,7 @@
}
}
@@ -123,7 +132,7 @@
public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H;
}
@@ -779,13 +785,74 @@
@@ -780,13 +788,80 @@
}
public static boolean func_196252_e(Block p_196252_0_) {
@@ -140,6 +149,7 @@
+ protected Random RANDOM = new Random();
+ private net.minecraftforge.common.ToolType harvestTool;
+ private int harvestLevel;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::getGeneration, BlockTags::func_199896_a);
+
+ @Override
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
@@ -189,6 +199,11 @@
+ return false;
+ }
+
+ @Override
+ public final java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ static {
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
+ block.harvestTool = tool;
@@ -200,3 +215,38 @@
public static enum OffsetType {
NONE,
XZ,
@@ -805,6 +880,8 @@
private float field_200961_i = 0.6F;
private ResourceLocation field_222381_j;
private boolean field_208772_j;
+ private int harvestLevel = -1;
+ private net.minecraftforge.common.ToolType harvestTool;
private Properties(Material p_i48616_1_, MaterialColor p_i48616_2_) {
this.field_200953_a = p_i48616_1_;
@@ -835,6 +912,8 @@
block$properties.field_200956_d = p_200950_0_.field_149762_H;
block$properties.field_200961_i = p_200950_0_.func_208618_m();
block$properties.field_208772_j = p_200950_0_.field_208621_p;
+ block$properties.harvestLevel = p_200950_0_.harvestLevel;
+ block$properties.harvestTool = p_200950_0_.harvestTool;
return block$properties;
}
@@ -883,6 +962,16 @@
return this;
}
+ public Block.Properties harvestLevel(int harvestLevel) {
+ this.harvestLevel = harvestLevel;
+ return this;
+ }
+
+ public Block.Properties harvestTool(net.minecraftforge.common.ToolType harvestTool) {
+ this.harvestTool = harvestTool;
+ return this;
+ }
+
public Block.Properties func_222380_e() {
this.field_222381_j = LootTables.field_186419_a;
return this;
@@ -9,7 +9,7 @@
@Nullable
private BlockState.Cache field_215707_c;
private final int field_215708_d;
@@ -107,10 +107,14 @@
@@ -106,10 +106,14 @@
return this.field_215708_d;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CropsBlock.java
+++ b/net/minecraft/block/CropsBlock.java
@@ -58,12 +58,14 @@
@@ -59,12 +59,14 @@
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
@@ -16,7 +16,7 @@
}
}
}
@@ -92,9 +94,9 @@
@@ -93,9 +95,9 @@
for(int j = -1; j <= 1; ++j) {
float f1 = 0.0F;
BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
@@ -28,3 +28,12 @@
f1 = 3.0F;
}
}
@@ -131,7 +133,7 @@
}
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
- if (p_196262_4_ instanceof RavagerEntity && p_196262_2_.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (p_196262_4_ instanceof RavagerEntity && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_196262_2_, p_196262_4_)) {
p_196262_2_.func_175655_b(p_196262_3_, true);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DetectorRailBlock.java
+++ b/net/minecraft/block/DetectorRailBlock.java
@@ -126,6 +126,8 @@
@@ -128,6 +128,8 @@
public int func_180641_l(BlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
if (p_180641_1_.func_177229_b(field_176574_M)) {
@@ -1,15 +1,15 @@
--- a/net/minecraft/block/FarmlandBlock.java
+++ b/net/minecraft/block/FarmlandBlock.java
@@ -72,7 +72,7 @@
@@ -73,7 +73,7 @@
}
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) {
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 0.512F) {
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 0.512F) {
+ if (!p_180658_1_.field_72995_K && net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) { // Forge: Move logic to Entity#canTrample
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -83,9 +83,9 @@
@@ -84,9 +84,9 @@
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_));
}
@@ -22,7 +22,7 @@
}
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -95,7 +95,7 @@
@@ -96,7 +96,7 @@
}
}
@@ -1,10 +1,10 @@
--- a/net/minecraft/block/FireBlock.java
+++ b/net/minecraft/block/FireBlock.java
@@ -63,13 +63,13 @@
@@ -64,13 +64,13 @@
public 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) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) {
- 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)) {
BlockState blockstate1 = this.func_176223_P();
@@ -16,10 +16,10 @@
}
}
@@ -90,12 +90,14 @@
@@ -91,12 +91,14 @@
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) {
if (p_196267_2_.func_82736_K().func_223586_b(GameRules.field_223598_a)) {
+ if (!p_196267_2_.isAreaLoaded(p_196267_3_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
p_196267_2_.func_217377_a(p_196267_3_, false);
@@ -32,7 +32,7 @@
int i = p_196267_1_.func_177229_b(field_176543_a);
if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_196267_2_.func_217377_a(p_196267_3_, false);
@@ -117,7 +119,7 @@
@@ -118,7 +120,7 @@
return;
}
@@ -41,7 +41,7 @@
p_196267_2_.func_217377_a(p_196267_3_, false);
return;
}
@@ -125,12 +127,12 @@
@@ -126,12 +128,12 @@
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
int k = flag1 ? -50 : 0;
@@ -60,7 +60,7 @@
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for(int l = -1; l <= 1; ++l) {
@@ -168,16 +170,18 @@
@@ -169,16 +171,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());
}
@@ -83,7 +83,7 @@
if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -198,7 +202,7 @@
@@ -199,7 +203,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) {
@@ -92,7 +92,7 @@
return true;
}
}
@@ -214,13 +218,14 @@
@@ -215,13 +219,14 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -108,18 +108,18 @@
public boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0;
}
@@ -245,8 +250,8 @@
@@ -246,8 +251,8 @@
BlockPos blockpos = p_180655_3_.func_177977_b();
BlockState blockstate = p_180655_2_.func_180495_p(blockpos);
- if (!this.func_196446_i(blockstate) && !Block.func_220056_d(blockstate, p_180655_2_, blockpos, Direction.UP)) {
- if (!this.func_196446_i(blockstate) && !blockstate.func_224755_d(p_180655_2_, blockpos, Direction.UP)) {
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177976_e()))) {
+ if (!this.canCatchFire(p_180655_2_, blockpos, Direction.UP) && !Block.func_220056_d(blockstate, p_180655_2_, blockpos, Direction.UP)) {
+ if (this.canCatchFire(p_180655_2_, blockpos.func_177976_e(), Direction.EAST)) {
for(int j = 0; j < 2; ++j) {
double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F;
double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -255,7 +260,7 @@
@@ -256,7 +261,7 @@
}
}
@@ -128,7 +128,7 @@
for(int k = 0; k < 2; ++k) {
double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -264,7 +269,7 @@
@@ -265,7 +270,7 @@
}
}
@@ -137,7 +137,7 @@
for(int l = 0; l < 2; ++l) {
double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -273,7 +278,7 @@
@@ -274,7 +279,7 @@
}
}
@@ -146,7 +146,7 @@
for(int i1 = 0; i1 < 2; ++i1) {
double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -282,7 +287,7 @@
@@ -283,7 +288,7 @@
}
}
@@ -155,7 +155,7 @@
for(int j1 = 0; j1 < 2; ++j1) {
double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
@@ -310,10 +315,23 @@
@@ -311,10 +316,23 @@
}
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/NetherPortalBlock.java
+++ b/net/minecraft/block/NetherPortalBlock.java
@@ -68,7 +68,7 @@
@@ -69,7 +69,7 @@
public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) {
NetherPortalBlock.Size netherportalblock$size = this.func_201816_b(p_176548_1_, p_176548_2_);
@@ -18,12 +18,20 @@
}
protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, BlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
@@ -105,7 +111,7 @@
RailShape railshape = blockstate.func_177229_b(field_176568_b);
@@ -99,13 +105,13 @@
protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) {
BlockState blockstate = p_208071_1_.func_180495_p(p_208071_2_);
- if (blockstate.func_177230_c() != this) {
+ if (!(blockstate.func_177230_c() instanceof PoweredRailBlock)) {
return false;
} else {
- RailShape railshape = blockstate.func_177229_b(field_176568_b);
+ RailShape railshape = getRailDirection(blockstate, p_208071_1_, p_208071_2_, null);
if (p_208071_5_ != RailShape.EAST_WEST || railshape != RailShape.NORTH_SOUTH && railshape != RailShape.ASCENDING_NORTH && railshape != RailShape.ASCENDING_SOUTH) {
if (p_208071_5_ != RailShape.NORTH_SOUTH || railshape != RailShape.EAST_WEST && railshape != RailShape.ASCENDING_EAST && railshape != RailShape.ASCENDING_WEST) {
- if (blockstate.func_177229_b(field_176569_M)) {
+ if (!(blockstate.func_177230_c() instanceof PoweredRailBlock) || isActivator != ((PoweredRailBlock)blockstate.func_177230_c()).isActivator) {
+ if (isActivator == ((PoweredRailBlock)blockstate.func_177230_c()).isActivator) {
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;
@@ -3,10 +3,10 @@
@@ -124,7 +124,7 @@
BlockState blockstate1 = p_208074_1_.func_180495_p(blockpos1);
if (!blockstate1.func_215686_e(p_208074_1_, blockpos1)) {
boolean flag = Block.func_220056_d(blockstate, p_208074_1_, blockpos, Direction.UP) || blockstate.func_177230_c() == Blocks.field_150438_bZ;
boolean flag = blockstate.func_224755_d(p_208074_1_, blockpos, Direction.UP) || blockstate.func_177230_c() == Blocks.field_150438_bZ;
- if (flag && func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177984_a()))) {
+ if (flag && canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177984_a()), p_208074_1_, blockpos.func_177984_a(), null)) {
if (func_208062_a(blockstate.func_196952_d(p_208074_1_, blockpos))) {
if (blockstate.func_224756_o(p_208074_1_, blockpos)) {
return RedstoneSide.UP;
}
@@ -133,7 +133,7 @@
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/ScaffoldingBlock.java
+++ b/net/minecraft/block/ScaffoldingBlock.java
@@ -142,6 +142,8 @@
return i;
}
+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
+
static {
VoxelShape voxelshape = Block.func_208617_a(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D);
VoxelShape voxelshape1 = Block.func_208617_a(0.0D, 0.0D, 0.0D, 2.0D, 16.0D, 2.0D);
@@ -7,4 +7,4 @@
+ if (!p_196267_2_.isAreaLoaded(p_196267_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
if (!func_220257_b(p_196267_1_, p_196267_2_, p_196267_3_)) {
p_196267_2_.func_175656_a(p_196267_3_, Blocks.field_150346_d.func_176223_P());
} else if (p_196267_2_.func_201696_r(p_196267_3_.func_177984_a()) >= 4) {
} else {
@@ -1,10 +1,9 @@
--- a/net/minecraft/block/TrapDoorBlock.java
+++ b/net/minecraft/block/TrapDoorBlock.java
@@ -151,4 +151,14 @@
@@ -153,6 +153,16 @@
return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
}
+
+ @Override
+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
+ if (state.func_177229_b(field_176283_b)) {
@@ -14,4 +13,7 @@
+ }
+ return false;
+ }
}
+
public boolean func_220067_a(BlockState p_220067_1_, IBlockReader p_220067_2_, BlockPos p_220067_3_, EntityType<?> p_220067_4_) {
return false;
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/TurtleEggBlock.java
+++ b/net/minecraft/block/TurtleEggBlock.java
@@ -146,7 +146,7 @@
if (p_212570_2_ instanceof TurtleEntity) {
return false;
} else {
- return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b) : true;
+ return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_) : true;
}
}
}
@@ -18,3 +18,10 @@
Direction direction = Direction.func_176741_a(p_196267_4_);
BlockPos blockpos = p_196267_3_.func_177984_a();
if (direction.func_176740_k().func_176722_c() && !p_196267_1_.func_177229_b(func_176267_a(direction))) {
@@ -329,4 +329,6 @@
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
return field_196546_A.get(p_176267_0_);
}
+
+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/GameSettings.java
+++ b/net/minecraft/client/GameSettings.java
@@ -142,7 +142,7 @@
@@ -143,7 +143,7 @@
public final KeyBinding[] field_151456_ac = new KeyBinding[]{new KeyBinding("key.hotbar.1", 49, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 50, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 51, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 52, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 53, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 54, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 55, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 56, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 57, "key.categories.inventory")};
public final KeyBinding field_193629_ap = new KeyBinding("key.saveToolbarActivator", 67, "key.categories.creative");
public final KeyBinding field_193630_aq = new KeyBinding("key.loadToolbarActivator", 88, "key.categories.creative");
@@ -9,7 +9,7 @@
protected Minecraft field_74317_L;
private final File field_74354_ai;
public Difficulty field_74318_M = Difficulty.NORMAL;
@@ -161,6 +161,7 @@
@@ -162,6 +162,7 @@
public String field_74363_ab = "en_us";
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
@@ -17,7 +17,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) {
@@ -462,7 +463,11 @@
@@ -467,7 +468,11 @@
for(KeyBinding keybinding : this.field_74324_K) {
if (s1.equals("key_" + keybinding.func_151464_g())) {
@@ -30,7 +30,7 @@
}
}
@@ -510,6 +515,7 @@
@@ -515,6 +520,7 @@
}
public void func_74303_b() {
@@ -38,7 +38,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));
@@ -583,7 +589,7 @@
@@ -589,7 +595,7 @@
printwriter.println("glDebugVerbosity:" + this.field_209231_W);
for(KeyBinding keybinding : this.field_74324_K) {
@@ -47,7 +47,7 @@
}
for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -680,6 +686,25 @@
@@ -686,6 +692,25 @@
}
}
@@ -24,9 +24,9 @@
Screen.wrapScreenError(() -> {
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
if (p_197961_5_ == 0) {
- aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
- aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_);
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
}
} else {
@@ -25,7 +25,15 @@
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_147129_ai = func_147122_X();
this.field_71437_Z = null;
@@ -451,6 +451,7 @@
@@ -442,7 +442,6 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
- this.field_71417_B.func_198029_a(this.field_195558_d.func_198092_i());
this.field_195559_v = new KeyboardListener(this);
this.field_195559_v.func_197968_a(this.field_195558_d.func_198092_i());
GLX.init();
@@ -451,6 +450,7 @@
this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
this.field_110451_am = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES, this.field_152352_aC);
this.field_71474_y.func_198017_a(this.field_110448_aq);
@@ -33,70 +41,35 @@
this.field_110448_aq.func_198983_a();
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
@@ -463,6 +464,7 @@
this.field_135017_as.func_135043_a(list);
this.field_71446_o = new TextureManager(this.field_110451_am);
this.field_110451_am.func_219534_a(this.field_71446_o);
+ //net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.textureManager);
this.func_213226_a();
this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
this.field_71469_aa = new SaveFormat(this.field_71412_D.toPath().resolve("saves"), this.field_71412_D.toPath().resolve("backups"), this.field_184131_U);
@@ -480,11 +482,14 @@
this.field_110451_am.func_219534_a(new GrassColorReloadListener());
this.field_110451_am.func_219534_a(new FoliageColorReloadListener());
+ try (net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Rendering Setup", 5, true)) {
+ bar.step("GL Setup");
this.field_195558_d.func_198076_a("Startup");
GlStateManager.enableTexture();
GlStateManager.shadeModel(7425);
GlStateManager.clearDepth(1.0D);
GlStateManager.enableDepthTest();
+ net.minecraftforge.fml.client.ClientModLoader.complete();
GlStateManager.depthFunc(515);
GlStateManager.enableAlphaTest();
GlStateManager.alphaFunc(516, 0.1F);
@@ -493,19 +498,24 @@
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
this.field_195558_d.func_198076_a("Post startup");
+ bar.step("Loading Texture Map");
this.field_147128_au = new AtlasTexture("textures");
this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
this.field_71446_o.func_110580_a(AtlasTexture.field_110575_b, this.field_147128_au);
this.field_71446_o.func_110577_a(AtlasTexture.field_110575_b);
this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
+ bar.step("Loading Model Manager");
this.field_175617_aL = new ModelManager(this.field_147128_au);
this.field_110451_am.func_219534_a(this.field_175617_aL);
this.field_184127_aH = BlockColors.func_186723_a();
this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
+ bar.step("Loading Item Renderer");
this.field_175621_X = new ItemRenderer(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
this.field_175616_W = new EntityRendererManager(this.field_71446_o, this.field_175621_X, this.field_110451_am);
this.field_175620_Y = new FirstPersonRenderer(this);
this.field_110451_am.func_219534_a(this.field_175621_X);
+ bar.step("Loading Entity Renderer");
+ //net.minecraftforge.fml.client.SplashProgress.pause();
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
this.field_110451_am.func_219534_a(this.field_71460_t);
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
@@ -521,9 +531,13 @@
@@ -521,7 +521,8 @@
this.field_110451_am.func_219534_a(this.field_213272_aL);
this.field_213273_aM = new PotionSpriteUploader(this.field_71446_o);
this.field_110451_am.func_219534_a(this.field_213273_aM);
- this.field_71456_v = new IngameGui(this);
+ //net.minecraftforge.fml.client.SplashProgress.resume();
+ }; // Forge: end progress bar
+ net.minecraftforge.fml.client.ClientModLoader.end();
+ this.field_71456_v = new net.minecraftforge.client.ForgeIngameGui(this);
+ this.field_71417_B.func_198029_a(this.field_195558_d.func_198092_i()); //Forge: Moved below ingameGUI setting to prevent NPEs in handeler.
this.field_184132_p = new DebugRenderer(this);
GLX.setGlfwErrorCallback(this::func_195545_a);
+ net.minecraftforge.fml.client.ClientModLoader.complete();
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
this.field_195558_d.func_198077_g();
this.field_71474_y.field_74353_u = this.field_195558_d.func_198113_j();
@@ -646,7 +660,7 @@
@@ -543,7 +544,7 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
-
+ net.minecraftforge.fml.client.ClientModLoader.complete();
}, false));
}
@@ -558,7 +559,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_) -> {
- return ItemTags.func_199903_a().func_199913_a(p_213235_0_.func_77973_b()).stream();
+ return p_213235_0_.func_77973_b().getTags().stream();
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -647,7 +648,7 @@
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
if (p_71377_1_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
@@ -105,7 +78,7 @@
} else if (p_71377_1_.func_147149_a(file2)) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
System.exit(-1);
@@ -661,6 +675,7 @@
@@ -662,6 +663,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -113,7 +86,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -740,16 +755,20 @@
@@ -741,16 +743,20 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -138,7 +111,7 @@
if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) {
this.field_71474_y.field_74330_P = false;
this.field_71456_v.func_146158_b().func_146231_a(true);
@@ -874,11 +893,13 @@
@@ -875,11 +881,13 @@
GlStateManager.enableTexture();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -152,21 +125,20 @@
}
this.field_71424_I.func_219897_b();
@@ -1146,10 +1167,10 @@
@@ -1147,10 +1155,10 @@
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();
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
- Direction direction = blockraytraceresult.func_216354_b();
+ Direction direction = blockraytraceresult.func_216354_b();
+ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, direction)) {
+ if (!this.field_71441_e.func_175623_d(blockpos)) {
Direction direction = blockraytraceresult.func_216354_b();
if (this.field_71442_b.func_180512_c(blockpos, direction)) {
- this.field_71452_i.func_180532_a(blockpos, direction);
+ this.field_71452_i.addBlockHitEffects(blockpos, blockraytraceresult);
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1176,7 +1197,7 @@
@@ -1177,7 +1185,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -175,7 +147,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1186,6 +1207,7 @@
@@ -1187,6 +1195,7 @@
}
this.field_71439_g.func_184821_cY();
@@ -183,7 +155,7 @@
}
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
@@ -1235,6 +1257,9 @@
@@ -1236,6 +1245,9 @@
}
}
@@ -193,7 +165,7 @@
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand) == ActionResultType.SUCCESS) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
return;
@@ -1254,6 +1279,8 @@
@@ -1255,6 +1267,8 @@
--this.field_71467_ac;
}
@@ -202,7 +174,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1372,6 +1399,8 @@
@@ -1373,6 +1387,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -211,15 +183,7 @@
}
private void func_184117_aA() {
@@ -1430,6 +1459,7 @@
this.field_71439_g.func_71040_bB(Screen.hasControlDown());
}
}
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
boolean flag2 = this.field_71474_y.field_74343_n != ChatVisibility.HIDDEN;
if (flag2) {
@@ -1526,6 +1556,12 @@
@@ -1527,6 +1543,12 @@
this.func_147108_a(worldloadprogressscreen);
while(!this.field_71437_Z.func_71200_ad()) {
@@ -232,7 +196,7 @@
worldloadprogressscreen.tick();
this.func_195542_b(false);
@@ -1546,11 +1582,17 @@
@@ -1547,11 +1569,17 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_213261_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -251,7 +215,15 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1623,6 +1665,7 @@
@@ -1587,6 +1615,7 @@
NarratorChatListener.field_193643_a.func_193642_b();
this.func_213241_c(p_213231_1_);
if (this.field_71441_e != null) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
if (integratedserver != null) {
while(!integratedserver.func_213201_w()) {
this.func_195542_b(false);
@@ -1624,6 +1653,7 @@
}
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
@@ -259,7 +231,7 @@
}
public final boolean func_71355_q() {
@@ -1648,112 +1691,8 @@
@@ -1649,112 +1679,8 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@@ -374,7 +346,7 @@
}
}
@@ -1825,6 +1764,7 @@
@@ -1826,6 +1752,7 @@
return field_71432_P;
}
@@ -382,7 +354,7 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> {
return p_213240_0_;
@@ -1968,6 +1908,8 @@
@@ -1972,6 +1899,8 @@
}
public MusicTicker.MusicType func_147109_W() {
@@ -391,7 +363,7 @@
if (this.field_71462_r instanceof WinGameScreen) {
return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) {
@@ -2124,4 +2066,12 @@
@@ -2128,4 +2057,12 @@
public LoadingGui func_213250_au() {
return this.field_213279_p;
}
@@ -49,3 +49,29 @@
}, "mouseDragged event handler", iguieventlistener.getClass().getCanonicalName());
}
}
@@ -233,6 +241,10 @@
return this.field_198039_d;
}
+ public boolean isMiddleDown() {
+ return this.field_198038_c;
+ }
+
public double func_198024_e() {
return this.field_198040_e;
}
@@ -241,6 +253,14 @@
return this.field_198041_f;
}
+ public double getXVelocity() {
+ return this.field_198048_m;
+ }
+
+ public double getYVelocity() {
+ return this.field_198049_n;
+ }
+
public void func_198021_g() {
this.field_198043_h = true;
}
@@ -1,42 +1,6 @@
--- a/net/minecraft/client/audio/SoundHandler.java
+++ b/net/minecraft/client/audio/SoundHandler.java
@@ -61,6 +61,7 @@
SoundHandler.Loader soundhandler$loader = new SoundHandler.Loader();
p_212854_2_.func_219894_a();
+ java.util.List<net.minecraft.util.Tuple<ResourceLocation, Runnable>> resources = new java.util.LinkedList<>();
for(String s : p_212854_1_.func_199001_a()) {
p_212854_2_.func_76320_a(s);
@@ -74,7 +75,9 @@
p_212854_2_.func_219895_b("register");
for(Entry<String, SoundList> entry : map.entrySet()) {
+ resources.add(new net.minecraft.util.Tuple<>(new ResourceLocation(s, entry.getKey()), () -> {
soundhandler$loader.func_217944_a(new ResourceLocation(s, entry.getKey()), entry.getValue(), p_212854_1_);
+ }));
}
p_212854_2_.func_76319_b();
@@ -91,6 +94,17 @@
p_212854_2_.func_76319_b();
}
+ net.minecraftforge.fml.common.progress.StartupProgressManager.start("Loading sounds", resources.size(), bar -> {
+ resources.forEach(entry -> {
+ bar.step(entry.func_76341_a().toString());
+ try {
+ entry.func_76340_b().run();
+ } catch (RuntimeException e) {
+ field_147698_b.warn("Invalid sounds.json", e);
+ }
+ });
+ });
+
p_212854_2_.func_219897_b();
return soundhandler$loader;
}
@@ -210,6 +224,11 @@
@@ -210,6 +210,11 @@
this.field_147694_f.func_195855_a(p_195478_1_, p_195478_2_);
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/ResourceLoadProgressGui.java
+++ b/net/minecraft/client/gui/ResourceLoadProgressGui.java
@@ -79,6 +79,7 @@
this.blit(k1, i1, 0, 0, 256, 256);
float f3 = this.field_212975_c.func_219555_b();
this.field_212978_f = this.field_212978_f * 0.95F + f3 * 0.050000012F;
+ net.minecraftforge.fml.client.ClientModLoader.renderProgressText();
if (f < 1.0F) {
this.func_212972_a(i / 2 - 150, j / 4 * 3, i / 2 + 150, j / 4 * 3 + 10, this.field_212978_f, 1.0F - MathHelper.func_76131_a(f, 0.0F, 1.0F));
}
@@ -0,0 +1,25 @@
--- a/net/minecraft/client/gui/ScreenManager.java
+++ b/net/minecraft/client/gui/ScreenManager.java
@@ -39,6 +39,10 @@
private static final Map<ContainerType<?>, ScreenManager.IScreenFactory<?, ?>> field_216914_b = Maps.newHashMap();
public static <T extends Container> void func_216909_a(@Nullable ContainerType<T> p_216909_0_, Minecraft p_216909_1_, int p_216909_2_, ITextComponent p_216909_3_) {
+ getScreenFactory(p_216909_0_, p_216909_1_, p_216909_2_, p_216909_3_).ifPresent(f -> f.func_216908_a(p_216909_3_, p_216909_0_, p_216909_1_, p_216909_2_));
+ }
+
+ public static <T extends Container> java.util.Optional<IScreenFactory<T, ?>> getScreenFactory(@Nullable ContainerType<T> p_216909_0_, Minecraft p_216909_1_, int p_216909_2_, ITextComponent p_216909_3_) {
if (p_216909_0_ == null) {
field_216913_a.warn("Trying to open invalid screen with name: {}", (Object)p_216909_3_.getString());
} else {
@@ -46,9 +50,10 @@
if (iscreenfactory == null) {
field_216913_a.warn("Failed to create screen for menu type: {}", (Object)Registry.field_218366_G.func_177774_c(p_216909_0_));
} else {
- iscreenfactory.func_216908_a(p_216909_3_, p_216909_0_, p_216909_1_, p_216909_2_);
+ return java.util.Optional.of(iscreenfactory);
}
}
+ return java.util.Optional.empty();
}
@Nullable
@@ -0,0 +1,28 @@
--- a/net/minecraft/client/gui/overlay/DebugOverlayGui.java
+++ b/net/minecraft/client/gui/overlay/DebugOverlayGui.java
@@ -342,7 +342,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 : blockstate.func_177230_c().getTags()) {
list.add("#" + resourcelocation);
}
}
@@ -358,7 +358,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(ifluidstate.func_206886_c())) {
+ for(ResourceLocation resourcelocation1 : ifluidstate.func_206886_c().getTags()) {
list.add("#" + resourcelocation1);
}
}
@@ -368,6 +368,7 @@
list.add("");
list.add(TextFormatting.UNDERLINE + "Targeted Entity");
list.add(String.valueOf((Object)Registry.field_212629_r.func_177774_c(entity.func_200600_R())));
+ entity.func_200600_R().getTags().forEach(t -> list.add("#" + t));
}
return list;
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/gui/recipebook/RecipeBookGui.java
+++ b/net/minecraft/client/gui/recipebook/RecipeBookGui.java
@@ -367,7 +367,7 @@
return true;
} else if (this.field_191888_F.field_71474_y.field_74310_D.func_197976_a(p_keyPressed_1_, p_keyPressed_2_) && !this.field_193962_q.isFocused()) {
this.field_199738_u = true;
- this.field_193962_q.func_146195_b(true);
+ this.field_193962_q.setFocused(true);
return true;
} else {
return false;
@@ -89,7 +89,7 @@
this.func_205702_a();
this.field_193018_j.clear();
- for(RecipeBookCategories recipebookcategories : ClientRecipeBook.func_216769_b(this.field_201522_g)) {
+ for(RecipeBookCategories recipebookcategories : this.field_201522_g.getRecipeBookCategories()) {
this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories));
}
@@ -421,7 +421,7 @@
languagemanager.func_135045_a(language);
@@ -1,29 +0,0 @@
--- a/net/minecraft/client/gui/screen/AbstractCommandBlockScreen.java
+++ b/net/minecraft/client/gui/screen/AbstractCommandBlockScreen.java
@@ -86,7 +86,7 @@
this.field_195239_f.func_146180_a("-");
this.children.add(this.field_195239_f);
this.func_212928_a(this.field_195237_a);
- this.field_195237_a.func_146195_b(true);
+ this.field_195237_a.setFocused(true);
this.func_209106_o();
}
@@ -247,7 +247,7 @@
if (!list.isEmpty()) {
this.field_209111_t.addAll(list);
- this.field_209112_u = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestioncontext.startPos), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.func_146200_o() - i);
+ this.field_209112_u = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestioncontext.startPos), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.getWidth() - i);
this.field_209113_v = i;
}
@@ -290,7 +290,7 @@
i = Math.max(i, this.font.func_78256_a(suggestion.getText()));
}
- int j = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestions.getRange().getStart()), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.func_146200_o() - i);
+ int j = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestions.getRange().getStart()), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.getWidth() - i);
this.field_209116_y = new AbstractCommandBlockScreen.SuggestionsList(j, 72, i, suggestions);
}
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/AddServerScreen.java
+++ b/net/minecraft/client/gui/screen/AddServerScreen.java
@@ -53,7 +53,7 @@
protected void init() {
this.minecraft.field_195559_v.func_197967_a(true);
this.field_146309_g = new TextFieldWidget(this.font, this.width / 2 - 100, 66, 200, 20, I18n.func_135052_a("addServer.enterName"));
- this.field_146309_g.func_146195_b(true);
+ this.field_146309_g.setFocused(true);
this.field_146309_g.func_146180_a(this.field_146311_h.field_78847_a);
this.field_146309_g.func_212954_a(this::func_213028_a);
this.children.add(this.field_146309_g);
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/ChatScreen.java
+++ b/net/minecraft/client/gui/screen/ChatScreen.java
@@ -351,7 +351,7 @@
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
this.setFocused(this.field_146415_a);
- this.field_146415_a.func_146195_b(true);
+ this.field_146415_a.setFocused(true);
fill(2, this.height - 14, this.width - 2, this.height - 2, this.minecraft.field_71474_y.func_216839_a(Integer.MIN_VALUE));
this.field_146415_a.render(p_render_1_, p_render_2_, p_render_3_);
if (this.field_195139_w != null) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/MainMenuScreen.java
+++ b/net/minecraft/client/gui/screen/MainMenuScreen.java
@@ -58,6 +58,7 @@
@@ -51,6 +51,7 @@
private final RenderSkybox field_209101_K = new RenderSkybox(field_213098_a);
private final boolean field_213102_y;
private long field_213103_z;
@@ -8,7 +8,7 @@
public MainMenuScreen() {
this(false);
@@ -108,10 +109,14 @@
@@ -98,10 +99,14 @@
this.field_193979_N = this.width - this.field_193978_M - 2;
int i = 24;
int j = this.height / 4 + 48;
@@ -23,7 +23,7 @@
}
this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_213090_1_) -> {
@@ -146,6 +151,7 @@
@@ -130,6 +135,7 @@
if (this.func_183501_a()) {
this.field_183503_M.init(this.minecraft, this.width, this.height);
}
@@ -31,7 +31,7 @@
}
@@ -156,7 +162,7 @@
@@ -140,7 +146,7 @@
this.addButton(new Button(this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, 200, 20, I18n.func_135052_a("menu.multiplayer"), (p_213086_1_) -> {
this.minecraft.func_147108_a(new MultiplayerScreen(this));
}));
@@ -40,7 +40,7 @@
this.func_140005_i();
}));
}
@@ -220,6 +226,7 @@
@@ -204,6 +210,7 @@
this.minecraft.func_110434_K().func_110577_a(field_194400_H);
blit(j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
@@ -48,7 +48,7 @@
if (this.field_73975_c != null) {
GlStateManager.pushMatrix();
GlStateManager.translatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
@@ -238,7 +245,10 @@
@@ -222,7 +229,10 @@
s = s + ("release".equalsIgnoreCase(this.minecraft.func_184123_d()) ? "" : "/" + this.minecraft.func_184123_d());
}
@@ -60,7 +60,7 @@
this.drawString(this.font, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.height - 10, 16777215 | l);
if (p_render_1_ > this.field_193979_N && p_render_1_ < this.field_193979_N + this.field_193978_M && p_render_2_ > this.height - 10 && p_render_2_ < this.height) {
fill(this.field_193979_N, this.height - 1, this.field_193979_N + this.field_193978_M, this.height, 16777215 | l);
@@ -258,6 +268,7 @@
@@ -240,6 +250,7 @@
if (this.func_183501_a() && f1 >= 1.0F) {
this.field_183503_M.render(p_render_1_, p_render_2_, p_render_3_);
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/ServerListScreen.java
+++ b/net/minecraft/client/gui/screen/ServerListScreen.java
@@ -37,7 +37,7 @@
}));
this.field_146302_g = new TextFieldWidget(this.font, this.width / 2 - 100, 116, 200, 20, I18n.func_135052_a("addServer.enterIp"));
this.field_146302_g.func_146203_f(128);
- this.field_146302_g.func_146195_b(true);
+ this.field_146302_g.setFocused(true);
this.field_146302_g.func_146180_a(this.minecraft.field_71474_y.field_74332_R);
this.field_146302_g.func_212954_a((p_213024_1_) -> {
this.func_195168_i();
@@ -119,7 +119,7 @@
this.field_147008_s.clear();
(this.field_147002_h).field_148330_a.clear();
if (p_147050_1_ == ItemGroup.field_192395_m) {
@@ -494,19 +531,21 @@
@@ -494,13 +531,15 @@
}
if (this.field_147062_A != null) {
@@ -127,8 +127,7 @@
+ if (p_147050_1_.hasSearchBar()) {
this.field_147062_A.func_146189_e(true);
this.field_147062_A.func_146205_d(false);
- this.field_147062_A.func_146195_b(true);
+ this.field_147062_A.setFocused(true);
this.field_147062_A.func_146195_b(true);
if (i != p_147050_1_.func_78021_a()) {
this.field_147062_A.func_146180_a("");
}
@@ -137,13 +136,6 @@
this.func_147053_i();
} else {
this.field_147062_A.func_146189_e(false);
this.field_147062_A.func_146205_d(true);
- this.field_147062_A.func_146195_b(false);
+ this.field_147062_A.setFocused(false);
this.field_147062_A.func_146180_a("");
}
}
@@ -560,16 +599,35 @@
this.renderBackground();
super.render(p_render_1_, p_render_2_, p_render_3_);
@@ -1,56 +0,0 @@
--- a/net/minecraft/client/gui/widget/TextFieldWidget.java
+++ b/net/minecraft/client/gui/widget/TextFieldWidget.java
@@ -349,7 +349,7 @@
} else {
boolean flag = p_mouseClicked_1_ >= (double)this.x && p_mouseClicked_1_ < (double)(this.x + this.width) && p_mouseClicked_3_ >= (double)this.y && p_mouseClicked_3_ < (double)(this.y + this.height);
if (this.field_146212_n) {
- this.func_146195_b(flag);
+ this.setFocused(flag);
}
if (this.isFocused() && flag && p_mouseClicked_5_ == 0) {
@@ -358,7 +358,7 @@
i -= 4;
}
- String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o());
+ String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.getWidth());
this.func_146190_e(this.field_146211_a.func_78269_a(s, i).length() + this.field_146225_q);
return true;
} else {
@@ -367,7 +367,7 @@
}
}
- public void func_146195_b(boolean p_146195_1_) {
+ public void setFocused(boolean p_146195_1_) {
super.setFocused(p_146195_1_);
}
@@ -381,7 +381,7 @@
int i = this.field_146226_p ? this.field_146222_t : this.field_146221_u;
int j = this.field_146224_r - this.field_146225_q;
int k = this.field_146223_s - this.field_146225_q;
- String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o());
+ String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.getWidth());
boolean flag = j >= 0 && j <= s.length();
boolean flag1 = this.isFocused() && this.field_146214_l / 6 % 2 == 0 && flag;
int l = this.field_146215_m ? this.x + 4 : this.x;
@@ -522,7 +522,7 @@
this.field_146226_p = p_146184_1_;
}
- public int func_146200_o() {
+ public int getWidth() {
return this.func_146181_i() ? this.width - 8 : this.width;
}
@@ -534,7 +534,7 @@
this.field_146225_q = i;
}
- int j = this.func_146200_o();
+ int j = this.getWidth();
String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), j);
int k = s.length() + this.field_146225_q;
if (this.field_146223_s == this.field_146225_q) {
@@ -1,24 +1,17 @@
--- a/net/minecraft/client/multiplayer/PlayerController.java
+++ b/net/minecraft/client/multiplayer/PlayerController.java
@@ -104,6 +104,8 @@
}
}
@@ -103,7 +103,9 @@
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;
- } else if (blockstate.func_196958_f()) {
+ } else if (blockstate.isAir(world, p_187103_1_)) {
+ if (field_78776_a.field_71439_g.func_184614_ca().onBlockStartBreak(p_187103_1_, field_78776_a.field_71439_g)) return false;
+
World world = this.field_78776_a.field_71441_e;
BlockState blockstate = world.func_180495_p(p_187103_1_);
if (!this.field_78776_a.field_71439_g.func_184614_ca().func_77973_b().func_195938_a(blockstate, world, p_187103_1_, this.field_78776_a.field_71439_g)) {
@@ -112,7 +114,7 @@
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;
- } else if (blockstate.func_196958_f()) {
+ } else if (blockstate.isAir(world, p_187103_1_)) {
return false;
} else {
block.func_176208_a(world, p_187103_1_, blockstate, this.field_78776_a.field_71439_g);
@@ -209,13 +211,13 @@
return false;
} else {
block.func_176208_a(world, p_187103_1_, blockstate, this.field_78776_a.field_71439_g);
@@ -187,13 +189,13 @@
return true;
} else if (this.func_178893_a(p_180512_1_)) {
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
@@ -34,7 +27,7 @@
this.field_78776_a.func_147118_V().func_147682_a(new SimpleSound(soundtype.func_185846_f(), SoundCategory.NEUTRAL, (soundtype.func_185843_a() + 1.0F) / 8.0F, soundtype.func_185847_b() * 0.5F, p_180512_1_));
}
@@ -239,7 +241,8 @@
@@ -217,7 +219,8 @@
}
public float func_78757_d() {
@@ -44,7 +37,7 @@
}
public void func_78765_e() {
@@ -256,7 +259,7 @@
@@ -234,7 +237,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()) {
@@ -53,7 +46,7 @@
}
return p_178893_1_.equals(this.field_178895_c) && flag;
@@ -320,11 +323,14 @@
@@ -298,11 +301,14 @@
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
return ActionResultType.PASS;
} else {
@@ -68,7 +61,7 @@
}
return actionresult.func_188397_a();
@@ -349,6 +355,9 @@
@@ -327,6 +333,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_));
@@ -78,7 +71,7 @@
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
}
@@ -356,6 +365,9 @@
@@ -334,6 +343,9 @@
this.func_78750_j();
Vec3d vec3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.field_70165_t, p_187102_2_.field_70163_u, p_187102_2_.field_70161_v);
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vec3d));
@@ -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));
}
@@ -122,6 +123,7 @@
@@ -126,6 +127,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
@@ -712,7 +712,7 @@
@@ -714,7 +714,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) {
@@ -9,7 +9,7 @@
}
}
@@ -784,7 +784,9 @@
@@ -790,7 +790,9 @@
public void func_147251_a(SChatPacket p_147251_1_) {
PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f);
@@ -20,7 +20,7 @@
}
public void func_147279_a(SAnimateHandPacket p_147279_1_) {
@@ -956,6 +958,7 @@
@@ -962,6 +964,7 @@
this.field_147299_f.field_71439_g = clientplayerentity1;
this.field_147299_f.field_175622_Z = clientplayerentity1;
clientplayerentity1.func_184212_Q().func_187218_a(clientplayerentity.func_184212_Q().func_187231_c());
@@ -28,7 +28,7 @@
clientplayerentity1.func_70065_x();
clientplayerentity1.func_175158_f(s);
this.field_147300_g.func_217408_a(i, clientplayerentity1);
@@ -1078,6 +1081,12 @@
@@ -1084,6 +1087,12 @@
boolean flag = i == 2 && tileentity instanceof CommandBlockTileEntity;
if (i == 1 && tileentity instanceof MobSpawnerTileEntity || flag || i == 3 && tileentity instanceof BeaconTileEntity || i == 4 && tileentity instanceof SkullTileEntity || i == 6 && tileentity instanceof BannerTileEntity || i == 7 && tileentity instanceof StructureBlockTileEntity || i == 8 && tileentity instanceof EndGatewayTileEntity || i == 9 && tileentity instanceof SignTileEntity || i == 11 && tileentity instanceof BedTileEntity || i == 5 && tileentity instanceof ConduitTileEntity || i == 12 && tileentity instanceof JigsawTileEntity || i == 13 && tileentity instanceof CampfireTileEntity) {
tileentity.func_145839_a(p_147273_1_.func_148857_g());
@@ -41,7 +41,7 @@
}
if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) {
@@ -1252,6 +1261,7 @@
@@ -1253,6 +1262,7 @@
clientrecipebook.func_199644_c();
clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a);
imutablesearchtree.func_194040_a();
@@ -49,7 +49,7 @@
}
public void func_200232_a(SPlayerLookPacket p_200232_1_) {
@@ -1332,7 +1342,7 @@
@@ -1333,7 +1343,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) {
@@ -58,7 +58,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());
@@ -1757,10 +1767,12 @@
@@ -1766,10 +1776,12 @@
this.field_147299_f.field_184132_p.field_217741_m.func_217692_a(pointofinterestdebugrenderer$braininfo);
} else {
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/particle/DiggingParticle.java
+++ b/net/minecraft/client/particle/DiggingParticle.java
@@ -21,7 +21,7 @@
public DiggingParticle(World p_i46280_1_, double p_i46280_2_, double p_i46280_4_, double p_i46280_6_, double p_i46280_8_, double p_i46280_10_, double p_i46280_12_, BlockState p_i46280_14_) {
super(p_i46280_1_, p_i46280_2_, p_i46280_4_, p_i46280_6_, p_i46280_8_, p_i46280_10_, p_i46280_12_);
this.field_174847_a = p_i46280_14_;
- this.func_217567_a(Minecraft.func_71410_x().func_175602_ab().func_175023_a().func_178122_a(p_i46280_14_));
+ this.func_217567_a(Minecraft.func_71410_x().func_175602_ab().func_175023_a().getTexture(p_i46280_14_, p_i46280_1_, new BlockPos(field_187126_f, field_187127_g, field_187128_h)));
this.field_70545_g = 1.0F;
this.field_70552_h = 0.6F;
this.field_70553_i = 0.6F;
@@ -1,19 +0,0 @@
--- a/net/minecraft/client/particle/Particle.java
+++ b/net/minecraft/client/particle/Particle.java
@@ -156,6 +156,7 @@
public void func_187110_a(double p_187110_1_, double p_187110_3_, double p_187110_5_) {
double d0 = p_187110_1_;
double d1 = p_187110_3_;
+ double origZ = p_187110_5_;
if (this.field_190017_n && p_187110_1_ != 0.0D || p_187110_3_ != 0.0D || p_187110_5_ != 0.0D) {
Vec3d vec3d = Entity.func_213313_a(new Vec3d(p_187110_1_, p_187110_3_, p_187110_5_), this.func_187116_l(), this.field_187122_b, ISelectionContext.func_216377_a(), new ReuseableStream<>(Stream.empty()));
p_187110_1_ = vec3d.field_72450_a;
@@ -173,7 +174,7 @@
this.field_187129_i = 0.0D;
}
- if (p_187110_5_ != p_187110_5_) {
+ if (origZ != p_187110_5_) {
this.field_187131_k = 0.0D;
}
@@ -13,7 +13,7 @@
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
- if (!p_180533_2_.func_196958_f()) {
+ if (!p_180533_2_.isAir(this.field_78878_a, p_180533_1_)) {
+ if (!p_180533_2_.isAir(this.field_78878_a, p_180533_1_) && !p_180533_2_.addDestroyEffects(this.field_78878_a, p_180533_1_, this)) {
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_199284_3_, p_199284_5_, p_199284_7_, p_199284_9_, p_199284_11_, p_199284_13_) -> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/ActiveRenderInfo.java
+++ b/net/minecraft/client/renderer/ActiveRenderInfo.java
@@ -174,4 +174,11 @@
@@ -172,4 +172,11 @@
this.field_216791_c = null;
this.field_216789_a = false;
}
@@ -0,0 +1,19 @@
--- a/net/minecraft/client/renderer/BlockModelShapes.java
+++ b/net/minecraft/client/renderer/BlockModelShapes.java
@@ -24,10 +24,16 @@
this.field_178128_c = p_i46245_1_;
}
+ @Deprecated
public TextureAtlasSprite func_178122_a(BlockState p_178122_1_) {
return this.func_178125_b(p_178122_1_).func_177554_e();
}
+ public TextureAtlasSprite getTexture(BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) {
+ net.minecraftforge.client.model.data.IModelData data = net.minecraftforge.client.model.ModelDataManager.getModelData(world, pos);
+ return this.func_178125_b(state).getParticleTexture(data == null ? net.minecraftforge.client.model.data.EmptyModelData.INSTANCE : data);
+ }
+
public IBakedModel func_178125_b(BlockState p_178125_1_) {
IBakedModel ibakedmodel = this.field_178129_a.get(p_178125_1_);
if (ibakedmodel == null) {
@@ -42,7 +42,7 @@
if (flag1) {
float f4 = hand == Hand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - MathHelper.func_219799_g(p_78440_1_, this.field_187472_i, this.field_187471_h);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_78440_1_, f1, f4, f6, this.field_187467_d))
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_78440_1_, f1, f4, f6, this.field_187468_e))
this.func_187457_a(abstractclientplayerentity, p_78440_1_, f1, Hand.OFF_HAND, f4, this.field_187468_e, f6);
}
@@ -72,8 +72,9 @@
}
if (blockstate.func_185901_i() != BlockRenderType.INVISIBLE) {
- this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(blockstate));
+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, blockstate, overlayPos))
this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(blockstate));
+ this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().getTexture(blockstate, field_78455_a.field_71441_e, overlayPos));
}
}
@@ -46,7 +46,7 @@
} catch (Throwable throwable) {
CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details");
@@ -655,7 +662,7 @@
@@ -656,7 +663,7 @@
double d2 = activerenderinfo.func_216785_c().field_72449_c;
icamera.func_78547_a(d0, d1, d2);
if (this.field_78531_r.field_71474_y.field_151451_c >= 4) {
@@ -55,7 +55,7 @@
this.field_78531_r.func_213239_aq().func_219895_b("sky");
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
@@ -668,14 +675,14 @@
@@ -669,14 +676,14 @@
GlStateManager.matrixMode(5888);
}
@@ -72,7 +72,7 @@
this.field_78531_r.func_110434_K().func_110577_a(AtlasTexture.field_110575_b);
RenderHelper.func_74518_a();
this.field_78531_r.func_213239_aq().func_219895_b("terrain_setup");
@@ -689,7 +696,9 @@
@@ -690,7 +697,9 @@
GlStateManager.disableAlphaTest();
worldrenderer.func_215323_a(BlockRenderLayer.SOLID, activerenderinfo);
GlStateManager.enableAlphaTest();
@@ -82,7 +82,7 @@
this.field_78531_r.func_110434_K().func_110581_b(AtlasTexture.field_110575_b).func_174936_b(false, false);
worldrenderer.func_215323_a(BlockRenderLayer.CUTOUT, activerenderinfo);
this.field_78531_r.func_110434_K().func_110581_b(AtlasTexture.field_110575_b).func_174935_a();
@@ -708,6 +717,7 @@
@@ -709,6 +718,7 @@
if (flag && this.field_78531_r.field_71476_x != null) {
GlStateManager.disableAlphaTest();
this.field_78531_r.func_213239_aq().func_219895_b("outline");
@@ -90,7 +90,7 @@
worldrenderer.func_215325_a(activerenderinfo, this.field_78531_r.field_71476_x, 0);
GlStateManager.enableAlphaTest();
}
@@ -724,7 +734,7 @@
@@ -725,7 +735,7 @@
this.field_78531_r.func_110434_K().func_110581_b(AtlasTexture.field_110575_b).func_174935_a();
GlStateManager.disableBlend();
this.func_180436_i();
@@ -99,7 +99,7 @@
this.field_78531_r.func_213239_aq().func_219895_b("particles");
particlemanager.func_215233_a(activerenderinfo, p_181560_1_);
this.func_175072_h();
@@ -738,7 +748,7 @@
@@ -739,7 +749,7 @@
GlStateManager.enableCull();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.alphaFunc(516, 0.1F);
@@ -108,7 +108,7 @@
GlStateManager.enableBlend();
GlStateManager.depthMask(false);
this.field_78531_r.func_110434_K().func_110577_a(AtlasTexture.field_110575_b);
@@ -755,6 +765,9 @@
@@ -756,6 +766,9 @@
this.func_215313_a(activerenderinfo, worldrenderer, p_181560_1_, d0, d1, d2);
}
@@ -118,7 +118,7 @@
this.field_78531_r.func_213239_aq().func_219895_b("hand");
if (this.field_175074_C) {
GlStateManager.clear(256, Minecraft.field_142025_a);
@@ -771,7 +784,7 @@
@@ -772,7 +785,7 @@
GlStateManager.multMatrix(Matrix4f.func_195876_a(this.func_215311_a(p_215313_1_, p_215313_3_, true), (float)this.field_78531_r.field_195558_d.func_198109_k() / (float)this.field_78531_r.field_195558_d.func_198091_l(), 0.05F, this.field_78530_s * 4.0F));
GlStateManager.matrixMode(5888);
GlStateManager.pushMatrix();
@@ -127,19 +127,19 @@
p_215313_2_.func_195466_a(p_215313_3_, p_215313_4_, p_215313_6_, p_215313_8_);
GlStateManager.disableFog();
GlStateManager.popMatrix();
@@ -857,6 +870,11 @@
@@ -858,6 +871,11 @@
}
protected void func_78474_d(float p_78474_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.func_201675_m().getWeatherRenderer();
+ if (renderer != null) {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ renderer.render(this.field_78529_t, p_78474_1_, this.field_78531_r.field_71441_e, this.field_78531_r);
+ return;
+ }
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (!(f <= 0.0F)) {
this.func_180436_i();
@@ -1089,4 +1107,9 @@
@@ -1090,4 +1108,9 @@
public ActiveRenderInfo func_215316_n() {
return this.field_215317_L;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/WorldRenderer.java
+++ b/net/minecraft/client/renderer/WorldRenderer.java
@@ -589,10 +589,12 @@
@@ -592,10 +592,12 @@
this.field_72769_h.func_217381_Z().func_219895_b("blockentities");
RenderHelper.func_74519_b();
@@ -13,7 +13,7 @@
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_215326_3_, -1);
}
}
@@ -600,16 +602,18 @@
@@ -603,16 +605,18 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity1 : this.field_181024_n) {
@@ -33,7 +33,7 @@
TileEntity tileentity2 = this.field_72769_h.func_175625_s(blockpos);
if (tileentity2 instanceof ChestTileEntity && blockstate.func_177229_b(ChestBlock.field_196314_b) == ChestType.LEFT) {
blockpos = blockpos.func_177972_a(blockstate.func_177229_b(ChestBlock.field_176459_a).func_176746_e());
@@ -730,7 +734,7 @@
@@ -733,7 +737,7 @@
for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) {
for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) {
ChunkRender chunkrender1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
@@ -42,7 +42,7 @@
chunkrender1.func_178577_a(p_215320_3_);
queue.add(new WorldRenderer.LocalRenderInformationContainer(chunkrender1, (Direction)null, 0));
}
@@ -775,7 +779,7 @@
@@ -778,7 +782,7 @@
this.field_147595_R = true;
BlockPos blockpos2 = chunkrender4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
@@ -51,19 +51,19 @@
this.field_175009_l.add(chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -969,6 +973,11 @@
@@ -972,6 +976,11 @@
}
public void func_195465_a(float p_195465_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ renderer.render(this.field_72773_u, p_195465_1_, this.field_72769_h, this.field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) {
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) {
this.func_180448_r();
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
@@ -1113,6 +1122,7 @@
@@ -1116,6 +1125,7 @@
}
public void func_195466_a(float p_195466_1_, double p_195466_2_, double p_195466_4_, double p_195466_6_) {
@@ -71,7 +71,7 @@
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
float f = 12.0F;
float f1 = 4.0F;
@@ -1488,7 +1498,11 @@
@@ -1491,7 +1501,11 @@
DestroyBlockProgress destroyblockprogress = iterator.next();
BlockPos blockpos = destroyblockprogress.func_180246_b();
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
@@ -84,7 +84,7 @@
double d3 = (double)blockpos.func_177958_n() - d0;
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
@@ -1496,7 +1510,7 @@
@@ -1499,7 +1513,7 @@
iterator.remove();
} else {
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
@@ -93,7 +93,7 @@
int i = destroyblockprogress.func_73106_e();
TextureAtlasSprite textureatlassprite = this.field_94141_F[i];
BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab();
@@ -1517,7 +1531,7 @@
@@ -1520,7 +1534,7 @@
if (p_215325_3_ == 0 && p_215325_2_.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockPos blockpos = ((BlockRayTraceResult)p_215325_2_).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
@@ -102,7 +102,7 @@
GlStateManager.enableBlend();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.lineWidth(Math.max(2.5F, (float)this.field_72777_q.field_195558_d.func_198109_k() / 1920.0F * 2.5F));
@@ -1984,7 +1998,7 @@
@@ -1994,7 +2008,7 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
@@ -111,7 +111,7 @@
SoundType soundtype = blockstate.func_215695_r();
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);
}
@@ -2108,6 +2122,11 @@
@@ -2118,6 +2132,11 @@
}
}
@@ -4,15 +4,15 @@
private Vec3d field_217672_l = Vec3d.field_186680_a;
public ChunkRenderDispatcher(boolean p_i51518_1_) {
+ this(p_i51518_1_,-1);
+ this(p_i51518_1_, -1);
+ }
+
+ public ChunkRenderDispatcher(boolean p_i51518_1_, int countRenderBuilders) {
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760 - 1);
int j = Runtime.getRuntime().availableProcessors();
int k = p_i51518_1_ ? j : Math.min(j, 4);
- int l = Math.max(1, Math.min(k * 3, i));
+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 3, i)) : countRenderBuilders;
- int l = Math.max(1, Math.min(k * 2, i));
+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 2, i)) : countRenderBuilders;
this.field_178525_i = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
List<RegionRenderCacheBuilder> list = Lists.newArrayListWithExpectedSize(l);
@@ -1,16 +1,16 @@
--- a/net/minecraft/client/renderer/color/BlockColors.java
+++ b/net/minecraft/client/renderer/color/BlockColors.java
@@ -22,7 +22,8 @@
@@ -27,7 +27,8 @@
@OnlyIn(Dist.CLIENT)
public class BlockColors {
- private final ObjectIntIdentityMap<IBlockColor> field_186725_a = new ObjectIntIdentityMap<>(32);
+ // FORGE: Use RegistryDelegates as non-Vanilla block ids are not constant
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Block>, IBlockColor> field_186725_a = new java.util.HashMap<>();
private final Map<Block, Set<IProperty<?>>> field_225311_b = Maps.newHashMap();
public static BlockColors func_186723_a() {
BlockColors blockcolors = new BlockColors();
@@ -63,11 +64,12 @@
@@ -72,11 +73,12 @@
blockcolors.func_186722_a((p_210228_0_, p_210228_1_, p_210228_2_, p_210228_3_) -> {
return p_210228_1_ != null && p_210228_2_ != null ? 2129968 : 7455580;
}, Blocks.field_196651_dG);
@@ -24,7 +24,7 @@
if (iblockcolor != null) {
return iblockcolor.getColor(p_189991_1_, (IEnviromentBlockReader)null, (BlockPos)null, 0);
} else {
@@ -77,13 +79,13 @@
@@ -86,13 +88,13 @@
}
public int func_216860_a(BlockState p_216860_1_, @Nullable IEnviromentBlockReader p_216860_2_, @Nullable BlockPos p_216860_3_, int p_216860_4_) {
@@ -1,10 +1,7 @@
--- a/net/minecraft/client/renderer/entity/EntityRendererManager.java
+++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java
@@ -255,8 +255,13 @@
this.field_178637_m = new PlayerRenderer(this);
this.field_178636_l.put("default", this.field_178637_m);
@@ -257,6 +257,10 @@
this.field_178636_l.put("slim", new PlayerRenderer(this, true));
+ net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o);
}
+ public Map<String, PlayerRenderer> getSkinMap() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
+++ b/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
@@ -55,12 +55,13 @@
@@ -55,24 +55,25 @@
ArmorItem armoritem = (ArmorItem)itemstack.func_77973_b();
if (armoritem.func_185083_B_() == p_188361_9_) {
A a = this.func_215337_a(p_188361_9_);
@@ -16,7 +16,12 @@
int i = ((DyeableArmorItem)armoritem).func_200886_f(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
@@ -72,7 +73,7 @@
float f2 = (float)(i & 255) / 255.0F;
GlStateManager.color4f(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e);
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
- this.func_215333_a(this.func_177178_a(armoritem, flag, "overlay"));
+ this.func_215333_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay"));
}
GlStateManager.color4f(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
@@ -10,38 +10,43 @@
public boolean func_178309_b() {
return this.field_178315_d != null ? this.field_178315_d.func_178309_b() : this.field_178322_i;
}
@@ -87,6 +90,10 @@
return this.field_187968_k;
}
+ public ItemOverrideList getOverrides(BlockModel model, Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> spriteGetter) {
+ return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(model, modelGetter, this.field_187968_k, spriteGetter);
+ }
+
@@ -90,6 +93,10 @@
private ItemOverrideList func_217646_a(ModelBakery p_217646_1_, BlockModel p_217646_2_) {
return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(p_217646_1_, p_217646_2_, p_217646_1_::func_209597_a, this.field_187968_k);
}
@@ -160,25 +167,26 @@
+
+ public ItemOverrideList getOverrides(ModelBakery p_217646_1_, BlockModel p_217646_2_, Function<ResourceLocation, TextureAtlasSprite> textureGetter, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(p_217646_1_, p_217646_2_, p_217646_1_::func_209597_a, textureGetter, this.field_187968_k, format);
+ }
public Collection<ResourceLocation> func_187965_e() {
Set<ResourceLocation> set = Sets.newHashSet();
@@ -160,25 +167,33 @@
return set1;
}
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
- return this.func_217644_a(p_217641_1_, this, p_217641_2_, p_217641_3_);
- }
+ @Nullable
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217644_1_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_2_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT))
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
+ // FORGE: Override our interface method, binary compatible
+ public IBakedModel bake(ModelBakery bakery, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, ISprite sprite, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT))
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
+ return this.bake(bakery, this, spriteGetter, sprite, format);
}
- public IBakedModel func_217644_a(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_) {
+ @Deprecated
public IBakedModel func_217644_a(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_) {
+ return bake(p_217644_1_, p_217644_2_, p_217644_3_, p_217644_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ public IBakedModel bake(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
TextureAtlasSprite textureatlassprite = p_217644_3_.apply(new ResourceLocation(this.func_178308_c("particle")));
if (this.func_178310_f() == ModelBakery.field_177616_r) {
- return new BuiltInModel(this.func_181682_g(), this.func_217646_a(p_217644_1_, p_217644_2_), textureatlassprite);
+ return new BuiltInModel(this.func_181682_g(), this.getOverrides(this, p_217644_1_, p_217644_3_), textureatlassprite);
+ return new BuiltInModel(this.func_181682_g(), this.getOverrides(p_217644_1_, p_217644_2_, p_217644_3_, format), textureatlassprite);
} else {
- SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.func_217646_a(p_217644_1_, p_217644_2_))).func_177646_a(textureatlassprite);
+ SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.getOverrides(this, p_217644_1_, p_217644_3_))).func_177646_a(textureatlassprite);
+ SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.getOverrides(p_217644_1_, p_217644_2_, p_217644_3_, format))).func_177646_a(textureatlassprite);
for(BlockPart blockpart : this.func_178298_a()) {
for(Direction direction : blockpart.field_178240_c.keySet()) {
@@ -49,14 +54,14 @@
TextureAtlasSprite textureatlassprite1 = p_217644_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d)));
if (blockpartface.field_178244_b == null) {
- simplebakedmodel$builder.func_177648_a(func_217645_a(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_2_));
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
} else {
- simplebakedmodel$builder.func_177650_a(p_217644_4_.func_188048_b().func_177523_a(blockpartface.field_178244_b), func_217645_a(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
+ simplebakedmodel$builder.func_177650_a(p_217644_2_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(direction)).orElse(direction), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_2_));
+ simplebakedmodel$builder.func_177650_a(p_217644_4_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(blockpartface.field_178244_b)).orElse(blockpartface.field_178244_b), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
}
}
}
@@ -191,6 +199,10 @@
@@ -191,6 +206,10 @@
return field_217647_g.func_217648_a(p_217645_0_.field_178241_a, p_217645_0_.field_178239_b, p_217645_1_, p_217645_2_, p_217645_3_, p_217645_4_, p_217645_0_.field_178237_d, p_217645_0_.field_178238_e);
}
@@ -6,13 +6,17 @@
@OnlyIn(Dist.CLIENT)
-public interface IBakedModel {
+public interface IBakedModel extends net.minecraftforge.client.extensions.IForgeBakedModel {
+
+ /**@deprecated Forge: Use {@link net.minecraftforge.client.extensions.IForgeBakedModel#getQuads(IBlockState, EnumFacing, Random, net.minecraftforge.client.model.data.IModelData)}*/
+ @Deprecated
List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,7 +23,8 @@
@@ -19,9 +21,12 @@
boolean func_188618_c();
+ /**@deprecated Forge: Use {@link net.minecraftforge.client.extensions.IForgeBakedModel#getParticleTexture(net.minecraftforge.client.model.data.IModelData)}*/
+ @Deprecated
TextureAtlasSprite func_177554_e();
- ItemCameraTransforms func_177552_f();
@@ -17,6 +17,6 @@
- IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_);
+ @Deprecated
+ default IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ return bake(p_217641_1_::func_209597_a, p_217641_2_, p_217641_3_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return bake(p_217641_1_, p_217641_2_, p_217641_3_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
}
@@ -1,25 +1,22 @@
--- a/net/minecraft/client/renderer/model/ItemOverrideList.java
+++ b/net/minecraft/client/renderer/model/ItemOverrideList.java
@@ -24,10 +24,17 @@
@@ -24,10 +24,14 @@
this.field_209582_c = Collections.emptyList();
}
+ @Deprecated //Forge: Use IUnbakedModel
+ @Deprecated //Forge: Use IUnbakedModel, add texture getter
public ItemOverrideList(ModelBakery p_i50984_1_, BlockModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_) {
+ this(p_i50984_1_, (IUnbakedModel)p_i50984_2_, p_i50984_3_, p_i50984_4_);
+ this(p_i50984_1_, (IUnbakedModel)p_i50984_2_, p_i50984_3_, p_i50984_1_.field_177609_j::func_195424_a, p_i50984_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+ public ItemOverrideList(ModelBakery p_i50984_1_, IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_) {
+ this(p_i50984_2_, p_i50984_3_, p_i50984_4_, net.minecraftforge.client.model.ModelLoader.defaultTextureGetter());
+ }
+ public ItemOverrideList(IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_, Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> spriteGetter) {
+ public ItemOverrideList(ModelBakery p_i50984_1_, IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, List<ItemOverride> p_i50984_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
this.field_209582_c = p_i50984_4_.stream().map((p_217649_3_) -> {
IUnbakedModel iunbakedmodel = p_i50984_3_.apply(p_217649_3_.func_188026_a());
- return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_1_.func_217845_a(p_217649_3_.func_188026_a(), ModelRotation.X0_Y0);
+ return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_3_.apply(p_217649_3_.func_188026_a()).bake(p_i50984_3_, spriteGetter, ModelRotation.X0_Y0, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_1_.getBakedModel(p_217649_3_.func_188026_a(), ModelRotation.X0_Y0, textureGetter, format);
}).collect(Collectors.toList());
Collections.reverse(this.field_209582_c);
@@ -55,4 +62,8 @@
@@ -55,4 +59,8 @@
return p_209581_1_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/model/ModelBakery.java
+++ b/net/minecraft/client/renderer/model/ModelBakery.java
@@ -87,7 +87,7 @@
@@ -97,7 +97,7 @@
private final Set<ResourceLocation> field_217848_D = Sets.newHashSet();
private final BlockModelDefinition.ContainerHolder field_209610_F = new BlockModelDefinition.ContainerHolder();
private final Map<ResourceLocation, IUnbakedModel> field_217849_F = Maps.newHashMap();
@@ -9,30 +9,40 @@
private final Map<ResourceLocation, IUnbakedModel> field_217851_H = Maps.newHashMap();
private final Map<ResourceLocation, IBakedModel> field_217852_I = Maps.newHashMap();
private final AtlasTexture.SheetData field_217853_J;
@@ -269,7 +269,7 @@
flag = true;
lvt_9_4_ = this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_217839_1_) -> {
@@ -288,7 +288,7 @@
{
lvt_13_5_ = this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_217839_1_) -> {
try (InputStream inputstream = p_217839_1_.func_199027_b()) {
- Pair pair1 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8)));
+ Pair pair1 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_));
return pair1;
- Pair pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8)));
+ Pair<String,BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_));
return pair2;
} catch (Exception exception1) {
throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_217839_1_.func_199029_a(), p_217839_1_.func_199026_d(), exception1.getMessage()));
@@ -381,7 +381,7 @@
@@ -404,7 +404,12 @@
@Nullable
public IBakedModel func_217845_a(ResourceLocation p_217845_1_, ISprite p_217845_2_) {
- Triple<ResourceLocation, ModelRotation, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.func_188048_b(), p_217845_2_.func_188049_c());
+ return getBakedModel(p_217845_1_, p_217845_2_, this.field_177609_j::func_195424_a, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ @Nullable
+ public IBakedModel getBakedModel(ResourceLocation p_217845_1_, ISprite p_217845_2_, java.util.function.Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ Triple<ResourceLocation, net.minecraftforge.common.model.IModelState, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.getState(), p_217845_2_.func_188049_c());
if (this.field_217850_G.containsKey(triple)) {
return this.field_217850_G.get(triple);
} else {
@@ -389,7 +389,7 @@
@@ -412,11 +417,11 @@
if (iunbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)iunbakedmodel;
if (blockmodel.func_178310_f() == field_177606_o) {
- return field_217854_z.func_209579_a(this.field_177609_j::func_195424_a, blockmodel).func_217644_a(this, blockmodel, this.field_177609_j::func_195424_a, p_217845_2_);
+ return field_217854_z.func_209579_a(this.field_177609_j::func_195424_a, blockmodel).bake(this::func_209597_a, this.field_177609_j::func_195424_a, p_217845_2_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return field_217854_z.func_209579_a(textureGetter, blockmodel).func_217644_a(this, blockmodel, textureGetter, p_217845_2_);
}
}
- IBakedModel ibakedmodel = iunbakedmodel.func_217641_a(this, this.field_177609_j::func_195424_a, p_217845_2_);
+ IBakedModel ibakedmodel = iunbakedmodel.bake(this, this.field_177609_j::func_195424_a, p_217845_2_, format);
this.field_217850_G.put(triple, ibakedmodel);
return ibakedmodel;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/model/ModelManager.java
+++ b/net/minecraft/client/renderer/model/ModelManager.java
@@ -12,7 +12,7 @@
@@ -16,7 +16,7 @@
@OnlyIn(Dist.CLIENT)
public class ModelManager extends ReloadListener<ModelBakery> {
@@ -8,21 +8,32 @@
+ private Map<ResourceLocation, IBakedModel> field_174958_a = new java.util.HashMap<>();
private final AtlasTexture field_174956_b;
private final BlockModelShapes field_174957_c;
private IBakedModel field_174955_d;
@@ -34,9 +34,15 @@
return this.field_174957_c;
}
private final BlockColors field_224743_d;
@@ -43,7 +43,7 @@
protected ModelBakery func_212854_a_(IResourceManager p_212854_1_, IProfiler p_212854_2_) {
p_212854_2_.func_219894_a();
- ModelBakery modelbakery = new ModelBakery(p_212854_1_, this.field_174956_b, this.field_224743_d, p_212854_2_);
+ net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_212854_1_, this.field_174956_b, this.field_224743_d, p_212854_2_);
p_212854_2_.func_219897_b();
return modelbakery;
}
@@ -55,6 +55,7 @@
this.field_174958_a = p_212853_1_.func_217846_a();
this.field_224744_f = p_212853_1_.func_225354_b();
this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a);
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, (net.minecraftforge.client.model.ModelLoader) p_212853_1_);
p_212853_3_.func_219895_b("cache");
this.field_174957_c.func_178124_c();
p_212853_3_.func_76319_b();
@@ -78,4 +79,10 @@
return true;
}
}
+
+ // TODO
+ //@Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.MODELS;
+ }
+
protected ModelBakery func_212854_a_(IResourceManager p_212854_1_, IProfiler p_212854_2_) {
p_212854_2_.func_219894_a();
- ModelBakery modelbakery = new ModelBakery(p_212854_1_, this.field_174956_b, p_212854_2_);
+ net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_212854_1_, this.field_174956_b, p_212854_2_);
p_212854_2_.func_219897_b();
return modelbakery;
}
}
@@ -6,7 +6,7 @@
@Nullable
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ public IBakedModel bake(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
if (this.func_188114_a().isEmpty()) {
return null;
} else {
@@ -14,7 +14,7 @@
for(Variant variant : this.func_188114_a()) {
- IBakedModel ibakedmodel = p_217641_1_.func_217845_a(variant.func_188046_a(), variant);
+ IBakedModel ibakedmodel = p_217641_1_.apply(variant.func_188046_a()).bake(p_217641_1_, p_217641_2_, variant, format);
+ IBakedModel ibakedmodel = p_217641_1_.getBakedModel(variant.func_188046_a(), variant, p_217641_2_, format);
weightedbakedmodel$builder.func_177677_a(ibakedmodel, variant.func_188047_d());
}
@@ -6,7 +6,7 @@
@Nullable
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ public IBakedModel bake(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
MultipartBakedModel.Builder multipartbakedmodel$builder = new MultipartBakedModel.Builder();
for(Selector selector : this.func_188136_a()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/AtlasTexture.java
+++ b/net/minecraft/client/renderer/texture/AtlasTexture.java
@@ -79,10 +79,12 @@
@@ -80,6 +80,7 @@
}
}
@@ -8,12 +8,15 @@
}
public AtlasTexture.SheetData func_215254_a(IResourceManager p_215254_1_, Iterable<ResourceLocation> p_215254_2_, IProfiler p_215254_3_) {
Set<ResourceLocation> set = Sets.newHashSet();
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this);
p_215254_3_.func_76320_a("preparing");
p_215254_2_.forEach((p_215253_1_) -> {
if (p_215253_1_ == null) {
@@ -110,6 +112,7 @@
@@ -92,6 +93,7 @@
set.add(p_215253_1_);
}
});
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this, set);
int i = this.field_215265_o;
Stitcher stitcher = new Stitcher(i, i, this.field_147636_j);
int j = Integer.MAX_VALUE;
@@ -111,6 +113,7 @@
int i1 = Math.min(j, k);
int j1 = MathHelper.func_151239_c(i1);
@@ -21,7 +24,7 @@
if (j1 < this.field_147636_j) {
field_147635_d.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.field_94254_c, this.field_147636_j, j1, i1);
this.field_147636_j = j1;
@@ -191,6 +194,7 @@
@@ -198,6 +201,7 @@
label62: {
boolean flag;
@@ -29,15 +32,14 @@
try {
iresource = p_195422_1_.func_199002_a(resourcelocation);
p_195422_2_.func_195664_a(iresource, this.field_147636_j + 1);
@@ -267,7 +271,94 @@
this.field_94252_e.clear();
@@ -275,6 +279,93 @@
this.field_94258_i.clear();
}
+
+ //===================================================================================================
+ // Forge Start
+ //===================================================================================================
+
+ private final java.util.Deque<ResourceLocation> loadingSprites = new java.util.ArrayDeque<>();
+ private final java.util.Set<ResourceLocation> loadedSprites = new java.util.HashSet<>();
+
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/Stitcher.java
+++ b/net/minecraft/client/renderer/texture/Stitcher.java
@@ -13,6 +13,8 @@
@@ -14,6 +14,8 @@
@OnlyIn(Dist.CLIENT)
public class Stitcher {
@@ -9,29 +9,20 @@
private static final Comparator<Stitcher.Holder> field_217797_a = Comparator.<Stitcher.Holder, Integer>comparing((p_217793_0_) -> {
return -p_217793_0_.field_94201_d;
}).thenComparing((p_217795_0_) -> {
@@ -50,15 +52,21 @@
public void func_94305_f() {
List<Stitcher.Holder> list = Lists.newArrayList(this.field_94319_a);
@@ -53,6 +55,12 @@
list.sort(field_217797_a);
+ try(net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Texture stitching", list.size())) {
for(Stitcher.Holder stitcher$holder : list) {
+ bar.step(stitcher$holder.field_98151_a.func_195668_m().toString());
+ LOGGER.info(new net.minecraftforge.fml.loading.AdvancedLogMessageAdapter(sb->{
+ sb.append("Unable to fit: ").append(stitcher$holder.field_98151_a.func_195668_m());
+ sb.append(" - size: ").append(stitcher$holder.field_98151_a.func_94211_a()).append("x").append(stitcher$holder.field_98151_a.func_94216_b());
+ sb.append(" - Maybe try a lower resolution resourcepack?\n");
+ list.forEach(h-> sb.append("\t").append(h).append("\n"));
+ }));
if (!this.func_94310_b(stitcher$holder)) {
+ LOGGER.info(String.format("Unable to fit: %s - size: %dx%d - Maybe try a lower resolution resourcepack?", stitcher$holder.field_98151_a.func_195668_m(), stitcher$holder.field_98151_a.func_94211_a(), stitcher$holder.field_98151_a.func_94216_b()));
+ for (Stitcher.Holder h : list)
+ LOGGER.info(" {}", h);
throw new StitcherException(stitcher$holder.field_98151_a);
}
}
this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c);
this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d);
+ }; // Forge: end progress bar
}
public List<TextureAtlasSprite> func_94309_g() {
@@ -104,7 +112,7 @@
throw new StitcherException(stitcher$holder.field_98151_a, list.stream().map((p_225334_0_) -> {
return p_225334_0_.field_98151_a;
@@ -107,7 +115,7 @@
boolean flag4 = flag2 && j != l;
boolean flag;
if (flag3 ^ flag4) {
@@ -40,7 +31,7 @@
} else {
flag = flag1 && i <= j;
}
@@ -141,7 +149,7 @@
@@ -144,7 +152,7 @@
}
public String toString() {
@@ -9,7 +9,7 @@
private final ResourceLocation field_110984_i;
protected final int field_130223_c;
protected final int field_130224_d;
@@ -104,7 +104,10 @@
@@ -103,7 +103,10 @@
anativeimage[k1] = this.field_195670_c[k1];
} else {
NativeImage nativeimage1 = anativeimage[k1 - 1];
@@ -21,7 +21,7 @@
int k = nativeimage.func_195702_a();
int l = nativeimage.func_195714_b();
@@ -113,8 +116,11 @@
@@ -112,8 +115,11 @@
nativeimage.func_195700_a(i1, j1, func_195661_b(nativeimage1.func_195709_a(i1 * 2 + 0, j1 * 2 + 0), nativeimage1.func_195709_a(i1 * 2 + 1, j1 * 2 + 0), nativeimage1.func_195709_a(i1 * 2 + 0, j1 * 2 + 1), nativeimage1.func_195709_a(i1 * 2 + 1, j1 * 2 + 1), flag));
}
}
@@ -34,7 +34,7 @@
}
}
@@ -196,6 +202,7 @@
@@ -209,6 +215,7 @@
private void func_195667_a(int p_195667_1_, int p_195667_2_, NativeImage[] p_195667_3_) {
for(int i = 0; i < this.field_195670_c.length; ++i) {
@@ -42,7 +42,7 @@
p_195667_3_[i].func_195706_a(i, this.field_110975_c >> i, this.field_110974_d >> i, p_195667_1_ >> i, p_195667_2_ >> i, this.field_130223_c >> i, this.field_130224_d >> i, this.field_195670_c.length > 1);
}
@@ -451,4 +458,10 @@
@@ -464,4 +471,10 @@
public void func_195663_q() {
this.func_195659_d(0);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
@@ -67,6 +67,7 @@
@@ -70,6 +70,7 @@
}
private boolean func_188186_a(BlockPos p_188186_1_, BlockState p_188186_2_, BufferBuilder p_188186_3_, World p_188186_4_, boolean p_188186_5_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/resources/JsonReloadListener.java
+++ b/net/minecraft/client/resources/JsonReloadListener.java
@@ -61,4 +61,8 @@
return map;
}
+
+ protected ResourceLocation getPreparedPath(ResourceLocation rl) {
+ return new ResourceLocation(rl.func_110624_b(), this.field_223383_d + "/" + rl.func_110623_a() + ".json");
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/world/ClientWorld.java
+++ b/net/minecraft/client/world/ClientWorld.java
@@ -86,6 +86,8 @@
@@ -87,6 +87,8 @@
this.func_175652_B(new BlockPos(8, 64, 8));
this.func_72966_v();
this.func_72947_a();
@@ -9,7 +9,7 @@
}
public void func_72835_b(BooleanSupplier p_72835_1_) {
@@ -110,6 +112,7 @@
@@ -111,6 +113,7 @@
Entity entity = this.field_217428_a.get(i);
this.func_217390_a((p_217415_0_) -> {
++p_217415_0_.field_70173_aa;
@@ -17,7 +17,7 @@
p_217415_0_.func_70071_h_();
}, entity);
if (entity.field_70128_L) {
@@ -157,6 +160,7 @@
@@ -158,6 +161,7 @@
this.func_217381_Z().func_194340_a(() -> {
return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString();
});
@@ -25,7 +25,11 @@
p_217418_1_.func_70071_h_();
this.func_217381_Z().func_76319_b();
}
@@ -267,6 +271,7 @@
@@ -265,9 +269,11 @@
}
private void func_217424_b(int p_217424_1_, Entity p_217424_2_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_217424_2_, this))) return;
this.func_217413_d(p_217424_1_);
this.field_217429_b.put(p_217424_1_, p_217424_2_);
this.func_72863_F().func_212849_a_(MathHelper.func_76128_c(p_217424_2_.field_70165_t / 16.0D), MathHelper.func_76128_c(p_217424_2_.field_70161_v / 16.0D), ChunkStatus.field_222617_m, true).func_76612_a(p_217424_2_);
@@ -33,7 +37,7 @@
}
public void func_217413_d(int p_217413_1_) {
@@ -285,6 +290,7 @@
@@ -286,6 +292,7 @@
}
this.field_217431_w.remove(p_217414_1_);
@@ -41,7 +45,7 @@
}
public void func_217417_b(Chunk p_217417_1_) {
@@ -410,6 +416,11 @@
@@ -411,6 +418,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_) {
@@ -53,7 +57,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);
}
@@ -417,6 +428,11 @@
@@ -418,6 +430,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,6 @@
--- a/net/minecraft/crash/CrashReport.java
+++ b/net/minecraft/crash/CrashReport.java
@@ -65,6 +65,7 @@
@@ -69,6 +69,7 @@
List<String> list = Util.func_211565_f().collect(Collectors.toList());
return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" ")));
});
@@ -8,7 +8,7 @@
}
public String func_71501_a() {
@@ -117,23 +118,13 @@
@@ -121,23 +122,13 @@
throwable.setStackTrace(this.field_71511_b.getStackTrace());
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/crash/CrashReportCategory.java
+++ b/net/minecraft/crash/CrashReportCategory.java
@@ -98,8 +98,10 @@
@@ -100,8 +100,10 @@
if (astacktraceelement.length <= 0) {
return 0;
} else {
@@ -0,0 +1,22 @@
--- a/net/minecraft/data/DataGenerator.java
+++ b/net/minecraft/data/DataGenerator.java
@@ -19,7 +19,7 @@
public DataGenerator(Path p_i48266_1_, Collection<Path> p_i48266_2_) {
this.field_200395_c = p_i48266_1_;
- this.field_200394_b = p_i48266_2_;
+ this.field_200394_b = Lists.newArrayList(p_i48266_2_);
}
public Collection<Path> func_200389_a() {
@@ -53,6 +53,10 @@
this.field_200396_d.add(p_200390_1_);
}
+ public void addInput(Path value) {
+ this.field_200394_b.add(value);
+ }
+
static {
Bootstrap.func_151354_b();
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/data/DirectoryCache.java
+++ b/net/minecraft/data/DirectoryCache.java
@@ -23,7 +23,7 @@
private final Path field_208326_c;
private int field_208327_d;
private final Map<Path, String> field_208328_e = Maps.newHashMap();
- private final Map<Path, String> field_208329_f = Maps.newHashMap();
+ private final Map<Path, String> field_208329_f = Maps.newTreeMap(); //Forge: TreeMap, makes the file output predictable/sorted.
private final Set<Path> field_218457_g = Sets.newHashSet();
public DirectoryCache(Path p_i49352_1_, String p_i49352_2_) throws IOException {
@@ -0,0 +1,37 @@
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -1,5 +1,6 @@
package net.minecraft.data;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -21,8 +22,10 @@
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
+ OptionSpec<File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")).required();
+ OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
OptionSet optionset = optionparser.parse(p_main_0_);
- if (!optionset.has(optionspec) && optionset.hasOptions()) {
+ if (!optionset.has(optionspec) && optionset.hasOptions() && !(optionset.specs().size() == 1 && optionset.has(gameDir))) {
Path path = Paths.get(optionspec7.value(optionset));
boolean flag = optionset.has(optionspec6);
boolean flag1 = flag || optionset.has(optionspec2);
@@ -30,10 +33,11 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
- DataGenerator datagenerator = func_200264_a(path, optionset.valuesOf(optionspec8).stream().map((p_200263_0_) -> {
- return Paths.get(p_200263_0_);
- }).collect(Collectors.toList()), flag1, flag2, flag3, flag4, flag5);
- datagenerator.func_200392_c();
+ Collection<Path> inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList());
+ java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, flag2, flag1, flag3, flag4, flag5);
+ if (mods.contains("minecraft") || mods.isEmpty())
+ func_200264_a(mods.isEmpty() ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
} else {
optionparser.printHelpOn(System.out);
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/data/TagsProvider.java
+++ b/net/minecraft/data/TagsProvider.java
@@ -48,6 +48,7 @@
tagcollection.func_200039_c().forEach((p_223474_2_, p_223474_3_) -> {
JsonObject jsonobject = p_223474_3_.func_200571_a(this.field_200435_c::func_177774_c);
Path path = this.func_200431_a(p_223474_2_);
+ if (path == null) return; //Forge: Allow running this data provider without writing it. Recipe provider needs valid tags.
try {
String s = field_200437_e.toJson((JsonElement)jsonobject);
@@ -21,7 +21,7 @@
+ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantments.field_185308_t, p_82487_2_));
+ java.util.Random rand = new java.util.Random();
+ drops.forEach(d -> {
+ net.minecraft.entity.item.ItemEntity ent = entity.func_70099_a(p_82487_2_, 1.0F);
+ net.minecraft.entity.item.ItemEntity ent = entity.func_70099_a(d, 1.0F);
+ ent.func_213317_d(ent.func_213322_ci().func_72441_c((double)((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double)(rand.nextFloat() * 0.05F), (double)((rand.nextFloat() - rand.nextFloat()) * 0.1F)));
+ });
if (p_82487_2_.func_96631_a(1, world.field_73012_v, (ServerPlayerEntity)null)) {
@@ -9,7 +9,7 @@
private final EquipmentSlotType[] field_185263_a;
private final Enchantment.Rarity field_77333_a;
@Nullable
@@ -110,7 +110,7 @@
@@ -114,7 +114,7 @@
}
public boolean func_92089_a(ItemStack p_92089_1_) {
@@ -18,7 +18,7 @@
}
public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) {
@@ -127,12 +127,31 @@
@@ -131,6 +131,24 @@
return false;
}
@@ -41,12 +41,5 @@
+ }
+
public static enum Rarity {
COMMON(30),
UNCOMMON(10),
RARE(3),
VERY_RARE(1);
+
private final int field_185275_e;
private Rarity(int p_i47026_3_) {
COMMON(10),
UNCOMMON(5),
@@ -1,6 +1,6 @@
--- a/net/minecraft/enchantment/EnchantmentHelper.java
+++ b/net/minecraft/enchantment/EnchantmentHelper.java
@@ -257,7 +257,7 @@
@@ -258,7 +258,7 @@
public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) {
Item item = p_77514_3_.func_77973_b();
@@ -9,7 +9,7 @@
if (i <= 0) {
return 0;
} else {
@@ -295,7 +295,7 @@
@@ -296,7 +296,7 @@
public static List<EnchantmentData> func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) {
List<EnchantmentData> list = Lists.newArrayList();
Item item = p_77513_1_.func_77973_b();
@@ -18,12 +18,12 @@
if (i <= 0) {
return list;
} else {
@@ -354,7 +354,7 @@
@@ -349,7 +349,7 @@
boolean flag = p_185291_1_.func_77973_b() == Items.field_151122_aG;
for(Enchantment enchantment : Registry.field_212628_q) {
- if ((!enchantment.func_185261_e() || p_185291_2_) && (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()))) {
for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
if (p_185291_0_ >= enchantment.func_77321_a(i)) {
if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
list.add(new EnchantmentData(enchantment, i));
@@ -1,6 +1,6 @@
--- a/net/minecraft/enchantment/FrostWalkerEnchantment.java
+++ b/net/minecraft/enchantment/FrostWalkerEnchantment.java
@@ -38,9 +38,10 @@
@@ -42,9 +42,10 @@
if (blockpos.func_218137_a(p_185266_0_.func_213303_ch(), (double)f)) {
blockpos$mutableblockpos.func_181079_c(blockpos.func_177958_n(), blockpos.func_177956_o() + 1, blockpos.func_177952_p());
BlockState blockstate1 = p_185266_1_.func_180495_p(blockpos$mutableblockpos);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/Entity.java
+++ b/net/minecraft/entity/Entity.java
@@ -103,12 +103,13 @@
@@ -104,12 +104,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;
@@ -135,6 +136,7 @@
@@ -136,6 +137,7 @@
public boolean field_70132_H;
public boolean field_70133_I;
protected Vec3d field_213328_B = Vec3d.field_186680_a;
@@ -23,7 +23,7 @@
public boolean field_70128_L;
public float field_70141_P;
public float field_70140_Q;
@@ -196,6 +198,7 @@
@@ -197,6 +199,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 @@
@@ -214,7 +217,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 @@
}
public boolean func_175149_v() {
@@ -302,7 +307,13 @@
@@ -303,7 +308,13 @@
}
public void func_70106_y() {
@@ -56,7 +56,7 @@
}
protected void func_213301_b(Pose p_213301_1_) {
@@ -322,6 +333,7 @@
@@ -323,6 +334,7 @@
this.field_70165_t = p_70107_1_;
this.field_70163_u = p_70107_3_;
this.field_70161_v = p_70107_5_;
@@ -64,7 +64,7 @@
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));
@@ -487,7 +499,7 @@
@@ -496,7 +508,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -73,7 +73,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
BlockState blockstate1 = this.field_70170_p.func_180495_p(blockpos1);
Block block = blockstate1.func_177230_c();
@@ -526,7 +538,7 @@
@@ -535,7 +547,7 @@
this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vec3d)) * 0.6D);
this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d2 * d2 + d0 * d0 + d1 * d1) * 0.6D);
@@ -82,7 +82,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;
@@ -541,7 +553,7 @@
@@ -550,7 +562,7 @@
} else {
this.func_180429_a(blockpos, blockstate);
}
@@ -91,7 +91,7 @@
this.field_191959_ay = this.func_191954_d(this.field_82151_R);
}
}
@@ -743,6 +755,7 @@
@@ -792,6 +804,7 @@
this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
this.field_70163_u = axisalignedbb.field_72338_b;
this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
@@ -99,7 +99,7 @@
}
protected SoundEvent func_184184_Z() {
@@ -795,7 +808,7 @@
@@ -844,7 +857,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());
@@ -108,7 +108,7 @@
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -991,6 +1004,7 @@
@@ -1040,6 +1053,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -116,7 +116,7 @@
if (blockstate.func_185901_i() != BlockRenderType.INVISIBLE) {
Vec3d vec3d = this.func_213322_ci();
this.field_70170_p.func_195594_a(new BlockParticleData(ParticleTypes.field_197611_d, blockstate), this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, this.field_70163_u + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, vec3d.field_72450_a * -4.0D, 1.5D, vec3d.field_72449_c * -4.0D);
@@ -1012,7 +1026,7 @@
@@ -1061,7 +1075,7 @@
return false;
} else {
IFluidState ifluidstate = this.field_70170_p.func_204610_c(blockpos);
@@ -125,7 +125,7 @@
}
}
}
@@ -1083,6 +1097,7 @@
@@ -1132,6 +1146,7 @@
this.field_70126_B -= 360.0F;
}
@@ -133,7 +133,7 @@
this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
this.func_70101_b(p_70080_7_, p_70080_8_);
}
@@ -1319,6 +1334,7 @@
@@ -1368,6 +1383,7 @@
if (this.field_184238_ar) {
p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
}
@@ -141,7 +141,7 @@
if (!this.field_184236_aF.isEmpty()) {
ListNBT listnbt = new ListNBT();
@@ -1330,6 +1346,10 @@
@@ -1379,6 +1395,10 @@
p_189511_1_.func_218657_a("Tags", listnbt);
}
@@ -152,7 +152,7 @@
this.func_213281_b(p_189511_1_);
if (this.func_184207_aI()) {
ListNBT listnbt1 = new ListNBT();
@@ -1406,6 +1426,9 @@
@@ -1455,6 +1475,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"));
@@ -162,7 +162,7 @@
if (p_70020_1_.func_150297_b("Tags", 9)) {
this.field_184236_aF.clear();
ListNBT listnbt1 = p_70020_1_.func_150295_c("Tags", 8);
@@ -1494,6 +1517,8 @@
@@ -1543,6 +1566,8 @@
} else {
ItemEntity itementity = new ItemEntity(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_);
itementity.func_174869_p();
@@ -171,7 +171,7 @@
this.field_70170_p.func_217376_c(itementity);
return itementity;
}
@@ -1537,6 +1562,7 @@
@@ -1586,6 +1611,7 @@
public void func_70098_U() {
this.func_213317_d(Vec3d.field_186680_a);
@@ -179,7 +179,7 @@
this.func_70071_h_();
if (this.func_184218_aH()) {
this.func_184187_bx().func_184232_k(this);
@@ -1577,6 +1603,7 @@
@@ -1626,6 +1652,7 @@
}
}
@@ -187,7 +187,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();
@@ -1608,6 +1635,7 @@
@@ -1657,6 +1684,7 @@
public void func_184210_p() {
if (this.field_184239_as != null) {
Entity entity = this.field_184239_as;
@@ -195,7 +195,7 @@
this.field_184239_as = null;
entity.func_184225_p(this);
}
@@ -1758,6 +1786,7 @@
@@ -1807,6 +1835,7 @@
return !this.func_184188_bt().isEmpty();
}
@@ -203,7 +203,7 @@
public boolean func_205710_ba() {
return true;
}
@@ -1956,7 +1985,7 @@
@@ -2005,7 +2034,7 @@
func_207712_c(itextcomponent1);
return itextcomponent1;
} else {
@@ -212,7 +212,7 @@
}
}
@@ -2014,6 +2043,7 @@
@@ -2063,6 +2092,7 @@
@Nullable
public Entity func_212321_a(DimensionType p_212321_1_) {
@@ -220,36 +220,49 @@
if (!this.field_70170_p.field_72995_K && !this.field_70128_L) {
this.field_70170_p.func_217381_Z().func_76320_a("changeDimension");
MinecraftServer minecraftserver = this.func_184102_h();
@@ -2031,17 +2061,9 @@
} else if (p_212321_1_ == DimensionType.THE_END) {
@@ -2080,16 +2110,9 @@
} else if (p_212321_1_ == DimensionType.field_223229_c_) {
blockpos = serverworld1.func_180504_m();
} else {
- double d0 = this.field_70165_t;
- double d1 = this.field_70161_v;
- double d2 = 8.0D;
- if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.NETHER) {
- if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) {
- d0 /= 8.0D;
- d1 /= 8.0D;
- } else if (dimensiontype == DimensionType.NETHER && p_212321_1_ == DimensionType.OVERWORLD) {
- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) {
- d0 *= 8.0D;
- d1 *= 8.0D;
- }
-
+ double movementFactor = serverworld.func_201675_m().getMovementFactor() / serverworld1.func_201675_m().getMovementFactor();
+ double d0 = this.field_70165_t * movementFactor;
+ double d1 = this.field_70161_v * movementFactor;
double d3 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177726_b() + 16.0D);
double d4 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177736_c() + 16.0D);
double d5 = Math.min(2.9999872E7D, serverworld1.func_175723_af().func_177728_d() - 16.0D);
@@ -2069,7 +2091,6 @@
@@ -2118,7 +2141,7 @@
serverworld1.func_217460_e(entity);
}
- this.field_70128_L = true;
+ this.remove(false);
this.field_70170_p.func_217381_Z().func_76319_b();
serverworld.func_82742_i();
serverworld1.func_82742_i();
@@ -2225,7 +2246,7 @@
@@ -2146,10 +2169,12 @@
}
public Vec3d func_181014_aG() {
+ if (this.field_181017_ao == null) return Vec3d.field_186680_a;
return this.field_181017_ao;
}
public Direction func_181012_aH() {
+ if (this.field_181018_ap == null) return Direction.NORTH;
return this.field_181018_ap;
}
@@ -2274,7 +2299,7 @@
Pose pose = this.func_213283_Z();
EntitySize entitysize1 = this.func_213305_a(pose);
this.field_213325_aI = entitysize1;
@@ -258,7 +271,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.field_70165_t - d0, this.field_70163_u, this.field_70161_v - d0, this.field_70165_t + d0, this.field_70163_u + (double)entitysize1.field_220316_b, this.field_70161_v + d0));
@@ -2592,6 +2613,7 @@
@@ -2641,6 +2666,7 @@
return this.field_211517_W;
}
@@ -266,7 +279,7 @@
public final float func_213311_cf() {
return this.field_213325_aI.field_220315_a;
}
@@ -2621,4 +2643,69 @@
@@ -2670,4 +2696,69 @@
public void func_213293_j(double p_213293_1_, double p_213293_3_, double p_213293_5_) {
this.func_213317_d(new Vec3d(p_213293_1_, p_213293_3_, p_213293_5_));
}
@@ -329,7 +342,7 @@
+ this.field_70128_L = false;
+ this.reviveCaps();
+ }
+
+
+ private float getEyeHeightForge(Pose pose, EntitySize size) {
+ net.minecraftforge.event.entity.EntityEvent.EyeHeight evt = new net.minecraftforge.event.entity.EntityEvent.EyeHeight(this, pose, size, this.func_213316_a(pose, size));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(evt);
@@ -1,33 +1,27 @@
--- a/net/minecraft/entity/EntitySpawnPlacementRegistry.java
+++ b/net/minecraft/entity/EntitySpawnPlacementRegistry.java
@@ -9,6 +9,7 @@
private static final Map<EntityType<?>, EntitySpawnPlacementRegistry.Entry> field_209347_a = Maps.newHashMap();
private static void func_209343_a(EntityType<?> p_209343_0_, EntitySpawnPlacementRegistry.PlacementType p_209343_1_, Heightmap.Type p_209343_2_) {
+ if (field_209347_a.containsKey(p_209343_0_)) throw new IllegalArgumentException("Invalid register call, " + p_209343_0_ + " already registered.");
field_209347_a.put(p_209343_0_, new EntitySpawnPlacementRegistry.Entry(p_209343_2_, p_209343_1_));
}
@@ -87,8 +88,23 @@
}
@@ -141,9 +141,25 @@
boolean test(EntityType<T> p_test_1_, IWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_);
}
- public static enum PlacementType {
+ public static enum PlacementType implements net.minecraftforge.common.IExtensibleEnum {
ON_GROUND,
IN_WATER;
IN_WATER,
NO_RESTRICTIONS;
+
+ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<? extends MobEntity>> predicate) {
+ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<? extends MobEntity>> predicate) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ private net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<?>> predicate;
+ private net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<?>> predicate;
+ private PlacementType() { this(null); }
+ private PlacementType(net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<?>> predicate) {
+ private PlacementType(net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<?>> predicate) {
+ this.predicate = predicate;
+ }
+
+ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, net.minecraft.util.math.BlockPos pos, EntityType<?> type) {
+ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, BlockPos pos, EntityType<?> type) {
+ if (this == NO_RESTRICTIONS) return true;
+ if (predicate == null) return net.minecraft.world.spawner.WorldEntitySpawner.canSpawnAtBody(this, world, pos, type);
+ return predicate.test(world, pos, type);
+ }
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/EntityType.java
+++ b/net/minecraft/entity/EntityType.java
@@ -135,7 +135,7 @@
@@ -134,7 +134,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,31 +9,32 @@
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));
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));
@@ -254,6 +254,11 @@
private final Type<?> field_206832_aX;
@@ -252,6 +252,12 @@
private ResourceLocation field_220358_bg;
private final EntitySize field_220359_bi;
+ private final java.util.function.Predicate<EntityType<?>> velocityUpdateSupplier;
+ private final java.util.function.ToIntFunction<EntityType<?>> trackingRangeSupplier;
+ private final java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier;
+ private final java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<EntityType<?>> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, net.minecraft.tags.EntityTypeTags::getGeneration, net.minecraft.tags.EntityTypeTags::func_219762_a);
+
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_));
}
@@ -266,7 +271,7 @@
@@ -264,7 +270,7 @@
return Registry.field_212629_r.func_218349_b(ResourceLocation.func_208304_a(p_220327_0_));
}
- public EntityType(EntityType.IFactory<T> p_i50385_1_, EntityClassification p_i50385_2_, boolean p_i50385_3_, boolean p_i50385_4_, boolean p_i50385_5_, @Nullable Type<?> p_i50385_6_, EntitySize p_i50385_7_) {
+ public EntityType(IFactory<T> p_i50385_1_, EntityClassification p_i50385_2_, boolean p_i50385_3_, boolean p_i50385_4_, boolean p_i50385_5_, @Nullable Type<?> p_i50385_6_, EntitySize p_i50385_7_, final java.util.function.Predicate<EntityType<?>> velocityUpdateSupplier, final java.util.function.ToIntFunction<EntityType<?>> trackingRangeSupplier, final java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier, final java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory) {
this.field_200732_aK = p_i50385_1_;
this.field_220355_ba = p_i50385_2_;
this.field_200733_aL = p_i50385_3_;
@@ -274,6 +279,10 @@
this.field_220357_bd = p_i50385_5_;
this.field_206832_aX = p_i50385_6_;
this.field_220359_bi = p_i50385_7_;
- public EntityType(EntityType.IFactory<T> p_i51559_1_, EntityClassification p_i51559_2_, boolean p_i51559_3_, boolean p_i51559_4_, boolean p_i51559_5_, boolean p_i51559_6_, EntitySize p_i51559_7_) {
+ public EntityType(EntityType.IFactory<T> p_i51559_1_, EntityClassification p_i51559_2_, boolean p_i51559_3_, boolean p_i51559_4_, boolean p_i51559_5_, boolean p_i51559_6_, EntitySize p_i51559_7_, final java.util.function.Predicate<EntityType<?>> velocityUpdateSupplier, final java.util.function.ToIntFunction<EntityType<?>> trackingRangeSupplier, final java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier, final java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory) {
this.field_200732_aK = p_i51559_1_;
this.field_220355_ba = p_i51559_2_;
this.field_225438_be = p_i51559_6_;
@@ -272,6 +278,10 @@
this.field_200734_aM = p_i51559_4_;
this.field_220357_bd = p_i51559_5_;
this.field_220359_bi = p_i51559_7_;
+ this.velocityUpdateSupplier = velocityUpdateSupplier;
+ this.trackingRangeSupplier = trackingRangeSupplier;
+ this.updateIntervalSupplier = updateIntervalSupplier;
@@ -41,7 +42,7 @@
}
@Nullable
@@ -284,6 +293,7 @@
@@ -282,6 +292,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_) {
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_);
@@ -49,7 +50,7 @@
p_220342_1_.func_217376_c(t);
return t;
}
@@ -462,6 +472,9 @@
@@ -464,6 +475,9 @@
}
public int func_220345_k() {
@@ -59,7 +60,7 @@
if (this == field_200729_aH) {
return 32;
} else if (this == field_200801_o) {
@@ -474,6 +487,9 @@
@@ -476,6 +490,9 @@
}
public int func_220332_l() {
@@ -69,7 +70,7 @@
if (this != field_200729_aH && this != field_200805_s) {
if (this == field_200808_v) {
return 4;
@@ -494,6 +510,9 @@
@@ -496,6 +513,9 @@
}
public boolean func_220340_m() {
@@ -79,7 +80,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;
}
@@ -501,12 +520,22 @@
@@ -503,12 +523,30 @@
return p_220341_1_.func_199685_a_(this);
}
@@ -87,6 +88,14 @@
+ if (customClientFactory == null) throw new RuntimeException("Missing custom spawn data for entity type "+this);
+ return customClientFactory.apply(packet, world);
+ }
+
+ /**
+ * Retrieves a list of tags names this is known to be associated with.
+ * This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.
+ */
+ public java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
public static class Builder<T extends Entity> {
private final EntityType.IFactory<T> field_200709_a;
@@ -99,10 +108,10 @@
+ private java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier = EntityType::defaultUpdateIntervalSupplier;
+ private java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory;
+
private boolean field_225436_f;
private EntitySize field_220326_f = EntitySize.func_220314_b(0.6F, 1.8F);
private Builder(EntityType.IFactory<T> p_i50479_1_, EntityClassification p_i50479_2_) {
@@ -544,12 +573,32 @@
@@ -553,6 +591,26 @@
return this;
}
@@ -127,21 +136,14 @@
+ }
+
public EntityType<T> func_206830_a(String p_206830_1_) {
Type<?> type = null;
if (this.field_200710_b) {
try {
type = DataFixesManager.func_210901_a().getSchema(DataFixUtils.makeKey(SharedConstants.func_215069_a().getWorldVersion())).getChoiceType(TypeReferences.field_211298_n, p_206830_1_);
- } catch (IllegalStateException illegalstateexception) {
+ } catch (IllegalArgumentException illegalstateexception) {
if (SharedConstants.field_206244_b) {
throw illegalstateexception;
}
@@ -558,7 +607,7 @@
@@ -566,7 +624,7 @@
}
}
- return new EntityType<>(this.field_200709_a, this.field_220324_b, this.field_200710_b, this.field_200711_c, this.field_220325_e, type, this.field_220326_f);
+ return new EntityType<>(this.field_200709_a, this.field_220324_b, this.field_200710_b, this.field_200711_c, this.field_220325_e, type, this.field_220326_f, velocityUpdateSupplier, trackingRangeSupplier, updateIntervalSupplier, customClientFactory);
- return new EntityType<>(this.field_200709_a, this.field_220324_b, this.field_200710_b, this.field_200711_c, this.field_220325_e, this.field_225436_f, this.field_220326_f);
+ return new EntityType<>(this.field_200709_a, this.field_220324_b, this.field_200710_b, this.field_200711_c, this.field_220325_e, this.field_225436_f, this.field_220326_f, velocityUpdateSupplier, trackingRangeSupplier, updateIntervalSupplier, customClientFactory);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/LivingEntity.java
+++ b/net/minecraft/entity/LivingEntity.java
@@ -104,6 +104,8 @@
@@ -105,6 +105,8 @@
public abstract class LivingEntity extends Entity {
private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", (double)0.3F, AttributeModifier.Operation.MULTIPLY_TOTAL)).func_111168_a(false);
@@ -9,7 +9,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);
@@ -227,6 +229,8 @@
@@ -228,6 +230,8 @@
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_189429_h);
@@ -18,7 +18,7 @@
}
protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, BlockState p_184231_4_, BlockPos p_184231_5_) {
@@ -236,9 +240,10 @@
@@ -237,9 +241,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);
@@ -30,7 +30,7 @@
((ServerWorld)this.field_70170_p).func_195598_a(new BlockParticleData(ParticleTypes.field_197611_d, p_184231_4_), this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, (double)0.15F);
}
}
@@ -302,7 +307,7 @@
@@ -303,7 +308,7 @@
}
}
@@ -39,15 +39,15 @@
this.func_184210_p();
}
} else if (this.func_70086_ai() < this.func_205010_bg()) {
@@ -387,6 +392,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_82766_b("doMobLoot"))) {
@@ -388,6 +393,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);
+ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.field_70717_bb, i);
while(i > 0) {
int j = ExperienceOrbEntity.func_70527_a(i);
i -= j;
@@ -589,7 +595,7 @@
@@ -590,7 +596,7 @@
Effect effect = iterator.next();
EffectInstance effectinstance = this.field_70713_bf.get(effect);
if (!effectinstance.func_76455_a(this)) {
@@ -56,7 +56,7 @@
iterator.remove();
this.func_70688_c(effectinstance);
}
@@ -639,8 +645,10 @@
@@ -640,8 +646,10 @@
this.func_82142_c(false);
} else {
Collection<EffectInstance> collection = this.field_70713_bf.values();
@@ -69,7 +69,7 @@
this.func_82142_c(this.func_70644_a(Effects.field_76441_p));
}
@@ -704,7 +712,10 @@
@@ -705,7 +713,10 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
@@ -81,7 +81,7 @@
iterator.remove();
}
@@ -734,6 +745,7 @@
@@ -735,6 +746,7 @@
return false;
} else {
EffectInstance effectinstance = this.field_70713_bf.get(p_195064_1_.func_188419_a());
@@ -89,17 +89,17 @@
if (effectinstance == null) {
this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_);
this.func_70670_a(p_195064_1_);
@@ -748,6 +760,9 @@
@@ -749,6 +761,9 @@
}
public boolean func_70687_e(EffectInstance p_70687_1_) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ if (event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DEFAULT) return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
if (this.func_70668_bt() == CreatureAttribute.UNDEAD) {
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) {
@@ -768,6 +783,7 @@
@@ -769,6 +784,7 @@
}
public boolean func_195063_d(Effect p_195063_1_) {
@@ -107,7 +107,7 @@
EffectInstance effectinstance = this.func_184596_c(p_195063_1_);
if (effectinstance != null) {
this.func_70688_c(effectinstance);
@@ -804,6 +820,8 @@
@@ -805,6 +821,8 @@
}
public void func_70691_i(float p_70691_1_) {
@@ -116,7 +116,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -820,6 +838,7 @@
@@ -821,6 +839,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -124,7 +124,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -886,8 +905,8 @@
@@ -887,8 +906,8 @@
if (entity1 instanceof PlayerEntity) {
this.field_70718_bc = 100;
this.field_70717_bb = (PlayerEntity)entity1;
@@ -135,7 +135,7 @@
if (wolfentity.func_70909_n()) {
this.field_70718_bc = 100;
LivingEntity livingentity = wolfentity.func_70902_q();
@@ -1069,6 +1088,7 @@
@@ -1070,6 +1089,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -143,7 +143,16 @@
if (!this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
LivingEntity livingentity = this.func_94060_bK();
@@ -1113,13 +1133,10 @@
@@ -1091,7 +1111,7 @@
this.func_213345_d(p_70645_1_);
boolean flag = false;
if (livingentity instanceof WitherEntity) {
- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v);
BlockState blockstate = Blocks.field_222388_bz.func_176223_P();
if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) {
@@ -1114,13 +1134,10 @@
protected void func_213345_d(DamageSource p_213345_1_) {
Entity entity = p_213345_1_.func_76346_g();
@@ -158,9 +167,9 @@
+ this.captureDrops(new java.util.ArrayList<>());
+
boolean flag = this.field_70718_bc > 0;
if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) {
if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e)) {
this.func_213354_a(p_213345_1_, flag);
@@ -1127,6 +1144,10 @@
@@ -1128,6 +1145,10 @@
}
this.func_213337_cE();
@@ -171,7 +180,7 @@
}
protected void func_213337_cE() {
@@ -1156,6 +1177,9 @@
@@ -1157,6 +1178,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -181,7 +190,7 @@
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
this.field_70160_al = true;
Vec3d vec3d = this.func_213322_ci();
@@ -1191,12 +1215,7 @@
@@ -1192,12 +1216,7 @@
return false;
} else {
BlockState blockstate = this.func_213339_cH();
@@ -195,7 +204,7 @@
}
}
@@ -1220,6 +1239,9 @@
@@ -1221,6 +1240,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -205,7 +214,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
EffectInstance effectinstance = this.func_70660_b(Effects.field_76430_j);
float f = effectinstance == null ? 0.0F : (float)(effectinstance.func_76458_c() + 1);
@@ -1232,7 +1254,7 @@
@@ -1233,7 +1255,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!blockstate.func_196958_f()) {
@@ -214,7 +223,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1301,6 +1323,8 @@
@@ -1302,6 +1324,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -223,7 +232,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 f = p_70665_2_;
@@ -1311,10 +1335,11 @@
@@ -1312,10 +1336,11 @@
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f1 * 10.0F));
}
@@ -236,7 +245,7 @@
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1356,6 +1381,8 @@
@@ -1357,6 +1382,8 @@
}
public void func_184609_a(Hand p_184609_1_) {
@@ -245,7 +254,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;
@@ -1714,15 +1741,16 @@
@@ -1715,15 +1742,16 @@
}
this.field_70160_al = true;
@@ -264,7 +273,7 @@
}
protected float func_189749_co() {
@@ -1785,7 +1813,7 @@
@@ -1786,7 +1814,7 @@
}
} else {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v);
@@ -273,7 +282,7 @@
float f7 = this.field_70122_E ? f5 * 0.91F : 0.91F;
this.func_213309_a(this.func_213335_r(f5), p_213352_1_);
this.func_213317_d(this.func_213362_f(this.func_213322_ci()));
@@ -1847,6 +1875,7 @@
@@ -1848,6 +1876,7 @@
f = 0.96F;
}
@@ -281,7 +290,7 @@
this.func_213309_a(f1, p_213352_1_);
this.func_213315_a(MoverType.SELF, this.func_213322_ci());
Vec3d vec3d1 = this.func_213322_ci();
@@ -1922,6 +1951,7 @@
@@ -1923,6 +1952,7 @@
}
public void func_70071_h_() {
@@ -289,7 +298,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1953,7 +1983,9 @@
@@ -1954,7 +1984,9 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -299,11 +308,11 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype));
}
@@ -2402,13 +2434,22 @@
@@ -2403,13 +2435,22 @@
protected void func_184608_ct() {
private void func_184608_ct() {
if (this.func_184587_cr()) {
- if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
- if (ItemStack.func_185132_d(this.func_184586_b(this.func_184600_cs()), this.field_184627_bm)) {
+ ItemStack itemstack = this.func_184586_b(this.func_184600_cs());
+ if (net.minecraftforge.common.ForgeHooks.canContinueUsing(this.field_184627_bm, itemstack)) this.field_184627_bm = itemstack;
+ if (itemstack == this.field_184627_bm) {
@@ -324,7 +333,7 @@
this.func_71036_o();
}
} else {
@@ -2442,8 +2483,10 @@
@@ -2443,8 +2484,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()) {
@@ -336,7 +345,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);
@@ -2503,6 +2546,9 @@
@@ -2504,6 +2547,9 @@
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
@@ -346,7 +355,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c);
}
@@ -2511,7 +2557,9 @@
@@ -2512,7 +2558,9 @@
protected void func_71036_o() {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_184584_a(this.field_184627_bm, 16);
@@ -357,7 +366,7 @@
this.func_184602_cy();
}
@@ -2531,6 +2579,7 @@
@@ -2532,6 +2580,7 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -365,7 +374,7 @@
this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv());
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
@@ -2686,16 +2735,16 @@
@@ -2687,16 +2736,16 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_213347_1_) -> {
@@ -386,11 +395,11 @@
BlockPos blockpos = p_213368_1_.func_177984_a();
return new Vec3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D);
});
@@ -2710,8 +2759,13 @@
@@ -2711,8 +2760,13 @@
@Nullable
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
+// this.func_213374_dv().map(pos->{ // This is apparently an "optimization" by Mojang, so we'll copy their lead here for now
+// this.getBedPosition().map(pos->{ // This is apparently an "optimization" by Mojang, so we'll copy their lead here for now
+// BlockState state = this.world.getBlockState(pos);
+// return !state.isBed(world, pos, this) ? Direction.UP : state.getBedDirection(world, pos);
+// });
@@ -401,7 +410,7 @@
}
public boolean func_70094_T() {
@@ -2778,4 +2832,58 @@
@@ -2779,4 +2833,58 @@
public void func_213334_d(Hand p_213334_1_) {
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/MobEntity.java
+++ b/net/minecraft/entity/MobEntity.java
@@ -174,6 +174,7 @@
@@ -176,6 +176,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_) {
@@ -257,7 +258,6 @@
@@ -259,7 +260,6 @@
}
@@ -16,16 +16,16 @@
public void func_70103_a(byte p_70103_1_) {
if (p_70103_1_ == 20) {
this.func_70656_aK();
@@ -456,7 +456,7 @@
@@ -458,7 +458,7 @@
public void func_70636_d() {
super.func_70636_d();
this.field_70170_p.func_217381_Z().func_76320_a("looting");
- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
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_175445_a(itementity);
@@ -546,6 +546,14 @@
@@ -548,6 +548,14 @@
protected void func_70623_bb() {
if (!this.func_104002_bU() && !this.func_213392_I()) {
Entity entity = this.field_70170_p.func_217362_a(this, -1.0D);
@@ -40,7 +40,7 @@
if (entity != null) {
double d0 = entity.func_70068_e(this);
if (d0 > 16384.0D && this.func_213397_c(d0)) {
@@ -784,6 +792,8 @@
@@ -786,6 +794,8 @@
}
public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) {
@@ -49,7 +49,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) {
@@ -791,7 +801,7 @@
@@ -793,7 +803,7 @@
} else if (item == Items.field_185160_cR) {
return EquipmentSlotType.CHEST;
} else {
@@ -58,7 +58,7 @@
}
} else {
return EquipmentSlotType.HEAD;
@@ -1171,10 +1181,10 @@
@@ -1173,10 +1183,10 @@
PlayerEntity playerentity = (PlayerEntity)p_70652_1_;
ItemStack itemstack = this.func_184614_ca();
ItemStack itemstack1 = playerentity.func_184587_cr() ? playerentity.func_184607_cu() : ItemStack.field_190927_a;
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
+++ b/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
@@ -18,7 +18,7 @@
import net.minecraft.util.math.IPosWrapper;
import net.minecraft.util.registry.Registry;
-public class MemoryModuleType<U> {
+public class MemoryModuleType<U> extends net.minecraftforge.registries.ForgeRegistryEntry<MemoryModuleType<?>> {
public static final MemoryModuleType<Void> field_220940_a = func_223541_a("dummy");
public static final MemoryModuleType<GlobalPos> field_220941_b = func_220937_a("home", Optional.of(GlobalPos::func_218176_a));
public static final MemoryModuleType<GlobalPos> field_220942_c = func_220937_a("job_site", Optional.of(GlobalPos::func_218176_a));
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/schedule/Activity.java
+++ b/net/minecraft/entity/ai/brain/schedule/Activity.java
@@ -2,7 +2,7 @@
import net.minecraft.util.registry.Registry;
-public class Activity {
+public class Activity extends net.minecraftforge.registries.ForgeRegistryEntry<Activity> {
public static final Activity field_221365_a = func_221363_a("core");
public static final Activity field_221366_b = func_221363_a("idle");
public static final Activity field_221367_c = func_221363_a("work");
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/schedule/Schedule.java
+++ b/net/minecraft/entity/ai/brain/schedule/Schedule.java
@@ -8,7 +8,7 @@
import java.util.stream.Collectors;
import net.minecraft.util.registry.Registry;
-public class Schedule {
+public class Schedule extends net.minecraftforge.registries.ForgeRegistryEntry<Schedule> {
public static final Schedule field_221383_a = func_221380_a("empty").func_221402_a(0, Activity.field_221366_b).func_221404_a();
public static final Schedule field_221384_b = func_221380_a("simple").func_221402_a(5000, Activity.field_221367_c).func_221402_a(11000, Activity.field_221369_e).func_221404_a();
public static final Schedule field_221385_c = func_221380_a("villager_baby").func_221402_a(10, Activity.field_221366_b).func_221402_a(3000, Activity.field_221368_d).func_221402_a(6000, Activity.field_221366_b).func_221402_a(10000, Activity.field_221368_d).func_221402_a(12000, Activity.field_221369_e).func_221404_a();
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/sensor/SensorType.java
+++ b/net/minecraft/entity/ai/brain/sensor/SensorType.java
@@ -4,7 +4,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
-public class SensorType<U extends Sensor<?>> {
+public class SensorType<U extends Sensor<?>> extends net.minecraftforge.registries.ForgeRegistryEntry<SensorType<?>> {
public static final SensorType<DummySensor> field_220997_a = func_220996_a("dummy", DummySensor::new);
public static final SensorType<NearestLivingEntitiesSensor> field_220998_b = func_220996_a("nearest_living_entities", NearestLivingEntitiesSensor::new);
public static final SensorType<NearestPlayersSensor> field_220999_c = func_220996_a("nearest_players", NearestPlayersSensor::new);
@@ -4,12 +4,12 @@
}
protected boolean func_212832_a_(ServerWorld p_212832_1_, VillagerEntity p_212832_2_) {
- if (!p_212832_1_.func_82736_K().func_82766_b("mobGriefing")) {
- if (!p_212832_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212832_1_, p_212832_2_)) {
return false;
} else if (p_212832_2_.func_213700_eh().func_221130_b() != VillagerProfession.field_221156_f) {
return false;
@@ -106,6 +106,11 @@
@@ -136,6 +136,11 @@
} else if (itemstack.func_77973_b() == Items.field_185163_cU) {
p_212833_1_.func_180501_a(this.field_220422_a, Blocks.field_185773_cZ.func_176223_P(), 3);
flag = true;
@@ -1,11 +1,11 @@
--- a/net/minecraft/entity/ai/goal/BreakBlockGoal.java
+++ b/net/minecraft/entity/ai/goal/BreakBlockGoal.java
@@ -29,7 +29,7 @@
@@ -32,7 +32,7 @@
}
public boolean func_75250_a() {
- if (!this.field_203118_g.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_203118_g.field_70170_p, this.field_203118_g) || !this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b).canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_203118_g, this.field_179494_b, this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b))) {
- if (!this.field_203118_g.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g)) {
return false;
} else if (this.field_179496_a > 0) {
--this.field_179496_a;
@@ -1,11 +1,11 @@
--- a/net/minecraft/entity/ai/goal/BreakDoorGoal.java
+++ b/net/minecraft/entity/ai/goal/BreakDoorGoal.java
@@ -28,7 +28,7 @@
@@ -29,7 +29,7 @@
public boolean func_75250_a() {
if (!super.func_75250_a()) {
return false;
- } else if (!this.field_75356_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75356_a.field_70170_p, this.field_75356_a) || !this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b).canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_75356_a, this.field_179507_b, this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b))) {
- } else if (!this.field_75356_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a)) {
return false;
} else {
return this.func_220696_a(this.field_75356_a.field_70170_p.func_175659_aa()) && !this.func_195922_f();
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/ai/goal/BreedGoal.java
+++ b/net/minecraft/entity/ai/goal/BreedGoal.java
@@ -79,6 +79,17 @@
@@ -80,6 +80,17 @@
protected void func_75388_i() {
AgeableEntity ageableentity = this.field_75390_d.func_90011_a(this.field_75391_e);
Loaded 100 of 634 files, more files were not shown because too many files have changed in this diff. Show more