Compare commits

..
182 Commits
Author SHA1 Message Date
LexManos 5e392f6012 Update license header to SPDX format 2026-07-09 11:42:57 -07:00
Spectrall 867159643c Add ForgeSpawnEggItem to lazily handle EntityTypes (#10626) 2026-07-09 11:27:52 -07:00
LexManos 0e6e6ef2d8 Update ForgeGradle version and re-add evaluationDependsOn 2025-08-12 12:03:29 -07:00
LexManos 404ea1e016 Attempt to migrate to github actions 2025-08-12 11:45:53 -07:00
LexManos f8877789b5 Attempt to migrate to TeamCity 2025-08-11 15:16:48 -07:00
SizableShrimp a3d50ff545 [1.15.x] Update Installer to 2.1.+ (#8290)
* Update Installer to 2.1.+

Signed-off-by: SizableShrimp <[email protected]>

* Update references of files.mcf.net/maven to maven.mcf.net

Signed-off-by: SizableShrimp <[email protected]>
2021-12-12 04:14:32 +10:30
Marc Hermans 5c3f80bbcf [CVE-2021-44228]: Update Log4J to fix the security issue inside it (#8271) 2021-12-10 02:10:26 -08:00
MelanX 181b9bd927 Fix JenkinsFile not pushing web page regen/making build as latest (#7925) 2021-07-26 12:01:16 -07:00
SuperMartijn642 c63db5758d Pass the 'includeName' flag to the ItemTossEvent (#7875)
(Same as #7758 for 1.16)
The PlayerEntity#dropItem(ItemStack, boolean) method (PlayerEntity#drop(ItemStack, boolean) for mojmap), does not pass the second argument, the 'includeName' flag, on to the ItemTossEvent.

This leads to situations where the player drops an item and the resulting ItemEntity does not have a thrower id.
For example, items thrown by a player from inside a ContainerScreen do not have a thrower id.

This pull request passes the 'includeName' flag on to the ItemTossEvent, thus resolving the issue.
2021-07-24 16:54:39 +02:00
Jenny 38a9fe304c Edge biomes (#7001) 2021-07-22 03:10:41 +02:00
LexManos 6807c294c4 Update Jenkins/Maven. 2021-07-13 18:48:45 -07:00
LexManos 026b6d6519 Regen patches. 2021-07-13 18:19:44 -07:00
Joseph Tarbit 90ced4b3f7 [1.15.x] Add horizon hook (#7528)
* Redirect getHorizonHeight to extension interface

* Add getHorizonHeight method
2021-03-22 12:32:20 +10:30
Take Weiland 52dd0eceb2 [1.15] Fix food bar not rendering when non-living entities are mounted (#7447) 2021-02-15 16:32:59 -08:00
LexManos 2d6de8ea7b Fix Scheduled events being called by derived worlds. Closes #7631 2021-02-06 17:08:05 -08:00
Jamie Mansfield 60eb1c25e9 [1.15] Fix modproperties property in mods.toml causing exception (#7524)
Cherry-pick of 07ffc890e5 (GH-7192)
for 1.15.x.
Co-authored-by: sciwhiz12 <[email protected]>
2020-11-29 10:57:19 -08:00
Nightenom 90c50085c0 [1.15] Fix possible crash when using rendering regionCache (#7319) 2020-11-11 21:21:40 -05:00
Mumfrey 9ea3f8f6f1 Bump mixin version to 0.8.2 2020-10-05 15:33:24 +01:00
Curle 10d72c3cf0 Add mixin 0.8.1 (#7393) 2020-10-03 14:34:39 -07:00
tterrag 214cff1aae Add missing license headers 2020-09-25 19:39:58 -04:00
ichttt b5802b150a Fix grass disappearing when alwaysSetupTerrainOffThread is true (#7291) 2020-09-25 19:35:51 -04:00
Take Weiland 043765257d Fix wrong BlockState param passed into canSustainPlant from FarmlandBlock, causing crops to uproot wrongly (#7215) 2020-09-15 22:42:58 +02:00
L3MON4D3 210e931c31 [1.15.x] Post EntityJoinWorldEvent when Lightning is added in ServerWorld. (#7223)
* Post EntityJoinWorldEvent when Lightning is added in ServerWorld.

* Ignite Blocks around impact Position in tick() instead of constructor.
2020-09-15 22:18:33 +02:00
Take Weiland 45e125b0ec Fix config iteration order (#7231) 2020-09-15 22:10:27 +02:00
shartte 46eb109a7e Sets the empty/fill sounds for vanilla fluids (#6787) 2020-09-15 22:07:46 +02:00
brandon3055 a753a3eddc Added custom elytra support (#6791) 2020-09-08 12:07:54 -07:00
sciwhiz12 5224533d45 Fix misaligned patch for ServerWorld#updateEntity Fixes #6516 (#7210) 2020-08-03 17:12:26 -07:00
Tschipp 46804f6a0c Re-added PlayerEvent.NameFormat (#7173) 2020-08-03 16:34:59 -07:00
IzzelAliz 934e0cad6f Fire AnimalTameEvent for cats. (#6760) 2020-08-03 15:44:53 -07:00
Raycoms 29c0512de9 Fix rail 180 rotations (#7174) 2020-07-27 16:27:06 -07:00
Curle 043cb331ee Add extra debugging information to the MDK (#6882) 2020-07-06 14:44:59 -07:00
shartte 614e65c6a3 Fix using Fluid's emptySound when filling buckets, rather than the fillSound. (#6786) 2020-07-06 13:59:11 -07:00
tterrag f321e58a41 Fix improper handling of baked lighting in forge light pipeline
Closes #6803
2020-07-02 01:42:09 -04:00
Take Weiland 7288c2106d Fix IItemHandler wrappers for chests not updating both chests (#6874) 2020-06-30 12:45:40 -07:00
Matthew Messinger 4ebb390a1e Fix Language.javaLocale parsing (#6861) 2020-06-29 12:47:31 -07:00
covers1624 eceaf7ecc8 Allow RayTraceContext to be constructed with a null entity. (#6708) 2020-06-25 10:11:34 -07:00
Yanny 0c25531761 Replace explicit shears reference in vanilla loot tables with tag for modded shears. (#6765) 2020-06-25 09:31:09 -07:00
hanetzer ea0b61ad5e Fix cache file sorting issue on linux (#6793) 2020-06-25 09:29:21 -07:00
Cyborgmas 6f18c61070 Fire jump event for horses when ridden (#6802) 2020-06-24 13:22:19 -07:00
cpw feae488fa8 Modify how modfiles load slightly, for better decoupling.
Signed-off-by: cpw <[email protected]>
2020-06-23 22:12:39 -04:00
Take Weiland 034e75f5a5 Throw an exception from DeferredRegister when trying to register entries after registry event has fired (#6789) 2020-06-22 00:52:30 -07:00
DaemonUmbra 2acf2110ef Potential userProperties Fix (#6740) 2020-06-18 14:24:26 -07:00
Take Weiland 6345f2670c Add system for dimensions to be marked for deletion (#6515) 2020-06-15 09:37:08 -07:00
LexManos 9114bec81d Fix dedicated server issue in some implementations of Block.getPickBlock. Closes #6566 2020-06-12 17:28:05 -07:00
LexManos 9ac626d2a9 Fire SpecialSpawn event for mobs spawners. Closes #6700 2020-06-12 16:53:01 -07:00
LexManos 457909b6d5 Remove the yellow coloring on hover in ExtendedButton to match vanilla behavior. Closes #6714 Closes #6713 2020-06-12 16:36:58 -07:00
LexManos 07b62b77e6 Fix entity pathing not matching vanilla. Closes #6755 2020-06-12 16:24:27 -07:00
DaemonUmbra e374f62037 Fixed --server argument crashing the client (#6754)
Closes #6753
Moving the fadeOutStart setter above the callback invocation prevents re-entry into the block (which would result in an infinite loop and a StackOverflowException) if the callback causes a render tick (which creating a new ConnectionScreen does).
2020-06-12 15:46:52 -07:00
brandon3055 0209daec36 Fixed ItemStack comparison ignoring capabilities when stack nbt is null. (#6764) 2020-06-12 15:43:38 -07:00
Vincent Lee 1b89f931eb Supply matrixstack to IRenderHandler where possible. Closes #6439 (#6537) 2020-06-12 15:42:44 -07:00
Take Weiland a3e4b75c59 Fix StartupQuery not working more than once on the client (#6699) 2020-06-12 15:36:00 -07:00
DaemonUmbra 45b90a0d45 Added ProjectileImpactEvent.FireworkRocket (#6758) 2020-06-12 15:33:44 -07:00
LexManos fd9bf64d53 Add custom registry type support to DeferredRegister. (#6742)
It's still a hard dependency because it requires a class reference.
But there is not a sane way to test registry types without a class reference.
2020-06-12 15:28:43 -07:00
Take Weiland 5dbea9ea8d Fix "overlayMessage" rendering in ForgeIngameGui being different than vanilla (#6748) 2020-06-07 08:47:59 -07:00
David Quintana 28f7b5d885 Implement loader for ItemLayerModel.
Add support for specifying which layers are fullbright.
Fix improper generation of model edge. - Thanks to iChun and KnightMiner for the fix suggestions.
2020-06-04 16:04:09 +02:00
LexManos 0c0603dc91 Remove dead test classes. 2020-06-03 17:46:30 -07:00
LexManos f24991f3bb Add --flat argument to data generators to not create data in mod specific directores.
Useful For Forge's test mods mainly.
Standardized data gen cache file's folder separators.
Added ItemModelProvider to BlockStateProvider for cleaner datagen code.
Added .gitattributes to fix datagen json's line endings correct on windows.
2020-06-03 16:57:07 -07:00
cpw a39f1cbe1a Improve the DistExecutor API and introduce some "almost completely" safe mechanisms to handle sided lambdas.
In general, use sided lambdas safely by embedding them in a separately loaded class. There's a whole twitch stream
dedicated to investigating this problem. See link in DistExecutor if you're interested.

Signed-off-by: cpw <[email protected]>
2020-05-24 17:40:52 -04:00
tterrag 6fd01a13ee Fix typo in new registry fields' names
Note: this is technically a breaking change. If you for some reason added code referencing these two fields in the last few hours, sorry.
2020-05-23 21:24:30 -04:00
tterrag 6829324f5a Fix server startup query info not including new text 2020-05-23 16:22:29 -04:00
tterrag eb9c966095 Improve look of notification GUI, improve StartupQuery API 2020-05-23 16:05:10 -04:00
tterrag f0bab0fb38 Add forge registries for applicable new registry types
Expose constructors for all forge registry entries
Also, remove deprecation on ItemCameraTransforms/TransformType
2020-05-23 13:42:56 -04:00
LexManos d5cb0935e9 Bump version for new RB. 2020-05-15 12:33:32 -07:00
LexManos d4f79882f9 Update MCP Mappings. 2020-05-15 12:17:25 -07:00
ichttt 8d3685439e fix test mod and add warning comment to framebuffer (#6698) 2020-05-15 20:25:57 +02:00
LexManos 68cf703435 Fix FireBlock using flammability instead of spread speed when looking for places to spread. Closes #6646 2020-05-15 10:59:57 -07:00
LexManos bcdd04d549 Fix incorrect argument passed in RenderPipeline potentially causing crash. #6677 2020-05-15 10:53:35 -07:00
Funwayguy ec7d9d4179 Re-added patch to enable stencil buffer in net.minecraft.client.shader.Framebuffer
Add test for the stencil buffer feature. Only tests that it doesn't crash when enabling, for now. - giga
2020-05-15 19:49:55 +02:00
TheSilkMiner 765da1aca8 Allow Music Discs to be created with SoundEvent delegates. (#6523) 2020-05-15 10:38:19 -07:00
Edwin Mindcraft 7fa42ca064 Use IProperty#getName when generating blockstate jsons (#6582)
Close #6520
2020-05-15 13:28:10 -04:00
David Quintana c23ea1e733 Model system fixes:
- Add "origin" key to determine what origin to use. This will default to the existing (broken) behaviour to avoid breaking changes.
- Fix interaction of transforms with variant transforms (transformation ordering).
- Fix OBJ loader ignoring "diffuseLighting" attribute from the json.
  This attribute will continue not being used if "ambientToFullbright" is on (default) to avoid breaking changes.
2020-05-15 19:25:26 +02:00
LexManos 0f48e851a3 Fixed typo in registry alias writing causing infinite loop. Closes #6689 2020-05-15 09:38:20 -07:00
LexManos 549007a4a6 Fixed Partivle.onGround not updating correctly due to decompile error. Closes #6595 2020-05-15 09:37:51 -07:00
covers1624 932e7c84b3 Remove duplicate post of ChunkEvent.Load. (#6697) 2020-05-15 07:45:37 -07:00
Cyborgmas 999b5df933 Fix LevelChange event not firing after enchanting (#6693) 2020-05-14 13:22:12 -07:00
ichttt 29396b6235 Fix server config directory remaining locked when integrated server is shut down. (#6644) 2020-05-12 15:11:45 -07:00
Alex Thomson 4ce32c3663 Fix exclusion of coremods not filtering correctly when the mods directory is a symbolic link. (#6600) 2020-05-12 15:02:01 -07:00
Jais Djurhuus-Kempel 8084cc5499 Allow Bees to use custom hives. (#6656) 2020-05-12 14:29:32 -07:00
Tom Boshoven 988fc97af1 Fixed tile entities persisting when switching between states that don't have TEs without changing the block. (#6674) 2020-05-12 14:21:28 -07:00
Jamie Mansfield 5f082045b0 Fixed CropGrowEvents not firing for Bamboo (#6680) 2020-05-12 14:18:36 -07:00
Jamie Mansfield abc98ba56b Fix vanilla screens escape key not matching done button behavior (#6682) 2020-05-12 14:18:03 -07:00
ShetiPhian e35c5c9ae4 Fixed FluidTank.drain calling onContentsChanged when simulating (#6684) 2020-05-12 14:17:17 -07:00
LexManos 926fa5d5a6 Fix infinite loading screen when resources error. Closes #6592 & #6593 2020-05-12 14:08:05 -07:00
covers1624 99d8fa1a6b Fix IForgeBlock.removedByPlayer not firing on the client. (#6638) 2020-05-11 15:28:38 -07:00
cpw 1a317a7306 Update to newer eventbus, with typetools compatibility with jvms up to j14. No guarantees on actual game compatibility however.
Signed-off-by: cpw <[email protected]>
2020-05-10 20:34:57 -04:00
Jamie Mansfield fa01ba3221 Fixed informational /forge commands being repeated to all ops when logging is enabled. Closes #6330 2020-05-06 13:49:15 -07:00
Jamie Mansfield 766019e1fc Fix ModListScreen escape key not matching done button behavior. Closes #6672 2020-05-06 13:41:43 -07:00
David Quintana a7e4cdcc49 Patch the bucket logic to not hardcode some checks to WATER. Fixes not being able to place custom fluids into modded fluid-loggable blocks that accept fluids other than water. 2020-05-06 13:30:20 +02:00
David Quintana 6551ccc247 Avoid discarding the bottom 4 bits of the lightmap coords. It turns out vanilla relies on those bits. Fixes some blocks being darker than they should be in certain circumstances. 2020-05-04 01:13:43 +02:00
Jacob Smith c3e4d303e9 Fix issue with providing a null ItemStack to onPlayerDestroyItem (#6633) 2020-05-03 13:48:17 -07:00
Brennan Ward 9e763a8334 Allow overriding of tool level requirements when harvesting a block, via the HarvestCheck event. (#6632) 2020-05-03 13:40:34 -07:00
Richard Freimer 035c01e222 Fixed Hoppers not inserting fully into custom contains with slots that can hold more then max stack (#6631) 2020-05-03 13:34:26 -07:00
Corey Frenette 1fa88ebd56 Fixed ChunkDataEvent.Save being fired with a null world if chunk isn't fully generated when unloaded. (#6628) 2020-05-03 13:27:06 -07:00
Tyler Hancock 4fce4eb10b Fix vanilla loot table resource leak. (#6622) 2020-05-03 13:23:09 -07:00
Tyler Hancock 2e694d3a6d Change recipe condition log level to debug. (#6621) 2020-05-03 13:22:22 -07:00
CAS-ual-TY e8966a05f5 Fix milk buckets removing potion effects without filters. (#6609) 2020-05-03 13:17:43 -07:00
Dion van der Hak a377727ac4 Added missing localization for swim speed, and reach distance attributes (#6585) 2020-05-03 13:13:56 -07:00
Vincent Lee 385fb64ab7 Allow colors of tooltip to be specified in GuiUtils.drawHoveringText tooltip methods (#6579) 2020-05-03 13:09:28 -07:00
ichttt f2216f4e25 Fix config comments referencing disallowed enum values. (#6542) 2020-05-03 12:56:47 -07:00
David Quintana 0fc1ea01d1 Remove redundant call to modifyLoot. Closes #6657 2020-04-28 19:22:48 +02:00
tterrag ea23cd4779 Fix various issues with the loading screen and datagen
Fix NPE on datagen startup
Fix early loading GUI hanging and never terminating after datagen
Add loading GUI messages for datagen
2020-04-28 00:00:45 -04:00
Take Weiland 903a400132 Fix BackgroundScanHandler crashing on servers (#6660) 2020-04-27 11:06:34 -07:00
cpw 940f3ed731 Remove silly icon override. Squirrels are fun y'all..
Signed-off-by: cpw <[email protected]>
2020-04-27 09:55:14 -04:00
tterrag 9d8817b5db Rename window icon image to avoid conflict, fix not using vanilla icon 2020-04-27 01:09:34 -04:00
tterrag 10204f8d82 Fix VariantList calling deprecated bake method 2020-04-26 23:48:51 -04:00
LexManos 746d702058 Fix resource packs not being sorted properly. Closes #6287 2020-04-26 20:05:56 -07:00
LexManos 3c5728f070 Fix Automatic Event Subscriber not detecting mod id defaults, and fix test mods. 2020-04-26 19:04:37 -07:00
cpw 8c8ef2d9e1 Use forge logo as short term window Icon, fix Buffer cast problems for new JDK stupid.
Signed-off-by: cpw <[email protected]>
2020-04-26 21:42:18 -04:00
cpw 6a25490d7f Handle message display a bit better, try to make the UI tick a bit better.. Still a problem with
a modelbake right at the end, happening on the window flip.

Signed-off-by: cpw <[email protected]>
2020-04-26 21:03:43 -04:00
RogueLogix 6a0b16817d Move ClientVisualization to secondary thread 2020-04-26 16:06:44 -07:00
RogueLogix 677e2104a0 move handOffWindow down near start() 2020-04-26 15:41:53 -07:00
cpw 438c969fef merge early startup into main window if used. It seems to work well.. Also ticks window on main thread, so mac compatible now.
Signed-off-by: cpw <[email protected]>
2020-04-26 18:24:48 -04:00
cpw 4af0bfd661 Update jenkinsfile and gradle for new versions of things..
Signed-off-by: cpw <[email protected]>
2020-04-25 17:54:50 -04:00
LexManos 03c2a3d3a8 Fix potential NPEs in RegistryObject.orElseThrow/isPresent/ifPresent Closes #6647 2020-04-24 19:18:57 -07:00
David Quintana 9a6d1c390e Add tickRate setter to the ForgeFlowingFluid Properties builder. 2020-04-23 14:57:06 +02:00
cpw 0512a47eba Fix recursion mess in PlayerAdvancement loading, by using an alternative based on a toposorted list of all advancements.
It seems to be fully equivalent in testing, but there may be corner cases, so there is a config to disable, though disabling
may break servers, especially those chunkloading fake players.

Signed-off-by: cpw <[email protected]>
2020-04-19 21:36:44 -04:00
LexManos 699a5c3c18 Revert defualt jvm args. 2020-04-15 10:09:49 -07:00
LexManos 5a552b9f8d Fixed dev time compilation using J9+ producing incorrect bytecode. 2020-04-14 23:54:32 -07:00
David Quintana aa5b9d12ea Add "type" field to global loot modifier jsons. (#6554)
* Add "type" field to global loot modifier jsons and fix tests.
To avoid binary breaking, "type" defaults to be the same as the filename.
* Fix license headers.
2020-04-12 21:27:11 +02:00
tterrag a3b1007633 Fix child annotations not inheriting member name, cleanup 2020-04-11 01:57:40 -04:00
tterrag bdd0af5280 Fix element type of scanned child annotations 2020-04-11 01:19:25 -04:00
Patrick Ocampo 5e554530ac Fixed PlantType not extending IExtensibleEnum, Closes #6286 2020-04-08 17:17:38 -07:00
valoeghese 713c24d916 Added hook to allow modded Hill Biomes (#6571) 2020-04-08 17:12:04 -07:00
tterrag c359a38d9f Improve performance of VertexBufferConsumer by inlining element locs 2020-04-07 21:44:29 -04:00
tterrag d84a88d78d Revive forge lighting pipeline, disabled by default for now
Remove a lot of light value convolution by using 0..1 for nearly everything
Fix a lot of TODOs that are needed for the lighting pipeline to function
Potential fix for #6425
2020-04-07 21:44:15 -04:00
tterrag cf9b1b2193 Fix Tag serializing empty optionals, improve RegistryObject error msg 2020-04-05 00:48:56 -04:00
tterrag 25605505d5 Remove SideOnly from WoodType methods 2020-04-04 15:35:41 -04:00
LexManos 0d2a0deef3 Cleanup IForgeTagBuilder code style. 2020-04-01 11:34:36 -07:00
tterrag b6dc5381ca Move global loot test data files out of generated folder 2020-03-31 20:15:55 -04:00
tterrag 559bacbd98 Add support for optional tag values to Tag.Builder
Add optional tag values to data gen test
Fix data gen test not running by correcting gui_light value
2020-03-31 20:15:09 -04:00
tterrag 19444ffa18 Fix a few issues with BufferBuilder
Fix vanilla bug that caused the byte order of the buffer from getNextBuffer to be incorrect
Fix missing modification to nextElementBytes in putBulkData
2020-03-31 19:55:09 -04:00
tterrag db3d202c4e Deprecate ModelBuilder#gui3d, add ModelBuilder#guiLight 2020-03-30 00:15:08 -04:00
naqaden 2f5172f907 Add renderer to RenderNameplateEvent (#6562) 2020-03-27 16:22:01 -07:00
dags f6cb5268a2 Defer writing the server.properties file until after mods have loaded to prevent config loss (#6545) 2020-03-27 16:19:34 -07:00
hnOsmium0001 fcee09cab2 Fix ownership leak in ItemStackHandler (#6580)
- Triggered by invoking ItemStackHandler#extractItem with `simulate=true`
2020-03-27 16:10:21 -07:00
cpw dd1d8737ad Fix cycle happening in noteblock even though we're setting the new value as well..
Signed-off-by: cpw <[email protected]>
2020-03-20 20:05:23 -04:00
cpw 3e48066021 Add a progress message for atlas textures. Fills a big time gap on bigger packs.
Signed-off-by: cpw <[email protected]>
2020-03-20 17:34:46 -04:00
Managarmr 0d16042705 Remove ArrowEntity patch, vanilla fixed MC-107941 2020-03-17 02:41:36 -07:00
LexManos 52b8070692 Fix Forge's tps and gen commands. 2020-03-15 16:27:58 -07:00
LexManos 23541ab175 Update gradle wrapper
Update MCPConfig to version that bypasses javac compiler bugs
Fix Global loot test compile errors.
2020-03-15 13:55:03 -07:00
tterrag c7a17946a5 Fix loading text not rendering after mojang logo appears 2020-03-15 03:39:04 -04:00
tterrag 208ca23515 Fix loading GUI corrupting matrix state 2020-03-15 03:27:43 -04:00
cpw 6329c0fcf2 Somewhat restore the loading screen overlay. It seems that once the mojang logo and progress bar
start running, I can no longer write to the window, even though I am obviously trying to..

Signed-off-by: cpw <[email protected]>
2020-03-14 23:28:45 -04:00
Nightenom 202ae50820 Add projection matrix to RenderWorldLastEvent (#6536) 2020-03-11 00:00:21 -07:00
Draco18s 58e5f33fad Global Loot Functions (#6401) 2020-02-26 22:13:36 -08:00
DaemonUmbra 2ce4f5ece5 Updated ForgeDev MCP Mapping Version (#6532) 2020-02-25 19:45:14 -08:00
cpw aca45340bf Fix up alarming security crisis with network handling that allowed for wrong code execution on the server, resulting in CRASHED SERVERS. AWFUL stuff.
Also fixed a silly log message from the login handler.

This change introduces a mechanism to direct certain packets to only process on one side or another. Invalid sidedness will result in the connection being terminated.

Signed-off-by: cpw <[email protected]>
2020-02-23 22:15:34 -05:00
Julian Dunskus 30d4520c6b Make TransformationHelper.slerp for quaternions public (#6528) 2020-02-23 18:32:33 +01:00
DaemonUmbra daff482092 Fixed Conduit and Beacon Activation on Vanilla Servers (#6438) 2020-02-17 11:01:38 -08:00
Richard Freimer a740044e21 Fix ITeleporter being ignored when teleporting from the end to the overworld (#6505)
* Fix custom teleporters triggering end credits when returning from the end
* Fix setdimension command ignoring position
2020-02-17 17:16:46 +01:00
Vincent Lee 1a4955f9fd Fix missing call to itemstack TER (#6445) 2020-02-14 22:43:31 +01:00
Vincent Lee 2c4042c17c Fix missed modeldata passing in BlockModelRenderer (#6442) 2020-02-14 22:33:27 +01:00
Robert Skalko e95ba8a3dc Fix NPE when players rejoin the server in a dimension that was deleted (#6511) 2020-02-14 12:34:41 -08:00
Rigner 63cb030cba Fix a wrong RenderState name MC-167447 (#6501) 2020-02-14 12:12:52 -08:00
Daniël Goossens 743fc70a7f Fix client not informing server when it attempts to interact with things, and is canceled by a client side handler. 2020-02-14 12:04:38 -08:00
ewewukek c14ffa3264 Fix wrong arguments passed to ForgeHooksClient.renderSpecificFirstPersonHand() (#6496) 2020-02-14 12:03:08 -08:00
malte0811 3f292d5d42 Fixed ChunkWatchEvent.(Un)Watch not firing correctly (#6453) 2020-02-14 12:02:47 -08:00
Unnoen 886e89ccb2 Update version and support data on README. (#6429) 2020-02-14 12:02:00 -08:00
Joseph Tarbit 977428e42c Fixed Food not using effect suppliers, to better support delayed initialization and registry replacements. (#6411) 2020-02-14 12:00:40 -08:00
Parker Hawke 1c02312ae6 Fixed displaying item names when only more sensitive version changes (#6402) 2020-02-14 11:55:27 -08:00
David Quintana 8fbd84515f Fix gui_light for forge's item parent models. 2020-02-14 19:03:11 +01:00
Richard Freimer f93289e01c Allows custom blocks to define if they should use the fluid overlay instead of the flowing texture when in a fluid (#6493) 2020-02-06 23:53:37 +01:00
LexManos 982ed69776 Fix a small patch misalignment. 2020-02-03 13:21:18 -08:00
Richard Freimer 1f46169e1e Add FluidStack support to the Forge packet buffer. (#6353) (#6485) 2020-02-03 12:46:14 -08:00
Richard Freimer 7bac75f370 Make Minecarts work with modded powered/activator rails. (#6486)
Re-adds functionality for rails to have different maximum speeds.
2020-02-03 12:45:36 -08:00
ichttt 06d9b6531c Revert game data to frozen on disconnect from a remote server or when terminating a local server. Closes #6487 (#6497) 2020-02-03 12:21:10 -08:00
David Quintana 2991e767dd Remove unintended changes. 2020-02-02 23:05:04 +01:00
David Quintana a901d80dd5 Implement fluid overlay texture rendering for custom fluids. 2020-02-02 23:02:56 +01:00
DaemonUmbra d86f58a0df Fixed Attacks/Punches not Registering (#6481)
Replaced incorrect magic number with constant
2020-01-29 22:12:04 -08:00
Vincent Lee 0ad574257e Clean up a bunch of render events (#6444)
* Delete RenderHandEvent as RenderSpecificHandEvent can do everything it does and more. Rename RenderSpecificHandEvent to RenderHandEvent as it's now the only hand rendering event.
* Pass MatrixStack and IRenderTypeBuffer into the event whenever they are available. If they're available, that means we're in a batching environment and the modder should not be using the tessellator or other buffers on their own, or they risk "Already building" crashes.
2020-01-30 00:46:22 +01:00
Bartosz Skrzypczak 4839d18c73 Fix NullPointerException on java 8u242 in dev environment. (#6473)
Java 8u242 no longer re-initializes internal sys_paths and usr_paths fields in loadLibrary when they are null, so the value can't be set to null.
2020-01-29 13:55:07 -08:00
Vincent Lee e539e7ecbb Fix incorrectly ported patch for restoreBlurMipmap (#6450) 2020-01-29 13:13:08 -08:00
Daniël Goossens 1b618fae90 Fix RightClickBlock code differences between client and server implementation (#6451) 2020-01-29 13:11:50 -08:00
Yamahari f12a93fe1e Defer material getting for ChestTileEntityRenderer into seperate function (#6465) 2020-01-29 13:05:12 -08:00
Cadiboo 617159c825 Small Forge config fixes (#6466) 2020-01-29 13:04:35 -08:00
LexManos c72d6e9122 Fix ChunkDataEvent.Load not firing, it now fires in the aync thread. Be careful. Closes #6471 2020-01-29 12:18:13 -08:00
LexManos 69ae178bf4 Fix incorrect keybinding modifiers patch. Closes #6478 2020-01-29 11:57:10 -08:00
LexManos d391299340 Fix PlayerChangedDimensionEvent using incorrect from dimension argument in ServerPlayerEntity.teleport. Closes #6457 2020-01-29 11:56:38 -08:00
LexManos 40091678a8 Fix default mod resources loosing it's sort order. 2020-01-29 11:31:31 -08:00
LexManos 2b43aa6301 Fix WakeupEvent patch misalign. Closes #6474 2020-01-29 11:31:02 -08:00
mcenderdragon 44d9fff2b4 [1.15] Reimplemented the ITeleporter interface (#6404) 2020-01-29 09:18:07 -08:00
David Quintana 509a28efd3 Hook "gui_light" value from the model into the IBakedModel implementations.
Apply some of the suggestions from the 1.14 models PR.
2020-01-23 22:54:54 +01:00
1017 changed files with 9842 additions and 28855 deletions

No files matched your search

+7
View File
@@ -14,3 +14,10 @@
*.cfg text eol=lf
*.py text eol=lf
*.jks binary
# Disable autocrlf on generated files, they always generate with LF
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
src/generated_test/**/.cache/cache text eol=lf
src/generated_test/**/*.json text eol=lf
+28
View File
@@ -0,0 +1,28 @@
name: Publish
on:
push:
branches: [ '1.15.x' ]
permissions:
contents: read
jobs:
build:
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
with:
java: 8
gradle_tasks: 'setup build publish'
artifact_name: 'forge'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
# Unused for now until we upgrade gradle
# SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
# SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
# SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}
# SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
+2 -2
View File
@@ -15,8 +15,8 @@
#gradle
/build
/.gradle
/mdk/.gradle
/mdk/build
/**/.gradle
/**/build
#occupational hazards
/projects/mcp/
-39
View File
@@ -1,39 +0,0 @@
sudo: required
dist: trusty
language: java
jdk: oraclejdk8
env:
- BUILD_NUMBER=9999
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $TRAVIS_BUILD_DIR/build/localCache/Forge/
before_install: chmod +x gradlew
install:
- ./gradlew --refresh-dependencies
- ./gradlew ciWriteBuildNumber
script:
- travis_wait ./gradlew build -x createExe -S
- ./gradlew -p projects/Forge test -S -i
notifications:
email: false
# skip building travis on 1.13+ - it doesn't work there
branches:
except:
- 1.13-pre
- 1.13.x
- 1.14.x
- 1.15.x
- /^noci-.*$/
Vendored
-110
View File
@@ -1,110 +0,0 @@
@Library('forge-shared-library')_
pipeline {
options {
disableConcurrentBuilds()
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
stage('notify_start') {
when {
not {
changeRequest()
}
}
steps {
discordSend(
title: "${DISCORD_PREFIX} Started",
successful: true,
result: 'ABORTED', //White border
thumbnail: JENKINS_HEAD,
webhookURL: DISCORD_WEBHOOK
)
}
}
stage('setup') {
steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
}
stage('changelog') {
when {
not {
changeRequest()
}
}
steps {
writeChangelog(currentBuild, 'build/changelog.txt')
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
CROWDIN = credentials('forge-crowdin')
KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
}
}
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
when {
changeRequest()
}
environment {
CROWDIN = credentials('forge-crowdin')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
}
}
post {
always {
script {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
if (env.CHANGE_ID == null) { // This is unset for non-PRs
discordSend(
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
description: '```\n' + getChanges(currentBuild) + '\n```',
successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"),
result: currentBuild.currentResult,
thumbnail: JENKINS_HEAD,
webhookURL: DISCORD_WEBHOOK
)
}
}
}
}
}
+2 -16
View File
@@ -1,16 +1,2 @@
Minecraft Forge
Copyright (c) 2016-2019.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation version 2.1
of the License.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (c) Forge Development LLC and contributors
SPDX-License-Identifier: LGPL-2.1-only
+87 -96
View File
@@ -1,8 +1,7 @@
buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
//mavenCentral() //TODO: Update Gradle to use HTTPS by default
maven {
name 'maven_central'
@@ -10,7 +9,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.197'
classpath 'org.ow2.asm:asm:7.2'
classpath 'org.ow2.asm:asm-tree:7.2'
}
@@ -46,25 +45,21 @@ import org.objectweb.asm.ClassReader
plugins {
id 'net.minecrell.licenser' version '0.4'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'org.ajoberstar.grgit' version '4.1.1'
id 'de.undercouch.download' version '3.3.0'
id 'com.github.ben-manes.versions' version '0.22.0'
// Does not support this old of gradle
//id 'net.minecraftforge.gradlejarsigner' version '1.0.5'
}
apply plugin: 'eclipse'
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version'))
ext {
JAR_SIGNER = null
if (project.hasProperty('keystore')) {
JAR_SIGNER = [
storepass: project.properties.keystoreStorePass,
keypass: project.properties.keystoreKeyPass,
keystore: project.properties.keystore
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20190719-1.14.3'
MAPPING_VERSION = '20200514-1.15.1'
MC_VERSION = '1.15.2'
MCP_VERSION = '20200122.131323'
MCP_VERSION = '20200515.085601'
}
project(':mcp') {
@@ -75,6 +70,7 @@ project(':mcp') {
}
}
if (findProject(':clean') != null) {
project(':clean') {
evaluationDependsOn(':mcp')
apply plugin: 'eclipse'
@@ -122,9 +118,10 @@ project(':clean') {
}
}
}
}
project(':forge') {
evaluationDependsOn(':clean')
project(':forge') {
evaluationDependsOn(findProject(':clean') != null ? ':clean' : ':mcp')
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
@@ -183,6 +180,12 @@ project(':forge') {
srcDirs = ["$rootDir/src/userdev/resources"]
}
}
userdev_test {
compileClasspath += sourceSets.userdev.runtimeClasspath
runtimeClasspath += sourceSets.userdev.runtimeClasspath
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
}
}
//Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
@@ -197,14 +200,14 @@ project(':forge') {
}
ext {
SPEC_VERSION = '30.0' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '31.2' // 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'
VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.7:fatjar'
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar'
}
def getVersion = {
@@ -224,10 +227,13 @@ project(':forge') {
}
version = getVersion()
println('Forge Version: ' + version)
patcher {
exc = file("$rootDir/src/main/resources/forge.exc")
parent = project(':clean')
parent = project(':mcp')
mcVersion = MC_VERSION
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
patches = file("$rootDir/patches/minecraft")
patchedSrc = file('src/main/java')
srgPatches = true
@@ -266,6 +272,8 @@ project(':forge') {
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
ideaModule "${rootProject.name}.${project.name}.userdev_test"
mods {
TestMods { sources sourceSets.test }
}
@@ -298,6 +306,8 @@ project(':forge') {
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
ideaModule "${rootProject.name}.${project.name}.userdev_test"
mods {
TestMods { sources sourceSets.test }
}
@@ -333,12 +343,17 @@ project(':forge') {
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
ideaModule "${rootProject.name}.${project.name}.userdev_test"
mods {
tests { sources sourceSets.test }
}
args '--mod', 'data_gen_test', '--all', '--output', rootProject.file('src/generated_test/resources/'), '--validate',
'--existing', sourceSets.main.resources.srcDirs[0]
args '--flat', '--all', '--validate',
'--mod', 'data_gen_test',
'--mod', 'piston_event_test',
'--output', rootProject.file('src/generated_test/resources/'),
'--existing', sourceSets.main.resources.srcDirs[0]
}
}
}
@@ -417,20 +432,24 @@ project(':forge') {
installer 'org.ow2.asm:asm:7.2'
installer 'org.ow2.asm:asm-commons:7.2'
installer 'org.ow2.asm:asm-tree:7.2'
installer 'cpw.mods:modlauncher:5.0.+'
installer 'cpw.mods:grossjava9hacks:1.1.+'
installer 'net.minecraftforge:accesstransformers:2.0.+:shadowed'
installer 'net.minecraftforge:eventbus:2.0.+:service'
installer 'net.minecraftforge:forgespi:2.0.+'
installer 'org.ow2.asm:asm-util:7.2'
installer 'org.ow2.asm:asm-analysis:7.2'
installer 'cpw.mods:modlauncher:5.1.+'
installer 'cpw.mods:grossjava9hacks:1.3.+'
installer 'net.minecraftforge:accesstransformers:2.1.+:shadowed'
installer 'net.minecraftforge:eventbus:2.2.+:service'
installer 'net.minecraftforge:forgespi:3.0.+'
installer 'net.minecraftforge:coremods:2.0.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'org.spongepowered:mixin:0.8.2'
installer 'com.electronwill.night-config:core:3.6.2'
installer 'com.electronwill.night-config:toml:3.6.2'
installer 'org.jline:jline:3.12.+'
installer 'org.apache.maven:maven-artifact:3.6.0'
installer 'net.jodah:typetools:0.6.1'
installer 'org.apache.logging.log4j:log4j-api:2.11.2'
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
installer 'net.jodah:typetools:0.8.3'
installer 'org.apache.logging.log4j:log4j-api:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-core:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'net.minecrell:terminalconsoleappender:1.2.+'
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
fmllauncherImplementation 'com.google.guava:guava:21.0'
@@ -454,48 +473,21 @@ project(':forge') {
if (changelog.exists())
extraTxts += changelog
task downloadCrowdin() {
ext {
output = file('build/crowdin_raw.zip')
update = file('build/crowdin.json')
id = 'minecraft-forge'
}
onlyIf {
project.hasProperty('crowdinKey') && !project.gradle.startParameter.isOffline()
}
doLast {
download {
src "https://api.crowdin.com/api/project/${id}/export?key=${project.crowdinKey}&json"
dest update
overwrite true
}
if (!update.text.contains('success')) {
throw new RuntimeException("Crowdin export failed, see ${update} for more info")
}
download {
src "https://api.crowdin.com/api/project/${id}/download/all.zip?key=${project.crowdinKey}"
dest output
overwrite true
}
}
tasks.register('downloadCrowdin', Download) {
src 'https://files.minecraftforge.net/crowdin.zip'
dest file('build/crowdin.zip')
onlyIfModified true
quiet true
}
task crowdin(type: Zip) {
dependsOn downloadCrowdin
onlyIf {
!downloadCrowdin.state.skipped
}
baseName = project.name
version = project.version
classifier = 'crowdin'
destinationDir = file('build/distributions')
from(zipTree(downloadCrowdin.output)){
eachFile { //Tired of waiting for crowdin API, rename things myself. Remove once crowdin stops being dumb
if (it.name.equals('en_us.json') && !it.path.startsWith('assets/')) {
it.name = it.path.split('/')[0] + '.json'
it.path = 'assets/forge/lang/' + it.name
}
}
from(zipTree(downloadCrowdin.dest)){
exclude { it.isDirectory() }
rename { it.toLowerCase() }//Minecraft needs it lowercase.
exclude '**/*.lang' //Pre-1.13 format
@@ -698,7 +690,7 @@ project(':forge') {
}
}
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
task launcherJson(dependsOn: ['universalJar', 'launcherJar']) {
inputs.file universalJar.archivePath
inputs.file { launcherJar.archivePath }
ext {
@@ -934,7 +926,7 @@ project(':forge') {
*/
// add crowdin locales
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
from zipTree(crowdin.archivePath)
dependsOn crowdin
doFirst {
@@ -981,11 +973,11 @@ project(':forge') {
}
task downloadInstaller(type: DownloadMavenArtifact) {
artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
artifact = 'net.minecraftforge:installer:2.2.9:fatjar'
changing = true
}
task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) {
task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, universalJar, launcherJar]) {
classifier = 'installer'
extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
destinationDir = file('build/libs')
@@ -1014,24 +1006,12 @@ project(':forge') {
}
}
[universalJar, launcherJar, installerJar].each { t ->
task "sign${t.name.capitalize()}"(type: SignJar, dependsOn: t) {
onlyIf {
JAR_SIGNER != null && t.state.failure == null
}
def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
alias = 'forge'
storePass = jarsigner.storepass
keyPass = jarsigner.keypass
keyStore = jarsigner.keystore
inputFile = t.archivePath
outputFile = t.archivePath
doFirst {
project.logger.lifecycle('Signing: ' + inputFile)
}
}
t.finalizedBy(tasks.getByName("sign${t.name.capitalize()}"))
}
/*
jarSigner.autoDetect()
jarSigner.sign(universalJar)
jarSigner.sign(launcherJar)
jarSigner.sign(installerJar)
*/
task makeMdk(type: Zip) {
baseName = project.name
@@ -1059,6 +1039,7 @@ project(':forge') {
MAPPING_VERSION: MAPPING_VERSION
])
rename 'gitignore\\.txt', '.gitignore'
rename 'gitattributes\\.txt', '.gitattributes'
}
}
@@ -1221,12 +1202,15 @@ project(':forge') {
}
repositories {
maven {
if (project.hasProperty('forgeMavenPassword')) {
credentials {
username project.properties.forgeMavenUser
password project.properties.forgeMavenPassword
if (System.env.MAVEN_USER) {
url "https://maven.minecraftforge.net/releases/"
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?: 'not'
password = System.env.MAVEN_PASSWORD ?: 'set'
}
url 'https://files.minecraftforge.net/maven/manage/upload'
} else {
url 'file://' + rootProject.file('repo').getAbsolutePath()
}
@@ -1279,7 +1263,7 @@ def getArtifacts(project, config, classifiers) {
def path = "${folder}${filename}"
def url = "https://libraries.minecraft.net/${path}"
if (!checkExists(url)) {
url = "https://files.minecraftforge.net/maven/${path}"
url = "https://maven.minecraftforge.net/${path}"
}
//TODO remove when Mojang launcher is updated
if (!classifiers && art.classifier != null) { //Mojang launcher doesn't currently support classifiers, so... move it to part of the version, and force the extension to 'jar'
@@ -1304,12 +1288,18 @@ def getArtifacts(project, config, classifiers) {
}
def checkExists(url) {
def code = new URL(url).openConnection().with {
requestMethod = 'HEAD'
connect()
responseCode
try {
def code = new URL(url).openConnection().with {
requestMethod = 'HEAD'
connect()
responseCode
}
return code == 200
} catch (Exception e) {
if (e.toString().contains('unable to find valid certification path to requested target'))
throw new RuntimeException('Failed to connect to ' + url + ': Missing certificate root authority, try updating java')
throw e
}
return code == 200
}
def getClasspath(project, libs, artifact) {
@@ -1324,6 +1314,7 @@ def getClasspath(project, libs, artifact) {
//evaluationDependsOnChildren()
task setup() {
if (findProject(':clean') != null)
dependsOn ':clean:extractMapped'
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}
+4 -4
View File
@@ -2,16 +2,16 @@
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.14.4-&query=$.promos["1.14.4-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.14.4-&query=$.promos["1.14.4-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.15.2-&query=$.promos["1.15.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.15.2-&query=$.promos["1.15.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/Flocker-Merch-blueviolet.svg)](https://forgedev.flocker.tv/)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.14.x | Active |
| 1.12.x | Legacy |
| 1.15.x | Active |
| 1.14.x | LTS |
* [Download]
* [Forum]
+1 -1
View File
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
+10 -12
View File
@@ -1,7 +1,6 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -18,6 +17,8 @@ group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming
archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
//Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time, and must be in the following format.
@@ -127,18 +128,15 @@ jar {
}
// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
}
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact reobfArtifact
artifact jar
}
}
repositories {
@@ -146,4 +144,4 @@ publishing {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
}
+5
View File
@@ -0,0 +1,5 @@
# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
@@ -578,10 +578,17 @@
@@ -579,10 +579,17 @@
GL13.glClientActiveTexture(p_227747_0_);
}
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/IVertexBuilder.java
+++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java
@@ -17,7 +17,7 @@
@@ -18,7 +18,7 @@
import org.lwjgl.system.MemoryStack;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
Logger field_227884_f_ = LogManager.getLogger();
IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_);
@@ -95,11 +95,12 @@
@@ -96,11 +96,12 @@
f5 = p_227890_3_[k] * p_227890_6_;
}
@@ -0,0 +1,18 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
@@ -64,6 +64,15 @@
super.tick();
}
+ @Override
+ public boolean keyPressed(int key, int scanCode, int modifiers) {
+ if (key == org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE) {
+ Realms.setScreen(this.field_224228_a);
+ return true;
+ }
+ return super.keyPressed(key, scanCode, modifiers);
+ }
+
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
this.renderBackground();
this.drawCenteredString(this.field_224229_b, this.width() / 2, 80, 16777215);
@@ -0,0 +1,10 @@
--- a/net/minecraft/advancements/AdvancementList.java
+++ b/net/minecraft/advancements/AdvancementList.java
@@ -96,6 +96,7 @@
}
}
+ net.minecraftforge.common.AdvancementLoadFix.buildSortedTrees(this.field_192093_c);
field_192091_a.info("Loaded {} advancements", (int)this.field_192092_b.size());
}
@@ -1,6 +1,14 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -187,6 +187,8 @@
@@ -154,6 +154,7 @@
}
this.func_192748_e();
+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.field_192759_g, this.field_192760_h, this.field_192758_f, this.field_192761_i, this::func_192738_c); else
this.func_192752_d();
this.func_192751_c();
}
@@ -187,6 +188,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
@@ -9,7 +17,7 @@
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -199,6 +201,7 @@
@@ -199,6 +202,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()));
}
@@ -0,0 +1,16 @@
--- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java
@@ -91,10 +91,11 @@
if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) {
p_225534_2_.func_175655_b(p_225534_3_, true);
} else if (p_225534_1_.func_177229_b(field_220266_f) == 0) {
- if (p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9) {
+ if (true) {
int i = this.func_220260_b(p_225534_2_, p_225534_3_) + 1;
- if (i < 16) {
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9)) {
this.func_220258_a(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_, i);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_);
}
}
@@ -58,7 +58,7 @@
@Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ if (p_196243_1_.hasTileEntity() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) {
p_196243_2_.func_175713_t(p_196243_3_);
}
-
@@ -9,7 +9,7 @@
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -87,9 +87,9 @@
@@ -87,9 +87,10 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
}
@@ -17,12 +17,13 @@
- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c();
- return block instanceof CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock;
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
+ BlockState plant = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_);
+ return plant.func_177230_c() instanceof net.minecraftforge.common.IPlantable && state.canSustainPlant(p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)plant.func_177230_c());
}
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -99,7 +99,7 @@
@@ -99,7 +100,7 @@
}
}
@@ -109,7 +109,7 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
- i = Math.max(this.func_220275_r(blockstate), i);
+ i = Math.max(blockstate.getFlammability(p_176538_1_, p_176538_2_.func_177972_a(direction), direction.func_176734_d()), i);
+ i = Math.max(blockstate.getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(direction), direction.func_176734_d()), i);
}
return i;
@@ -22,7 +22,7 @@
+ *
+ * @param emptyPot The empty pot for this pot, or null for self.
+ * @param p_i48395_1_ The flower block.
+ * @param p_i48395_2_
+ * @param properties
+ */
+ public FlowerPotBlock(@javax.annotation.Nullable java.util.function.Supplier<FlowerPotBlock> emptyPot, java.util.function.Supplier<? extends Block> p_i48395_1_, Block.Properties p_i48395_2_) {
super(p_i48395_2_);
@@ -9,17 +9,18 @@
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
}
@@ -60,6 +60,9 @@
@@ -60,7 +60,9 @@
if (p_225533_2_.field_72995_K) {
return ActionResultType.SUCCESS;
} else {
- p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_225533_2_, p_225533_3_, p_225533_1_, p_225533_1_.func_177229_b(field_196485_c), p_225533_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c));
+ if (_new == -1) return ActionResultType.FAIL;
+ p_225533_1_ = (BlockState)p_225533_1_.func_206870_a(field_196485_c, _new);
p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3);
this.func_196482_a(p_225533_2_, p_225533_3_);
@@ -76,6 +79,9 @@
p_225533_4_.func_195066_a(Stats.field_188087_U);
@@ -76,6 +78,9 @@
}
public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) {
@@ -4,17 +4,17 @@
public class PoweredRailBlock extends AbstractRailBlock {
public static final EnumProperty<RailShape> field_176568_b = BlockStateProperties.field_208166_S;
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
+ private final boolean isActivator;
+ private final boolean isActivator; // TRUE for an Activator Rail, FALSE for Powered Rail
protected PoweredRailBlock(Block.Properties p_i48349_1_) {
- super(true, p_i48349_1_);
+ this(p_i48349_1_, false);
+ }
+
+ protected PoweredRailBlock(Block.Properties builder, boolean isActivator) {
+ protected PoweredRailBlock(Block.Properties builder, boolean isPoweredRail) {
+ super(true, builder);
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176568_b, RailShape.NORTH_SOUTH).func_206870_a(field_176569_M, Boolean.valueOf(false)));
+ this.isActivator = isActivator;
+ this.isActivator = !isPoweredRail;
}
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_) {
@@ -35,3 +35,23 @@
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;
@@ -156,6 +162,10 @@
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST);
+ //Forge fix: MC-196102
+ case NORTH_SOUTH:
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) {
@@ -255,4 +265,8 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176568_b, field_176569_M);
}
+
+ public boolean isActivatorRail() {
+ return isActivator;
+ }
}
@@ -0,0 +1,13 @@
--- a/net/minecraft/block/RailBlock.java
+++ b/net/minecraft/block/RailBlock.java
@@ -49,6 +49,10 @@
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST);
case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST);
+ //Forge fix: MC-196102
+ case NORTH_SOUTH:
+ case EAST_WEST:
+ return p_185499_1_;
}
case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176565_b)) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/StemBlock.java
+++ b/net/minecraft/block/StemBlock.java
@@ -40,22 +40,24 @@
@@ -38,22 +38,24 @@
public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) {
super.func_225534_a_(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_);
@@ -30,7 +30,7 @@
}
}
@@ -101,4 +103,10 @@
@@ -98,4 +100,10 @@
public StemGrownBlock func_208486_d() {
return this.field_149877_a;
}
@@ -38,11 +38,8 @@
}
for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -712,6 +718,25 @@
}
}
@@ -714,4 +720,22 @@
+ if (net.minecraftforge.fml.client.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
p_198017_1_.func_198985_a(set);
}
+
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/MainWindow.java
+++ b/net/minecraft/client/MainWindow.java
@@ -86,7 +86,7 @@
GLFW.glfwWindowHint(139266, 2);
GLFW.glfwWindowHint(139267, 0);
GLFW.glfwWindowHint(139272, 0);
- this.field_198119_f = GLFW.glfwCreateWindow(this.field_198129_p, this.field_198130_q, p_i51170_5_, this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L, 0L);
+ this.field_198119_f = net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.handOffWindow(()->this.field_198129_p, ()->this.field_198130_q, ()->p_i51170_5_, ()->this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L);
if (monitor != null) {
VideoMode videomode = monitor.func_197992_a(this.field_198125_l ? this.field_198124_k : Optional.empty());
this.field_198120_g = this.field_198127_n = monitor.func_197989_c() + videomode.func_198064_a() / 2 - this.field_198129_p / 2;
@@ -16,15 +16,16 @@
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;
@@ -368,6 +368,7 @@
screensize = p_i45547_1_.field_178743_b;
@@ -350,7 +350,7 @@
i = 0;
}
+ net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.join();
Util.field_211180_a = RenderSystem.initBackendSystem();
this.field_195557_T = new VirtualScreen(this);
this.field_195558_d = this.field_195557_T.func_217626_a(screensize, this.field_71474_y.field_198019_u, this.func_230149_ax_());
@@ -383,7 +384,6 @@
- Bootstrap.func_151354_b();
+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.func_151354_b(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick);
Bootstrap.func_218821_c();
KeybindTextComponent.field_193637_b = KeyBinding::func_193626_b;
this.field_184131_U = DataFixesManager.func_210901_a();
@@ -383,13 +383,13 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
@@ -32,15 +33,14 @@
this.field_195559_v = new KeyboardListener(this);
this.field_195559_v.func_197968_a(this.field_195558_d.func_198092_i());
RenderSystem.initRenderer(this.field_71474_y.field_209231_W, false);
@@ -391,6 +391,7 @@
this.field_147124_at = new Framebuffer(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), true, field_142025_a);
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);
+ net.minecraftforge.fml.client.ClientModLoader.begin(this, this.field_110448_aq, this.field_110451_am, this.field_195554_ax);
this.field_71474_y.func_198017_a(this.field_110448_aq);
this.field_110448_aq.func_198983_a();
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
this.field_110451_am.func_219534_a(this.field_135017_as);
@@ -434,12 +435,14 @@
@@ -434,12 +434,14 @@
this.func_193986_ar();
this.field_110451_am.func_219534_a(this.field_193995_ae);
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -56,7 +56,7 @@
this.field_184132_p = new DebugRenderer(this);
RenderSystem.setErrorCallback(this::func_195545_a);
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
@@ -451,12 +454,11 @@
@@ -451,12 +453,11 @@
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
this.field_195558_d.func_227801_c_();
this.func_213226_a();
@@ -73,7 +73,7 @@
ResourceLoadProgressGui.func_212970_a(this);
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
this.func_213268_a(new ResourceLoadProgressGui(this, this.field_110451_am.func_219537_a(Util.func_215072_e(), this, field_223714_G, list), (p_229990_2_) -> {
@@ -466,6 +468,14 @@
@@ -466,6 +467,14 @@
this.func_213256_aB();
}
@@ -88,7 +88,16 @@
});
}, false));
}
@@ -579,7 +589,7 @@
@@ -505,7 +514,7 @@
}
private void func_229988_a_(Throwable p_229988_1_) {
- if (this.field_110448_aq.func_198980_d().size() > 1) {
+ if (this.field_110448_aq.func_198980_d().stream().anyMatch(e -> !e.func_195797_g())) { //Forge: This caused infinite loop if any resource packs are forced. Such as mod resources. So check if we can disable any.
ITextComponent itextcomponent;
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_230028_a().func_195762_a());
@@ -579,7 +588,7 @@
return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b()));
});
SearchTreeReloadable<ItemStack> searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> {
@@ -97,7 +106,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -667,13 +677,13 @@
@@ -667,13 +676,13 @@
Bootstrap.func_179870_a(p_71377_0_.func_71502_e());
if (p_71377_0_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f());
@@ -114,7 +123,7 @@
}
}
@@ -682,6 +692,7 @@
@@ -682,6 +691,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -122,7 +131,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -760,10 +771,6 @@
@@ -760,10 +770,6 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -133,7 +142,7 @@
if (p_147108_1_ == null && this.field_71441_e == null) {
p_147108_1_ = new MainMenuScreen();
} else if (p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
@@ -774,6 +781,14 @@
@@ -774,6 +780,14 @@
}
}
@@ -148,7 +157,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);
@@ -905,11 +920,13 @@
@@ -905,11 +919,13 @@
RenderSystem.enableTexture();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -162,7 +171,16 @@
}
this.field_71424_I.func_219897_b();
@@ -1164,11 +1181,21 @@
@@ -976,7 +992,7 @@
Framebuffer framebuffer = this.func_147110_a();
framebuffer.func_216491_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), field_142025_a);
- this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
+ if (this.field_71460_t!=null) this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
this.field_71417_B.func_198021_g();
}
@@ -1164,11 +1180,21 @@
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -186,7 +204,7 @@
}
}
@@ -1187,6 +1214,8 @@
@@ -1187,6 +1213,8 @@
}
} else if (!this.field_71439_g.func_184838_M()) {
@@ -195,7 +213,7 @@
switch(this.field_71476_x.func_216346_c()) {
case ENTITY:
this.field_71442_b.func_78764_a(this.field_71439_g, ((EntityRayTraceResult)this.field_71476_x).func_216348_a());
@@ -1194,7 +1223,7 @@
@@ -1194,7 +1222,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -204,7 +222,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1204,8 +1233,10 @@
@@ -1204,8 +1232,10 @@
}
this.field_71439_g.func_184821_cY();
@@ -215,7 +233,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1220,6 +1251,11 @@
@@ -1220,6 +1250,11 @@
}
for(Hand hand : Hand.values()) {
@@ -227,7 +245,7 @@
ItemStack itemstack = this.field_71439_g.func_184586_b(hand);
if (this.field_71476_x != null) {
switch(this.field_71476_x.func_216346_c()) {
@@ -1233,6 +1269,7 @@
@@ -1233,6 +1268,7 @@
if (actionresulttype.func_226246_a_()) {
if (actionresulttype.func_226247_b_()) {
@@ -235,7 +253,7 @@
this.field_71439_g.func_184609_a(hand);
}
@@ -1245,6 +1282,7 @@
@@ -1245,6 +1281,7 @@
ActionResultType actionresulttype1 = this.field_71442_b.func_217292_a(this.field_71439_g, this.field_71441_e, hand, blockraytraceresult);
if (actionresulttype1.func_226246_a_()) {
if (actionresulttype1.func_226247_b_()) {
@@ -243,7 +261,7 @@
this.field_71439_g.func_184609_a(hand);
if (!itemstack.func_190926_b() && (itemstack.func_190916_E() != i || this.field_71442_b.func_78758_h())) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
@@ -1260,6 +1298,9 @@
@@ -1260,6 +1297,9 @@
}
}
@@ -253,7 +271,7 @@
if (!itemstack.func_190926_b()) {
ActionResultType actionresulttype2 = this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand);
if (actionresulttype2.func_226246_a_()) {
@@ -1286,6 +1327,8 @@
@@ -1286,6 +1326,8 @@
--this.field_71467_ac;
}
@@ -262,7 +280,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1403,6 +1446,8 @@
@@ -1403,6 +1445,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -271,7 +289,7 @@
}
private void func_184117_aA() {
@@ -1557,6 +1602,12 @@
@@ -1557,6 +1601,12 @@
this.func_147108_a(worldloadprogressscreen);
while(!this.field_71437_Z.func_71200_ad()) {
@@ -284,7 +302,7 @@
worldloadprogressscreen.tick();
this.func_195542_b(false);
@@ -1577,11 +1628,17 @@
@@ -1577,11 +1627,17 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -303,13 +321,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1608,15 +1665,18 @@
if (clientplaynethandler != null) {
this.func_213159_be();
clientplaynethandler.func_147296_c();
+ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
}
@@ -1613,10 +1669,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -322,6 +334,22 @@
if (integratedserver != null) {
while(!integratedserver.func_213201_w()) {
this.func_195542_b(false);
@@ -1627,6 +1685,7 @@
this.field_71456_v.func_181029_i();
this.field_71422_O = null;
this.field_71455_al = false;
+ net.minecraftforge.fml.client.ClientHooks.handleClientWorldClosing(field_71441_e);
this.field_213274_aO.func_216815_b();
}
@@ -1649,6 +1708,7 @@
this.field_71452_i.func_78870_a(p_213257_1_);
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
this.func_230150_b_();
+ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
}
public final boolean func_71355_q() {
@@ -1674,112 +1734,9 @@
private void func_147112_ai() {
@@ -46,6 +46,15 @@
}
boolean flag4 = (float)this.func_71024_bL().func_75116_a() > 6.0F || this.field_71075_bZ.field_75101_c;
@@ -667,7 +675,7 @@
if (this.field_71158_b.field_78901_c && !flag7 && !flag && !this.field_71075_bZ.field_75100_b && !this.func_184218_aH() && !this.func_70617_f_()) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack) && this.func_226566_ei_()) {
+ if (itemstack.canElytraFly(this) && this.func_226566_ei_()) {
this.field_71174_a.func_147297_a(new CEntityActionPacket(this, CEntityActionPacket.Action.START_FALL_FLYING));
}
}
@@ -961,4 +969,16 @@
return this.field_204230_bP;
}
@@ -40,3 +40,12 @@
RenderSystem.disableBlend();
RenderSystem.popMatrix();
}
@@ -1045,7 +1056,7 @@
ItemStack itemstack = this.field_73839_d.field_71439_g.field_71071_by.func_70448_g();
if (itemstack.func_190926_b()) {
this.field_92017_k = 0;
- } else if (!this.field_92016_l.func_190926_b() && itemstack.func_77973_b() == this.field_92016_l.func_77973_b() && itemstack.func_200301_q().equals(this.field_92016_l.func_200301_q())) {
+ } else if (!this.field_92016_l.func_190926_b() && itemstack.func_77973_b() == this.field_92016_l.func_77973_b() && (itemstack.func_200301_q().equals(this.field_92016_l.func_200301_q()) && itemstack.getHighlightTip(itemstack.func_200301_q().func_150261_e()).equals(field_92016_l.getHighlightTip(field_92016_l.func_200301_q().func_150261_e())))) {
if (this.field_92017_k > 0) {
--this.field_92017_k;
}
@@ -8,3 +8,19 @@
if (f < 1.0F) {
this.func_228181_a_(i / 2 - 150, j / 4 * 3, i / 2 + 150, j / 4 * 3 + 10, 1.0F - MathHelper.func_76131_a(f, 0.0F, 1.0F));
}
@@ -90,6 +91,7 @@
}
if (this.field_212979_g == -1L && this.field_212975_c.func_219554_d() && (!this.field_212977_e || f1 >= 2.0F)) {
+ this.field_212979_g = Util.func_211177_b(); // Moved up to guard against inf loops caused by callback
try {
this.field_212975_c.func_219556_e();
this.field_212976_d.accept(Optional.empty());
@@ -97,7 +99,6 @@
this.field_212976_d.accept(Optional.of(throwable));
}
- this.field_212979_g = Util.func_211177_b();
if (this.field_212974_b.field_71462_r != null) {
this.field_212974_b.field_71462_r.init(this.field_212974_b, this.field_212974_b.func_228018_at_().func_198107_o(), this.field_212974_b.func_228018_at_().func_198087_p());
}
@@ -0,0 +1,14 @@
--- a/net/minecraft/client/gui/screen/MultiplayerScreen.java
+++ b/net/minecraft/client/gui/screen/MultiplayerScreen.java
@@ -241,6 +241,11 @@
}
+ @Override
+ public void onClose() {
+ this.minecraft.func_147108_a(this.field_146798_g);
+ }
+
public ServerPinger func_146789_i() {
return this.field_146797_f;
}
@@ -0,0 +1,15 @@
--- a/net/minecraft/client/gui/screen/OptionsScreen.java
+++ b/net/minecraft/client/gui/screen/OptionsScreen.java
@@ -118,4 +118,12 @@
this.drawCenteredString(this.font, this.title.func_150254_d(), this.width / 2, 15, 16777215);
super.render(p_render_1_, p_render_2_, p_render_3_);
}
+
+ @Override
+ public void onClose() {
+ // We need to consider 2 potential parent screens here:
+ // 1. From the main menu, in which case display the main menu
+ // 2. From the pause menu, in which case exit back to game
+ this.minecraft.func_147108_a(this.field_146441_g instanceof IngameMenuScreen ? null : this.field_146441_g);
+ }
}
@@ -8,7 +8,7 @@
if (this.field_78776_a.field_71439_g.func_223729_a(this.field_78776_a.field_71441_e, p_187103_1_, this.field_78779_k)) {
return false;
} else {
@@ -103,7 +104,7 @@
@@ -103,12 +104,11 @@
Block block = blockstate.func_177230_c();
if ((block instanceof CommandBlockBlock || block instanceof StructureBlock || block instanceof JigsawBlock) && !this.field_78776_a.field_71439_g.func_195070_dx()) {
return false;
@@ -16,8 +16,14 @@
+ } 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);
@@ -129,21 +130,25 @@
- block.func_176208_a(world, p_187103_1_, blockstate, this.field_78776_a.field_71439_g);
IFluidState ifluidstate = world.func_204610_c(p_187103_1_);
- boolean flag = world.func_180501_a(p_187103_1_, ifluidstate.func_206883_i(), 11);
+ boolean flag = blockstate.removedByPlayer(world, p_187103_1_, field_78776_a.field_71439_g, false, ifluidstate);
if (flag) {
block.func_176206_d(world, p_187103_1_, blockstate);
}
@@ -129,21 +129,25 @@
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, blockstate, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_);
@@ -44,7 +50,7 @@
if (flag && blockstate1.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) {
this.func_187103_a(p_180511_1_);
} else {
@@ -183,22 +188,24 @@
@@ -183,22 +187,24 @@
BlockState blockstate1 = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate1, 1.0F);
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -71,7 +77,7 @@
if (this.field_78770_f >= 1.0F) {
this.field_78778_j = false;
this.func_225324_a(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
@@ -217,7 +224,8 @@
@@ -217,7 +223,8 @@
}
public float func_78757_d() {
@@ -81,7 +87,7 @@
}
public void func_78765_e() {
@@ -234,7 +242,7 @@
@@ -234,7 +241,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()) {
@@ -90,7 +96,7 @@
}
return p_178893_1_.equals(this.field_178895_c) && flag;
@@ -256,13 +264,19 @@
@@ -256,13 +263,27 @@
return ActionResultType.FAIL;
} else {
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
@@ -105,6 +111,14 @@
return ActionResultType.SUCCESS;
} else {
- boolean flag = !p_217292_1_.func_184614_ca().func_190926_b() || !p_217292_1_.func_184592_cb().func_190926_b();
+ ItemUseContext itemusecontext = new ItemUseContext(p_217292_1_, p_217292_3_, p_217292_4_);
+ if (event.getUseItem() != net.minecraftforge.eventbus.api.Event.Result.DENY) {
+ ActionResultType result = itemstack.onItemUseFirst(itemusecontext);
+ if (result != ActionResultType.PASS) {
+ this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
+ return result;
+ }
+ }
+ boolean flag = !p_217292_1_.func_184614_ca().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_) || !p_217292_1_.func_184592_cb().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_);
boolean flag1 = p_217292_1_.func_226563_dT_() && flag;
- if (!flag1) {
@@ -112,15 +126,17 @@
ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
if (actionresulttype.func_226246_a_()) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
@@ -271,6 +285,7 @@
@@ -271,8 +292,8 @@
}
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return ActionResultType.PASS;
if (!itemstack.func_190926_b() && !p_217292_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
ItemUseContext itemusecontext = new ItemUseContext(p_217292_1_, p_217292_3_, p_217292_4_);
- ItemUseContext itemusecontext = new ItemUseContext(p_217292_1_, p_217292_3_, p_217292_4_);
ActionResultType actionresulttype1;
@@ -300,11 +315,14 @@
if (this.field_78779_k.func_77145_d()) {
int i = itemstack.func_190916_E();
@@ -300,11 +321,14 @@
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
return ActionResultType.PASS;
} else {
@@ -135,7 +151,7 @@
}
return actionresult.func_188397_a();
@@ -329,6 +347,9 @@
@@ -329,6 +353,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_));
@@ -145,7 +161,7 @@
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
}
@@ -336,6 +357,9 @@
@@ -336,6 +363,9 @@
this.func_78750_j();
Vec3d vec3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.func_226277_ct_(), p_187102_2_.func_226278_cu_(), p_187102_2_.func_226281_cx_());
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vec3d));
@@ -95,7 +95,7 @@
p_228800_4_.func_227890_a_(p_228800_5_, p_228800_6_, new float[]{p_228800_7_, p_228800_8_, p_228800_9_, p_228800_10_}, f, f1, f2, new int[]{p_228800_11_, p_228800_12_, p_228800_13_, p_228800_14_}, p_228800_15_, true);
}
@@ -208,7 +230,11 @@
@@ -208,17 +230,21 @@
}
@@ -107,3 +107,15 @@
Random random = new Random();
long i = 42L;
for(Direction direction : Direction.values()) {
random.setSeed(42L);
- func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.func_200117_a(p_228804_3_, direction, random), p_228804_8_, p_228804_9_);
+ func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.getQuads(p_228804_3_, direction, random, modelData), p_228804_8_, p_228804_9_);
}
random.setSeed(42L);
- func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.func_200117_a(p_228804_3_, (Direction)null, random), p_228804_8_, p_228804_9_);
+ func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.getQuads(p_228804_3_, (Direction)null, random, modelData), p_228804_8_, p_228804_9_);
}
private static void func_228803_a_(MatrixStack.Entry p_228803_0_, IVertexBuilder p_228803_1_, float p_228803_2_, float p_228803_3_, float p_228803_4_, List<BakedQuad> p_228803_5_, int p_228803_6_, int p_228803_7_) {
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/renderer/BlockRendererDispatcher.java
+++ b/net/minecraft/client/renderer/BlockRendererDispatcher.java
@@ -32,7 +32,7 @@
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) {
this.field_175028_a = p_i46577_1_;
this.field_228790_e_ = p_i46577_2_;
- this.field_175027_c = new BlockModelRenderer(this.field_228790_e_);
+ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(this.field_228790_e_);
this.field_175025_e = new FluidBlockRenderer();
}
@@ -40,18 +40,26 @@
return this.field_175028_a;
}
@@ -41,7 +50,7 @@
BlockRenderType blockrendertype = p_228791_1_.func_185901_i();
if (blockrendertype != BlockRenderType.INVISIBLE) {
switch(blockrendertype) {
@@ -89,7 +101,7 @@
@@ -89,10 +101,11 @@
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@@ -49,8 +58,13 @@
+ this.field_175027_c.renderModel(p_228791_2_.func_227866_c_(), p_228791_3_.getBuffer(RenderTypeLookup.func_228394_b_(p_228791_1_)), p_228791_1_, ibakedmodel, f, f1, f2, p_228791_4_, p_228791_5_, modelData);
break;
case ENTITYBLOCK_ANIMATED:
ItemStackTileEntityRenderer.field_147719_a.func_228364_a_(new ItemStack(p_228791_1_.func_177230_c()), p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
@@ -101,4 +113,9 @@
- ItemStackTileEntityRenderer.field_147719_a.func_228364_a_(new ItemStack(p_228791_1_.func_177230_c()), p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
+ ItemStack stack = new ItemStack(p_228791_1_.func_177230_c());
+ stack.func_77973_b().getItemStackTileEntityRenderer().func_228364_a_(stack, p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
}
}
@@ -101,4 +114,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175025_e.func_178268_a();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/BufferBuilder.java
+++ b/net/minecraft/client/renderer/BufferBuilder.java
@@ -121,7 +121,6 @@
@@ -122,7 +122,6 @@
bitset.set(l);
}
@@ -8,16 +8,25 @@
}
private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
@@ -364,4 +363,14 @@
@@ -298,6 +297,7 @@
}
ByteBuffer bytebuffer = this.field_179001_a.slice();
+ bytebuffer.order(this.field_179001_a.order()); // FORGE: Fix incorrect byte order
((Buffer)this.field_179001_a).clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
@@ -365,4 +365,15 @@
this.field_179018_e = p_i225907_2_;
}
}
+
+ public void putBulkData(ByteBuffer buffer) {
+ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f());
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ ((Buffer)this.field_179001_a).position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ this.field_179001_a.put(buffer);
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
+ this.field_227824_l_ += buffer.limit();
+ }
+
+ // Forge start
@@ -35,14 +35,14 @@
if (flag) {
float f5 = hand == Hand.MAIN_HAND ? f : 0.0F;
float f2 = 1.0F - MathHelper.func_219799_g(p_228396_1_, this.field_187470_g, this.field_187469_f);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_228396_2_, p_228396_1_, f1, f3, f5, this.field_187467_d))
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f5, f2, this.field_187467_d))
this.func_228405_a_(p_228396_4_, p_228396_1_, f1, Hand.MAIN_HAND, f5, this.field_187467_d, f2, p_228396_2_, p_228396_3_, p_228396_5_);
}
if (flag1) {
float f6 = hand == Hand.OFF_HAND ? f : 0.0F;
float f7 = 1.0F - MathHelper.func_219799_g(p_228396_1_, this.field_187472_i, this.field_187471_h);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_228396_2_, p_228396_1_, f1, f4, f6, this.field_187468_e))
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f6, f7, this.field_187468_e))
this.func_228405_a_(p_228396_4_, p_228396_1_, f1, Hand.OFF_HAND, f6, this.field_187468_e, f7, p_228396_2_, p_228396_3_, p_228396_5_);
}
@@ -20,19 +20,19 @@
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
if (p_228796_4_.func_205586_a(p_228796_1_, p_228796_2_.func_177984_a())) {
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, f13, f17, j);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
}
}
@@ -44,14 +44,28 @@
- this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, f34, f37, i1);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, f35, f37, i1);
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, f35, f39, i1);
+ this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f34, f39, i1);
+ this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, alpha, f34, f37, i1);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, alpha, f35, f37, i1);
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f35, f39, i1);
+ this.vertex(p_228796_3_, d0, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f34, f39, i1);
+ this.vertex(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, alpha, f34, f37, i1);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, alpha, f35, f37, i1);
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f35, f39, i1);
flag7 = true;
}
@@ -239,15 +240,15 @@
@@ -222,10 +223,9 @@
flag7 = true;
BlockPos blockpos = p_228796_2_.func_177972_a(direction);
TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1];
- if (!flag) {
- Block block = p_228796_1_.func_180495_p(blockpos).func_177230_c();
- if (block == Blocks.field_150359_w || block instanceof StainedGlassBlock) {
- textureatlassprite2 = this.field_187501_d;
+ if (atextureatlassprite[2] != null) {
+ if (p_228796_1_.func_180495_p(blockpos).shouldDisplayFluidOverlay(p_228796_1_, blockpos, p_228796_4_)) {
+ textureatlassprite2 = atextureatlassprite[2];
}
}
@@ -239,15 +239,15 @@
float f31 = 1.0F * f30 * f;
float f32 = 1.0F * f30 * f1;
float f33 = 1.0F * f30 * f2;
@@ -59,33 +73,34 @@
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, f49, f28, k);
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, f49, f29, k);
- this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, f48, f29, k);
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
if (textureatlassprite2 != this.field_187501_d) {
- if (textureatlassprite2 != this.field_187501_d) {
- this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, f48, f29, k);
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, f49, f29, k);
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, f49, f28, k);
- this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, f48, f50, k);
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
+ this.vertex(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
+ this.vertex(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
+ this.vertex(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
+ this.vertex(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
+ if (textureatlassprite2 != atextureatlassprite[2]) {
+ this.vertex(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
+ this.vertex(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
+ this.vertex(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
+ this.vertex(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
}
}
}
@@ -256,10 +257,15 @@
@@ -256,10 +256,15 @@
}
}
+ @Deprecated
private void func_228797_a_(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
- p_228797_1_.func_225582_a_(p_228797_2_, p_228797_4_, p_228797_6_).func_227885_a_(p_228797_8_, p_228797_9_, p_228797_10_, 1.0F).func_225583_a_(p_228797_11_, p_228797_12_).func_227886_a_(p_228797_13_).func_225584_a_(0.0F, 1.0F, 0.0F).func_181675_d();
+ func_228797_a_(p_228797_1_, p_228797_2_, p_228797_4_, p_228797_6_, p_228797_8_, p_228797_9_, p_228797_10_, 1.0F, p_228797_11_, p_228797_12_, p_228797_13_);
+ vertex(p_228797_1_, p_228797_2_, p_228797_4_, p_228797_6_, p_228797_8_, p_228797_9_, p_228797_10_, 1.0F, p_228797_11_, p_228797_12_, p_228797_13_);
}
+ private void func_228797_a_(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float alpha, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
+ private void vertex(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float alpha, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
+ p_228797_1_.func_225582_a_(p_228797_2_, p_228797_4_, p_228797_6_).func_227885_a_(p_228797_8_, p_228797_9_, p_228797_10_, alpha).func_225583_a_(p_228797_11_, p_228797_12_).func_227886_a_(p_228797_13_).func_225584_a_(0.0F, 1.0F, 0.0F).func_181675_d();
+ }
+
@@ -18,15 +18,7 @@
}
}
@@ -358,6 +360,7 @@
}
boolean flag = this.field_78531_r.func_175606_aa() instanceof LivingEntity && ((LivingEntity)this.field_78531_r.func_175606_aa()).func_70608_bn();
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_228381_1_, p_228381_3_))
if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && this.field_78531_r.field_71442_b.func_178889_l() != GameType.SPECTATOR) {
this.field_78513_d.func_205109_c();
this.field_78516_c.func_228396_a_(p_228381_3_, p_228381_1_, this.field_228374_i_.func_228487_b_(), this.field_78531_r.field_71439_g, this.field_78531_r.func_175598_ae().func_229085_a_(this.field_78531_r.field_71439_g, p_228381_3_));
@@ -475,7 +478,7 @@
@@ -475,7 +477,7 @@
}
} else if (this.field_78531_r.field_71462_r != null) {
try {
@@ -35,7 +27,7 @@
} catch (Throwable throwable) {
CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details");
@@ -588,9 +591,16 @@
@@ -588,9 +590,16 @@
Matrix4f matrix4f = matrixstack.func_227866_c_().func_227870_a_();
this.func_228379_a_(matrix4f);
activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), this.field_78531_r.field_71474_y.field_74320_O > 0, this.field_78531_r.field_71474_y.field_74320_O == 2, p_228378_1_);
@@ -48,11 +40,11 @@
p_228378_4_.func_227863_a_(Vector3f.field_229181_d_.func_229187_a_(activerenderinfo.func_216778_f() + 180.0F));
this.field_78531_r.field_71438_f.func_228426_a_(p_228378_4_, p_228378_1_, p_228378_2_, flag, activerenderinfo, this, this.field_78513_d, matrix4f);
+ this.field_78531_r.func_213239_aq().func_219895_b("forge_render_last");
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(this.field_78531_r.field_71438_f, p_228378_4_, p_228378_2_);
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(this.field_78531_r.field_71438_f, p_228378_4_, p_228378_1_, matrix4f, p_228378_2_);
this.field_78531_r.func_213239_aq().func_219895_b("hand");
if (this.field_175074_C) {
RenderSystem.clear(256, Minecraft.field_142025_a);
@@ -670,4 +680,9 @@
@@ -670,4 +679,9 @@
public OverlayTexture func_228385_m_() {
return this.field_228375_t_;
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/RenderState.java
+++ b/net/minecraft/client/renderer/RenderState.java
@@ -360,7 +360,7 @@
private final OptionalDouble field_228587_Q_;
public LineState(OptionalDouble p_i225982_1_) {
- super("alpha", () -> {
+ super("line_width", () -> { // FORGE: fix MC-167447
if (!Objects.equals(p_i225982_1_, OptionalDouble.of(1.0D))) {
if (p_i225982_1_.isPresent()) {
RenderSystem.lineWidth((float)p_i225982_1_.getAsDouble());
@@ -41,7 +41,7 @@
this.func_174967_a(p_228426_3_ + l1);
iprofiler.func_219895_b("terrain");
this.func_228441_a_(RenderType.func_228639_c_(), p_228426_1_, d0, d1, d2);
+ this.field_72777_q.func_209506_al().func_229356_a_(AtlasTexture.field_110575_b).func_174937_a(false, this.field_72777_q.field_71474_y.field_151442_I > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings
+ this.field_72777_q.func_209506_al().func_229356_a_(AtlasTexture.field_110575_b).setBlurMipmap(false, this.field_72777_q.field_71474_y.field_151442_I > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings
this.func_228441_a_(RenderType.func_228641_d_(), p_228426_1_, d0, d1, d2);
+ this.field_72777_q.func_209506_al().func_229356_a_(AtlasTexture.field_110575_b).restoreLastBlurMipmap();
this.func_228441_a_(RenderType.func_228643_e_(), p_228426_1_, d0, d1, d2);
@@ -68,24 +68,84 @@
BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
- if (!blockstate.func_196958_f() && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_228426_6_, field_72777_q.field_71476_x, 0, p_228426_2_))
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_228426_6_, field_72777_q.field_71476_x, p_228426_2_, p_228426_1_, irendertypebuffer$impl))
+ if (!blockstate.isAir(this.field_72769_h, blockpos) && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.func_228659_m_());
this.func_228429_a_(p_228426_1_, ivertexbuilder2, p_228426_6_.func_216773_g(), d0, d1, d2, blockpos, blockstate);
}
@@ -1380,6 +1390,11 @@
@@ -1380,6 +1390,15 @@
}
public void func_228424_a_(MatrixStack p_228424_1_, float p_228424_2_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(this.field_72773_u, p_228424_2_, this.field_72769_h, this.field_72777_q);
+ if (renderer instanceof net.minecraftforge.client.SkyRenderHandler) {
+ ((net.minecraftforge.client.SkyRenderHandler) renderer).render(this.field_72773_u, p_228424_2_, p_228424_1_, this.field_72769_h, this.field_72777_q);
+ } else {
+ renderer.render(this.field_72773_u, p_228424_2_, this.field_72769_h, this.field_72777_q);
+ }
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) {
this.func_228444_b_(p_228424_1_);
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
@@ -2283,8 +2298,8 @@
@@ -1508,6 +1527,15 @@
}
public void func_228425_a_(MatrixStack p_228425_1_, float p_228425_2_, double p_228425_3_, double p_228425_5_, double p_228425_7_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getCloudRenderer();
+ if (renderer != null) {
+ if (renderer instanceof net.minecraftforge.client.CloudRenderHandler) {
+ ((net.minecraftforge.client.CloudRenderHandler) renderer).render(this.field_72773_u, p_228425_2_, p_228425_1_, this.field_72769_h, this.field_72777_q);
+ } else {
+ renderer.render(this.field_72773_u, p_228425_2_, this.field_72769_h, this.field_72777_q);
+ }
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
RenderSystem.disableCull();
RenderSystem.enableBlend();
@@ -1689,7 +1717,7 @@
while(iterator.hasNext()) {
ChunkRenderDispatcher.ChunkRender chunkrenderdispatcher$chunkrender = iterator.next();
- if (chunkrenderdispatcher$chunkrender.func_188281_o()) {
+ if (!net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() && chunkrenderdispatcher$chunkrender.func_188281_o()) {
this.field_174995_M.func_228902_a_(chunkrenderdispatcher$chunkrender);
} else {
chunkrenderdispatcher$chunkrender.func_228929_a_(this.field_174995_M);
@@ -1977,7 +2005,12 @@
this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_);
}
+ @Deprecated // Forge: use item aware function below
public void func_184377_a(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_) {
+ this.playRecord(p_184377_1_, p_184377_2_, p_184377_1_ == null? null : MusicDiscItem.func_185074_a(p_184377_1_));
+ }
+
+ public void playRecord(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_, @Nullable MusicDiscItem musicDiscItem) {
ISound isound = this.field_147593_P.get(p_184377_2_);
if (isound != null) {
this.field_72777_q.func_147118_V().func_147683_b(isound);
@@ -1985,7 +2018,7 @@
}
if (p_184377_1_ != null) {
- MusicDiscItem musicdiscitem = MusicDiscItem.func_185074_a(p_184377_1_);
+ MusicDiscItem musicdiscitem = musicDiscItem;
if (musicdiscitem != null) {
this.field_72777_q.field_71456_v.func_73833_a(musicdiscitem.func_200299_h().func_150254_d());
}
@@ -2133,7 +2166,7 @@
break;
case 1010:
if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) {
- this.func_184377_a(((MusicDiscItem)Item.func_150899_d(p_180439_4_)).func_185075_h(), p_180439_3_);
+ this.playRecord(((MusicDiscItem)Item.func_150899_d(p_180439_4_)).func_185075_h(), p_180439_3_, (MusicDiscItem) Item.func_150899_d(p_180439_4_));
} else {
this.func_184377_a((SoundEvent)null, p_180439_3_);
}
@@ -2283,8 +2316,8 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
@@ -96,7 +156,7 @@
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}
@@ -2432,7 +2447,7 @@
@@ -2432,7 +2465,7 @@
} else {
int i = p_228420_0_.func_226658_a_(LightType.SKY, p_228420_2_);
int j = p_228420_0_.func_226658_a_(LightType.BLOCK, p_228420_2_);
@@ -105,7 +165,7 @@
if (j < k) {
j = k;
}
@@ -2445,6 +2460,11 @@
@@ -2445,6 +2478,11 @@
return this.field_175015_z;
}
@@ -6,7 +6,7 @@
public void func_225623_a_(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
- if (this.func_177070_b(p_225623_1_)) {
- this.func_225629_a_(p_225623_1_, p_225623_1_.func_145748_c_().func_150254_d(), p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_,p_225623_1_.func_145748_c_().func_150254_d(), p_225623_4_, p_225623_5_);
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_().func_150254_d(), this, p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(renderNameplateEvent);
+ if (renderNameplateEvent.getResult() != net.minecraftforge.eventbus.api.Event.Result.DENY && (renderNameplateEvent.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || this.func_177070_b(p_225623_1_))) {
+ this.func_225629_a_(p_225623_1_, renderNameplateEvent.getContent(), p_225623_4_, p_225623_5_, p_225623_6_);
@@ -19,7 +19,7 @@
+ int i = mapdata != null ? p_225623_1_.func_82333_j() % 4 * 2 : p_225623_1_.func_82333_j();
p_225623_4_.func_227863_a_(Vector3f.field_229183_f_.func_229187_a_((float)i * 360.0F / 8.0F));
- if (flag) {
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderItemInFrameEvent(p_225623_1_, this))) {
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderItemInFrameEvent(p_225623_1_, this, p_225623_4_, p_225623_5_, p_225623_6_))) {
+ if (mapdata != null) {
p_225623_4_.func_227863_a_(Vector3f.field_229183_f_.func_229187_a_(180.0F));
float f = 0.0078125F;
@@ -4,7 +4,7 @@
}
public void func_225623_a_(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_))) return;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_))) return;
p_225623_4_.func_227860_a_();
this.field_77045_g.field_217112_c = this.func_77040_d(p_225623_1_, p_225623_3_);
- this.field_77045_g.field_217113_d = p_225623_1_.func_184218_aH();
@@ -33,7 +33,7 @@
p_225623_4_.func_227865_b_();
super.func_225623_a_(p_225623_1_, p_225623_2_, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_));
}
@Nullable
@@ -4,9 +4,9 @@
public void func_225623_a_(AbstractClientPlayerEntity p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
this.func_177137_d(p_225623_1_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_225623_1_, this, p_225623_3_, p_225623_4_))) return;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_))) return;
super.func_225623_a_(p_225623_1_, p_225623_2_, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_225623_1_, this, p_225623_3_, p_225623_4_));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_));
}
public Vec3d func_225627_b_(AbstractClientPlayerEntity p_225627_1_, float p_225627_2_) {
@@ -0,0 +1,54 @@
--- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
+++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
@@ -29,7 +29,7 @@
public void func_225628_a_(MatrixStack p_225628_1_, IRenderTypeBuffer p_225628_2_, int p_225628_3_, T p_225628_4_, float p_225628_5_, float p_225628_6_, float p_225628_7_, float p_225628_8_, float p_225628_9_, float p_225628_10_) {
ItemStack itemstack = p_225628_4_.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR) {
+ if (shouldRender(itemstack, p_225628_4_)) {
ResourceLocation resourcelocation;
if (p_225628_4_ instanceof AbstractClientPlayerEntity) {
AbstractClientPlayerEntity abstractclientplayerentity = (AbstractClientPlayerEntity)p_225628_4_;
@@ -38,10 +38,10 @@
} else if (abstractclientplayerentity.func_152122_n() && abstractclientplayerentity.func_110303_q() != null && abstractclientplayerentity.func_175148_a(PlayerModelPart.CAPE)) {
resourcelocation = abstractclientplayerentity.func_110303_q();
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
} else {
- resourcelocation = field_188355_a;
+ resourcelocation = getElytraTexture(itemstack, p_225628_4_);
}
p_225628_1_.func_227860_a_();
@@ -53,4 +53,29 @@
p_225628_1_.func_227865_b_();
}
}
+
+ /**
+ * Determines if the ElytraLayer should render.
+ * ItemStack and Entity are provided for modder convenience,
+ * For example, using the same ElytraLayer for multiple custom Elytra.
+ *
+ * @param stack The Elytra ItemStack
+ * @param entity The entity being rendered.
+ * @return If the ElytraLayer should render.
+ */
+ public boolean shouldRender(ItemStack stack, T entity) {
+ return stack.func_77973_b() == Items.field_185160_cR;
+ }
+
+ /**
+ * Gets the texture to use with this ElytraLayer.
+ * This assumes the vanilla Elytra model.
+ *
+ * @param stack The Elytra ItemStack.
+ * @param entity The entity being rendered.
+ * @return The texture.
+ */
+ public ResourceLocation getElytraTexture(ItemStack stack, T entity) {
+ return field_188355_a;
+ }
}
@@ -78,3 +78,11 @@
public boolean func_178300_b(String p_178300_1_) {
return !MissingTextureSprite.func_195675_b().equals(this.func_228816_c_(p_178300_1_).func_229313_b_());
}
@@ -373,5 +396,7 @@
public boolean func_230178_a_() {
return this == SIDE;
}
+
+ public String getSerializedName() { return field_230177_c_; }
}
}
@@ -11,7 +11,7 @@
List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,9 +23,12 @@
@@ -21,9 +23,13 @@
boolean func_188618_c();
@@ -20,6 +20,7 @@
TextureAtlasSprite func_177554_e();
- ItemCameraTransforms func_177552_f();
+ /**@deprecated Forge: Use {@link net.minecraftforge.client.extensions.IForgeBakedModel#handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType, com.mojang.blaze3d.matrix.MatrixStack)} instead */
+ @Deprecated
+ default ItemCameraTransforms func_177552_f() { return ItemCameraTransforms.field_178357_a; }
@@ -1,17 +1,6 @@
--- a/net/minecraft/client/renderer/model/ItemCameraTransforms.java
+++ b/net/minecraft/client/renderer/model/ItemCameraTransforms.java
@@ -9,6 +9,10 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
+/**
+ * @deprecated use {@link net.minecraft.client.renderer.model.IBakedModel#handlePerspective(TransformType)} instead
+ */
+@Deprecated
@OnlyIn(Dist.CLIENT)
public class ItemCameraTransforms {
public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms();
@@ -25,6 +29,7 @@
@@ -25,6 +25,7 @@
this(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a);
}
@@ -19,7 +8,7 @@
public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_) {
this.field_188036_k = p_i46443_1_.field_188036_k;
this.field_188037_l = p_i46443_1_.field_188037_l;
@@ -36,6 +41,7 @@
@@ -36,6 +37,7 @@
this.field_181700_p = p_i46443_1_.field_181700_p;
}
@@ -27,7 +16,7 @@
public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_) {
this.field_188036_k = p_i46569_1_;
this.field_188037_l = p_i46569_2_;
@@ -47,6 +53,7 @@
@@ -47,6 +49,7 @@
this.field_181700_p = p_i46569_8_;
}
@@ -50,7 +50,7 @@
this.field_217848_D.addAll(p_209593_2_.func_187965_e());
}
+ // Same as func_217843_a but without restricting to MRL's
+ // Same as loadTopModel but without restricting to MRL's
+ private void addModelToCache(ResourceLocation p_217843_1_) {
+ IUnbakedModel iunbakedmodel = this.func_209597_a(p_217843_1_);
+ this.field_217849_F.put(p_217843_1_, iunbakedmodel);
@@ -41,7 +41,7 @@
}
public AtlasTexture func_229356_a_(ResourceLocation p_229356_1_) {
+ if (this.field_229352_b_ == null) throw new RuntimeException("func_229356_a_ called too early!");
+ if (this.field_229352_b_ == null) throw new RuntimeException("getAtlasTexture called too early!");
return this.field_229352_b_.func_229152_a_(p_229356_1_);
}
@@ -5,7 +5,7 @@
private final ItemCameraTransforms field_177651_f;
+ public Builder(net.minecraftforge.client.model.IModelConfiguration model, ItemOverrideList overrides) {
+ this(model.useSmoothLighting(), model.isShadedInGui(), true/*TODO: Forge*/, model.getCameraTransforms(), overrides);
+ this(model.useSmoothLighting(), model.isShadedInGui(), model.isSideLit(), model.getCameraTransforms(), overrides);
+ }
+
public Builder(BlockModel p_i230060_1_, ItemOverrideList p_i230060_2_, boolean p_i230060_3_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/model/VariantList.java
+++ b/net/minecraft/client/renderer/model/VariantList.java
@@ -64,7 +64,7 @@
WeightedBakedModel.Builder weightedbakedmodel$builder = new WeightedBakedModel.Builder();
for(Variant variant : this.func_188114_a()) {
- IBakedModel ibakedmodel = p_225613_1_.func_217845_a(variant.func_188046_a(), variant);
+ IBakedModel ibakedmodel = p_225613_1_.getBakedModel(variant.func_188046_a(), variant, p_225613_2_);
weightedbakedmodel$builder.func_177677_a(ibakedmodel, variant.func_188047_d());
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/NativeImage.java
+++ b/net/minecraft/client/renderer/texture/NativeImage.java
@@ -179,7 +179,7 @@
@@ -180,7 +180,7 @@
public int func_195709_a(int p_195709_1_, int p_195709_2_) {
if (this.field_211680_b != NativeImage.PixelFormat.RGBA) {
throw new IllegalArgumentException(String.format("getPixelRGBA only works on RGBA images; have %s", this.field_211680_b));
@@ -9,7 +9,7 @@
this.func_195696_g();
long i = (long)((p_195709_1_ + p_195709_2_ * this.field_195719_a) * 4);
return MemoryUtil.memGetInt(this.field_195722_d + i);
@@ -191,7 +191,7 @@
@@ -192,7 +192,7 @@
public void func_195700_a(int p_195700_1_, int p_195700_2_, int p_195700_3_) {
if (this.field_211680_b != NativeImage.PixelFormat.RGBA) {
throw new IllegalArgumentException(String.format("getPixelRGBA only works on RGBA images; have %s", this.field_211680_b));
@@ -18,7 +18,7 @@
this.func_195696_g();
long i = (long)((p_195700_1_ + p_195700_2_ * this.field_195719_a) * 4);
MemoryUtil.memPutInt(this.field_195722_d + i, p_195700_3_);
@@ -203,7 +203,7 @@
@@ -204,7 +204,7 @@
public byte func_211675_e(int p_211675_1_, int p_211675_2_) {
if (!this.field_211680_b.func_211653_r()) {
throw new IllegalArgumentException(String.format("no luminance or alpha in %s", this.field_211680_b));
@@ -1,12 +1,21 @@
--- a/net/minecraft/client/renderer/texture/Texture.java
+++ b/net/minecraft/client/renderer/texture/Texture.java
@@ -33,6 +33,11 @@
@@ -33,6 +33,20 @@
GlStateManager.func_227677_b_(3553, 10240, j);
}
+ // FORGE: This seems to have been stripped out, but we need it
+ private boolean lastBlur;
+ private boolean lastMipmap;
+
+ public void setBlurMipmap(boolean blur, boolean mipmap) {
+ this.lastBlur = this.field_174940_b;
+ this.lastMipmap = this.field_174941_c;
+ func_174937_a(blur, mipmap);
+ }
+
+ public void restoreLastBlurMipmap() {
+ func_174937_a(this.field_174940_b, this.field_174941_c);
+ func_174937_a(this.lastBlur, this.lastMipmap);
+ }
+
public int func_110552_b() {
@@ -17,14 +17,13 @@
p_195667_3_[i].func_227788_a_(i, this.field_110975_c >> i, this.field_110974_d >> i, p_195667_1_ >> i, p_195667_2_ >> i, this.field_229226_c_.field_229245_b_ >> i, this.field_229226_c_.field_229246_c_ >> i, this.field_195670_c.length > 1, false);
}
@@ -341,4 +342,10 @@
@@ -341,4 +342,9 @@
}
}
+
+
+ // Forge Start
+
+ public int getPixelRGBA(int frameIndex, int x, int y) {
+ return this.field_195670_c[frameIndex].func_195709_a(x + this.field_195671_d[frameIndex] * func_94211_a(), y + this.field_195672_e[frameIndex] * func_94216_b());
+ return this.field_195670_c[0].func_195709_a(x + this.field_195671_d[frameIndex] * func_94211_a(), y + this.field_195672_e[frameIndex] * func_94216_b());
+ }
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/client/renderer/tileentity/ChestTileEntityRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/ChestTileEntityRenderer.java
@@ -98,7 +98,7 @@
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
int i = icallbackwrapper.apply(new DualBrightnessCallback<>()).applyAsInt(p_225616_5_);
- Material material = Atlases.func_228771_a_(p_225616_1_, chesttype, this.field_147509_j);
+ Material material = this.getMaterial(p_225616_1_, chesttype);
IVertexBuilder ivertexbuilder = material.func_229311_a_(p_225616_4_, RenderType::func_228638_b_);
if (flag1) {
if (chesttype == ChestType.LEFT) {
@@ -121,4 +121,8 @@
p_228871_4_.func_228308_a_(p_228871_1_, p_228871_2_, p_228871_7_, p_228871_8_);
p_228871_5_.func_228308_a_(p_228871_1_, p_228871_2_, p_228871_7_, p_228871_8_);
}
+
+ protected Material getMaterial(T tileEntity, ChestType chestType) {
+ return Atlases.func_228771_a_(tileEntity, chestType, this.field_147509_j);
+ }
}
@@ -4,7 +4,7 @@
this.field_135037_b = p_i1303_2_;
this.field_135038_c = p_i1303_3_;
this.field_135036_d = p_i1303_4_;
+ String[] splitLangCode = field_135038_c.split("_", 2);
+ String[] splitLangCode = field_135039_a.split("_", 2);
+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores
+ this.javaLocale = new java.util.Locale(field_135039_a);
+ } else {
@@ -17,7 +17,7 @@
public static void func_197981_a(InputMappings.Input p_197981_0_) {
- KeyBinding keybinding = field_74514_b.get(p_197981_0_);
+ for (KeyBinding keybinding : field_74514_b.lookupAll(p_197981_0_))
+ KeyBinding keybinding = field_74514_b.lookupActive(p_197981_0_);
if (keybinding != null) {
++keybinding.field_151474_i;
}
@@ -0,0 +1,47 @@
--- a/net/minecraft/client/shader/Framebuffer.java
+++ b/net/minecraft/client/shader/Framebuffer.java
@@ -100,8 +100,14 @@
GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227594_c_, 3553, this.field_147617_g, 0);
if (this.field_147619_e) {
GlStateManager.func_227730_i_(FramebufferConstants.field_227593_b_, this.field_147624_h);
+ if (!stencilEnabled) {
GlStateManager.func_227678_b_(FramebufferConstants.field_227593_b_, 33190, this.field_147622_a, this.field_147620_b);
GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227595_d_, FramebufferConstants.field_227593_b_, this.field_147624_h);
+ } else {
+ GlStateManager.func_227678_b_(FramebufferConstants.field_227593_b_, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b);
+ GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, FramebufferConstants.field_227593_b_, this.field_147624_h);
+ GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, FramebufferConstants.field_227593_b_, this.field_147624_h);
+ }
}
this.func_147611_b();
@@ -254,4 +260,29 @@
GlStateManager.func_227658_a_(i, p_216493_1_);
this.func_147609_e();
}
+
+ /*================================ FORGE START ================================================*/
+ private boolean stencilEnabled = false;
+ /**
+ * Attempts to enable 8 bits of stencil buffer on this FrameBuffer.
+ * Modders must call this directly to set things up.
+ * This is to prevent the default cause where graphics cards do not support stencil bits.
+ * <b>Make sure to call this on the main render thread!</b>
+ */
+ public void enableStencil()
+ {
+ if(stencilEnabled) return;
+ stencilEnabled = true;
+ this.func_216491_a(field_147621_c, field_147618_d, net.minecraft.client.Minecraft.field_142025_a);
+ }
+
+ /**
+ * Returns wither or not this FBO has been successfully initialized with stencil bits.
+ * If not, and a modder wishes it to be, they must call enableStencil.
+ */
+ public boolean isStencilEnabled()
+ {
+ return this.stencilEnabled;
+ }
+ /*================================ FORGE END ================================================*/
}
@@ -69,3 +69,12 @@
if (p_217384_1_ == this.field_73037_M.field_71439_g) {
this.field_73037_M.func_147118_V().func_147682_a(new EntityTickableSound(p_217384_3_, p_217384_4_, p_217384_2_));
}
@@ -689,7 +706,7 @@
}
public double func_228331_m_() {
- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D;
+ return this.field_73011_w.getHorizonHeight();
}
public int func_228332_n_() {
@@ -1,6 +1,10 @@
--- a/net/minecraft/data/DataGenerator.java
+++ b/net/minecraft/data/DataGenerator.java
@@ -19,7 +19,7 @@
@@ -16,10 +16,11 @@
private final Collection<Path> field_200394_b;
private final Path field_200395_c;
private final List<IDataProvider> field_200396_d = Lists.newArrayList();
+ private final List<IDataProvider> providerView = java.util.Collections.unmodifiableList(field_200396_d);
public DataGenerator(Path p_i48266_1_, Collection<Path> p_i48266_2_) {
this.field_200395_c = p_i48266_1_;
@@ -9,10 +13,22 @@
}
public Collection<Path> func_200389_a() {
@@ -53,6 +53,10 @@
@@ -38,6 +39,7 @@
for(IDataProvider idataprovider : this.field_200396_d) {
field_200393_a.info("Starting provider: {}", (Object)idataprovider.func_200397_b());
+ net.minecraftforge.fml.StartupMessageManager.addModMessage("Generating: " + idataprovider.func_200397_b());
stopwatch1.start();
idataprovider.func_200398_a(directorycache);
stopwatch1.stop();
@@ -53,6 +55,14 @@
this.field_200396_d.add(p_200390_1_);
}
+ public List<IDataProvider> getProviders() {
+ return this.providerView;
+ }
+
+ public void addInput(Path value) {
+ this.field_200394_b.add(value);
+ }
@@ -1,11 +1,13 @@
--- 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();
@@ -55,8 +55,8 @@
}
public DirectoryCache(Path p_i49352_1_, String p_i49352_2_) throws IOException {
IOUtils.writeLines(this.field_208329_f.entrySet().stream().map((p_208319_1_) -> {
- return (String)p_208319_1_.getValue() + ' ' + this.field_208325_b.relativize(p_208319_1_.getKey());
- }).collect(Collectors.toList()), System.lineSeparator(), writer);
+ return (String)p_208319_1_.getValue() + ' ' + this.field_208325_b.relativize(p_208319_1_.getKey()).toString().replace('\\', '/'); //Forge: Standardize file paths.
+ }).sorted(java.util.Comparator.comparing(a -> a.split(" ")[1])).collect(Collectors.toList()), System.lineSeparator(), writer);
writer.close();
field_208324_a.debug("Caching: cache hits: {}, created: {} removed: {}", this.field_208327_d, this.field_208329_f.size() - this.field_208327_d, this.field_208328_e.size());
}
@@ -1,19 +1,20 @@
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -21,8 +21,11 @@
@@ -21,8 +21,12 @@
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
+ OptionSpec<String> existing = optionparser.accepts("existing", "Existing resource packs that generated resources can reference").withRequiredArg();
+ OptionSpec<java.io.File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(java.io.File.class).defaultsTo(new java.io.File(".")).required(); //Need by modlauncher, so lets just eat it
+ OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
+ OptionSpec<Void> flat = optionparser.accepts("flat", "Do not append modid prefix to output directory when generating for multiple mods");
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,12 @@
@@ -30,10 +34,13 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
@@ -24,9 +25,10 @@
+ Collection<Path> inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList());
+ Collection<Path> existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).collect(Collectors.toList());
+ java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5);
+ boolean isFlat = mods.isEmpty() || optionset.has(flat);
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5, isFlat);
+ if (mods.contains("minecraft") || mods.isEmpty())
+ func_200264_a(mods.isEmpty() ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
+ func_200264_a(isFlat ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
} else {
optionparser.printHelpOn(System.out);
}
@@ -1,6 +1,28 @@
--- a/net/minecraft/dispenser/IDispenseItemBehavior.java
+++ b/net/minecraft/dispenser/IDispenseItemBehavior.java
@@ -295,8 +295,9 @@
@@ -62,6 +62,7 @@
import net.minecraft.world.World;
public interface IDispenseItemBehavior {
+ org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger();
IDispenseItemBehavior field_223216_a_ = (p_210297_0_, p_210297_1_) -> {
return p_210297_1_;
};
@@ -162,7 +163,12 @@
public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
Direction direction = p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a);
EntityType<?> entitytype = ((SpawnEggItem)p_82487_2_.func_77973_b()).func_208076_b(p_82487_2_.func_77978_p());
- entitytype.func_220331_a(p_82487_1_.func_197524_h(), p_82487_2_, (PlayerEntity)null, p_82487_1_.func_180699_d().func_177972_a(direction), SpawnReason.DISPENSER, direction != Direction.UP, false);
+ try { // FORGE: fix potential crash
+ entitytype.func_220331_a(p_82487_1_.func_197524_h(), p_82487_2_, (PlayerEntity) null, p_82487_1_.func_180699_d().func_177972_a(direction), SpawnReason.DISPENSER, direction != Direction.UP, false);
+ } catch (Exception e) {
+ LOGGER.error("Error while dispensing spawn egg from dispenser at {}", p_82487_1_.func_180699_d(), e);
+ return ItemStack.field_190927_a;
+ }
p_82487_2_.func_190918_g(1);
return p_82487_2_;
}
@@ -295,8 +301,9 @@
world.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P());
} else if (FlintAndSteelItem.func_219997_a(blockstate)) {
world.func_175656_a(blockpos, blockstate.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)));
@@ -12,7 +34,7 @@
world.func_217377_a(blockpos, false);
} else {
this.field_218407_b = false;
@@ -426,15 +427,23 @@
@@ -426,15 +433,23 @@
}
});
DispenserBlock.func_199774_a(Items.field_151097_aZ.func_199767_j(), new OptionalDispenseBehavior() {
@@ -222,15 +222,27 @@
}
public boolean func_70028_i(Entity p_70028_1_) {
@@ -2046,6 +2073,7 @@
@@ -2046,6 +2073,11 @@
@Nullable
public Entity func_212321_a(DimensionType p_212321_1_) {
+ return this.changeDimension(p_212321_1_, func_184102_h().func_71218_a(p_212321_1_).func_85176_s());
+ }
+ @Nullable
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null;
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();
@@ -2063,16 +2091,9 @@
@@ -2055,6 +2087,7 @@
this.field_71093_bK = p_212321_1_;
this.func_213319_R();
this.field_70170_p.func_217381_Z().func_76320_a("reposition");
+ Entity transportedEntity = teleporter.placeEntity(this, serverworld, serverworld1, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic
Vec3d vec3d = this.func_213322_ci();
float f = 0.0F;
BlockPos blockpos;
@@ -2063,16 +2096,9 @@
} else if (p_212321_1_ == DimensionType.field_223229_c_) {
blockpos = serverworld1.func_180504_m();
} else {
@@ -250,16 +262,41 @@
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);
@@ -2101,7 +2122,7 @@
@@ -2082,6 +2108,7 @@
d1 = MathHelper.func_151237_a(d1, d4, d6);
Vec3d vec3d1 = this.func_181014_aG();
blockpos = new BlockPos(d0, this.func_226278_cu_(), d1);
+ if (spawnPortal) {
BlockPattern.PortalInfo blockpattern$portalinfo = serverworld1.func_85176_s().func_222272_a(blockpos, vec3d, this.func_181012_aH(), vec3d1.field_72450_a, vec3d1.field_72448_b, this instanceof PlayerEntity);
if (blockpattern$portalinfo == null) {
return null;
@@ -2090,6 +2117,7 @@
blockpos = new BlockPos(blockpattern$portalinfo.field_222505_a);
vec3d = blockpattern$portalinfo.field_222506_b;
f = (float)blockpattern$portalinfo.field_222507_c;
+ }
}
this.field_70170_p.func_217381_Z().func_219895_b("reloading");
@@ -2100,13 +2128,15 @@
entity.func_213317_d(vec3d);
serverworld1.func_217460_e(entity);
}
+ return entity;
+ });//Forge: End vanilla logic
- 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();
@@ -2129,10 +2150,12 @@
this.field_70170_p.func_217381_Z().func_76319_b();
- return entity;
+ return transportedEntity;
} else {
return null;
}
@@ -2129,10 +2159,12 @@
}
public Vec3d func_181014_aG() {
@@ -272,7 +309,7 @@
return this.field_181018_ap;
}
@@ -2261,7 +2284,7 @@
@@ -2261,7 +2293,7 @@
Pose pose = this.func_213283_Z();
EntitySize entitysize1 = this.func_213305_a(pose);
this.field_213325_aI = entitysize1;
@@ -281,7 +318,7 @@
if (entitysize1.field_220315_a < entitysize.field_220315_a) {
double d0 = (double)entitysize1.field_220315_a / 2.0D;
this.func_174826_a(new AxisAlignedBB(this.func_226277_ct_() - d0, this.func_226278_cu_(), this.func_226281_cx_() - d0, this.func_226277_ct_() + d0, this.func_226278_cu_() + (double)entitysize1.field_220316_b, this.func_226281_cx_() + d0));
@@ -2713,6 +2736,7 @@
@@ -2713,6 +2745,7 @@
this.field_70165_t = p_226288_1_;
this.field_70163_u = p_226288_3_;
this.field_70161_v = p_226288_5_;
@@ -289,7 +326,7 @@
}
public void func_70623_bb() {
@@ -2726,4 +2750,69 @@
@@ -2726,4 +2759,69 @@
public interface IMoveCallback {
void accept(Entity p_accept_1_, double p_accept_2_, double p_accept_4_, double p_accept_6_);
}
@@ -205,7 +205,17 @@
}
protected void func_213333_a(DamageSource p_213333_1_, int p_213333_2_, boolean p_213333_3_) {
@@ -1161,6 +1186,9 @@
@@ -1148,7 +1173,8 @@
ResourceLocation resourcelocation = this.func_213346_cF();
LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(resourcelocation);
LootContext.Builder lootcontext$builder = this.func_213363_a(p_213354_2_, p_213354_1_);
- loottable.func_216120_b(lootcontext$builder.func_216022_a(LootParameterSets.field_216263_d), this::func_199701_a_);
+ LootContext ctx = lootcontext$builder.func_216022_a(LootParameterSets.field_216263_d);
+ loottable.func_216113_a(ctx).forEach(this::func_199701_a_);
}
protected LootContext.Builder func_213363_a(boolean p_213363_1_, DamageSource p_213363_2_) {
@@ -1161,6 +1187,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -215,7 +225,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();
@@ -1196,12 +1224,7 @@
@@ -1196,12 +1225,7 @@
return false;
} else {
BlockState blockstate = this.func_213339_cH();
@@ -229,7 +239,7 @@
}
}
@@ -1225,6 +1248,11 @@
@@ -1225,6 +1249,11 @@
}
public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) {
@@ -241,7 +251,7 @@
boolean flag = super.func_225503_b_(p_225503_1_, p_225503_2_);
int i = this.func_225508_e_(p_225503_1_, p_225503_2_);
if (i > 0) {
@@ -1248,9 +1276,10 @@
@@ -1248,9 +1277,10 @@
int i = MathHelper.func_76128_c(this.func_226277_ct_());
int j = MathHelper.func_76128_c(this.func_226278_cu_() - (double)0.2F);
int k = MathHelper.func_76128_c(this.func_226281_cx_());
@@ -255,7 +265,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
@@ -1319,6 +1348,8 @@
@@ -1319,6 +1349,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -264,7 +274,7 @@
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f2 = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F);
@@ -1328,10 +1359,11 @@
@@ -1328,10 +1360,11 @@
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f * 10.0F));
}
@@ -277,7 +287,7 @@
this.func_110149_m(this.func_110139_bj() - f2);
}
}
@@ -1385,6 +1417,8 @@
@@ -1385,6 +1418,8 @@
}
public void func_226292_a_(Hand p_226292_1_, boolean p_226292_2_) {
@@ -286,7 +296,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;
@@ -1771,15 +1805,16 @@
@@ -1771,15 +1806,16 @@
}
this.field_70160_al = true;
@@ -305,7 +315,7 @@
}
protected float func_189749_co() {
@@ -1789,11 +1824,15 @@
@@ -1789,11 +1825,15 @@
public void func_213352_e(Vec3d p_213352_1_) {
if (this.func_70613_aW() || this.func_184186_bw()) {
double d0 = 0.08D;
@@ -322,7 +332,7 @@
if (!this.func_70090_H() || this instanceof PlayerEntity && ((PlayerEntity)this).field_71075_bZ.field_75100_b) {
if (!this.func_180799_ab() || this instanceof PlayerEntity && ((PlayerEntity)this).field_71075_bZ.field_75100_b) {
@@ -1842,7 +1881,7 @@
@@ -1842,7 +1882,7 @@
}
} else {
BlockPos blockpos = this.func_226270_aj_();
@@ -331,7 +341,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()));
@@ -1904,6 +1943,7 @@
@@ -1904,6 +1944,7 @@
f = 0.96F;
}
@@ -339,7 +349,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();
@@ -1979,6 +2019,7 @@
@@ -1979,6 +2020,7 @@
}
public void func_70071_h_() {
@@ -347,7 +357,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -2022,7 +2063,9 @@
@@ -2022,7 +2064,9 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -357,7 +367,16 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype));
}
@@ -2474,13 +2517,22 @@
@@ -2258,6 +2302,8 @@
boolean flag = this.func_70083_f(7);
if (flag && !this.field_70122_E && !this.func_184218_aH()) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
+ flag = itemstack.canElytraFly(this) && itemstack.elytraFlightTick(this, this.field_184629_bo);
+ if (false) //Forge: Moved to ElytraItem
if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack)) {
flag = true;
if (!this.field_70170_p.field_72995_K && (this.field_184629_bo + 1) % 20 == 0) {
@@ -2474,13 +2520,22 @@
private void func_184608_ct() {
if (this.func_184587_cr()) {
@@ -382,7 +401,7 @@
this.func_71036_o();
}
} else {
@@ -2522,8 +2574,10 @@
@@ -2522,8 +2577,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()) {
@@ -394,7 +413,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);
@@ -2583,6 +2637,9 @@
@@ -2583,6 +2640,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.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_());
@@ -404,7 +423,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);
}
@@ -2594,7 +2651,9 @@
@@ -2594,7 +2654,9 @@
} else {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_226293_b_(this.field_184627_bm, 16);
@@ -415,7 +434,7 @@
this.func_184602_cy();
}
@@ -2615,7 +2674,11 @@
@@ -2615,7 +2677,11 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -427,7 +446,7 @@
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
}
@@ -2772,16 +2835,16 @@
@@ -2772,16 +2838,16 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_213347_1_) -> {
@@ -448,7 +467,7 @@
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);
});
@@ -2797,7 +2860,9 @@
@@ -2797,7 +2863,9 @@
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
BlockPos blockpos = this.func_213374_dv().orElse((BlockPos)null);
@@ -459,7 +478,7 @@
}
public boolean func_70094_T() {
@@ -2866,4 +2931,58 @@
@@ -2866,4 +2934,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,29 @@
--- a/net/minecraft/entity/effect/LightningBoltEntity.java
+++ b/net/minecraft/entity/effect/LightningBoltEntity.java
@@ -80,6 +80,7 @@
@@ -38,11 +38,6 @@
this.field_70264_a = this.field_70146_Z.nextLong();
this.field_70263_c = this.field_70146_Z.nextInt(3) + 1;
this.field_184529_d = p_i46780_8_;
- Difficulty difficulty = p_i46780_1_.func_175659_aa();
- if (difficulty == Difficulty.NORMAL || difficulty == Difficulty.HARD) {
- this.func_195053_a(4);
- }
-
}
public SoundCategory func_184176_by() {
@@ -58,6 +53,10 @@
if (this.field_70262_b == 2) {
this.field_70170_p.func_184148_a((PlayerEntity)null, this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), SoundEvents.field_187754_de, SoundCategory.WEATHER, 10000.0F, 0.8F + this.field_70146_Z.nextFloat() * 0.2F);
this.field_70170_p.func_184148_a((PlayerEntity)null, this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), SoundEvents.field_187752_dd, SoundCategory.WEATHER, 2.0F, 0.5F + this.field_70146_Z.nextFloat() * 0.2F);
+ Difficulty difficulty = this.field_70170_p.func_175659_aa();
+ if (difficulty == Difficulty.NORMAL || difficulty == Difficulty.HARD) {
+ this.func_195053_a(4);
+ }
}
--this.field_70262_b;
@@ -80,6 +79,7 @@
List<Entity> list = this.field_70170_p.func_175674_a(this, new AxisAlignedBB(this.func_226277_ct_() - 3.0D, this.func_226278_cu_() - 3.0D, this.func_226281_cx_() - 3.0D, this.func_226277_ct_() + 3.0D, this.func_226278_cu_() + 6.0D + 3.0D, this.func_226281_cx_() + 3.0D), Entity::func_70089_S);
for(Entity entity : list) {
@@ -22,3 +22,17 @@
}
} else if (livingentity != null) {
livingentity.func_70634_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_());
@@ -121,11 +124,11 @@
}
@Nullable
- public Entity func_212321_a(DimensionType p_212321_1_) {
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
if (this.field_70192_c.field_71093_bK != p_212321_1_) {
this.field_70192_c = null;
}
- return super.func_212321_a(p_212321_1_);
+ return super.changeDimension(p_212321_1_, teleporter);
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/entity/item/FireworkRocketEntity.java
+++ b/net/minecraft/entity/item/FireworkRocketEntity.java
@@ -187,6 +187,7 @@
}
protected void func_213892_a(RayTraceResult p_213892_1_) {
+ if(p_213892_1_.func_216346_c() != RayTraceResult.Type.MISS && net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, p_213892_1_)) return;
if (p_213892_1_.func_216346_c() == RayTraceResult.Type.ENTITY && !this.field_70170_p.field_72995_K) {
this.func_213893_k();
} else if (this.field_70132_H) {
@@ -109,6 +109,17 @@
this.func_70106_y();
itemstack.func_190920_e(i);
}
@@ -300,8 +328,8 @@
}
@Nullable
- public Entity func_212321_a(DimensionType p_212321_1_) {
- Entity entity = super.func_212321_a(p_212321_1_);
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
+ Entity entity = super.changeDimension(p_212321_1_, teleporter);
if (!this.field_70170_p.field_72995_K && entity instanceof ItemEntity) {
((ItemEntity)entity).func_85054_d();
}
@@ -366,7 +394,7 @@
public void func_174870_v() {
@@ -31,15 +31,18 @@
}
public double func_70042_X() {
@@ -239,7 +241,7 @@
@@ -239,9 +241,9 @@
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
- if (blockstate.func_203425_a(BlockTags.field_203437_y)) {
+ if (canUseRail() && blockstate.func_203425_a(BlockTags.field_203437_y)) {
this.func_180460_a(blockpos, blockstate);
if (blockstate.func_177230_c() == Blocks.field_150408_cc) {
- if (blockstate.func_177230_c() == Blocks.field_150408_cc) {
+ if (blockstate.func_177230_c() instanceof PoweredRailBlock && ((PoweredRailBlock) blockstate.func_177230_c()).isActivatorRail()) {
this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M));
}
} else {
@@ -266,8 +268,11 @@
}
@@ -98,7 +101,13 @@
}
}
@@ -327,24 +341,23 @@
@@ -322,29 +336,28 @@
boolean flag = false;
boolean flag1 = false;
AbstractRailBlock abstractrailblock = (AbstractRailBlock)p_180460_2_.func_177230_c();
- if (abstractrailblock == Blocks.field_196552_aC) {
+ if (abstractrailblock instanceof PoweredRailBlock && !((PoweredRailBlock) abstractrailblock).isActivatorRail()) {
flag = p_180460_2_.func_177229_b(PoweredRailBlock.field_176569_M);
flag1 = !flag;
}
@@ -238,7 +247,7 @@
+ public void moveMinecartOnRail(BlockPos pos) { //Non-default because getMaximumSpeed is protected
+ AbstractMinecartEntity mc = getMinecart();
+ double d24 = mc.func_184207_aI() ? 0.75D : 1.0D;
+ double d25 = mc.func_174898_m();
+ double d25 = mc.getMaxSpeedWithRail();
+ Vec3d vec3d1 = mc.func_213322_ci();
+ mc.func_213315_a(MoverType.SELF, new Vec3d(MathHelper.func_151237_a(d24 * vec3d1.field_72450_a, -d25, d25), 0.0D, MathHelper.func_151237_a(d24 * vec3d1.field_72449_c, -d25, d25)));
+ }
@@ -1,7 +1,14 @@
--- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
+++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
@@ -115,12 +115,14 @@
return super.func_212321_a(p_212321_1_);
@@ -110,17 +110,19 @@
}
@Nullable
- public Entity func_212321_a(DimensionType p_212321_1_) {
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
this.field_94112_b = false;
- return super.func_212321_a(p_212321_1_);
+ return super.changeDimension(p_212321_1_, teleporter);
}
- public void func_70106_y() {
@@ -0,0 +1,14 @@
--- a/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java
+++ b/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java
@@ -179,9 +179,9 @@
}
@Nullable
- public Entity func_212321_a(DimensionType p_212321_1_) {
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
this.func_213750_eg();
- return super.func_212321_a(p_212321_1_);
+ return super.changeDimension(p_212321_1_, teleporter);
}
protected void func_213750_eg() {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/passive/BeeEntity.java
+++ b/net/minecraft/entity/passive/BeeEntity.java
@@ -438,7 +438,7 @@
return false;
} else {
TileEntity tileentity = this.field_70170_p.func_175625_s(this.field_226369_bI_);
- return tileentity != null && tileentity.func_200662_C() == TileEntityType.field_226985_G_;
+ return tileentity instanceof BeehiveTileEntity;
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/passive/CatEntity.java
+++ b/net/minecraft/entity/passive/CatEntity.java
@@ -402,7 +402,7 @@
}
} else if (this.func_70877_b(itemstack)) {
this.func_175505_a(p_184645_1_, itemstack);
- if (this.field_70146_Z.nextInt(3) == 0) {
+ if (this.field_70146_Z.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) {
this.func_193101_c(p_184645_1_);
this.field_70911_d.func_75270_a(true);
this.field_70170_p.func_72960_a(this, (byte)7);
@@ -20,7 +20,15 @@
}
if (this.func_184207_aI() && this.field_190688_bE) {
@@ -947,4 +948,22 @@
@@ -672,6 +673,7 @@
this.func_213293_j(vec3d.field_72450_a, d1, vec3d.field_72449_c);
this.func_110255_k(true);
this.field_70160_al = true;
+ net.minecraftforge.common.ForgeHooks.onLivingJump(this);
if (f1 > 0.0F) {
float f2 = MathHelper.func_76126_a(this.field_70177_z * ((float)Math.PI / 180F));
float f3 = MathHelper.func_76134_b(this.field_70177_z * ((float)Math.PI / 180F));
@@ -947,4 +949,22 @@
return super.func_213386_a(p_213386_1_, p_213386_2_, p_213386_3_, p_213386_4_, p_213386_5_);
}
@@ -88,7 +88,7 @@
@Nullable
public ItemEntity func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) {
- return this.func_146097_a(p_71019_1_, false, p_71019_2_);
+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false);
+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, p_71019_2_);
}
@Nullable
@@ -312,14 +312,14 @@
return this.func_230126_g_(p_190774_1_) || this.func_230126_g_(p_190774_1_.func_177972_a(p_190774_2_.func_176734_d()));
}
@@ -1289,6 +1357,7 @@
@@ -1287,6 +1355,7 @@
}
public void func_225652_a_(boolean p_225652_1_, boolean p_225652_2_) {
+ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_225652_1_, p_225652_2_);
super.func_213366_dy();
if (this.field_70170_p instanceof ServerWorld && p_225652_2_) {
+ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_225652_1_, p_225652_2_);
((ServerWorld)this.field_70170_p).func_72854_c();
}
@@ -1300,17 +1369,17 @@
}
@@ -415,6 +415,15 @@
return false;
} else {
if (p_225503_1_ >= 2.0F) {
@@ -1519,7 +1636,7 @@
public boolean func_226566_ei_() {
if (!this.field_70122_E && !this.func_184613_cA() && !this.func_70090_H()) {
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST);
- if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack)) {
+ if (itemstack.canElytraFly(this)) {
this.func_226567_ej_();
return true;
}
@@ -1560,6 +1677,10 @@
}
@@ -426,6 +435,15 @@
this.func_85039_t(p_195068_1_);
this.field_71106_cc += (float)p_195068_1_ / (float)this.func_71050_bK();
this.field_71067_cb = MathHelper.func_76125_a(this.field_71067_cb + p_195068_1_, 0, Integer.MAX_VALUE);
@@ -1588,7 +1709,7 @@
}
public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) {
- this.field_71068_ca -= p_192024_2_;
+ func_82242_a(-p_192024_2_);
if (this.field_71068_ca < 0) {
this.field_71068_ca = 0;
this.field_71106_cc = 0.0F;
@@ -1599,6 +1720,10 @@
}
@@ -437,19 +455,20 @@
this.field_71068_ca += p_82242_1_;
if (this.field_71068_ca < 0) {
this.field_71068_ca = 0;
@@ -1789,7 +1914,10 @@
@@ -1789,7 +1914,11 @@
}
public ITextComponent func_145748_c_() {
- ITextComponent itextcomponent = ScorePlayerTeam.func_200541_a(this.func_96124_cp(), this.func_200200_C_());
+ if (this.displayname == null) this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_200200_C_());
+ ITextComponent itextcomponent = new StringTextComponent("");
+ prefixes.forEach(e -> itextcomponent.func_150257_a(e));
+ itextcomponent.func_150257_a(ScorePlayerTeam.func_200541_a(this.func_96124_cp(), this.func_200200_C_()));
+ itextcomponent.func_150257_a(ScorePlayerTeam.func_200541_a(this.func_96124_cp(), this.displayname));
+ suffixes.forEach(e -> itextcomponent.func_150257_a(e));
return this.func_208016_c(itextcomponent);
}
@@ -2029,4 +2157,45 @@
@@ -2029,4 +2158,53 @@
return this.field_221260_g;
}
}
@@ -470,7 +489,15 @@
+ public Collection<ITextComponent> getSuffixes() {
+ return this.suffixes;
+ }
+
+
+ private ITextComponent displayname = null;
+ /**
+ * Force the displayed name to refresh, by firing {@link net.minecraftforge.event.entity.player.PlayerEvent.NameFormat}, using the real player name as event parameter.
+ */
+ public void refreshDisplayName() {
+ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_200200_C_());
+ }
+
+ private final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>
+ playerMainHandler = net.minecraftforge.common.util.LazyOptional.of(
+ () -> new net.minecraftforge.items.wrapper.PlayerMainInvWrapper(field_71071_by));
@@ -14,18 +14,20 @@
+ @Override
@Nullable
public Entity func_212321_a(DimensionType p_212321_1_) {
- public Entity func_212321_a(DimensionType p_212321_1_) {
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null;
this.field_184851_cj = true;
DimensionType dimensiontype = this.field_71093_bK;
if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
- if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
+ if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_ && teleporter instanceof net.minecraft.world.Teleporter) { //Forge: Fix non-vanilla teleporters triggering end credits
this.func_213319_R();
- this.func_71121_q().func_217434_e(this);
+ this.func_71121_q().removePlayer(this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom
if (!this.field_71136_j) {
this.field_71136_j = true;
this.field_71135_a.func_147359_a(new SChangeGameStatePacket(4, this.field_192040_cp ? 0.0F : 1.0F));
@@ -569,12 +572,13 @@
@@ -569,12 +572,14 @@
this.field_71093_bK = p_212321_1_;
ServerWorld serverworld1 = this.field_71133_b.func_71218_a(p_212321_1_);
WorldInfo worldinfo = serverworld1.func_72912_H();
@@ -38,10 +40,11 @@
- this.field_70128_L = false;
+ serverworld.removeEntity(this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call.
+ this.revive();
+ Entity e = teleporter.placeEntity(this, serverworld, serverworld1, this.field_70177_z, spawnPortal -> {//Forge: Start vanilla logic
double d0 = this.func_226277_ct_();
double d1 = this.func_226278_cu_();
double d2 = this.func_226281_cx_();
@@ -583,13 +587,11 @@
@@ -583,13 +588,11 @@
double d3 = 8.0D;
float f2 = f1;
serverworld.func_217381_Z().func_76320_a("moving");
@@ -58,7 +61,26 @@
} else if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223229_c_) {
BlockPos blockpos = serverworld1.func_180504_m();
d0 = (double)blockpos.func_177958_n();
@@ -653,6 +655,7 @@
@@ -630,7 +633,7 @@
this.func_70012_b((double)i, (double)j, (double)k, f1, 0.0F);
this.func_213317_d(Vec3d.field_186680_a);
- } else if (!serverworld1.func_85176_s().func_222268_a(this, f2)) {
+ } else if (spawnPortal && !serverworld1.func_85176_s().func_222268_a(this, f2)) {
serverworld1.func_85176_s().func_85188_a(this);
serverworld1.func_85176_s().func_222268_a(this, f2);
}
@@ -640,6 +643,9 @@
serverworld1.func_217447_b(this);
this.func_213846_b(serverworld);
this.field_71135_a.func_147364_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), f1, f);
+ return this;//forge: this is part of the ITeleporter patch
+ });//Forge: End vanilla logic
+ if (e != this) throw new java.lang.IllegalArgumentException(String.format("Teleporter %s returned not the player entity but instead %s, expected PlayerEntity %s", teleporter, e, this));
this.field_71134_c.func_73080_a(serverworld1);
this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ));
playerlist.func_72354_b(this, serverworld1);
@@ -653,6 +659,7 @@
this.field_71144_ck = -1;
this.field_71149_ch = -1.0F;
this.field_71146_ci = -1;
@@ -66,7 +88,7 @@
return this;
}
}
@@ -788,6 +791,7 @@
@@ -788,6 +795,7 @@
this.field_71135_a.func_147359_a(new SOpenWindowPacket(container.field_75152_c, container.func_216957_a(), p_213829_1_.func_145748_c_()));
container.func_75132_a(this);
this.field_71070_bA = container;
@@ -74,7 +96,7 @@
return OptionalInt.of(this.field_71139_cq);
}
}
@@ -806,6 +810,7 @@
@@ -806,6 +814,7 @@
this.field_71135_a.func_147359_a(new SOpenHorseWindowPacket(this.field_71139_cq, p_184826_2_.func_70302_i_(), p_184826_1_.func_145782_y()));
this.field_71070_bA = new HorseInventoryContainer(this.field_71139_cq, this.field_71071_by, p_184826_2_, p_184826_1_);
this.field_71070_bA.func_75132_a(this);
@@ -82,7 +104,7 @@
}
public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) {
@@ -863,6 +868,7 @@
@@ -863,6 +872,7 @@
public void func_71128_l() {
this.field_71070_bA.func_75134_a(this);
@@ -90,7 +112,7 @@
this.field_71070_bA = this.field_71069_bz;
}
@@ -989,6 +995,20 @@
@@ -989,6 +999,20 @@
this.field_193110_cw = p_193104_1_.field_193110_cw;
this.func_192029_h(p_193104_1_.func_192023_dk());
this.func_192031_i(p_193104_1_.func_192025_dl());
@@ -111,12 +133,13 @@
}
protected void func_70670_a(EffectInstance p_70670_1_) {
@@ -1207,15 +1227,16 @@
@@ -1207,15 +1231,17 @@
this.func_184210_p();
if (p_200619_1_ == this.field_70170_p) {
this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
- } else {
+ } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_200619_1_.field_73011_w.func_186058_p())) {
+ DimensionType oldDimension = this.field_71093_bK;
ServerWorld serverworld = this.func_71121_q();
this.field_71093_bK = p_200619_1_.field_73011_w.func_186058_p();
WorldInfo worldinfo = p_200619_1_.func_72912_H();
@@ -131,15 +154,15 @@
this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
this.func_70029_a(p_200619_1_);
p_200619_1_.func_217446_a(this);
@@ -1224,6 +1245,7 @@
@@ -1224,6 +1250,7 @@
this.field_71134_c.func_73080_a(p_200619_1_);
this.field_71133_b.func_184103_al().func_72354_b(this, p_200619_1_);
this.field_71133_b.func_184103_al().func_72385_f(this);
+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, p_200619_1_.field_73011_w.func_186058_p(), this.field_71093_bK);
+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, oldDimension, this.field_71093_bK);
}
}
@@ -1261,6 +1283,8 @@
@@ -1261,6 +1288,8 @@
if (itementity == null) {
return null;
} else {
@@ -1,11 +0,0 @@
--- a/net/minecraft/entity/projectile/ArrowEntity.java
+++ b/net/minecraft/entity/projectile/ArrowEntity.java
@@ -59,7 +59,7 @@
} else if (p_184555_1_.func_77973_b() == Items.field_151032_g) {
this.field_184560_g = Potions.field_185229_a;
this.field_184561_h.clear();
- this.field_70180_af.func_187227_b(field_184559_f, -1);
+ this.func_191507_d(-1); // Forge: fix MC-107941
}
}
@@ -35,13 +35,41 @@
p_77659_2_.func_71029_a(Stats.field_75929_E.func_199076_b(this));
- p_77659_2_.func_184185_a(fluid.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187633_N : SoundEvents.field_187630_M, 1.0F, 1.0F);
+
+ SoundEvent soundevent = this.field_77876_a.getAttributes().getEmptySound();
+ SoundEvent soundevent = this.field_77876_a.getAttributes().getFillSound();
+ if (soundevent == null) soundevent = fluid.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187633_N : SoundEvents.field_187630_M;
+ p_77659_2_.func_184185_a(soundevent, 1.0F, 1.0F);
ItemStack itemstack1 = this.func_150910_a(itemstack, p_77659_2_, fluid.func_204524_b());
if (!p_77659_1_.field_72995_K) {
CriteriaTriggers.field_204813_j.func_204817_a((ServerPlayerEntity)p_77659_2_, new ItemStack(fluid.func_204524_b()));
@@ -148,7 +165,19 @@
@@ -67,7 +84,7 @@
return ActionResult.func_226251_d_(itemstack);
} else {
BlockState blockstate = p_77659_1_.func_180495_p(blockpos);
- BlockPos blockpos2 = blockstate.func_177230_c() instanceof ILiquidContainer && this.field_77876_a == Fluids.field_204546_a ? blockpos : blockpos1;
+ BlockPos blockpos2 = canBlockContainFluid(p_77659_1_, blockpos, blockstate) ? blockpos : blockpos1;
if (this.func_180616_a(p_77659_2_, p_77659_1_, blockpos2, blockraytraceresult)) {
this.func_203792_a(p_77659_1_, itemstack, blockpos2);
if (p_77659_2_ instanceof ServerPlayerEntity) {
@@ -117,7 +134,8 @@
BlockState blockstate = p_180616_2_.func_180495_p(p_180616_3_);
Material material = blockstate.func_185904_a();
boolean flag = blockstate.func_227032_a_(this.field_77876_a);
- if (blockstate.func_196958_f() || flag || blockstate.func_177230_c() instanceof ILiquidContainer && ((ILiquidContainer)blockstate.func_177230_c()).func_204510_a(p_180616_2_, p_180616_3_, blockstate, this.field_77876_a)) {
+ boolean canContainFluid = canBlockContainFluid(p_180616_2_, p_180616_3_, blockstate);
+ if (blockstate.func_196958_f() || flag || canContainFluid) {
if (p_180616_2_.field_73011_w.func_177500_n() && this.field_77876_a.func_207185_a(FluidTags.field_206959_a)) {
int i = p_180616_3_.func_177958_n();
int j = p_180616_3_.func_177956_o();
@@ -127,7 +145,7 @@
for(int l = 0; l < 8; ++l) {
p_180616_2_.func_195594_a(ParticleTypes.field_197594_E, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D);
}
- } else if (blockstate.func_177230_c() instanceof ILiquidContainer && this.field_77876_a == Fluids.field_204546_a) {
+ } else if (canContainFluid) {
if (((ILiquidContainer)blockstate.func_177230_c()).func_204509_a(p_180616_2_, p_180616_3_, blockstate, ((FlowingFluid)this.field_77876_a).func_207204_a(false))) {
this.func_203791_b(p_180616_1_, p_180616_2_, p_180616_3_);
}
@@ -148,7 +166,24 @@
}
protected void func_203791_b(@Nullable PlayerEntity p_203791_1_, IWorld p_203791_2_, BlockPos p_203791_3_) {
@@ -61,4 +89,9 @@
+
+ private final java.util.function.Supplier<? extends Fluid> fluidSupplier;
+ public Fluid getFluid() { return fluidSupplier.get(); }
+
+ private boolean canBlockContainFluid(World worldIn, BlockPos posIn, BlockState blockstate)
+ {
+ return blockstate.func_177230_c() instanceof ILiquidContainer && ((ILiquidContainer)blockstate.func_177230_c()).func_204510_a(worldIn, posIn, blockstate, this.field_77876_a);
+ }
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/item/ElytraItem.java
+++ b/net/minecraft/item/ElytraItem.java
@@ -38,4 +38,17 @@
return ActionResult.func_226251_d_(itemstack);
}
}
+
+ @Override
+ public boolean canElytraFly(ItemStack stack, net.minecraft.entity.LivingEntity entity) {
+ return ElytraItem.func_185069_d(stack);
+ }
+
+ @Override
+ public boolean elytraFlightTick(ItemStack stack, net.minecraft.entity.LivingEntity entity, int flightTicks) {
+ if (!entity.field_70170_p.field_72995_K && (flightTicks + 1) % 20 == 0) {
+ stack.func_222118_a(1, entity, e -> e.func_213361_c(net.minecraft.inventory.EquipmentSlotType.CHEST));
+ }
+ return true;
+ }
}
@@ -0,0 +1,73 @@
--- a/net/minecraft/item/Food.java
+++ b/net/minecraft/item/Food.java
@@ -11,15 +11,26 @@
private final boolean field_221472_c;
private final boolean field_221473_d;
private final boolean field_221474_e;
- private final List<Pair<EffectInstance, Float>> field_221475_f;
+ private final List<Pair<java.util.function.Supplier<EffectInstance>, Float>> field_221475_f;
+
+ private Food(Food.Builder builder) {
+ this.field_221470_a = builder.field_221458_a;
+ this.field_221471_b = builder.field_221459_b;
+ this.field_221472_c = builder.field_221460_c;
+ this.field_221473_d = builder.field_221461_d;
+ this.field_221474_e = builder.field_221462_e;
+ this.field_221475_f = builder.field_221463_f;
+ }
+ // Forge: Use builder method instead
+ @Deprecated
private Food(int p_i50106_1_, float p_i50106_2_, boolean p_i50106_3_, boolean p_i50106_4_, boolean p_i50106_5_, List<Pair<EffectInstance, Float>> p_i50106_6_) {
this.field_221470_a = p_i50106_1_;
this.field_221471_b = p_i50106_2_;
this.field_221472_c = p_i50106_3_;
this.field_221473_d = p_i50106_4_;
this.field_221474_e = p_i50106_5_;
- this.field_221475_f = p_i50106_6_;
+ this.field_221475_f = p_i50106_6_.stream().map(pair -> Pair.<java.util.function.Supplier<EffectInstance>, Float>of(pair::getLeft, pair.getRight())).collect(java.util.stream.Collectors.toList());
}
public int func_221466_a() {
@@ -43,7 +54,7 @@
}
public List<Pair<EffectInstance, Float>> func_221464_f() {
- return this.field_221475_f;
+ return this.field_221475_f.stream().map(pair -> Pair.of(pair.getLeft() != null ? pair.getLeft().get() : null, pair.getRight())).collect(java.util.stream.Collectors.toList());
}
public static class Builder {
@@ -52,7 +63,7 @@
private boolean field_221460_c;
private boolean field_221461_d;
private boolean field_221462_e;
- private final List<Pair<EffectInstance, Float>> field_221463_f = Lists.newArrayList();
+ private final List<Pair<java.util.function.Supplier<EffectInstance>, Float>> field_221463_f = Lists.newArrayList();
public Food.Builder func_221456_a(int p_221456_1_) {
this.field_221458_a = p_221456_1_;
@@ -78,14 +89,21 @@
this.field_221462_e = true;
return this;
}
+
+ public Food.Builder effect(java.util.function.Supplier<EffectInstance> effectIn, float probability) {
+ this.field_221463_f.add(Pair.of(effectIn, probability));
+ return this;
+ }
+ // Forge: Use supplier method instead
+ @Deprecated
public Food.Builder func_221452_a(EffectInstance p_221452_1_, float p_221452_2_) {
- this.field_221463_f.add(Pair.of(p_221452_1_, p_221452_2_));
+ this.field_221463_f.add(Pair.of(() -> p_221452_1_, p_221452_2_));
return this;
}
public Food func_221453_d() {
- return new Food(this.field_221458_a, this.field_221459_b, this.field_221460_c, this.field_221461_d, this.field_221462_e, this.field_221463_f);
+ return new Food(this);
}
}
}
@@ -177,7 +177,7 @@
return false;
} else {
- return p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d);
+ return p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d) && p_77970_0_.areCapsCompatible(p_77970_1_);
+ return (p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d)) && p_77970_0_.areCapsCompatible(p_77970_1_);
}
} else {
return false;
@@ -186,7 +186,7 @@
return false;
} else {
- return this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d);
+ return this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d) && this.areCapsCompatible(p_77959_1_);
+ return (this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d)) && this.areCapsCompatible(p_77959_1_);
}
}
@@ -9,7 +9,18 @@
if (p_77654_3_ instanceof ServerPlayerEntity) {
ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)p_77654_3_;
CriteriaTriggers.field_193138_y.func_193148_a(serverplayerentity, p_77654_1_);
@@ -44,4 +46,9 @@
@@ -25,10 +27,6 @@
p_77654_1_.func_190918_g(1);
}
- if (!p_77654_2_.field_72995_K) {
- p_77654_3_.func_195061_cb();
- }
-
return p_77654_1_.func_190926_b() ? new ItemStack(Items.field_151133_ar) : p_77654_1_;
}
@@ -44,4 +42,9 @@
p_77659_2_.func_184598_c(p_77659_3_);
return ActionResult.func_226248_a_(p_77659_2_.func_184586_b(p_77659_3_));
}
@@ -0,0 +1,51 @@
--- a/net/minecraft/item/MusicDiscItem.java
+++ b/net/minecraft/item/MusicDiscItem.java
@@ -21,17 +21,40 @@
import net.minecraftforge.api.distmarker.OnlyIn;
public class MusicDiscItem extends Item {
+ @Deprecated // Forge: refer to WorldRender#playRecord. Modders: there's no need to reflectively modify this map!
private static final Map<SoundEvent, MusicDiscItem> field_150928_b = Maps.newHashMap();
private final int field_195977_c;
+ @Deprecated // Forge: refer to soundSupplier
private final SoundEvent field_185076_b;
+ private final java.util.function.Supplier<SoundEvent> soundSupplier;
+ @Deprecated // Forge: Use the constructor that takes a supplier instead
protected MusicDiscItem(int p_i48475_1_, SoundEvent p_i48475_2_, Item.Properties p_i48475_3_) {
super(p_i48475_3_);
this.field_195977_c = p_i48475_1_;
this.field_185076_b = p_i48475_2_;
field_150928_b.put(this.field_185076_b, this);
+ this.soundSupplier = this.field_185076_b.delegate;
}
+ /**
+ * For mod use, allows to create a music disc without having to create a new
+ * SoundEvent before their registry event is fired.
+ *
+ * @param comparatorValue The value this music disc should output on the comparator. Must be between 0 and 15.
+ * @param soundSupplier A supplier that provides the sound that should be played. Use a
+ * {@link net.minecraftforge.fml.RegistryObject}{@code <SoundEvent>} or a
+ * {@link net.minecraftforge.registries.IRegistryDelegate} for this parameter.
+ * @param builder A set of {@link Item.Properties} that describe this item.
+ */
+ public MusicDiscItem(int comparatorValue, java.util.function.Supplier<SoundEvent> soundSupplier, Item.Properties builder)
+ {
+ super(builder);
+ this.field_195977_c = comparatorValue;
+ this.field_185076_b = null;
+ this.soundSupplier = soundSupplier;
+ }
+
public ActionResultType func_195939_a(ItemUseContext p_195939_1_) {
World world = p_195939_1_.func_195991_k();
BlockPos blockpos = p_195939_1_.func_195995_a();
@@ -76,6 +99,6 @@
@OnlyIn(Dist.CLIENT)
public SoundEvent func_185075_h() {
- return this.field_185076_b;
+ return this.soundSupplier.get();
}
}
@@ -0,0 +1,26 @@
--- a/net/minecraft/item/SpawnEggItem.java
+++ b/net/minecraft/item/SpawnEggItem.java
@@ -35,11 +35,14 @@
private final int field_195989_d;
private final EntityType<?> field_200890_d;
+ /** @deprecated Forge: Use {@link net.minecraftforge.common.ForgeSpawnEggItem} instead for suppliers */
+ @Deprecated
public SpawnEggItem(EntityType<?> p_i48465_1_, int p_i48465_2_, int p_i48465_3_, Item.Properties p_i48465_4_) {
super(p_i48465_4_);
this.field_200890_d = p_i48465_1_;
this.field_195988_c = p_i48465_2_;
this.field_195989_d = p_i48465_3_;
+ if (p_i48465_1_ != null)
field_195987_b.put(p_i48465_1_, this);
}
@@ -121,6 +124,8 @@
return p_195983_1_ == 0 ? this.field_195988_c : this.field_195989_d;
}
+ /** @deprecated Forge: call {@link net.minecraftforge.common.ForgeSpawnEggItem#fromEntityType(EntityType)} instead */
+ @Deprecated
@Nullable
public static SpawnEggItem func_200889_b(@Nullable EntityType<?> p_200889_0_) {
return field_195987_b.get(p_200889_0_);
@@ -8,7 +8,7 @@
try {
+ if (!net.minecraftforge.common.crafting.CraftingHelper.processConditions(entry.getValue(), "conditions")) {
+ field_199521_c.info("Skipping loading recipe {} as it's conditions were not met", resourcelocation);
+ field_199521_c.debug("Skipping loading recipe {} as it's conditions were not met", resourcelocation);
+ continue;
+ }
IRecipe<?> irecipe = func_215377_a(resourcelocation, entry.getValue());
@@ -0,0 +1,16 @@
--- a/net/minecraft/pathfinding/PathNodeType.java
+++ b/net/minecraft/pathfinding/PathNodeType.java
@@ -33,4 +33,13 @@
public float func_186289_a() {
return this.field_186307_r;
}
+
+ @javax.annotation.Nullable
+ public PathNodeType getDanger() {
+ return (this == DAMAGE_FIRE || this == DANGER_FIRE ) ? DANGER_FIRE :
+ (this == DAMAGE_CACTUS || this == DANGER_CACTUS) ? DANGER_CACTUS :
+ (this == DAMAGE_OTHER || this == DANGER_OTHER ) ? DANGER_OTHER :
+ (this == LAVA) ? DAMAGE_FIRE :
+ null;
+ }
}
@@ -14,8 +14,8 @@
- } else {
- p_193578_4_ = PathNodeType.DANGER_FIRE;
- }
+ PathNodeType type = func_189553_b(p_193578_0_, p_193578_1_, p_193578_2_, p_193578_3_);
+ if (type == PathNodeType.DANGER_CACTUS || type == PathNodeType.DANGER_FIRE || type == PathNodeType.DANGER_OTHER)
+ PathNodeType type = func_189553_b(p_193578_0_, p_193578_1_ + i, p_193578_2_ + j, p_193578_3_ + k).getDanger();
+ if (type != null)
+ p_193578_4_ = type;
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/resources/ResourcePackList.java
+++ b/net/minecraft/resources/ResourcePackList.java
@@ -48,7 +48,7 @@
private void func_198986_e() {
List<Entry<String, T>> list = Lists.newArrayList(this.field_198988_b.entrySet());
this.field_198988_b.clear();
- list.stream().sorted(Entry.comparingByKey()).forEachOrdered((p_198984_1_) -> {
+ list.stream().sorted(net.minecraftforge.fml.packs.ResourcePackLoader.getSorter()).forEachOrdered((p_198984_1_) -> {
ResourcePackInfo resourcepackinfo = (ResourcePackInfo)this.field_198988_b.put(p_198984_1_.getKey(), p_198984_1_.getValue());
});
}
@@ -9,7 +9,23 @@
p_213187_0_.setUncaughtExceptionHandler((p_213206_0_, p_213206_1_) -> {
field_147145_h.error(p_213206_1_);
});
@@ -336,6 +336,8 @@
@@ -221,6 +221,7 @@
private final LootTableManager field_200256_aj = new LootTableManager(this.field_229734_an_);
private final AdvancementManager field_200257_ak = new AdvancementManager();
private final FunctionManager field_200258_al = new FunctionManager(this);
+ private final net.minecraftforge.common.loot.LootModifierManager lootManager = new net.minecraftforge.common.loot.LootModifierManager();
private final FrameTimer field_213215_ap = new FrameTimer();
private boolean field_205745_an;
private boolean field_212205_ao;
@@ -249,6 +250,7 @@
this.field_195576_ac.func_219534_a(this.field_200256_aj);
this.field_195576_ac.func_219534_a(this.field_200258_al);
this.field_195576_ac.func_219534_a(this.field_200257_ak);
+ field_195576_ac.func_219534_a(lootManager);
this.field_213217_au = Util.func_215072_e();
this.field_71294_K = p_i50590_10_;
}
@@ -336,6 +338,8 @@
this.func_200245_b(new TranslationTextComponent("menu.loadingLevel"));
SaveHandler savehandler = this.func_71254_M().func_197715_a(p_71247_1_, this);
this.func_175584_a(this.func_71270_I(), savehandler);
@@ -18,7 +34,7 @@
WorldInfo worldinfo = savehandler.func_75757_d();
WorldSettings worldsettings;
if (worldinfo == null) {
@@ -357,13 +359,13 @@
@@ -357,13 +361,13 @@
worldinfo.func_230145_a_(this.getServerModName(), this.func_230045_q_().isPresent());
this.func_195560_a(savehandler.func_75765_b(), worldinfo);
@@ -33,7 +49,7 @@
if (this.func_71242_L()) {
p_213194_2_.func_176127_a(field_213219_c);
}
@@ -407,6 +409,7 @@
@@ -407,6 +411,7 @@
if (dimensiontype != DimensionType.field_223227_a_) {
this.field_71305_c.put(dimensiontype, new ServerMultiWorld(serverworld1, this, this.field_213217_au, p_213194_1_, dimensiontype, this.field_71304_b, p_213194_4_));
}
@@ -41,7 +57,7 @@
}
}
@@ -565,6 +568,7 @@
@@ -565,6 +570,7 @@
for(ServerWorld serverworld1 : this.func_212370_w()) {
if (serverworld1 != null) {
try {
@@ -49,7 +65,7 @@
serverworld1.close();
} catch (IOException ioexception) {
field_147145_h.error("Exception closing the level", (Throwable)ioexception);
@@ -605,6 +609,7 @@
@@ -605,6 +611,7 @@
public void run() {
try {
if (this.func_71197_b()) {
@@ -57,7 +73,7 @@
this.field_211151_aa = Util.func_211177_b();
this.field_147147_p.func_151315_a(new StringTextComponent(this.field_71286_C));
this.field_147147_p.func_151321_a(new ServerStatusResponse.Version(SharedConstants.func_215069_a().getName(), SharedConstants.func_215069_a().getProtocolVersion()));
@@ -636,9 +641,15 @@
@@ -636,9 +643,15 @@
this.field_71304_b.func_219897_b();
this.field_71296_Q = true;
}
@@ -73,7 +89,7 @@
} catch (Throwable throwable1) {
field_147145_h.error("Encountered an unexpected exception", throwable1);
CrashReport crashreport;
@@ -655,6 +666,7 @@
@@ -655,6 +668,7 @@
field_147145_h.error("We were unable to save this crash report to disk.");
}
@@ -81,7 +97,7 @@
this.func_71228_a(crashreport);
} finally {
try {
@@ -663,6 +675,7 @@
@@ -663,6 +677,7 @@
} catch (Throwable throwable) {
field_147145_h.error("Exception stopping the server", throwable);
} finally {
@@ -89,7 +105,7 @@
this.func_71240_o();
}
@@ -764,6 +777,7 @@
@@ -764,6 +779,7 @@
protected void func_71217_p(BooleanSupplier p_71217_1_) {
long i = Util.func_211178_c();
@@ -97,7 +113,7 @@
++this.field_71315_w;
this.func_71190_q(p_71217_1_);
if (i - this.field_147142_T >= 5000000000L) {
@@ -778,6 +792,7 @@
@@ -778,6 +794,7 @@
Collections.shuffle(Arrays.asList(agameprofile));
this.field_147147_p.func_151318_b().func_151330_a(agameprofile);
@@ -105,7 +121,7 @@
}
if (this.field_71315_w % 6000 == 0) {
@@ -805,6 +820,7 @@
@@ -805,6 +822,7 @@
long i1 = Util.func_211178_c();
this.field_213215_ap.func_181747_a(i1 - i);
this.field_71304_b.func_76319_b();
@@ -113,7 +129,7 @@
}
protected void func_71190_q(BooleanSupplier p_71190_1_) {
@@ -812,7 +828,8 @@
@@ -812,7 +830,8 @@
this.func_193030_aL().func_73660_a();
this.field_71304_b.func_219895_b("levels");
@@ -123,7 +139,7 @@
if (serverworld.field_73011_w.func_186058_p() == DimensionType.field_223227_a_ || this.func_71255_r()) {
this.field_71304_b.func_194340_a(() -> {
return serverworld.func_72912_H().func_76065_j() + " " + Registry.field_212622_k.func_177774_c(serverworld.field_73011_w.func_186058_p());
@@ -824,6 +841,7 @@
@@ -824,6 +843,7 @@
}
this.field_71304_b.func_76320_a("tick");
@@ -131,7 +147,7 @@
try {
serverworld.func_72835_b(p_71190_1_);
@@ -832,12 +850,16 @@
@@ -832,12 +852,16 @@
serverworld.func_72914_a(crashreport);
throw new ReportedException(crashreport);
}
@@ -148,7 +164,7 @@
this.field_71304_b.func_219895_b("connection");
this.func_147137_ag().func_151269_c();
this.field_71304_b.func_219895_b("players");
@@ -878,6 +900,7 @@
@@ -878,6 +902,7 @@
OptionSpec<Integer> optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1);
OptionSpec<String> optionspec11 = optionparser.accepts("serverId").withRequiredArg();
OptionSpec<String> optionspec12 = optionparser.nonOptions();
@@ -156,7 +172,16 @@
try {
OptionSet optionset = optionparser.parse(p_main_0_);
@@ -910,6 +933,10 @@
@@ -888,7 +913,7 @@
Path path = Paths.get("server.properties");
ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(path);
- serverpropertiesprovider.func_219035_b();
+ if (optionset.has(optionspec1) || !Files.exists(path)) serverpropertiesprovider.func_219035_b();
Path path1 = Paths.get("eula.txt");
ServerEula servereula = new ServerEula(path1);
if (optionset.has(optionspec1)) {
@@ -910,6 +935,10 @@
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(s, field_152367_a.getName()));
String s1 = Optional.ofNullable(optionset.valueOf(optionspec9)).orElse(serverpropertiesprovider.func_219034_a().field_219021_o);
@@ -167,7 +192,7 @@
final DedicatedServer dedicatedserver = new DedicatedServer(new File(s), serverpropertiesprovider, DataFixesManager.func_210901_a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache, LoggingChunkStatusListener::new, s1);
dedicatedserver.func_71224_l(optionset.valueOf(optionspec7));
dedicatedserver.func_71208_b(optionset.valueOf(optionspec10));
@@ -927,6 +954,7 @@
@@ -927,6 +956,7 @@
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
dedicatedserver.func_71263_m(true);
@@ -175,7 +200,7 @@
}
};
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(field_147145_h));
@@ -971,7 +999,7 @@
@@ -971,7 +1001,7 @@
}
public ServerWorld func_71218_a(DimensionType p_71218_1_) {
@@ -184,7 +209,7 @@
}
public Iterable<ServerWorld> func_212370_w() {
@@ -1010,7 +1038,7 @@
@@ -1010,7 +1040,7 @@
}
public String getServerModName() {
@@ -193,7 +218,18 @@
}
public CrashReport func_71230_b(CrashReport p_71230_1_) {
@@ -1567,6 +1595,31 @@
@@ -1396,6 +1426,10 @@
public FunctionManager func_193030_aL() {
return this.field_200258_al;
}
+
+ public net.minecraftforge.common.loot.LootModifierManager getLootModifierManager() {
+ return lootManager;
+ }
public void func_193031_aM() {
if (!this.func_213162_bc()) {
@@ -1567,6 +1601,31 @@
public abstract boolean func_213199_b(GameProfile p_213199_1_);
@@ -8,15 +8,17 @@
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
String s3;
@@ -118,6 +119,7 @@
@@ -118,7 +119,9 @@
field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
+ net.minecraftforge.fml.server.ServerModLoader.begin(this);
field_155771_h.info("Loading properties");
+ this.field_71340_o.func_219033_a(properties -> ServerProperties.func_218985_a(java.nio.file.Paths.get("server.properties")));
ServerProperties serverproperties = this.field_71340_o.func_219034_a();
if (this.func_71264_H()) {
@@ -175,6 +177,7 @@
this.func_71189_e("127.0.0.1");
@@ -175,6 +178,7 @@
if (!PreYggdrasilConverter.func_219587_e(this)) {
return false;
} else {
@@ -24,7 +26,7 @@
this.func_184105_a(new DedicatedPlayerList(this));
long i = Util.func_211178_c();
String s = serverproperties.field_219022_p;
@@ -196,6 +199,7 @@
@@ -196,6 +200,7 @@
SkullTileEntity.func_184293_a(this.func_152358_ax());
SkullTileEntity.func_184294_a(this.func_147130_as());
PlayerProfileCache.func_187320_a(this.func_71266_T());
@@ -32,7 +34,7 @@
field_155771_h.info("Preparing level \"{}\"", (Object)this.func_71270_I());
JsonObject jsonobject = new JsonObject();
if (worldtype == WorldType.field_77138_c) {
@@ -208,6 +212,7 @@
@@ -208,6 +213,7 @@
long l = Util.func_211178_c() - i;
String s2 = String.format(Locale.ROOT, "%.3fs", (double)l / 1.0E9D);
field_155771_h.info("Done ({})! For help, type \"help\"", (Object)s2);
@@ -40,7 +42,7 @@
if (serverproperties.field_219027_u != null) {
this.func_200252_aR().func_223585_a(GameRules.field_223620_w).func_223570_a(serverproperties.field_219027_u, this);
}
@@ -233,7 +238,8 @@
@@ -233,7 +239,8 @@
}
Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a());
@@ -50,7 +52,7 @@
}
}
@@ -547,4 +553,9 @@
@@ -547,4 +554,9 @@
public boolean func_213199_b(GameProfile p_213199_1_) {
return false;
}
@@ -122,12 +122,19 @@
int i = p_187250_3_.func_190916_E();
int j = p_187250_3_.func_77952_i();
ActionResult<ItemStack> actionresult = p_187250_3_.func_77957_a(p_187250_2_, p_187250_1_, p_187250_4_);
@@ -296,9 +321,16 @@
@@ -287,6 +312,8 @@
public ActionResultType func_219441_a(PlayerEntity p_219441_1_, World p_219441_2_, ItemStack p_219441_3_, Hand p_219441_4_, BlockRayTraceResult p_219441_5_) {
BlockPos blockpos = p_219441_5_.func_216350_a();
BlockState blockstate = p_219441_2_.func_180495_p(blockpos);
+ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks.onRightClickBlock(p_219441_1_, p_219441_4_, blockpos, p_219441_5_.func_216354_b());
+ if (event.isCanceled()) return event.getCancellationResult();
if (this.field_73091_c == GameType.SPECTATOR) {
INamedContainerProvider inamedcontainerprovider = blockstate.func_215699_b(p_219441_2_, blockpos);
if (inamedcontainerprovider != null) {
@@ -296,9 +323,14 @@
return ActionResultType.PASS;
}
} else {
+ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks.onRightClickBlock(p_219441_1_, p_219441_4_, blockpos, p_219441_5_.func_216354_b());
+ if (event.isCanceled()) return event.getCancellationResult();
+ ItemUseContext itemusecontext = new ItemUseContext(p_219441_1_, p_219441_4_, p_219441_5_);
+ if (event.getUseItem() != net.minecraftforge.eventbus.api.Event.Result.DENY) {
+ ActionResultType result = p_219441_3_.onItemUseFirst(itemusecontext);
@@ -8,12 +8,14 @@
public PlayerList(MinecraftServer p_i50688_1_, int p_i50688_2_) {
this.field_72400_f = p_i50688_1_;
@@ -110,6 +111,14 @@
@@ -109,7 +110,15 @@
String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName();
playerprofilecache.func_152649_a(gameprofile);
CompoundNBT compoundnbt = this.func_72380_a(p_72355_2_);
ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
- ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
+
+ //Forge: Make sure the dimension hasn't been deleted, if so stick them in the overworld.
+ ServerWorld serverworld = p_72355_2_.field_71093_bK != null ? this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK) : null ;
+ if (serverworld == null) {
+ p_72355_2_.field_71093_bK = DimensionType.field_223227_a_;
+ serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
@@ -155,7 +157,20 @@
return serverplayerentity;
}
@@ -739,7 +767,7 @@
@@ -698,12 +726,6 @@
if (serverstatisticsmanager == null) {
File file1 = new File(this.field_72400_f.func_71218_a(DimensionType.field_223227_a_).func_217485_w().func_75765_b(), "stats");
File file2 = new File(file1, uuid + ".json");
- if (!file2.exists()) {
- File file3 = new File(file1, p_152602_1_.func_200200_C_().getString() + ".json");
- if (file3.exists() && file3.isFile()) {
- file3.renameTo(file2);
- }
- }
serverstatisticsmanager = new ServerStatisticsManager(this.field_72400_f, file2);
this.field_148547_k.put(uuid, serverstatisticsmanager);
@@ -739,7 +761,7 @@
}
public List<ServerPlayerEntity> func_181057_v() {
@@ -164,7 +179,7 @@
}
@Nullable
@@ -769,4 +797,12 @@
@@ -769,4 +791,12 @@
public boolean func_206257_x() {
return this.field_72407_n;
}
@@ -18,24 +18,39 @@
this.field_199888_a = p_i48224_1_;
this.field_199889_b = (Set<T>)(p_i48224_3_ ? Sets.newLinkedHashSet() : Sets.newHashSet());
this.field_200150_c = p_i48224_2_;
@@ -48,7 +52,7 @@
@@ -45,11 +49,18 @@
JsonArray jsonarray = new JsonArray();
for(Tag.ITagEntry<T> itagentry : this.field_200150_c) {
+ if (!(itagentry instanceof net.minecraftforge.common.data.IOptionalTagEntry))
itagentry.func_200576_a(jsonarray, p_200571_1_);
}
+ JsonArray optional = new JsonArray();
+ for(Tag.ITagEntry<T> itagentry : this.field_200150_c) {
+ if (itagentry instanceof net.minecraftforge.common.data.IOptionalTagEntry)
+ itagentry.func_200576_a(optional, p_200571_1_);
+ }
- jsonobject.addProperty("replace", false);
+ jsonobject.addProperty("replace", replace);
jsonobject.add("values", jsonarray);
+ if (optional.size() > 0) jsonobject.add("optional", optional);
return jsonobject;
}
@@ -77,6 +81,7 @@
public static class Builder<T> {
@@ -74,9 +85,10 @@
return this.field_199888_a;
}
- public static class Builder<T> {
+ public static class Builder<T> implements net.minecraftforge.common.extensions.IForgeTagBuilder<T> {
private final Set<Tag.ITagEntry<T>> field_200052_a = Sets.newLinkedHashSet();
private boolean field_200053_b;
+ private boolean replace = false;
public static <T> Tag.Builder<T> func_200047_a() {
return new Tag.Builder<>();
@@ -103,6 +108,22 @@
@@ -103,6 +115,22 @@
return this;
}
@@ -58,7 +73,7 @@
public Tag.Builder<T> func_200045_a(boolean p_200045_1_) {
this.field_200053_b = p_200045_1_;
return this;
@@ -119,7 +140,7 @@
@@ -119,7 +147,7 @@
}
public Tag<T> func_200051_a(ResourceLocation p_200051_1_) {
@@ -67,7 +82,7 @@
}
public Tag.Builder<T> func_219783_a(Function<ResourceLocation, Optional<T>> p_219783_1_, JsonObject p_219783_2_) {
@@ -143,8 +164,10 @@
@@ -143,8 +171,10 @@
}
this.field_200052_a.addAll(list);
@@ -78,7 +93,7 @@
}
public interface ITagEntry<T> {
@@ -183,6 +206,8 @@
@@ -183,6 +213,8 @@
public Collection<T> func_200578_a() {
return this.field_200165_a;
}
@@ -87,7 +102,7 @@
}
public static class TagEntry<T> implements Tag.ITagEntry<T> {
@@ -229,5 +254,7 @@
@@ -229,5 +261,7 @@
public void func_200576_a(JsonArray p_200576_1_, Function<T, ResourceLocation> p_200576_2_) {
p_200576_1_.add("#" + this.func_200577_a());
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/tags/TagCollection.java
+++ b/net/minecraft/tags/TagCollection.java
@@ -154,4 +154,8 @@
public Map<ResourceLocation, Tag<T>> func_200039_c() {
return this.field_199921_d;
}
+
+ public Function<ResourceLocation, Optional<T>> getEntryLookup() {
+ return this.field_200040_e;
+ }
}
@@ -17,7 +17,7 @@
TileEntity tileentity = p_195481_0_.func_175625_s(p_195481_1_);
if (tileentity instanceof ChestTileEntity) {
return ((ChestTileEntity)tileentity).field_145987_o;
@@ -221,4 +222,56 @@
@@ -221,4 +222,39 @@
protected Container func_213906_a(int p_213906_1_, PlayerInventory p_213906_2_) {
return ChestContainer.func_216992_a(p_213906_1_, p_213906_2_, this);
}
@@ -46,25 +46,8 @@
+ if (!(state.func_177230_c() instanceof ChestBlock)) {
+ return new net.minecraftforge.items.wrapper.InvWrapper(this);
+ }
+ ChestType type = state.func_177229_b(ChestBlock.field_196314_b);
+ if (type != ChestType.SINGLE) {
+ BlockPos opos = this.func_174877_v().func_177972_a(ChestBlock.func_196311_i(state));
+ BlockState ostate = this.func_145831_w().func_180495_p(opos);
+ if (state.func_177230_c() == ostate.func_177230_c()) {
+ ChestType otype = ostate.func_177229_b(ChestBlock.field_196314_b);
+ if (otype != ChestType.SINGLE && type != otype && state.func_177229_b(ChestBlock.field_176459_a) == ostate.func_177229_b(ChestBlock.field_176459_a)) {
+ TileEntity ote = this.func_145831_w().func_175625_s(opos);
+ if (ote instanceof ChestTileEntity) {
+ IInventory top = type == ChestType.RIGHT ? this : (IInventory)ote;
+ IInventory bottom = type == ChestType.RIGHT ? (IInventory)ote : this;
+ return new net.minecraftforge.items.wrapper.CombinedInvWrapper(
+ new net.minecraftforge.items.wrapper.InvWrapper(top),
+ new net.minecraftforge.items.wrapper.InvWrapper(bottom));
+ }
+ }
+ }
+ }
+ return new net.minecraftforge.items.wrapper.InvWrapper(this);
+ IInventory inv = ChestBlock.func_226916_a_((ChestBlock) state.func_177230_c(), state, func_145831_w(), func_174877_v(), true);
+ return new net.minecraftforge.items.wrapper.InvWrapper(inv == null ? this : inv);
+ }
+
+ @Override
@@ -1,11 +1,14 @@
--- a/net/minecraft/tileentity/ConduitTileEntity.java
+++ b/net/minecraft/tileentity/ConduitTileEntity.java
@@ -131,7 +131,7 @@
@@ -131,10 +131,8 @@
BlockPos blockpos1 = this.field_174879_c.func_177982_a(j1, k1, l1);
BlockState blockstate = this.field_145850_b.func_180495_p(blockpos1);
- for(Block block : field_205042_e) {
+ for(Block block : net.minecraftforge.common.Tags.Blocks.SUPPORTS_CONDUIT.func_199885_a()) {
if (blockstate.func_177230_c() == block) {
- if (blockstate.func_177230_c() == block) {
+ if (blockstate.isConduitFrame(this.field_145850_b, blockpos1, func_174877_v())) {
this.field_205046_i.add(blockpos1);
}
- }
}
}
}
Loaded 100 of 1017 files, more files were not shown because too many files have changed in this diff. Show more