Compare commits

..
149 Commits
Author SHA1 Message Date
LexManos 2bfa53b05a Update License headers 2026-05-23 15:10:51 -07:00
Spectrall 3661620045 Add ForgeSpawnEggItem to lazily handle EntityTypes (#10640) 2026-05-23 14:57:49 -07:00
LexManos cd1fa60337 Validate packet directions for Forge packets. Closes #10740 2025-12-30 14:07:59 -08:00
LexManos 638196175c Migrate to Github Actions 2025-12-02 11:37:27 -08:00
SizableShrimp 97bd9d7fd0 [1.14.x] Update Installer to 2.1.+ (#8289)
* 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 03:51:44 +10:30
Marc Hermans 5a9520a591 Patch the jenkinsfile so it publishes using the correct credentials provided by Jenkins. (#8277) 2021-12-11 00:46:50 +10:30
Marc Hermans 54f411ad98 [1.14.x] [CVE-2021-44228]: Update Log4J to fix the security issue inside it. (#8272) 2021-12-10 22:43:11 +10:30
50ap5ud5 23f00d26bb Backport of patch #6543 to enable Stencil buffer in net.minecraft.client.shader.Framebuffer. Closes #6751 2020-07-01 17:47:42 +02:00
Tom Boshoven a401a9b9d0 Make MultiModel pass its extra model data down to its parts. Closes #6534 2020-06-29 21:02:52 +02:00
Dion van der Hak 2276abd7a4 Add missing localization for attributes (#6530) 2020-06-25 10:09:38 -07:00
Cyborgmas f424f1af2f Trigger xp event after enchanting (#6702) 2020-06-25 09:46:11 -07:00
DaemonUmbra c023b7084d Potential userProperties Fix (#6740) (#6784) 2020-06-18 14:41:46 -07:00
David Quintana 538d087a7f Add file missed in the backport of the global loot modifiers feature from 1.15. Avoids an error when loading a world or reloading datapacks. 2020-06-04 00:39:46 +02:00
David Quintana 3ba3a6649e Backport new multi-layer model from 1.15. Added as a separate class and loader ID to avoid breaking changes. 2020-05-28 17:05:33 +02:00
malte0811 d544c31b72 Fix ChunkWatchEvent.(Un)Watch not firing correctly (#6519) 2020-05-14 13:14:03 -07:00
Tom Boshoven 8d9b291e96 Fixed tile entities persisting when switching between states that don't have TEs without changing the block. (#6673) 2020-05-14 13:03:46 -07:00
Philip T 9c9abe3576 Fix ChunkDataEvent.Load not firing, it now fires in the aync thread. (#6610) 2020-05-12 14:54:45 -07:00
DaemonUmbra 6985736834 Fix recursion mess in PlayerAdvancement loading, by using an alternative based on a toposorted list of all advancements. (#6662)
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.
2020-05-12 14:26:05 -07:00
BlueAgent ec9d57cdc7 Fix Forge's tps and gen commands. (#6666) 2020-05-12 14:24:30 -07:00
David Quintana e758126529 Backport a7e4cdcc49 (Bucket unable to place custom fluid on block with custom fluid-loggable implementation) 2020-05-06 14:29:46 +02:00
LexManos dc3dec48b1 Fixed PlantType enum not using IExtensibleEnum. 2020-05-03 13:03:38 -07:00
David Quintana cf057c2c02 Remove redundant call to modifyLoot. Backports 0fc1ea01d1 2020-04-28 19:24:30 +02:00
David Quintana 27bd0de5eb Add tickRate setter to the ForgeFlowingFluid Properties builder. 2020-04-23 14:58:00 +02:00
David Quintana 90403d18f9 Backport Global Loot Functions by Draco18s 2020-04-12 22:45:55 +02:00
pat-aoc ece753cd56 updated comment pertaining to PlantType 2020-04-04 18:36:06 -04:00
pat-aoc c9c5346da7 added TODO in PlantType.java and made variables private in CustomPlantTypeTest 2020-03-31 16:18:18 -04:00
Brian Chim 2e2fe6c199 Add fix for issue 6286. Changed null return to throw exception as per IExtensibleEnum 2020-03-08 21:21:49 -04:00
David Quintana 6aadd20f5f Add AT entries for some implicit constructors that are protected, but the development setup makes public without telling anyone. 2020-02-28 22:43:54 +01:00
David Quintana dc145a3dfc Backport implementation of the new model system from 1.15: (#6180)
- Extended block model format to support a "loader" value, as an alternative to "elements.
- Extended block model format to support "gui_3d":false as a way to mark a model as being intended to be flat and lit from the front.
    (No this is not equivalent to the  "gui_light" flag in 1.15.2. It changes more than just the light direction)
- Added a new OBJ loader designed from the ground up to work with the new model system.
- Added stock models to serve as parent models when using custom loaders (forge:item/default, forge:item/default-tool, and forge:block/default).
- Added stock white texture (forge:white) for use in loaders that want to draw untextured geometry.
- Deprecated the old loader components, since they are gone in 1.15 already.
2020-02-28 18:26:59 +01:00
mcenderdragon 4e45da3cc3 Fix PlayerChangedDimensionEvent using incorrect from dimension argument in ServerPlayerEntity.teleport. 2020-02-14 12:35:25 -08:00
LexManos 220cb1fd81 Update binpatcher version to decrease installer download size. 2020-02-03 13:41:18 -08:00
FenixFyreX 19abf0cb9a [1.14.4] Fix NPE on java 8u242 backport of PR #6473 (#6495) 2020-02-03 12:44:21 -08:00
DaemonUmbra 508d872ef3 Fixed Brown Mooshrooms dropping Red Mushrooms when sheared (#6476)
Backports 1.15.x code to 1.14.x
2020-01-29 09:16:25 -08:00
Wyn Price b67c37fd6c Fixed rounding issue with entity navigation fix (#6455) 2020-01-22 12:24:07 -07:00
KnightMiner d4a3762f21 [1.14] Add support for custom nether portal frame blocks (#6417) 2020-01-15 16:22:57 -08:00
tterrag 4c7f1096e5 Add constructor for FishBucketItem that accepts suppliers 2020-01-09 17:32:45 -05:00
Choonster TheMage 4ff65feb63 Deprecate ElementBuilder#rotation(BlockPartRotation) and add zero-parameter overload (fixes #6321) (#6338) 2020-01-07 12:02:08 -08:00
tterrag dbec9b3d5a Fix dyes tag containing dye items instead of tags
Update generated data
2020-01-05 19:05:09 -05:00
Richard Freimer 28515d7c59 Fix capabilities becoming inaccessible on returning from end (#6359) 2019-12-31 16:09:21 -08:00
David Quintana ca819e09f2 Revert one of the hunks of #6216, which was actually correct as it was. (#6337) 2019-12-31 16:09:07 -08:00
King Lemming d28cd0352b Make Minecarts work with modded powered/activator rails.
Re-adds functionality for rails to have different maximum speeds.
2019-12-23 19:34:43 -08:00
King Lemming a436118e39 Add FluidStack support to the Forge packet buffer. (#6353) 2019-12-22 22:21:38 -08:00
King Lemming 9e5ecaaf75 Added a couple of raytraceresult.getType() != MISS checks in places where they were absent. This corrects a couple of vanilla oversights and also greatly reduces Forge bus event spam for arrows and llama spit. (#6355)
Signed-off-by: King Lemming <[email protected]>
2019-12-15 14:39:41 -08:00
Luke Tonon 3701ec06d0 Restored canRiderInteract boolean in IForgeEntity (#6347) 2019-12-10 11:56:07 -08:00
Daniël Goossens 5d0fb2967c Split DrawBlockHighlightEvent into subevents to make usage clearer, addresses #2190 (#6269) 2019-12-10 11:46:01 -08:00
tterrag 5c88451f6f Allow classpath locator to discover jars via FMLModType attribute 2019-12-05 22:56:05 -05:00
cpw cfc53c939e Tidy up some output and also add libraries from the modfile detection into the transforming classloader.
Signed-off-by: cpw <[email protected]>
2019-12-05 22:47:39 -05:00
tterrag 3ba78225c3 Fix swapped yaw/pitch in camera setup event 2019-12-02 19:10:59 -05:00
liach d8e6181058 Restore camera setup render event (#6335) 2019-12-02 14:54:46 -08:00
DaemonUmbra bb4e78da90 Fixed invocation of Vanilla spawn logic (#6334)
Forge's replacement of the Vanilla logic gets inverted, so the Vanilla logic inside that replacement must be inverted to correct for this.
(Fixes #6332)
2019-12-02 14:54:00 -08:00
bl4ckscor3 4dd32d6f72 Add item tag 'beacon_payment' for items that can activate a beacon (#6328) 2019-12-02 14:52:45 -08:00
Luke Tonon 68b0075fe6 Added FENCES_WOODEN and FENCE_GATES_WOODEN tags as fuels in AbstractFurnaceTileEntity (#6327) 2019-12-02 14:36:30 -08:00
Paul Becker f9686cf098 New SleepFinishedTimeEvent allowing control of world time when waking up. (#6043) 2019-12-02 14:08:14 -08:00
tterrag ca28877fd5 Fix EntityLootTables not calling addTables 2019-11-25 01:49:24 -05:00
tterrag c18d26c7d8 Make EntityLootTables reusable for modders 2019-11-25 01:03:24 -05:00
nikita488 241db39cea Fix emissive items not working 2019-11-24 19:08:46 -05:00
cpw 31da9a4878 Fix the hang on startup problem when windows' broken device enumeration
causes a huge glfwInit slowdown. Log a message too when this is detected.

See https://github.com/glfw/glfw/issues/1284, https://stackoverflow.com/questions/10967795/directinput8-enumdevices-sometimes-painfully-slow,
https://discourse.libsdl.org/t/win-10-initing-joystick-causes-45s-hang-in-sdl-dinput-joystickdetect/23293

Signed-off-by: cpw <[email protected]>
2019-11-23 15:37:56 -05:00
Richard Freimer 0e65f20f22 Add hooks to make it easier to add custom TNT blocks (#6290) 2019-11-20 19:19:34 -08:00
DaemonUmbra d8d70e8b35 Add tags supports_beacon and supports_conduit and modify Beacon and Conduit to use these tags (#6266) 2019-11-20 19:15:13 -08:00
bl4ckscor3 5d62261082 Fix RawMouseEvent not being cancelable (#6310) 2019-11-12 15:12:25 -08:00
Richard Freimer a72b774acf Fix DyeColor referencing incorrect Tag path. Fixes #6301 (#6303) 2019-11-12 15:11:43 -08:00
DaemonUmbra b1042f2c3c Modify StonecutterContainer to allow shift-click insertion of any block with a valid recipe rather than limiting to blocks in an Immutable List (#6268) 2019-11-12 15:10:52 -08:00
tterrag 124c78b926 Fix #6305 lighting optimization using the wrong method 2019-11-07 16:56:54 -05:00
tterrag 7332bf91d5 Add support for modded warm ocean biomes in bonemeal code 2019-11-07 10:39:33 -05:00
tterrag 33307fb1bd Optimize SectionLightStorage#cancelSectionUpdates loop 2019-11-05 14:55:43 -05:00
Daniël Goossens 1ef8b75cbb Add LeftClickEvent trigger to onPlayerDamageBlock (#6046) 2019-11-05 11:12:02 -08:00
DaemonUmbra f4a85e5f03 Fixed an NPE caused by missing registries. (#6292)
Missing registries in this case being registries renamed without proper remapping or created by mods that were removed.
2019-11-05 11:10:32 -08:00
DaemonUmbra 7f8b30aed3 Made the slash optional in fml confirm/cancel. (#6282) 2019-11-05 11:10:19 -08:00
LexManos b8ea220925 Fix registry snapshots not reading aliases correctly. Closes #6298 2019-11-05 11:10:03 -08:00
cpw 1e1644f6d4 A few tweaks to things. Make the mods command a bit better, make the
IndexedMessageCodec actually log which network channel it got back packets
on. Also, improve the custom directorymodlocator with actual custom names,
finally, allow up to 99 log rollovers, up from 7 default (this means a
repeatedly crashing server is less likely to roll out the log of the first
crash).

Signed-off-by: cpw <[email protected]>
2019-11-03 12:33:07 -05:00
tterrag fab4ce894a Fix BlockStateProvider#horizontalBlock emitting rotations >=360 2019-11-01 17:10:06 -04:00
Camilo f2f7ab80f6 Added some more biome types to BiomeDictionary (#6250) 2019-11-01 11:26:08 -07:00
DaemonUmbra c044f3b0c4 Replaced getTypes invocation in ensureHasTypes with a direct reference to types, preventing infinite recursion (#6284)
The direct reference is checked via ternary and reports if the set is empty, this is likely to result in log spam if modders don't assign types to their biomes
2019-11-01 11:24:00 -07:00
tterrag ebd463e92f Fix lang generator escaping newlines, add lang generator test 2019-10-30 15:25:03 -04:00
tterrag 69ba974960 Escape control chars and unicode when writing out lang datagen 2019-10-30 15:01:25 -04:00
tterrag dbee8a24d8 Allow LanguageProvider helpers to accept suppliers of subtypes 2019-10-28 21:23:01 -04:00
tterrag 2373dab982 Expose private helper methods in BlockLootTables to subclasses 2019-10-28 19:28:16 -04:00
Wyn Price 1ebfef5ec9 Fixed vanilla bug in entity navigation to stop entities spinning (MC-94054) (#6091) 2019-10-28 14:13:14 -07:00
Paul Becker ff7a2fe4d6 Reimplement usage of Item#doesSneakBypassUse() (#6114) 2019-10-28 13:24:15 -07:00
cpw 862289cf56 Handle logging during shutdown better on the server, by not
closing the logfile before the server itself has shutdown.

Signed-off-by: cpw <[email protected]>
2019-10-26 16:55:15 -04:00
cpw e3068d7db2 Fix NPE in modlauncher when there is no mods dir yet.
Signed-off-by: cpw <[email protected]>
2019-10-25 07:27:55 -04:00
DaemonUmbra 29ad7a39de Fixed NPEs caused by uninitialized lists in ModDirTransformerDiscoverer (#6277) 2019-10-24 23:06:27 -07:00
LexManos 3484200f80 Make Loot Table data generators more reusable for modders. 2019-10-24 22:09:08 -07:00
tterrag acaa470dea Add Blockstate and Model data providers (#6241) 2019-10-24 22:33:24 -04:00
cpw 3bf6c17bb8 Allow pack locators to load from the mods folder.
Regular mods are now automatically de-duped based on the version number -
the highest version file of a "root mod id" is now selected automatically.

Signed-off-by: cpw <[email protected]>
2019-10-23 21:30:17 -04:00
AfterRebelion ca8a418364 Exclude Cobblestone slabs and wall recipes (#6230) 2019-10-22 15:31:35 -07:00
Wyn Price 6422310453 Fixed forge rendering pipeline and shape based light occulsion. (#6178) 2019-10-22 15:29:27 -07:00
Wyn Price ebf489be8c Fix shouldCauseReequipAnimation not affecting anything (#6256) 2019-10-22 15:08:06 -04:00
cpw c8967fa176 Expose the registrationchange event to simple channel (not that anyone should care, but who knows?)
Also, Context.getNetworkManager should have been public. Derp.

Signed-off-by: cpw <[email protected]>
2019-10-18 09:32:44 -04:00
cpw 51d08ad8ab Fix clientside chunk load event spam. Was an offset patch.. Also fire unload on the client side too.
Signed-off-by: cpw <[email protected]>
2019-10-18 00:03:09 -04:00
cpw dc664ba597 Add in an event to expose the standard MC channel stuff to network
event channels that care about such things. Mods using simplechannel
don't need to care.

Also, put a sync wrapper around crashreportextender, so it doesn't
die sometimes randomly during startup.

Signed-off-by: cpw <[email protected]>
2019-10-17 20:28:39 -04:00
Daniël Goossens 8e74ba8c24 Fix #6244 RightClickBlock#getUseBlock and #getUseItem being ignored (#6246) 2019-10-17 19:13:16 -04:00
David Quintana ec3e8c2039 Fix vanilla models with parents not loading properly from forge blockstates. 2019-10-16 23:11:23 +02:00
ichttt 6cbd418703 Include a profile icon for the launcher json (#6222) 2019-10-15 15:00:03 -07:00
ichttt 6c8342b74e Fixed loading error/warning screen not showing (#6218) 2019-10-15 14:59:41 -07:00
James Mitchell c345dfb0c6 Fixed MC-162953 bounds checks in NativeImage (#6216) 2019-10-15 14:58:16 -07:00
JoJoModding 8adc546d92 Allow mods actually to have their own usable config gui (#6208) 2019-10-15 14:56:27 -07:00
iChun 25a9e477cb Fix error logging in FMLUserdevLaunchProvider.setup (#6206) 2019-10-15 14:55:45 -07:00
bl4ckscor3 886de4ee43 Fix shear sound not playing (#6202) 2019-10-15 14:55:26 -07:00
ichttt c98abaaa42 Fix some config checks still using the old fields (#6193) 2019-10-15 14:54:47 -07:00
Philipp a8bd5e7ece Add onCropsGrow event to KelpTopBlock (#6171) 2019-10-15 14:33:07 -07:00
Justin a328364999 Fix mod info panel rendering incorrectly on some systems with HiDPI displays (pesky macs) (#6170) 2019-10-15 14:31:41 -07:00
FireController1847 94cbf72e39 Re-add PlayerGiveXpEvent & PlayerChangeLevelEvent (#6165) 2019-10-14 10:37:44 -07:00
Max Becker 8248eb6ea1 Skip background for hidden effect instances (#6197) 2019-10-14 10:33:45 -07:00
cpw 408104dbaf Bump modlauncher version to 4.1
Signed-off-by: cpw <[email protected]>
2019-10-13 14:21:24 -04:00
Wyn Price 5978670897 Fixed IModelData not being cleared when tile entity is removed (#6115) 2019-10-10 23:07:52 -04:00
Vincent Lee 01d14004a9 Allow modded IParticleRenderTypes to be rendered (#6221) 2019-10-10 23:05:16 -04:00
tterrag 940bbc4e91 Better sanity checks in ModelDataManager 2019-10-10 16:02:36 -04:00
Vincent Lee 7070bd0340 Make customClientFactory optional again (#6191) 2019-10-10 11:23:27 -07:00
David Quintana 5e9380ab85 Fix forge blockstates and custom model loading (#6154)
* Reimplement forge blockstates variant through the use of a pseudo-model that handles the model loading, retexturing, custom data, etc. on behalf of the blockstates loader. This model gets injected into the model registry with an autogenerated unique name, to not collide with other model locations.
* Fix model loaders not being properly initialized by calling the reload method from the loader register function. In 1.12, registering a reload listener caused the listener to be called right away from the register method. This is not true anymore.
2019-10-08 00:18:29 +02:00
cpw 9c759294c6 Add a super early GUI for showing pre-game launch messages from FML. NOTE: this cannot show on MAC because MAC can't handle
off-thread GUIs in any way shape or form, and we need the main thread to do real work.

Fix forge fading in wrongly.

Signed-off-by: cpw <[email protected]>
2019-10-05 17:03:02 -04:00
David Quintana b294f4d894 New round of fluid system fixes: (#6175)
- Fix race condition lazy-initializing flowing fluid block data.
- Fix typo in ItemTextureQuadConverter that prevents certain animated textures from being used in the fluid bucket.
- Fix calls to onContentsChanged in FluidTank.
- Fix FluidUtil.tryEmptyContainer logic when simulating.
- Fix EmptyFluidHandler.fill returning the wrong number.
2019-10-05 19:49:26 +02:00
tterrag ca980a56bc Combine all hidden mod resource packs into a single sortable pack
Fix mod datapacks sorting under vanilla
2019-10-04 18:36:33 -04:00
cpw 8482293b40 Split server and client side pack locators apart and move them to their
respective behavioural components. This should facilitate fixing the
server pack data pack ordering, as well as other new features of mod
resource packs.

Signed-off-by: cpw <[email protected]>
2019-10-04 15:24:15 -04:00
LexManos dc5a06aab4 Fix dimension types being incorrect when connecting to a non-Forge server. Closes #6203 2019-10-04 10:36:50 -07:00
cpw 35bd69808c Fix the stupid derp that broke singleplayer dims. Don't send the dim packet
to the local client - it is not needed because obviously not. Seems to have
fixed the problem. Probably infinity new bugs by this.

Signed-off-by: cpw <[email protected]>
2019-10-04 07:27:11 -04:00
tterrag 4f12261080 Move OnlyIn patches on DyeColor to SAS file
Also fix broken cobblestone stairs recipe
2019-10-04 02:26:54 -04:00
tterrag fbdfc0f95c Expose DyeColor#colorValue, remove OnlyIn from all DyeColor methods 2019-10-04 01:40:28 -04:00
cpw 48735c3946 Properly propagate the DimensionType information from server to client
at client connection time. This means the client now knows about the
dimensiontype properly and can access the ModDimension information on
the client.

Signed-off-by: cpw <[email protected]>
2019-10-02 21:54:02 -04:00
Ruben Taelman c985225d0c Fix FluidTank with empty contents throwing error if drained (#6196) 2019-10-01 19:57:05 -07:00
Matthew Messinger 48ff897ed1 Move opening initial screen to after startup and events are enabled (#6139)
This allows events to be fired for the initial opening of the main menu
Also fixes MC-145102
2019-10-01 19:56:03 -07:00
Wyn Price 9db568d49d Changed all calls of BlockState#getSoundType to use the sensitive version. (#6120) 2019-10-01 19:54:23 -07:00
Draco18s 896e785994 Patch Sweet Berry Bush to have Crop Growth Event Hook (#6094) 2019-10-01 19:52:24 -07:00
tterrag 78cdb705d4 Allow structure processors to process entities 2019-09-28 18:18:24 -04:00
cpw 136452840d Remove forced ANSI terminal - it breaks the Eclipse terminal output.
As a result, we can now support coloured log output again, by default.

Regen run configs to get the change (you should do this every update, you
know :D)

Signed-off-by: cpw <[email protected]>
2019-09-28 16:05:50 -04:00
tterrag b3631b707c Make patched-in StairsBlock constructor public
Also fix supplier generic being too narrow in DeferredRegister#register
2019-09-27 17:56:30 -04:00
cpw f4bab8b8c1 Integrate modlauncher changes for mixin.
Signed-off-by: cpw <[email protected]>
2019-09-27 17:42:24 -04:00
tterrag 2392a4c184 Fix new flower pot ctor not being usable with deferred register 2019-09-25 18:01:43 -04:00
tterrag 476b7056fb Usability improvements to RegistryObject/DeferredRegister 2019-09-25 18:01:39 -04:00
tterrag d510978446 Add constructor to StairsBlock that accepts a state supplier 2019-09-24 21:05:23 -04:00
LexManos 583ff81dba Fix server jar manifest path. 2019-09-23 18:42:54 -07:00
tterrag 01a862db30 Fix sea level not being available on client, move hook to Dimension 2019-09-23 13:08:26 -04:00
tterrag dfbd61436b Add template arg to StructureProcessor#process 2019-09-22 23:35:12 -04:00
LexManos f03745ce45 Fix timezone issue with the installer. 2019-09-23 02:46:43 +00:00
LexManos 48cf910626 Bump binpatcher and jarsplitter versions to address Java differences on older JDKs. 2019-09-22 17:30:29 -07:00
tterrag 0492b25335 Allow modded dimensions to customise World#getSeaLevel 2019-09-22 16:47:56 -04:00
tterrag 6d9cb0a646 Fix jigsaw blocks not mirroring properly 2019-09-22 16:47:44 -04:00
tterrag 571ecafdbc Fix type bound on GameRegistry.findRegistry being too narrow 2019-09-21 16:19:23 -04:00
tterrag dee844e232 Add IExtensibleEnum#init, extend FillerBlockType/PlacementBehaviour 2019-09-21 15:57:32 -04:00
cpw 07bcff5067 Tag the deprecation of DeferredWorkQueue. I think this is causing confusion
as to scope. Its functionality will be tied to the events in future -
so mods can request the deferred work through methods on the Mod Lifecycle
events directly. The API will be coming soon.

Signed-off-by: cpw <[email protected]>
2019-09-17 21:41:08 -04:00
cpw 7fa3594c04 Fixed the problem where an error would cause the main thread to continue
even though there were still parallel threads running. Also, handle exceptions
in the AutomaticEventSubscriber rather than leaking them to the Parallel processor.

Actually closes #6148
Signed-off-by: cpw <[email protected]>
2019-09-17 21:41:08 -04:00
tterrag 6fda1e968d Make FlowerPotBlock extensible and reusable for mods
- Change static lookup map to an instance variable
- Add an instance variable for the "empty pot" for the current block
- Keep one instance of the lookup map between the empty pot and all its full versions
- Convert everything to use delegates
2019-09-17 19:57:58 -04:00
Brennan Ward af8074cc39 Post tag event directly from reloader thread (#6164) 2019-09-17 14:39:36 -07:00
cpw 71a4828809 Some tweaks around the code base. A functional consumer for networking - return a bool from your consumer function, rather than setPacketHandled.
Tweak the server modloading behaviour to try and be a bit clearer that a mod errored.

Signed-off-by: cpw <[email protected]>
2019-09-16 20:14:25 -04:00
Brennan Ward 79ce18ac3e Update furnace fuels to not recreate it's list every query, and update when tags are reloaded. Add Tag update events. (#6140) 2019-09-16 14:04:32 -07:00
Nightenom bb83e11a7c Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128) 2019-09-16 13:36:43 -07:00
Unnoen 0f888dde49 Update README badges to fix wrong version. (#6141) 2019-09-16 13:21:17 -07:00
MrCrayfish f4215d121c Reimplemented "MouseEvent" as RawMouseEvent for 1.14.X (#6144) 2019-09-16 13:03:10 -07:00
Take Weiland 60eecb98a6 Fix patch for vanilla spawning in WorldEntitySpawner (#6130) 2019-09-12 11:10:51 -07:00
1085 changed files with 17642 additions and 14964 deletions

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
name: Publish
on:
push:
branches: [ '1.14.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/
-38
View File
@@ -1,38 +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
- /^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
+82 -102
View File
@@ -1,18 +1,19 @@
buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath 'org.ow2.asm:asm:7.1'
classpath 'org.ow2.asm:asm-tree:7.1'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.197'
classpath 'org.ow2.asm:asm:7.2'
classpath 'org.ow2.asm:asm-tree:7.2'
}
}
import groovy.json.JsonSlurper
import groovy.json.JsonBuilder
import java.nio.file.Files
import java.text.SimpleDateFormat
import java.util.Date
import java.util.LinkedHashMap
@@ -40,21 +41,15 @@ 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'
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'
MC_VERSION = '1.14.4'
@@ -69,6 +64,7 @@ project(':mcp') {
}
}
if (findProject(':clean') != null) {
project(':clean') {
evaluationDependsOn(':mcp')
apply plugin: 'eclipse'
@@ -112,9 +108,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'
@@ -157,7 +154,10 @@ project(':forge') {
]
}
resources {
srcDirs = ["$rootDir/src/test/resources"]
srcDirs = [
"$rootDir/src/test/resources",
"$rootDir/src/generated_test/resources"
]
}
}
userdev {
@@ -187,6 +187,7 @@ project(':forge') {
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.12:fatjar'
}
def getVersion = {
@@ -209,7 +210,9 @@ project(':forge') {
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
@@ -234,7 +237,6 @@ project(':forge') {
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'terminal.ansi', 'true'
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
ideaModule "${rootProject.name}.${project.name}.userdev"
@@ -243,12 +245,6 @@ project(':forge') {
source sourceSets.userdev
}
cpw_forge_client {
parent runs.forge_client
taskName 'cpw_forge_client'
property 'forge.logging.noansi', 'false'
}
forge_test_client {
parent runs.forge_client
taskName 'forge_test_client'
@@ -312,7 +308,8 @@ project(':forge') {
source sourceSets.main
source sourceSets.userdev
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/')
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/'), '--validate',
'--existing', sourceSets.main.resources.srcDirs[0]
}
forge_test_data {
@@ -325,7 +322,8 @@ project(':forge') {
tests { sources sourceSets.test }
}
args '--mod', 'data_gen_test', '--all', '--output', rootProject.file('src/generated_test/resources/')
args '--mod', 'data_gen_test', '--all', '--output', rootProject.file('src/generated_test/resources/'), '--validate',
'--existing', sourceSets.main.resources.srcDirs[0]
}
}
}
@@ -404,25 +402,30 @@ project(':forge') {
installer 'org.ow2.asm:asm:6.2'
installer 'org.ow2.asm:asm-commons:6.2'
installer 'org.ow2.asm:asm-tree:6.2'
installer 'cpw.mods:modlauncher:3.2.+'
installer 'cpw.mods:modlauncher:4.1.+'
installer 'cpw.mods:grossjava9hacks:1.1.+'
installer 'net.minecraftforge:accesstransformers:1.0.+:shadowed'
installer 'net.minecraftforge:eventbus:1.0.+:service'
installer 'net.minecraftforge:forgespi:1.3.+'
installer 'net.minecraftforge:forgespi:1.5.+'
installer 'net.minecraftforge:coremods:1.0.+'
installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.0'
installer 'com.electronwill.night-config:toml:3.6.0'
installer 'org.jline:jline:3.12.+'
installer 'org.apache.maven:maven-artifact:3.6.0'
installer 'net.jodah:typetools:0.6.0'
installer 'java3d:vecmath:1.5.2'
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'
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
fmllauncherImplementation "org.lwjgl:lwjgl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-glfw:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-opengl:3.2.2"
fmllauncherImplementation "org.lwjgl:lwjgl-stb:3.2.2"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.+'
testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5
@@ -438,48 +441,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
@@ -487,17 +463,23 @@ project(':forge') {
}
// We apply the bin patches we just created to make a jar that is JUST our changes
genClientBinPatches.tool = BINPATCH_TOOL
task applyClientBinPatches(type: ApplyBinPatches, dependsOn: genClientBinPatches) {
clean = { genClientBinPatches.cleanJar }
input = genClientBinPatches.output
tool = BINPATCH_TOOL
}
genServerBinPatches.tool = BINPATCH_TOOL
task applyServerBinPatches(type: ApplyBinPatches, dependsOn: genServerBinPatches) {
clean = { genServerBinPatches.cleanJar }
input = genServerBinPatches.output
tool = BINPATCH_TOOL
}
genJoinedBinPatches.tool = BINPATCH_TOOL
task applyJoinedBinPatches(type: ApplyBinPatches, dependsOn: genJoinedBinPatches) {
clean = { genJoinedBinPatches.cleanJar }
input = genJoinedBinPatches.output
tool = BINPATCH_TOOL
}
// Create SRG named Vanilla jars, using the SpecialSource we have in the installer
task createClientSRG(type: RenameJar, dependsOn: genClientBinPatches) {
@@ -676,7 +658,7 @@ project(':forge') {
}
}
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
task launcherJson(dependsOn: ['universalJar', 'launcherJar']) {
inputs.file universalJar.archivePath
inputs.file { launcherJar.archivePath }
ext {
@@ -736,10 +718,10 @@ project(':forge') {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.2'
}
doFirst {
ext.BIN_PATCHER = 'net.minecraftforge:binarypatcher:' + genClientBinPatches.resolvedVersion
ext.BIN_PATCHER = BINPATCH_TOOL.substring(0, BINPATCH_TOOL.length() - 1 - BINPATCH_TOOL.split(':')[3].length())
}
inputs.file applyClientBinPatches.output
inputs.file applyServerBinPatches.output
@@ -769,6 +751,7 @@ project(':forge') {
spec: 0,
profile: project.name,
version: launcherJson.id,
icon: "data:image/png;base64," + new String(Base64.getEncoder().encode(Files.readAllBytes(rootProject.file("icon.ico").toPath()))),
json: '/version.json',
path: "${project.group}:${project.name}:${project.version}",
logo: '/big_logo.png',
@@ -784,16 +767,16 @@ project(':forge') {
server: '/data/server.lzma'
],
MC_SLIM: [
client: "[net.minecraft:client:${MC_VERSION}:slim]",
server: "[net.minecraft:server:${MC_VERSION}:slim]"
client: "[net.minecraft:client:${MC_VERSION}:slim${MC_VERSION == '1.14.4' ? '-stable' : ''}]",
server: "[net.minecraft:server:${MC_VERSION}:slim${MC_VERSION == '1.14.4' ? '-stable' : ''}]"
],
MC_SLIM_SHA: [
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
],
MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}:extra]"
client: "[net.minecraft:client:${MC_VERSION}:extra${MC_VERSION == '1.14.4' ? '-stable' : ''}]",
server: "[net.minecraft:server:${MC_VERSION}:extra${MC_VERSION == '1.14.4' ? '-stable' : ''}]"
],
MC_EXTRA_SHA: [
client: "'${sha1(tasks.getByName('downloadClientExtra').output)}'",
@@ -881,13 +864,18 @@ project(':forge') {
['slim', 'extra'].each { type ->
def name = "download${side.capitalize()}${type.capitalize()}"
task "${name}"(type: DownloadMavenArtifact) {
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
artifact = "net.minecraft:${side}:${MC_VERSION}${MC_VERSION == '1.14.4' ? '-stable' : ''}:${type}"
}
installerJson.dependsOn(name)
installerJson.inputs.file(tasks.getByName(name).output)
}
}
jar {
// this needs filtering because its a package that doesn't have any classes. Its a bug in FG but I dont care to fix it there.
exclude('net/minecraft/client/entity/package-info.class')
}
universalJar {
from extraTxts
@@ -911,7 +899,7 @@ project(':forge') {
*/
// add crowdin locales
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
from zipTree(crowdin.archivePath)
dependsOn crowdin
doFirst {
@@ -934,7 +922,7 @@ project(':forge') {
artifacts.each { key, lib ->
classpath += "libraries/${lib.downloads.artifact.path} "
}
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra${MC_VERSION == '1.14.4' ? '-stable' : ''}.jar"
MANIFESTS.each{ pkg, values ->
if (pkg == '/') {
@@ -958,11 +946,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')
@@ -991,24 +979,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
@@ -1198,12 +1174,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()
}
@@ -1256,7 +1235,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'
@@ -1301,6 +1280,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
}
+6 -3
View File
@@ -1,14 +1,17 @@
<img src="assets/Forge_logo.svg">
MinecraftForge [![Latest Release](https://img.shields.io/maven-metadata/v/https/files.minecraftforge.net/maven/net/minecraftforge/forge/maven-metadata.xml.svg?label=latest)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/patreon-support-orange.svg)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/flocker-merch-blueviolet.svg)](https://forgedev.flocker.tv/)
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.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/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=
)](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 (latest) |
| 1.12.x | Active (stable) |
| 1.14.x | Active |
| 1.12.x | Legacy |
* [Download]
* [Forum]
+1 -2
View File
@@ -1,7 +1,6 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -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()));
}
@@ -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_);
}
-
@@ -83,7 +83,19 @@
if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -199,7 +203,7 @@
@@ -188,18 +192,14 @@
p_176536_1_.func_217377_a(p_176536_2_, false);
}
- Block block = blockstate.func_177230_c();
- if (block instanceof TNTBlock) {
- TNTBlock tntblock = (TNTBlock)block;
- TNTBlock.func_196534_a(p_176536_1_, p_176536_2_);
- }
+ blockstate.catchFire(p_176536_1_, p_176536_2_, face, null);
}
}
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) {
@@ -92,7 +104,7 @@
return true;
}
}
@@ -215,13 +219,14 @@
@@ -215,13 +215,14 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -108,7 +120,7 @@
public boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0;
}
@@ -246,8 +251,8 @@
@@ -246,8 +247,8 @@
BlockPos blockpos = p_180655_3_.func_177977_b();
BlockState blockstate = p_180655_2_.func_180495_p(blockpos);
@@ -119,7 +131,7 @@
for(int j = 0; j < 2; ++j) {
double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F;
double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -256,7 +261,7 @@
@@ -256,7 +257,7 @@
}
}
@@ -128,7 +140,7 @@
for(int k = 0; k < 2; ++k) {
double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -265,7 +270,7 @@
@@ -265,7 +266,7 @@
}
}
@@ -137,7 +149,7 @@
for(int l = 0; l < 2; ++l) {
double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -274,7 +279,7 @@
@@ -274,7 +275,7 @@
}
}
@@ -146,7 +158,7 @@
for(int i1 = 0; i1 < 2; ++i1) {
double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -283,7 +288,7 @@
@@ -283,7 +284,7 @@
}
}
@@ -155,7 +167,7 @@
for(int j1 = 0; j1 < 2; ++j1) {
double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
@@ -311,10 +316,23 @@
@@ -311,10 +312,23 @@
}
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
@@ -1,11 +1,79 @@
--- a/net/minecraft/block/FlowerPotBlock.java
+++ b/net/minecraft/block/FlowerPotBlock.java
@@ -19,7 +19,7 @@
import net.minecraft.world.World;
public class FlowerPotBlock extends Block {
- private static final Map<Block, Block> field_196451_b = Maps.newHashMap();
+ private static final Map<Block, Block> field_196451_b = Maps.newHashMap(); //TODO: Delegates
@@ -23,10 +23,37 @@
protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
private final Block field_196452_c;
+ private final Map<net.minecraft.util.ResourceLocation, java.util.function.Supplier<? extends Block>> fullPots;
+ private final java.util.function.Supplier<FlowerPotBlock> emptyPot;
+ private final java.util.function.Supplier<? extends Block> flowerDelegate;
+
+ @Deprecated // Mods should use the constructor below
public FlowerPotBlock(Block p_i48395_1_, Block.Properties p_i48395_2_) {
+ this(Blocks.field_150457_bL == null ? null : () -> (FlowerPotBlock) Blocks.field_150457_bL.delegate.get(), () -> p_i48395_1_.delegate.get(), p_i48395_2_);
+ if (Blocks.field_150457_bL != null) {
+ ((FlowerPotBlock)Blocks.field_150457_bL).addPlant(p_i48395_1_.getRegistryName(), () -> this);
+ }
+ }
+
+ /**
+ * For mod use, eliminates the need to extend this class, and prevents modded
+ * flower pots from altering vanilla behavior.
+ *
+ * @param emptyPot The empty pot for this pot, or null for self.
+ * @param p_i48395_1_ The flower block.
+ * @param p_i48395_2_
+ */
+ 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_);
- this.field_196452_c = p_i48395_1_;
- field_196451_b.put(p_i48395_1_, this);
+ this.field_196452_c = null; // Unused, redirected by coremod
+ this.flowerDelegate = p_i48395_1_;
+ if (emptyPot == null) {
+ this.fullPots = Maps.newHashMap();
+ this.emptyPot = null;
+ } else {
+ this.fullPots = java.util.Collections.emptyMap();
+ this.emptyPot = emptyPot;
+ }
}
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
@@ -40,7 +67,7 @@
public boolean func_220051_a(BlockState p_220051_1_, World p_220051_2_, BlockPos p_220051_3_, PlayerEntity p_220051_4_, Hand p_220051_5_, BlockRayTraceResult p_220051_6_) {
ItemStack itemstack = p_220051_4_.func_184586_b(p_220051_5_);
Item item = itemstack.func_77973_b();
- Block block = item instanceof BlockItem ? field_196451_b.getOrDefault(((BlockItem)item).func_179223_d(), Blocks.field_150350_a) : Blocks.field_150350_a;
+ Block block = item instanceof BlockItem ? getEmptyPot().fullPots.getOrDefault(((BlockItem)item).func_179223_d().getRegistryName(), Blocks.field_150350_a.delegate).get() : Blocks.field_150350_a;
boolean flag = block == Blocks.field_150350_a;
boolean flag1 = this.field_196452_c == Blocks.field_150350_a;
if (flag != flag1) {
@@ -58,7 +85,7 @@
p_220051_4_.func_71019_a(itemstack1, false);
}
- p_220051_2_.func_180501_a(p_220051_3_, Blocks.field_150457_bL.func_176223_P(), 3);
+ p_220051_2_.func_180501_a(p_220051_3_, getEmptyPot().func_176223_P(), 3);
}
}
@@ -78,6 +105,17 @@
}
public Block func_220276_d() {
- return this.field_196452_c;
+ return flowerDelegate.get();
}
+
+ public FlowerPotBlock getEmptyPot() {
+ return emptyPot == null ? this : emptyPot.get();
+ }
+
+ public void addPlant(net.minecraft.util.ResourceLocation flower, java.util.function.Supplier<? extends Block> fullPot) {
+ if (getEmptyPot() != this) {
+ throw new IllegalArgumentException("Cannot add plant to non-empty pot: " + this);
+ }
+ fullPots.put(flower, fullPot);
+ }
}
@@ -59,7 +59,7 @@
this.func_180688_d(p_204515_1_, p_204515_2_);
return false;
}
@@ -160,4 +176,22 @@
@@ -160,4 +176,27 @@
}
}
@@ -70,15 +70,20 @@
+ return (FlowingFluid)supplier.get();
+ }
+
+ private boolean fluidStateCacheInitialized;
+ protected void initFluidStateCache() {
+ this.field_212565_c.add(getFluid().func_207204_a(false));
+ private boolean fluidStateCacheInitialized = false;
+ protected synchronized void initFluidStateCache() {
+ if (fluidStateCacheInitialized == false)
+ {
+ this.field_212565_c.add(getFluid().func_207204_a(false));
+
+ for(int i = 1; i < 8; ++i) {
+ this.field_212565_c.add(getFluid().func_207207_a(8 - i, false));
+ for (int i = 1; i < 8; ++i)
+ {
+ this.field_212565_c.add(getFluid().func_207207_a(8 - i, false));
+ }
+
+ this.field_212565_c.add(getFluid().func_207207_a(8, true));
+
+ fluidStateCacheInitialized = true;
+ }
+
+ this.field_212565_c.add(getFluid().func_207207_a(8, true));
+ fluidStateCacheInitialized = true;
+ }
}
@@ -0,0 +1,16 @@
--- a/net/minecraft/block/JigsawBlock.java
+++ b/net/minecraft/block/JigsawBlock.java
@@ -29,6 +29,13 @@
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
}
+ // FORGE: Fix jigsaw blocks not mirroring properly
+ @Override
+ @Deprecated
+ public BlockState func_185471_a(BlockState state, net.minecraft.util.Mirror mirrorIn) {
+ return state.func_206870_a(field_176387_N, mirrorIn.func_185803_b(state.func_177229_b(field_176387_N)));
+ }
+
public BlockState func_196258_a(BlockItemUseContext p_196258_1_) {
return this.func_176223_P().func_206870_a(field_176387_N, p_196258_1_.func_196000_l());
}
@@ -0,0 +1,13 @@
--- a/net/minecraft/block/KelpTopBlock.java
+++ b/net/minecraft/block/KelpTopBlock.java
@@ -57,8 +57,9 @@
} else {
BlockPos blockpos = p_196267_3_.func_177984_a();
BlockState blockstate = p_196267_2_.func_180495_p(blockpos);
- if (blockstate.func_177230_c() == Blocks.field_150355_j && p_196267_1_.func_177229_b(field_203163_a) < 25 && p_196267_4_.nextDouble() < 0.14D) {
+ if (blockstate.func_177230_c() == Blocks.field_150355_j && p_196267_1_.func_177229_b(field_203163_a) < 25 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, p_196267_4_.nextDouble() < 0.14D)) {
p_196267_2_.func_175656_a(blockpos, p_196267_1_.func_177231_a(field_203163_a));
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
@@ -9,3 +9,48 @@
netherportalblock$size.func_150859_c();
return true;
} else {
@@ -245,13 +245,13 @@
int i;
for(i = 0; i < 22; ++i) {
BlockPos blockpos = p_180120_1_.func_177967_a(p_180120_2_, i);
- if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || this.field_150867_a.func_180495_p(blockpos.func_177977_b()).func_177230_c() != Blocks.field_150343_Z) {
+ if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).isPortalFrame(this.field_150867_a, blockpos.func_177977_b())) {
break;
}
}
- Block block = this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_177230_c();
- return block == Blocks.field_150343_Z ? i : 0;
+ BlockPos framePos = p_180120_1_.func_177967_a(p_180120_2_, i);
+ return this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos) ? i : 0;
}
public int func_181100_a() {
@@ -278,13 +278,13 @@
}
if (i == 0) {
- block = this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_177230_c();
- if (block != Blocks.field_150343_Z) {
+ BlockPos framePos = blockpos.func_177972_a(this.field_150863_d);
+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) {
break label56;
}
} else if (i == this.field_150868_h - 1) {
- block = this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_177230_c();
- if (block != Blocks.field_150343_Z) {
+ BlockPos framePos = blockpos.func_177972_a(this.field_150866_c);
+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) {
break label56;
}
}
@@ -292,7 +292,8 @@
}
for(int j = 0; j < this.field_150868_h; ++j) {
- if (this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).func_177230_c() != Blocks.field_150343_Z) {
+ BlockPos framePos = this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g);
+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) {
this.field_150862_g = 0;
break;
}
@@ -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,12 @@
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else {
return false;
@@ -255,4 +261,8 @@
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,40 @@
--- a/net/minecraft/block/StairsBlock.java
+++ b/net/minecraft/block/StairsBlock.java
@@ -83,13 +83,24 @@
return voxelshape;
}
+ // Forge: Use the other constructor that takes a Supplier
+ @Deprecated
protected StairsBlock(BlockState p_i48321_1_, Block.Properties p_i48321_2_) {
super(p_i48321_2_);
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false)));
this.field_150149_b = p_i48321_1_.func_177230_c();
this.field_150151_M = p_i48321_1_;
+ this.stateSupplier = () -> p_i48321_1_;
}
+ public StairsBlock(java.util.function.Supplier<BlockState> state, Block.Properties properties) {
+ super(properties);
+ this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false)));
+ this.field_150149_b = Blocks.field_150350_a; // These are unused, fields are redirected
+ this.field_150151_M = Blocks.field_150350_a.func_176223_P();
+ this.stateSupplier = state;
+ }
+
public boolean func_220074_n(BlockState p_220074_1_) {
return true;
}
@@ -265,4 +276,12 @@
public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return false;
}
+
+ private final java.util.function.Supplier<BlockState> stateSupplier;
+ private Block getModelBlock() {
+ return getModelState().func_177230_c();
+ }
+ private BlockState getModelState() {
+ return stateSupplier.get();
+ }
}
@@ -0,0 +1,13 @@
--- a/net/minecraft/block/SweetBerryBushBlock.java
+++ b/net/minecraft/block/SweetBerryBushBlock.java
@@ -47,8 +47,9 @@
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
int i = p_196267_1_.func_177229_b(field_220125_a);
- if (i < 3 && p_196267_4_.nextInt(5) == 0 && p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
+ if (i < 3 && p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt(5) == 0)) {
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_220125_a, Integer.valueOf(i + 1)), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
@@ -0,0 +1,67 @@
--- a/net/minecraft/block/TNTBlock.java
+++ b/net/minecraft/block/TNTBlock.java
@@ -28,10 +28,14 @@
this.func_180632_j(this.func_176223_P().func_206870_a(field_212569_a, Boolean.valueOf(false)));
}
+ public void catchFire(BlockState state, World world, BlockPos pos, @Nullable net.minecraft.util.Direction face, @Nullable LivingEntity igniter) {
+ func_196535_a(world, pos, igniter);
+ }
+
public void func_220082_b(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_) {
if (p_220082_4_.func_177230_c() != p_220082_1_.func_177230_c()) {
if (p_220082_2_.func_175640_z(p_220082_3_)) {
- func_196534_a(p_220082_2_, p_220082_3_);
+ catchFire(p_220082_1_, p_220082_2_, p_220082_3_, null, null);
p_220082_2_.func_217377_a(p_220082_3_, false);
}
@@ -40,7 +44,7 @@
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (p_220069_2_.func_175640_z(p_220069_3_)) {
- func_196534_a(p_220069_2_, p_220069_3_);
+ catchFire(p_220069_1_, p_220069_2_, p_220069_3_, null, null);
p_220069_2_.func_217377_a(p_220069_3_, false);
}
@@ -48,7 +52,7 @@
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) {
if (!p_176208_1_.func_201670_d() && !p_176208_4_.func_184812_l_() && p_176208_3_.func_177229_b(field_212569_a)) {
- func_196534_a(p_176208_1_, p_176208_2_);
+ catchFire(p_176208_3_, p_176208_1_, p_176208_2_, null, null);
}
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
@@ -62,10 +66,12 @@
}
}
+ @Deprecated //Forge: Prefer using IForgeBlock#catchFire
public static void func_196534_a(World p_196534_0_, BlockPos p_196534_1_) {
func_196535_a(p_196534_0_, p_196534_1_, (LivingEntity)null);
}
+ @Deprecated //Forge: Prefer using IForgeBlock#catchFire
private static void func_196535_a(World p_196535_0_, BlockPos p_196535_1_, @Nullable LivingEntity p_196535_2_) {
if (!p_196535_0_.field_72995_K) {
TNTEntity tntentity = new TNTEntity(p_196535_0_, (double)((float)p_196535_1_.func_177958_n() + 0.5F), (double)p_196535_1_.func_177956_o(), (double)((float)p_196535_1_.func_177952_p() + 0.5F), p_196535_2_);
@@ -80,7 +86,7 @@
if (item != Items.field_151033_d && item != Items.field_151059_bz) {
return super.func_220051_a(p_220051_1_, p_220051_2_, p_220051_3_, p_220051_4_, p_220051_5_, p_220051_6_);
} else {
- func_196535_a(p_220051_2_, p_220051_3_, p_220051_4_);
+ catchFire(p_220051_1_, p_220051_2_, p_220051_3_, p_220051_6_.func_216354_b(), p_220051_4_);
p_220051_2_.func_180501_a(p_220051_3_, Blocks.field_150350_a.func_176223_P(), 11);
if (item == Items.field_151033_d) {
itemstack.func_222118_a(1, p_220051_4_, (p_220287_1_) -> {
@@ -100,7 +106,7 @@
Entity entity = abstractarrowentity.func_212360_k();
if (abstractarrowentity.func_70027_ad()) {
BlockPos blockpos = p_220066_3_.func_216350_a();
- func_196535_a(p_220066_1_, blockpos, entity instanceof LivingEntity ? (LivingEntity)entity : null);
+ catchFire(p_220066_2_, p_220066_1_, blockpos, null, entity instanceof LivingEntity ? (LivingEntity)entity : null);
p_220066_1_.func_217377_a(blockpos, false);
}
}
@@ -25,7 +25,15 @@
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_147129_ai = func_147122_X();
this.field_71437_Z = null;
@@ -442,7 +442,6 @@
@@ -423,6 +423,7 @@
screensize = new ScreenSize(this.field_71474_y.field_92118_B, this.field_71474_y.field_92119_C, screensize.field_216496_c, screensize.field_216497_d, screensize.field_216498_e);
}
+ net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.join();
LongSupplier longsupplier = GLX.initGlfw();
if (longsupplier != null) {
Util.field_211180_a = longsupplier;
@@ -442,7 +443,6 @@
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
this.field_71417_B = new MouseHelper(this);
@@ -33,7 +41,7 @@
this.field_195559_v = new KeyboardListener(this);
this.field_195559_v.func_197968_a(this.field_195558_d.func_198092_i());
GLX.init();
@@ -451,6 +450,7 @@
@@ -451,6 +451,7 @@
this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
this.field_110451_am = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES, this.field_152352_aC);
this.field_71474_y.func_198017_a(this.field_110448_aq);
@@ -41,7 +49,7 @@
this.field_110448_aq.func_198983_a();
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
@@ -516,12 +516,14 @@
@@ -516,12 +517,14 @@
this.field_110451_am.func_219534_a(this.field_193995_ae);
GlStateManager.viewport(0, 0, this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -57,16 +65,34 @@
this.field_184132_p = new DebugRenderer(this);
GLX.setGlfwErrorCallback(this::func_195545_a);
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
@@ -543,7 +545,7 @@
@@ -532,18 +535,20 @@
this.field_195558_d.func_216523_b(this.field_71474_y.field_74352_v);
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
this.field_195558_d.func_198112_b();
- if (this.field_71475_ae != null) {
- this.func_147108_a(new ConnectingScreen(new MainMenuScreen(), this, this.field_71475_ae, this.field_71477_af));
- } else {
- this.func_147108_a(new MainMenuScreen(true));
- }
ResourceLoadProgressGui.func_212970_a(this);
this.func_213268_a(new ResourceLoadProgressGui(this, this.field_110451_am.func_219535_a(Util.func_215072_e(), this, field_223714_G), () -> {
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
-
+ net.minecraftforge.fml.client.ClientModLoader.complete();
+ if (net.minecraftforge.fml.client.ClientModLoader.completeModLoading()) return; // Do not overwrite the error sceen
+ // FORGE: Move opening initial screen to after startup and events are enabled.
+ // Also Fixes MC-145102
+ if (this.field_71475_ae != null) {
+ this.func_147108_a(new ConnectingScreen(new MainMenuScreen(), this, this.field_71475_ae, this.field_71477_af));
+ } else {
+ this.func_147108_a(new MainMenuScreen(true));
+ }
}, false));
}
@@ -558,7 +560,7 @@
@@ -558,7 +563,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_) -> {
@@ -75,7 +101,7 @@
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -647,7 +649,7 @@
@@ -647,7 +652,7 @@
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
if (p_71377_1_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
@@ -84,7 +110,7 @@
} else if (p_71377_1_.func_147149_a(file2)) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
System.exit(-1);
@@ -662,6 +664,7 @@
@@ -662,6 +667,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -92,7 +118,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -741,16 +744,20 @@
@@ -741,16 +747,20 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -117,7 +143,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);
@@ -875,11 +882,13 @@
@@ -875,11 +885,13 @@
GlStateManager.enableTexture();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -131,7 +157,7 @@
}
this.field_71424_I.func_219897_b();
@@ -1147,10 +1156,10 @@
@@ -1147,10 +1159,10 @@
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -144,7 +170,7 @@
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1177,7 +1186,7 @@
@@ -1177,7 +1189,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -153,7 +179,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1187,6 +1196,7 @@
@@ -1187,6 +1199,7 @@
}
this.field_71439_g.func_184821_cY();
@@ -161,7 +187,7 @@
}
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
@@ -1236,6 +1246,9 @@
@@ -1236,6 +1249,9 @@
}
}
@@ -171,7 +197,7 @@
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand) == ActionResultType.SUCCESS) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
return;
@@ -1255,6 +1268,8 @@
@@ -1255,6 +1271,8 @@
--this.field_71467_ac;
}
@@ -180,7 +206,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1373,6 +1388,8 @@
@@ -1373,6 +1391,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -189,7 +215,7 @@
}
private void func_184117_aA() {
@@ -1527,6 +1544,12 @@
@@ -1527,6 +1547,12 @@
this.func_147108_a(worldloadprogressscreen);
while(!this.field_71437_Z.func_71200_ad()) {
@@ -202,7 +228,7 @@
worldloadprogressscreen.tick();
this.func_195542_b(false);
@@ -1547,11 +1570,17 @@
@@ -1547,11 +1573,17 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_213261_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -221,7 +247,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1583,10 +1612,12 @@
@@ -1583,10 +1615,12 @@
IntegratedServer integratedserver = this.field_71437_Z;
this.field_71437_Z = null;
this.field_71460_t.func_190564_k();
@@ -234,7 +260,7 @@
if (integratedserver != null) {
while(!integratedserver.func_213201_w()) {
this.func_195542_b(false);
@@ -1624,6 +1655,7 @@
@@ -1624,6 +1658,7 @@
}
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
@@ -242,7 +268,7 @@
}
public final boolean func_71355_q() {
@@ -1649,112 +1681,8 @@
@@ -1649,112 +1684,8 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@@ -357,7 +383,7 @@
}
}
@@ -1826,6 +1754,7 @@
@@ -1826,6 +1757,7 @@
return field_71432_P;
}
@@ -365,7 +391,7 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> {
return p_213240_0_;
@@ -1972,6 +1901,8 @@
@@ -1972,6 +1904,8 @@
}
public MusicTicker.MusicType func_147109_W() {
@@ -374,7 +400,7 @@
if (this.field_71462_r instanceof WinGameScreen) {
return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) {
@@ -2128,4 +2059,12 @@
@@ -2128,4 +2062,12 @@
public LoadingGui func_213250_au() {
return this.field_213279_p;
}
@@ -1,6 +1,13 @@
--- a/net/minecraft/client/MouseHelper.java
+++ b/net/minecraft/client/MouseHelper.java
@@ -77,11 +77,15 @@
@@ -71,17 +71,22 @@
if (!this.field_198051_p && flag) {
this.func_198034_i();
}
+ if (net.minecraftforge.client.ForgeHooksClient.onRawMouseClicked(p_198023_3_, p_198023_4_, p_198023_5_)) return;
} else {
double d0 = this.field_198040_e * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
double d1 = this.field_198041_f * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
int p_198023_3_f = p_198023_3_;
if (flag) {
Screen.wrapScreenError(() -> {
@@ -18,7 +25,7 @@
}, "mouseReleased event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
}
}
@@ -105,7 +109,7 @@
@@ -105,7 +110,7 @@
}
}
}
@@ -27,7 +34,7 @@
}
}
@@ -116,7 +120,9 @@
@@ -116,7 +121,9 @@
if (this.field_198036_a.field_71462_r != null) {
double d1 = this.field_198040_e * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
double d2 = this.field_198041_f * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
@@ -38,7 +45,7 @@
} else if (this.field_198036_a.field_71439_g != null) {
if (this.field_200542_o != 0.0D && Math.signum(d0) != Math.signum(this.field_200542_o)) {
this.field_200542_o = 0.0D;
@@ -129,6 +135,7 @@
@@ -129,6 +136,7 @@
}
this.field_200542_o -= (double)f1;
@@ -46,7 +53,7 @@
if (this.field_198036_a.field_71439_g.func_175149_v()) {
if (this.field_198036_a.field_71456_v.func_175187_g().func_175262_a()) {
this.field_198036_a.field_71456_v.func_175187_g().func_195621_a((double)(-f1));
@@ -168,7 +175,9 @@
@@ -168,7 +176,9 @@
double d2 = (p_198022_3_ - this.field_198040_e) * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
double d3 = (p_198022_5_ - this.field_198041_f) * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
Screen.wrapScreenError(() -> {
@@ -57,7 +64,7 @@
}, "mouseDragged event handler", iguieventlistener.getClass().getCanonicalName());
}
}
@@ -233,6 +242,10 @@
@@ -233,6 +243,10 @@
return this.field_198039_d;
}
@@ -68,7 +75,7 @@
public double func_198024_e() {
return this.field_198040_e;
}
@@ -241,6 +254,14 @@
@@ -241,6 +255,14 @@
return this.field_198041_f;
}
@@ -8,19 +8,19 @@
this.field_147003_i = 160 + (this.width - this.field_146999_f - 200) / 2;
this.field_147045_u = true;
}
@@ -84,6 +85,7 @@
int i = this.field_147009_r;
@@ -59,7 +60,7 @@
j = 132 / (collection.size() - 1);
}
for(EffectInstance effectinstance : p_214077_3_) {
+ if (!effectinstance.func_188419_a().shouldRender(effectinstance)) continue;
Effect effect = effectinstance.func_188419_a();
blit(p_214077_1_ + 6, i + 7, this.blitOffset, 18, 18, potionspriteuploader.func_215288_a(effect));
i += p_214077_2_;
@@ -95,6 +97,9 @@
- Iterable<EffectInstance> iterable = Ordering.<EffectInstance>natural().sortedCopy(collection);
+ Iterable<EffectInstance> iterable = collection.stream().filter( effectInstance -> effectInstance.func_188419_a().shouldRender(effectInstance)).sorted().collect(java.util.stream.Collectors.toList());
this.func_214079_a(i, j, iterable);
this.func_214077_b(i, j, iterable);
this.func_214078_c(i, j, iterable);
@@ -95,6 +96,8 @@
int i = this.field_147009_r;
for(EffectInstance effectinstance : p_214078_3_) {
+ if (!effectinstance.func_188419_a().shouldRender(effectinstance)) continue;
+ effectinstance.func_188419_a().renderInventoryEffect(effectinstance, this, p_214078_1_, i, this.blitOffset);
+ if (!effectinstance.func_188419_a().shouldRenderInvText(effectinstance)) { i += p_214078_2_; continue; }
String s = I18n.func_135052_a(effectinstance.func_188419_a().func_76393_a());
@@ -48,7 +48,7 @@
if (this.field_73975_c != null) {
GlStateManager.pushMatrix();
GlStateManager.translatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
@@ -222,7 +229,10 @@
@@ -222,7 +229,13 @@
s = s + ("release".equalsIgnoreCase(this.minecraft.func_184123_d()) ? "" : "/" + this.minecraft.func_184123_d());
}
@@ -57,10 +57,13 @@
+ this.drawString(this.font, brd, 2, this.height - ( 10 + brdline * (this.font.field_78288_b + 1)), 16777215 | l)
+ );
+
+ net.minecraftforge.fml.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
+ this.drawString(this.font, brd, this.width - font.func_78256_a(brd), this.height - (10 + (brdline + 1) * ( this.font.field_78288_b + 1)), 16777215 | l)
+ );
this.drawString(this.font, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.height - 10, 16777215 | l);
if (p_render_1_ > this.field_193979_N && p_render_1_ < this.field_193979_N + this.field_193978_M && p_render_2_ > this.height - 10 && p_render_2_ < this.height) {
fill(this.field_193979_N, this.height - 1, this.field_193979_N + this.field_193978_M, this.height, 16777215 | l);
@@ -240,6 +250,7 @@
@@ -240,6 +253,7 @@
if (this.func_183501_a() && f1 >= 1.0F) {
this.field_183503_M.render(p_render_1_, p_render_2_, p_render_3_);
}
@@ -1,10 +1,18 @@
--- a/net/minecraft/client/multiplayer/ClientChunkProvider.java
+++ b/net/minecraft/client/multiplayer/ClientChunkProvider.java
@@ -72,6 +72,7 @@
if (this.field_217256_d.func_217183_b(p_212849_1_, p_212849_2_)) {
Chunk chunk = this.field_217256_d.func_217192_a(this.field_217256_d.func_217191_a(p_212849_1_, p_212849_2_));
if (func_217249_a(chunk, p_212849_1_, p_212849_2_)) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
return chunk;
@@ -61,6 +61,7 @@
int i = this.field_217256_d.func_217191_a(p_73234_1_, p_73234_2_);
Chunk chunk = this.field_217256_d.func_217192_a(i);
if (func_217249_a(chunk, p_73234_1_, p_73234_2_)) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload(chunk));
this.field_217256_d.func_217190_a(i, chunk, (Chunk)null);
}
@@ -113,6 +114,7 @@
worldlightmanager.func_215566_a(SectionPos.func_218154_a(p_217250_2_, j, p_217250_3_), ChunkSection.func_222628_a(chunksection));
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
return chunk;
}
}
@@ -37,7 +37,12 @@
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 {
@@ -187,13 +193,13 @@
@@ -183,22 +189,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_);
+ if (!net.minecraftforge.common.ForgeHooks.onLeftClickBlock(this.field_78776_a.field_71439_g, p_180512_1_, p_180512_2_).isCanceled())
func_178891_a(this.field_78776_a, this, p_180512_1_, p_180512_2_);
return true;
} else if (this.func_178893_a(p_180512_1_)) {
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
@@ -53,7 +58,13 @@
this.field_78776_a.func_147118_V().func_147682_a(new SimpleSound(soundtype.func_185846_f(), SoundCategory.NEUTRAL, (soundtype.func_185843_a() + 1.0F) / 8.0F, soundtype.func_185847_b() * 0.5F, p_180512_1_));
}
@@ -217,7 +223,8 @@
++this.field_78780_h;
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate, MathHelper.func_76131_a(this.field_78770_f, 0.0F, 1.0F));
+ if (net.minecraftforge.common.ForgeHooks.onLeftClickBlock(this.field_78776_a.field_71439_g, p_180512_1_, p_180512_2_).getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return true;
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 +225,8 @@
}
public float func_78757_d() {
@@ -63,7 +74,7 @@
}
public void func_78765_e() {
@@ -234,7 +241,7 @@
@@ -234,7 +243,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()) {
@@ -72,7 +83,7 @@
}
return p_178893_1_.equals(this.field_178895_c) && flag;
@@ -257,6 +264,12 @@
@@ -257,17 +266,24 @@
return ActionResultType.FAIL;
} else {
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
@@ -85,7 +96,21 @@
if (this.field_78779_k == GameType.SPECTATOR) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
return ActionResultType.SUCCESS;
@@ -298,11 +311,14 @@
} else {
boolean flag = !p_217292_1_.func_184614_ca().func_190926_b() || !p_217292_1_.func_184592_cb().func_190926_b();
- boolean flag1 = p_217292_1_.func_70093_af() && flag;
- if (!flag1 && p_217292_2_.func_180495_p(blockpos).func_215687_a(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_)) {
+ boolean flag1 = !(p_217292_1_.func_70093_af() && 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_));
+ if (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && flag1 && p_217292_2_.func_180495_p(blockpos).func_215687_a(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_)) {
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
return ActionResultType.SUCCESS;
} else {
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_);
ActionResultType actionresulttype;
@@ -298,11 +314,14 @@
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
return ActionResultType.PASS;
} else {
@@ -100,7 +125,7 @@
}
return actionresult.func_188397_a();
@@ -327,6 +343,9 @@
@@ -327,6 +346,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_));
@@ -110,7 +135,7 @@
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
}
@@ -334,6 +353,9 @@
@@ -334,6 +356,9 @@
this.func_78750_j();
Vec3d vec3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.field_70165_t, p_187102_2_.field_70163_u, p_187102_2_.field_70161_v);
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vec3d));
@@ -64,7 +64,7 @@
clientrecipebook.func_199644_c();
clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a);
imutablesearchtree.func_194040_a();
+ net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated();
+ net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.field_199528_o);
}
public void func_200232_a(SPlayerLookPacket p_200232_1_) {
@@ -77,7 +77,15 @@
if (effect != null) {
EffectInstance effectinstance = new EffectInstance(effect, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h());
effectinstance.func_100012_b(p_147260_1_.func_149429_c());
@@ -1766,10 +1779,12 @@
@@ -1353,6 +1366,7 @@
}
this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.field_199725_m));
}
public void func_175098_a(SCombatPacket p_175098_1_) {
@@ -1766,10 +1780,12 @@
this.field_147299_f.field_184132_p.field_217741_m.func_217692_a(pointofinterestdebugrenderer$braininfo);
} else {
@@ -91,7 +99,7 @@
packetbuffer.release();
}
@@ -1909,7 +1924,7 @@
@@ -1909,7 +1925,7 @@
for(SEntityPropertiesPacket.Snapshot sentitypropertiespacket$snapshot : p_147290_1_.func_149441_d()) {
IAttributeInstance iattributeinstance = abstractattributemap.func_111152_a(sentitypropertiespacket$snapshot.func_151409_a());
if (iattributeinstance == null) {
@@ -39,7 +39,17 @@
this.field_187241_h.add(p_78873_1_);
}
@@ -342,7 +343,7 @@
@@ -306,7 +307,8 @@
Particle.field_70554_ao = p_215233_1_.func_216785_c().field_72448_b;
Particle.field_70555_ap = p_215233_1_.func_216785_c().field_72449_c;
- for(IParticleRenderType iparticlerendertype : field_215241_b) {
+ for(IParticleRenderType iparticlerendertype : this.field_78876_b.keySet()) { // Forge: allow custom IParticleRenderType's
+ if(iparticlerendertype == IParticleRenderType.field_217606_f) continue;
Iterable<Particle> iterable = this.field_78876_b.get(iparticlerendertype);
if (iterable != null) {
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -342,7 +344,7 @@
}
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
@@ -48,7 +58,7 @@
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_199284_3_, p_199284_5_, p_199284_7_, p_199284_9_, p_199284_11_, p_199284_13_) -> {
@@ -414,6 +415,12 @@
@@ -414,6 +416,12 @@
return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum());
}
@@ -1,6 +1,17 @@
--- a/net/minecraft/client/renderer/ActiveRenderInfo.java
+++ b/net/minecraft/client/renderer/ActiveRenderInfo.java
@@ -172,4 +172,11 @@
@@ -53,6 +53,10 @@
this.func_216776_a(direction != null ? direction.func_185119_l() - 180.0F : 0.0F, 0.0F);
this.func_216782_a(0.0D, 0.3D, 0.0D);
}
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(net.minecraft.client.Minecraft.func_71410_x().field_71460_t, this, p_216772_5_, this.field_216798_j, this.field_216797_i, 0f);
+ this.field_216797_i = cameraSetup.getPitch();
+ this.field_216798_j = cameraSetup.getYaw();
+ GlStateManager.rotatef(cameraSetup.getRoll(), 0, 0, 1);
GlStateManager.rotatef(this.field_216797_i, 1.0F, 0.0F, 0.0F);
GlStateManager.rotatef(this.field_216798_j + 180.0F, 0.0F, 1.0F, 0.0F);
@@ -172,4 +176,11 @@
this.field_216791_c = null;
this.field_216789_a = false;
}
@@ -97,10 +97,12 @@
GlStateManager.popMatrix();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
@@ -600,6 +608,15 @@
@@ -600,8 +608,17 @@
this.field_187471_h = MathHelper.func_76131_a(this.field_187471_h - 0.4F, 0.0F, 1.0F);
} else {
float f = clientplayerentity.func_184825_o(1.0F);
- this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
- this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
+
+ boolean requipM = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, clientplayerentity.field_71071_by.field_70461_c);
+ boolean requipO = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1);
@@ -110,6 +112,8 @@
+ if (!requipO && !Objects.equals(this.field_187468_e, itemstack1))
+ this.field_187468_e = itemstack1;
+
this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
+ this.field_187469_f += MathHelper.func_76131_a((!requipM ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
+ this.field_187471_h += MathHelper.func_76131_a((float)(!requipO ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
}
if (this.field_187469_f < 0.1F) {
@@ -47,7 +47,7 @@
BlockPos blockpos2 = chunkrender4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if (!chunkrender4.func_188281_o() && !flag3) {
+ if (net.minecraftforge.common.ForgeMod.alwaysSetupTerrainOffThread || !chunkrender4.func_188281_o() && !flag3) {
+ if (net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() || !chunkrender4.func_188281_o() && !flag3) {
this.field_175009_l.add(chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -102,15 +102,17 @@
GlStateManager.enableBlend();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.lineWidth(Math.max(2.5F, (float)this.field_72777_q.field_195558_d.func_198109_k() / 1920.0F * 2.5F));
@@ -1994,7 +2008,7 @@
@@ -1994,8 +2008,8 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
- if (!blockstate.func_196958_f()) {
- SoundType soundtype = blockstate.func_215695_r();
+ if (!blockstate.isAir(this.field_72769_h, p_180439_3_)) {
SoundType soundtype = blockstate.func_215695_r();
+ SoundType soundtype = blockstate.getSoundType(field_72769_h, p_180439_3_, null);
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);
}
@@ -2118,6 +2132,11 @@
}
}
@@ -1,6 +1,32 @@
--- a/net/minecraft/client/renderer/model/BlockModel.java
+++ b/net/minecraft/client/renderer/model/BlockModel.java
@@ -75,6 +75,9 @@
@@ -38,6 +38,7 @@
public class BlockModel implements IUnbakedModel {
private static final Logger field_178313_f = LogManager.getLogger();
private static final FaceBakery field_217647_g = new FaceBakery();
+ @Deprecated
@VisibleForTesting
static final Gson field_178319_a = (new GsonBuilder()).registerTypeAdapter(BlockModel.class, new BlockModel.Deserializer()).registerTypeAdapter(BlockPart.class, new BlockPart.Deserializer()).registerTypeAdapter(BlockPartFace.class, new BlockPartFace.Deserializer()).registerTypeAdapter(BlockFaceUV.class, new BlockFaceUV.Deserializer()).registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer()).registerTypeAdapter(ItemCameraTransforms.class, new ItemCameraTransforms.Deserializer()).registerTypeAdapter(ItemOverride.class, new ItemOverride.Deserializer()).create();
private final List<BlockPart> field_178314_g;
@@ -52,9 +53,10 @@
public BlockModel field_178315_d;
@Nullable
protected ResourceLocation field_178316_e;
+ public final net.minecraftforge.client.model.BlockModelConfiguration customData = new net.minecraftforge.client.model.BlockModelConfiguration(this);
public static BlockModel func_178307_a(Reader p_178307_0_) {
- return JSONUtils.func_193839_a(field_178319_a, p_178307_0_, BlockModel.class);
+ return JSONUtils.func_193839_a(net.minecraftforge.client.model.ModelLoaderRegistry2.ExpandedBlockModelDeserializer.INSTANCE, p_178307_0_, BlockModel.class);
}
public static BlockModel func_178294_a(String p_178294_0_) {
@@ -71,10 +73,15 @@
this.field_187968_k = p_i46573_7_;
}
+ @Deprecated
public List<BlockPart> func_178298_a() {
+ if (customData.hasCustomGeometry()) return java.util.Collections.emptyList();
return this.field_178314_g.isEmpty() && this.field_178315_d != null ? this.field_178315_d.func_178298_a() : this.field_178314_g;
}
@@ -10,7 +36,7 @@
public boolean func_178309_b() {
return this.field_178315_d != null ? this.field_178315_d.func_178309_b() : this.field_178322_i;
}
@@ -91,6 +94,10 @@
@@ -91,6 +98,10 @@
return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(p_217646_1_, p_217646_2_, p_217646_1_::func_209597_a, this.field_187968_k);
}
@@ -21,7 +47,17 @@
public Collection<ResourceLocation> func_187965_e() {
Set<ResourceLocation> set = Sets.newHashSet();
@@ -160,25 +167,33 @@
@@ -134,6 +145,9 @@
Set<ResourceLocation> set1 = Sets.newHashSet(new ResourceLocation(this.func_178308_c("particle")));
+ if(customData.hasCustomGeometry())
+ set1.addAll(customData.getTextureDependencies(p_209559_1_, p_209559_2_));
+ else
for(BlockPart blockpart : this.func_178298_a()) {
for(BlockPartFace blockpartface : blockpart.field_178240_c.values()) {
String s = this.func_178308_c(blockpartface.field_178242_d);
@@ -160,25 +174,36 @@
return set1;
}
@@ -29,8 +65,6 @@
- return this.func_217644_a(p_217641_1_, this, p_217641_2_, p_217641_3_);
+ // FORGE: Override our interface method, binary compatible
+ public IBakedModel bake(ModelBakery bakery, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, ISprite sprite, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT))
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
+ return this.bake(bakery, this, spriteGetter, sprite, format);
}
@@ -39,7 +73,12 @@
+ return bake(p_217644_1_, p_217644_2_, p_217644_3_, p_217644_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ public IBakedModel bake(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ public IBakedModel bake(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_, net.minecraft.client.renderer.vertex.VertexFormat format)
+ {
+ return net.minecraftforge.client.model.ModelLoaderRegistry2.bakeHelper(this, p_217644_1_, p_217644_2_, p_217644_3_, p_217644_4_, format);
+ }
+
+ public IBakedModel bakeVanilla(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
TextureAtlasSprite textureatlassprite = p_217644_3_.apply(new ResourceLocation(this.func_178308_c("particle")));
if (this.func_178310_f() == ModelBakery.field_177616_r) {
- return new BuiltInModel(this.func_181682_g(), this.func_217646_a(p_217644_1_, p_217644_2_), textureatlassprite);
@@ -61,7 +100,7 @@
}
}
}
@@ -191,6 +206,10 @@
@@ -191,6 +216,10 @@
return field_217647_g.func_217648_a(p_217645_0_.field_178241_a, p_217645_0_.field_178239_b, p_217645_1_, p_217645_2_, p_217645_3_, p_217645_4_, p_217645_0_.field_178237_d, p_217645_0_.field_178238_e);
}
@@ -72,3 +111,13 @@
public boolean func_178300_b(String p_178300_1_) {
return !MissingTextureSprite.func_195675_b().toString().equals(this.func_178308_c(p_178300_1_));
}
@@ -280,7 +309,8 @@
List<ItemOverride> list1 = this.func_187964_a(p_deserialize_3_, jsonobject);
ResourceLocation resourcelocation = s.isEmpty() ? null : new ResourceLocation(s);
- return new BlockModel(resourcelocation, list, map, flag, true, itemcameratransforms, list1);
+ boolean gui3d = JSONUtils.func_151209_a(jsonobject, "gui_3d", true);
+ return new BlockModel(resourcelocation, list, map, flag, gui3d, itemcameratransforms, list1);
}
protected List<ItemOverride> func_187964_a(JsonDeserializationContext p_187964_1_, JsonObject p_187964_2_) {
@@ -7,11 +7,11 @@
+ @Deprecated
public static BlockModelDefinition func_209577_a(BlockModelDefinition.ContainerHolder p_209577_0_, Reader p_209577_1_) {
- return JSONUtils.func_193839_a(p_209577_0_.field_209575_a, p_209577_1_, BlockModelDefinition.class);
+ return fromJson(p_209577_0_, p_209577_1_, null);
+ return fromJson(p_209577_0_, p_209577_1_, null, null, null);
}
+ public static BlockModelDefinition fromJson(BlockModelDefinition.ContainerHolder containerHolderIn, Reader readerIn, @Nullable net.minecraft.util.ResourceLocation location) {
+ return net.minecraftforge.client.model.BlockStateLoader.load(readerIn, location, containerHolderIn.field_209575_a);
+ public static BlockModelDefinition fromJson(BlockModelDefinition.ContainerHolder containerHolderIn, Reader readerIn, @Nullable net.minecraft.util.ResourceLocation location, @Nullable ModelBakery bakery, @Nullable java.util.function.BiConsumer<net.minecraft.util.ResourceLocation, IUnbakedModel> modelConsumer) {
+ return net.minecraftforge.client.model.BlockStateLoader.load(readerIn, location, containerHolderIn.field_209575_a, bakery, modelConsumer);
+ }
+
public BlockModelDefinition(Map<String, VariantList> p_i46572_1_, Multipart p_i46572_2_) {
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/renderer/model/ItemModelGenerator.java
+++ b/net/minecraft/client/renderer/model/ItemModelGenerator.java
@@ -35,6 +35,7 @@
map.put("particle", p_209579_2_.func_178300_b("particle") ? p_209579_2_.func_178308_c("particle") : map.get("layer0"));
BlockModel blockmodel = new BlockModel((ResourceLocation)null, list, map, false, false, p_209579_2_.func_181682_g(), p_209579_2_.func_187966_f());
blockmodel.field_178317_b = p_209579_2_.field_178317_b;
+ blockmodel.customData.copyFrom(p_209579_2_.customData);
return blockmodel;
}
@@ -8,8 +8,26 @@
+ private final Map<Triple<ResourceLocation, net.minecraftforge.common.model.IModelState, Boolean>, IBakedModel> field_217850_G = Maps.newHashMap();
private final Map<ResourceLocation, IUnbakedModel> field_217851_H = Maps.newHashMap();
private final Map<ResourceLocation, IBakedModel> field_217852_I = Maps.newHashMap();
private final AtlasTexture.SheetData field_217853_J;
@@ -142,12 +142,19 @@
private AtlasTexture.SheetData field_217853_J;
@@ -107,9 +107,17 @@
});
public ModelBakery(IResourceManager p_i51735_1_, AtlasTexture p_i51735_2_, BlockColors p_i51735_3_, IProfiler p_i51735_4_) {
+ this(p_i51735_1_, p_i51735_2_, p_i51735_3_, true);
+ processLoading(p_i51735_4_);
+ }
+
+ protected ModelBakery(IResourceManager p_i51735_1_, AtlasTexture p_i51735_2_, BlockColors p_i51735_3_, boolean vanillaBakery) {
this.field_177598_f = p_i51735_1_;
this.field_177609_j = p_i51735_2_;
this.field_225365_D = p_i51735_3_;
+ }
+
+ protected void processLoading(IProfiler p_i51735_4_) {
p_i51735_4_.func_76320_a("missing_model");
try {
@@ -142,12 +150,19 @@
p_i51735_4_.func_219895_b("special");
this.func_217843_a(new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
@@ -29,16 +47,16 @@
set.forEach((p_217833_0_) -> {
field_177603_c.warn("Unable to resolve texture reference: {}", (Object)p_217833_0_);
});
@@ -288,7 +295,7 @@
@@ -288,7 +303,7 @@
{
lvt_13_5_ = this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_217839_1_) -> {
try (InputStream inputstream = p_217839_1_.func_199027_b()) {
- Pair<String, BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8)));
+ Pair<String, BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_));
+ Pair<String, BlockModelDefinition> pair2 = Pair.of(p_217839_1_.func_199026_d(), BlockModelDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_, this, this::func_209593_a));
return pair2;
} catch (Exception exception1) {
throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_217839_1_.func_199029_a(), p_217839_1_.func_199026_d(), exception1.getMessage()));
@@ -404,7 +411,12 @@
@@ -404,7 +419,12 @@
@Nullable
public IBakedModel func_217845_a(ResourceLocation p_217845_1_, ISprite p_217845_2_) {
@@ -52,7 +70,7 @@
if (this.field_217850_G.containsKey(triple)) {
return this.field_217850_G.get(triple);
} else {
@@ -412,11 +424,11 @@
@@ -412,11 +432,11 @@
if (iunbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)iunbakedmodel;
if (blockmodel.func_178310_f() == field_177606_o) {
@@ -66,7 +84,7 @@
this.field_217850_G.put(triple, ibakedmodel);
return ibakedmodel;
}
@@ -471,6 +483,10 @@
@@ -471,6 +491,10 @@
return this.field_225367_M;
}
@@ -9,7 +9,18 @@
private final AtlasTexture field_174956_b;
private final BlockModelShapes field_174957_c;
private final BlockColors field_224743_d;
@@ -43,7 +43,7 @@
@@ -29,6 +29,10 @@
this.field_174957_c = new BlockModelShapes(this);
}
+ public IBakedModel getModel(ResourceLocation modelLocation) {
+ return this.field_174958_a.getOrDefault(modelLocation, this.field_174955_d);
+ }
+
public IBakedModel func_174953_a(ModelResourceLocation p_174953_1_) {
return this.field_174958_a.getOrDefault(p_174953_1_, this.field_174955_d);
}
@@ -43,7 +47,7 @@
protected ModelBakery func_212854_a_(IResourceManager p_212854_1_, IProfiler p_212854_2_) {
p_212854_2_.func_219894_a();
@@ -18,7 +29,7 @@
p_212854_2_.func_219897_b();
return modelbakery;
}
@@ -55,6 +55,7 @@
@@ -55,6 +59,7 @@
this.field_174958_a = p_212853_1_.func_217846_a();
this.field_224744_f = p_212853_1_.func_225354_b();
this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a);
@@ -26,7 +37,7 @@
p_212853_3_.func_219895_b("cache");
this.field_174957_c.func_178124_c();
p_212853_3_.func_76319_b();
@@ -78,4 +79,10 @@
@@ -78,4 +83,10 @@
return true;
}
}
@@ -1,8 +1,13 @@
--- a/net/minecraft/client/renderer/model/SimpleBakedModel.java
+++ b/net/minecraft/client/renderer/model/SimpleBakedModel.java
@@ -75,7 +75,7 @@
@@ -74,8 +74,12 @@
this(p_i46988_1_.func_178309_b(), p_i46988_1_.func_178311_c(), p_i46988_1_.func_181682_g(), p_i46988_2_);
}
+ public Builder(net.minecraftforge.client.model.IModelConfiguration model, ItemOverrideList overrides) {
+ this(model.useSmoothLighting(), model.isShadedInGui(), model.getCameraTransforms(), overrides);
+ }
+
public Builder(BlockState p_i48189_1_, IBakedModel p_i48189_2_, TextureAtlasSprite p_i48189_3_, Random p_i48189_4_, long p_i48189_5_) {
- this(p_i48189_2_.func_177555_b(), p_i48189_2_.func_177556_c(), p_i48189_2_.func_177552_f(), p_i48189_2_.func_188617_f());
+ this(p_i48189_2_.isAmbientOcclusion(p_i48189_1_), p_i48189_2_.func_177556_c(), p_i48189_2_.func_177552_f(), p_i48189_2_.func_188617_f());
@@ -9,7 +9,7 @@
private final ResourceLocation field_188050_a;
private final ModelRotation field_188051_b;
private final boolean field_188052_c;
@@ -30,10 +30,16 @@
@@ -30,6 +30,7 @@
return this.field_188050_a;
}
@@ -17,12 +17,3 @@
public ModelRotation func_188048_b() {
return this.field_188051_b;
}
+ @Override
+ public net.minecraftforge.common.model.IModelState getState() {
+ return this.field_188051_b;
+ }
+
public boolean func_188049_c() {
return this.field_188052_c;
}
@@ -0,0 +1,29 @@
--- a/net/minecraft/client/renderer/texture/NativeImage.java
+++ b/net/minecraft/client/renderer/texture/NativeImage.java
@@ -172,7 +172,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));
- } else if (p_195709_1_ <= this.field_195719_a && p_195709_2_ <= this.field_195720_b) {
+ } else if (p_195709_1_ >= 0 && p_195709_2_ >= 0 && p_195709_1_ < this.field_195719_a && p_195709_2_ < this.field_195720_b) { //Fix MC-162953 bounds checks in `NativeImage`
this.func_195696_g();
return MemoryUtil.memIntBuffer(this.field_195722_d, this.field_195723_e).get(p_195709_1_ + p_195709_2_ * this.field_195719_a);
} else {
@@ -183,7 +183,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));
- } else if (p_195700_1_ <= this.field_195719_a && p_195700_2_ <= this.field_195720_b) {
+ } else if (p_195700_1_ >= 0 && p_195700_2_ >= 0 && p_195700_1_ < this.field_195719_a && p_195700_2_ < this.field_195720_b) { //Fix MC-162953 bounds checks in `NativeImage`
this.func_195696_g();
MemoryUtil.memIntBuffer(this.field_195722_d, this.field_195723_e).put(p_195700_1_ + p_195700_2_ * this.field_195719_a, p_195700_3_);
} else {
@@ -194,7 +194,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));
- } else if (p_211675_1_ <= this.field_195719_a && p_211675_2_ <= this.field_195720_b) {
+ } else if (p_211675_1_ >= 0 && p_211675_2_ >= 0 && p_211675_1_ < this.field_195719_a && p_211675_2_ < this.field_195720_b) { //Fix MC-162953 bounds checks in `NativeImage`
return MemoryUtil.memByteBuffer(this.field_195722_d, this.field_195723_e).get((p_211675_1_ + p_211675_2_ * this.field_195719_a) * this.field_211680_b.func_211651_a() + this.field_211680_b.func_211647_v() / 8);
} else {
throw new IllegalArgumentException(String.format("(%s, %s) outside of image bounds (%s, %s)", p_211675_1_, p_211675_2_, this.field_195719_a, this.field_195720_b));
@@ -42,14 +42,25 @@
p_195667_3_[i].func_195706_a(i, this.field_110975_c >> i, this.field_110974_d >> i, p_195667_1_ >> i, p_195667_2_ >> i, this.field_130223_c >> i, this.field_130224_d >> i, this.field_195670_c.length > 1);
}
@@ -464,4 +471,10 @@
@@ -454,14 +461,21 @@
}
public int func_195665_a(int p_195665_1_, int p_195665_2_, int p_195665_3_, int p_195665_4_) {
+ if (this.field_195671_d == null || this.field_195672_e == null) return this.field_195670_c[p_195665_2_].func_195709_a(p_195665_3_, p_195665_4_); // FORGE: Avoid crash if the texture is not animated
return this.field_195670_c[p_195665_2_].func_195709_a(p_195665_3_ + (this.field_195671_d[p_195665_1_] * this.field_130223_c >> p_195665_2_), p_195665_4_ + (this.field_195672_e[p_195665_1_] * this.field_130224_d >> p_195665_2_));
}
public boolean func_195662_a(int p_195662_1_, int p_195662_2_, int p_195662_3_) {
+ if (this.field_195671_d == null || this.field_195672_e == null) return (this.field_195670_c[0].func_195709_a(p_195662_2_, p_195662_3_) >> 24 & 255) == 0; // FORGE: Avoid crash if the texture is not animated
return (this.field_195670_c[0].func_195709_a(p_195662_2_ + this.field_195671_d[p_195662_1_] * this.field_130223_c, p_195662_3_ + this.field_195672_e[p_195662_1_] * this.field_130224_d) >> 24 & 255) == 0;
}
public void func_195663_q() {
this.func_195659_d(0);
}
+
+
+ // 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] * this.field_130223_c, y + this.field_195672_e[frameIndex] * this.field_130224_d);
+ return this.func_195665_a(frameIndex, 0, x, y);
+ }
}
@@ -0,0 +1,47 @@
--- a/net/minecraft/client/shader/Framebuffer.java
+++ b/net/minecraft/client/shader/Framebuffer.java
@@ -95,8 +95,14 @@
GLX.glFramebufferTexture2D(GLX.GL_FRAMEBUFFER, GLX.GL_COLOR_ATTACHMENT0, 3553, this.field_147617_g, 0);
if (this.field_147619_e) {
GLX.glBindRenderbuffer(GLX.GL_RENDERBUFFER, this.field_147624_h);
+ if (!stencilEnabled) {
GLX.glRenderbufferStorage(GLX.GL_RENDERBUFFER, 33190, this.field_147622_a, this.field_147620_b);
GLX.glFramebufferRenderbuffer(GLX.GL_FRAMEBUFFER, GLX.GL_DEPTH_ATTACHMENT, GLX.GL_RENDERBUFFER, this.field_147624_h);
+ } else {
+ GLX.glRenderbufferStorage(GLX.GL_RENDERBUFFER, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b);
+ GLX.glFramebufferRenderbuffer(GLX.GL_FRAMEBUFFER, GLX.GL_DEPTH_ATTACHMENT, GLX.GL_RENDERBUFFER, this.field_147624_h);
+ GLX.glFramebufferRenderbuffer(GLX.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, GLX.GL_RENDERBUFFER, this.field_147624_h);
+ }
}
this.func_147611_b();
@@ -229,4 +235,29 @@
GlStateManager.clear(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 whether or not this FBO has been successfully initialised with stencil bits.
+ * If not, and a modder wishes it to be, they must call enableStencil.
+ */
+ public boolean isStencilEnabled()
+ {
+ return this.stencilEnabled;
+ }
+ /*================================ FORGE END ================================================*/
}
@@ -0,0 +1,47 @@
--- a/net/minecraft/data/LootTableProvider.java
+++ b/net/minecraft/data/LootTableProvider.java
@@ -42,7 +42,7 @@
public void func_200398_a(DirectoryCache p_200398_1_) {
Path path = this.field_218443_d.func_200391_b();
Map<ResourceLocation, LootTable> map = Maps.newHashMap();
- this.field_218444_e.forEach((p_218438_1_) -> {
+ this.getTables().forEach((p_218438_1_) -> {
p_218438_1_.getFirst().get().accept((p_218437_2_, p_218437_3_) -> {
if (map.put(p_218437_2_, p_218437_3_.func_216039_a(p_218438_1_.getSecond()).func_216038_b()) != null) {
throw new IllegalStateException("Duplicate loot table " + p_218437_2_);
@@ -51,13 +51,8 @@
});
ValidationResults validationresults = new ValidationResults();
- for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) {
- validationresults.func_216105_a("Missing built-in table: " + resourcelocation);
- }
+ validate(map, validationresults);
- map.forEach((p_218436_2_, p_218436_3_) -> {
- LootTableManager.func_215302_a(validationresults, p_218436_2_, p_218436_3_, map::get);
- });
Multimap<String, String> multimap = validationresults.func_216106_a();
if (!multimap.isEmpty()) {
multimap.forEach((p_218435_0_, p_218435_1_) -> {
@@ -78,6 +73,20 @@
}
}
+ protected List<Pair<Supplier<Consumer<BiConsumer<ResourceLocation, LootTable.Builder>>>, LootParameterSet>> getTables() {
+ return field_218444_e;
+ }
+
+ protected void validate(Map<ResourceLocation, LootTable> map, ValidationResults validationresults) {
+ for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) {
+ validationresults.func_216105_a("Missing built-in table: " + resourcelocation);
+ }
+
+ map.forEach((p_218436_2_, p_218436_3_) -> {
+ LootTableManager.func_215302_a(validationresults, p_218436_2_, p_218436_3_, map::get);
+ });
+ }
+
private static Path func_218439_a(Path p_218439_0_, ResourceLocation p_218439_1_) {
return p_218439_0_.resolve("data/" + p_218439_1_.func_110624_b() + "/loot_tables/" + p_218439_1_.func_110623_a() + ".json");
}
@@ -7,10 +7,11 @@
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -21,8 +22,10 @@
@@ -21,8 +22,11 @@
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<File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")).required();
+ OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
OptionSet optionset = optionparser.parse(p_main_0_);
@@ -19,7 +20,7 @@
Path path = Paths.get(optionspec7.value(optionset));
boolean flag = optionset.has(optionspec6);
boolean flag1 = flag || optionset.has(optionspec2);
@@ -30,10 +33,11 @@
@@ -30,10 +34,12 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
@@ -28,8 +29,9 @@
- }).collect(Collectors.toList()), flag1, flag2, flag3, flag4, flag5);
- datagenerator.func_200392_c();
+ Collection<Path> inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList());
+ 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, flag2, flag1, flag3, flag4, flag5);
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5);
+ if (mods.contains("minecraft") || mods.isEmpty())
+ func_200264_a(mods.isEmpty() ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
} else {
@@ -0,0 +1,37 @@
--- a/net/minecraft/data/loot/BlockLootTables.java
+++ b/net/minecraft/data/loot/BlockLootTables.java
@@ -188,7 +188,7 @@
return LootTable.func_216119_b();
}
- public void accept(BiConsumer<ResourceLocation, LootTable.Builder> p_accept_1_) {
+ protected void addTables() {
this.func_218492_c(Blocks.field_196650_c);
this.func_218492_c(Blocks.field_196652_d);
this.func_218492_c(Blocks.field_196654_e);
@@ -962,9 +962,13 @@
this.func_218507_a(Blocks.field_196713_dt, func_218482_a());
this.func_218507_a(Blocks.field_185778_de, func_218482_a());
this.func_218507_a(Blocks.field_150474_ac, func_218482_a());
+ }
+
+ public void accept(BiConsumer<ResourceLocation, LootTable.Builder> p_accept_1_) {
+ this.addTables();
Set<ResourceLocation> set = Sets.newHashSet();
- for(Block block : Registry.field_212618_g) {
+ for(Block block : getKnownBlocks()) {
ResourceLocation resourcelocation = block.func_220068_i();
if (resourcelocation != LootTables.field_186419_a && set.add(resourcelocation)) {
LootTable.Builder loottable$builder = this.field_218581_i.remove(resourcelocation);
@@ -981,6 +985,10 @@
}
}
+ protected Iterable<Block> getKnownBlocks() {
+ return Registry.field_212618_g;
+ }
+
public void func_218547_a(Block p_218547_1_) {
this.func_218522_a(p_218547_1_, (p_218524_0_) -> {
return func_218523_c(((FlowerPotBlock)p_218524_0_).func_220276_d());
@@ -0,0 +1,49 @@
--- a/net/minecraft/data/loot/EntityLootTables.java
+++ b/net/minecraft/data/loot/EntityLootTables.java
@@ -51,7 +51,7 @@
return LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(p_218583_0_))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(TableLootEntry.func_216171_a(EntityType.field_200737_ac.func_220348_g())));
}
- public void accept(BiConsumer<ResourceLocation, LootTable.Builder> p_accept_1_) {
+ protected void addTables() {
this.func_218582_a(EntityType.field_200789_c, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_200791_e, LootTable.func_216119_b());
this.func_218582_a(EntityType.field_200792_f, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151072_bj).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 1.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F)))).func_212840_b_(KilledByPlayer.func_215994_b())));
@@ -136,8 +136,12 @@
this.func_218582_a(EntityType.field_200726_aE, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151078_bh).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 2.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))));
this.func_218582_a(EntityType.field_200785_Y, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151078_bh).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 1.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151074_bl).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 1.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151043_k)).func_212840_b_(KilledByPlayer.func_215994_b()).func_212840_b_(RandomChanceWithLooting.func_216003_a(0.025F, 0.01F))));
this.func_218582_a(EntityType.field_200727_aF, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151078_bh).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 2.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151042_j)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151172_bF)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151174_bG)).func_212840_b_(KilledByPlayer.func_215994_b()).func_212840_b_(RandomChanceWithLooting.func_216003_a(0.025F, 0.01F))));
+ }
+
+ public void accept(BiConsumer<ResourceLocation, LootTable.Builder> p_accept_1_) {
+ this.addTables();
Set<ResourceLocation> set = Sets.newHashSet();
- Iterator iterator = Registry.field_212629_r.iterator();
+ Iterator iterator = getKnownEntities().iterator();
EntityType<?> entitytype;
ResourceLocation resourcelocation;
@@ -149,7 +153,7 @@
entitytype = (EntityType)iterator.next();
resourcelocation = entitytype.func_220348_g();
- if (!field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC) {
+ if (isNonLiving(entitytype)) {
if (resourcelocation != LootTables.field_186419_a && this.field_218587_b.remove(resourcelocation) != null) {
break;
}
@@ -166,6 +170,14 @@
throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.field_212629_r.func_177774_c(entitytype)));
}
+ protected Iterable<EntityType<?>> getKnownEntities() {
+ return Registry.field_212629_r;
+ }
+
+ protected boolean isNonLiving(EntityType<?> entitytype) {
+ return !field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC;
+ }
+
protected void func_218582_a(EntityType<?> p_218582_1_, LootTable.Builder p_218582_2_) {
this.func_218585_a(p_218582_1_.func_220348_g(), p_218582_2_);
}
@@ -1,6 +1,40 @@
--- a/net/minecraft/dispenser/IDispenseItemBehavior.java
+++ b/net/minecraft/dispenser/IDispenseItemBehavior.java
@@ -370,15 +370,23 @@
@@ -55,6 +55,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_;
};
@@ -155,7 +156,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_;
}
@@ -270,8 +276,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)));
- } else if (blockstate.func_177230_c() instanceof TNTBlock) {
- TNTBlock.func_196534_a(world, blockpos);
+ } else if (blockstate.isFlammable(world, blockpos, p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a).func_176734_d())) {
+ blockstate.catchFire(world, blockpos, p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a).func_176734_d(), null);
+ if (blockstate.func_177230_c() instanceof TNTBlock)
world.func_217377_a(blockpos, false);
} else {
this.field_218407_b = false;
@@ -370,15 +377,23 @@
}
DispenserBlock.func_199774_a(Items.field_151097_aZ.func_199767_j(), new OptionalDispenseBehavior() {
@@ -109,7 +109,7 @@
if (!p_180429_2_.func_185904_a().func_76224_d()) {
BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a());
- SoundType soundtype = blockstate.func_177230_c() == Blocks.field_150433_aE ? blockstate.func_215695_r() : p_180429_2_.func_215695_r();
+ SoundType soundtype = blockstate.func_177230_c() == Blocks.field_150433_aE ? blockstate.func_215695_r() : p_180429_2_.getSoundType(field_70170_p, p_180429_1_, this);
+ SoundType soundtype = blockstate.func_177230_c() == Blocks.field_150433_aE ? blockstate.getSoundType(field_70170_p, p_180429_1_, this) : p_180429_2_.getSoundType(field_70170_p, p_180429_1_, this);
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -85,7 +85,7 @@
}
+ public T customClientSpawn(net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity packet, World world) {
+ if (customClientFactory == null) throw new RuntimeException("Missing custom spawn data for entity type "+this);
+ if (customClientFactory == null) return this.func_200721_a(world);
+ return customClientFactory.apply(packet, world);
+ }
+
@@ -111,7 +111,7 @@
private boolean field_225436_f;
private EntitySize field_220326_f = EntitySize.func_220314_b(0.6F, 1.8F);
@@ -553,11 +591,31 @@
@@ -553,11 +591,35 @@
return this;
}
@@ -130,6 +130,10 @@
+ return this;
+ }
+
+ /**
+ * By default, entities are spawned clientside via {@link EntityType#create(World)}.
+ * If you need finer control over the spawning process, use this to get read access to the spawn packet.
+ */
+ public EntityType.Builder<T> setCustomClientFactory(java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory) {
+ this.customClientFactory = customClientFactory;
+ return this;
@@ -144,7 +148,7 @@
if (SharedConstants.field_206244_b) {
throw illegalstateexception;
}
@@ -566,7 +624,7 @@
@@ -566,7 +628,7 @@
}
}
@@ -194,7 +194,17 @@
}
protected void func_213337_cE() {
@@ -1157,6 +1182,9 @@
@@ -1144,7 +1169,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_) {
@@ -1157,6 +1183,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -204,7 +214,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();
@@ -1192,12 +1220,7 @@
@@ -1192,12 +1221,7 @@
return false;
} else {
BlockState blockstate = this.func_213339_cH();
@@ -218,7 +228,7 @@
}
}
@@ -1221,6 +1244,9 @@
@@ -1221,6 +1245,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -228,7 +238,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
EffectInstance effectinstance = this.func_70660_b(Effects.field_76430_j);
float f = effectinstance == null ? 0.0F : (float)(effectinstance.func_76458_c() + 1);
@@ -1233,7 +1259,7 @@
@@ -1233,7 +1260,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!blockstate.func_196958_f()) {
@@ -237,7 +247,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1302,6 +1328,8 @@
@@ -1302,6 +1329,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -246,7 +256,7 @@
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f = p_70665_2_;
@@ -1312,10 +1340,11 @@
@@ -1312,10 +1341,11 @@
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f1 * 10.0F));
}
@@ -259,7 +269,7 @@
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1357,6 +1386,8 @@
@@ -1357,6 +1387,8 @@
}
public void func_184609_a(Hand p_184609_1_) {
@@ -268,7 +278,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;
@@ -1715,15 +1746,16 @@
@@ -1715,15 +1747,16 @@
}
this.field_70160_al = true;
@@ -287,7 +297,7 @@
}
protected float func_189749_co() {
@@ -1733,11 +1765,15 @@
@@ -1733,11 +1766,15 @@
public void func_213352_e(Vec3d p_213352_1_) {
if (this.func_70613_aW() || this.func_184186_bw()) {
double d0 = 0.08D;
@@ -304,7 +314,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) {
@@ -1786,7 +1822,7 @@
@@ -1786,7 +1823,7 @@
}
} else {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v);
@@ -313,7 +323,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()));
@@ -1848,6 +1884,7 @@
@@ -1848,6 +1885,7 @@
f = 0.96F;
}
@@ -321,7 +331,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();
@@ -1923,6 +1960,7 @@
@@ -1923,6 +1961,7 @@
}
public void func_70071_h_() {
@@ -329,7 +339,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1954,7 +1992,9 @@
@@ -1954,7 +1993,9 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -339,7 +349,7 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype));
}
@@ -2403,13 +2443,22 @@
@@ -2403,13 +2444,22 @@
private void func_184608_ct() {
if (this.func_184587_cr()) {
@@ -364,7 +374,7 @@
this.func_71036_o();
}
} else {
@@ -2443,8 +2492,10 @@
@@ -2443,8 +2493,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()) {
@@ -376,7 +386,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);
@@ -2504,6 +2555,9 @@
@@ -2504,6 +2556,9 @@
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
@@ -386,7 +396,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);
}
@@ -2512,7 +2566,9 @@
@@ -2512,7 +2567,9 @@
protected void func_71036_o() {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_184584_a(this.field_184627_bm, 16);
@@ -397,7 +407,7 @@
this.func_184602_cy();
}
@@ -2532,7 +2588,11 @@
@@ -2532,7 +2589,11 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -409,7 +419,7 @@
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
}
@@ -2687,16 +2747,16 @@
@@ -2687,16 +2748,16 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_213347_1_) -> {
@@ -430,7 +440,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);
});
@@ -2711,8 +2771,13 @@
@@ -2711,8 +2772,13 @@
@Nullable
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
@@ -445,7 +455,7 @@
}
public boolean func_70094_T() {
@@ -2779,4 +2844,58 @@
@@ -2779,4 +2845,58 @@
public void func_213334_d(Hand p_213334_1_) {
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}
@@ -31,15 +31,18 @@
}
public double func_70042_X() {
@@ -214,7 +216,7 @@
@@ -214,9 +216,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 {
@@ -241,8 +243,11 @@
}
@@ -98,7 +101,13 @@
}
}
@@ -299,24 +313,24 @@
@@ -294,29 +308,29 @@
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;
}
@@ -239,7 +248,7 @@
+ public void moveMinecartOnRail(BlockPos pos) { //Non-default because getMaximumSpeed is protected
+ AbstractMinecartEntity mc = getMinecart();
+ double d21 = mc.func_184207_aI() ? 0.75D : 1.0D;
+ double d22 = mc.func_174898_m();
+ double d22 = mc.getMaxSpeedWithRail();
+ Vec3d vec3d1 = mc.func_213322_ci();
+ mc.func_213315_a(MoverType.SELF, new Vec3d(MathHelper.func_151237_a(d21 * vec3d1.field_72450_a, -d22, d22), 0.0D, MathHelper.func_151237_a(d21 * vec3d1.field_72449_c, -d22, d22)));
+ }
@@ -1,6 +1,19 @@
--- a/net/minecraft/entity/passive/FoxEntity.java
+++ b/net/minecraft/entity/passive/FoxEntity.java
@@ -767,7 +767,7 @@
@@ -573,9 +573,10 @@
}
}
- BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double)this.field_70126_B, this.field_70161_v));
+ BlockPos pos = new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double)this.field_70126_B, this.field_70161_v);
+ BlockState blockstate = this.field_70170_p.func_180495_p(pos);
if (!blockstate.func_196958_f() && !this.func_174814_R()) {
- SoundType soundtype = blockstate.func_215695_r();
+ SoundType soundtype = blockstate.getSoundType(field_70170_p, pos, this);
this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, soundtype.func_185844_d(), this.func_184176_by(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
@@ -767,7 +768,7 @@
}
protected void func_220730_m() {
@@ -42,7 +42,7 @@
+ }
+ this.field_70170_p.func_217376_c(entitycow);
+ for(int i = 0; i < 5; ++i) {
+ ret.add(new ItemStack(Blocks.field_150337_Q));
+ ret.add(new ItemStack(this.func_213444_dV().field_221099_d.func_177230_c()));
+ }
+ this.func_184185_a(SoundEvents.field_187784_dt, 1.0F, 1.0F);
+ }
@@ -26,7 +26,7 @@
public void func_213612_dV() {
if (!this.field_70170_p.field_72995_K) {
this.func_70893_e(true);
@@ -353,4 +354,23 @@
@@ -353,4 +354,24 @@
protected float func_213348_b(Pose p_213348_1_, EntitySize p_213348_2_) {
return 0.95F * p_213348_2_.field_220316_b;
}
@@ -47,6 +47,7 @@
+ ret.add(new ItemStack(field_200206_bz.get(this.func_175509_cj())));
+ }
+ }
+ this.func_184185_a(SoundEvents.field_187763_eJ, 1.0F, 1.0F);
+ return ret;
+ }
}
@@ -1,6 +1,19 @@
--- a/net/minecraft/entity/passive/horse/AbstractHorseEntity.java
+++ b/net/minecraft/entity/passive/horse/AbstractHorseEntity.java
@@ -260,6 +260,7 @@
@@ -230,9 +230,10 @@
}
}
- BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double)this.field_70126_B, this.field_70161_v));
+ BlockPos pos = new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double) this.field_70126_B, this.field_70161_v);
+ BlockState blockstate = this.field_70170_p.func_180495_p(pos);
if (!blockstate.func_196958_f() && !this.func_174814_R()) {
- SoundType soundtype = blockstate.func_215695_r();
+ SoundType soundtype = blockstate.getSoundType(field_70170_p, pos, this);
this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, soundtype.func_185844_d(), this.func_184176_by(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
@@ -260,6 +261,7 @@
this.field_110296_bG.func_110134_a(this);
this.func_110232_cE();
@@ -8,7 +21,19 @@
}
protected void func_110232_cE() {
@@ -944,4 +945,22 @@
@@ -321,9 +323,9 @@
protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) {
if (!p_180429_2_.func_185904_a().func_76224_d()) {
BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a());
- SoundType soundtype = p_180429_2_.func_215695_r();
+ SoundType soundtype = p_180429_2_.getSoundType(field_70170_p, p_180429_1_, this);
if (blockstate.func_177230_c() == Blocks.field_150433_aE) {
- soundtype = blockstate.func_215695_r();
+ soundtype = blockstate.getSoundType(field_70170_p, p_180429_1_, this);
}
if (this.func_184207_aI() && this.field_190688_bE) {
@@ -944,4 +946,22 @@
return p_213386_4_;
}
@@ -0,0 +1,15 @@
--- a/net/minecraft/entity/passive/horse/LlamaEntity.java
+++ b/net/minecraft/entity/passive/horse/LlamaEntity.java
@@ -364,9 +364,10 @@
}
}
- BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double)this.field_70126_B, this.field_70161_v));
+ BlockPos pos = new BlockPos(this.field_70165_t, this.field_70163_u - 0.2D - (double)this.field_70126_B, this.field_70161_v);
+ BlockState blockstate = this.field_70170_p.func_180495_p(pos);
if (!blockstate.func_196958_f() && !this.func_174814_R()) {
- SoundType soundtype = blockstate.func_215695_r();
+ SoundType soundtype = blockstate.getSoundType(field_70170_p, pos, this);
this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, soundtype.func_185844_d(), this.func_184176_by(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
@@ -425,7 +425,38 @@
}
}
@@ -1703,7 +1818,10 @@
@@ -1462,6 +1577,10 @@
}
public void func_195068_e(int p_195068_1_) {
+ net.minecraftforge.event.entity.player.PlayerXpEvent.XpChange event = new net.minecraftforge.event.entity.player.PlayerXpEvent.XpChange(this, p_195068_1_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
+ p_195068_1_ = event.getAmount();
+
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);
@@ -1490,7 +1609,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;
@@ -1501,6 +1620,10 @@
}
public void func_82242_a(int p_82242_1_) {
+ net.minecraftforge.event.entity.player.PlayerXpEvent.LevelChange event = new net.minecraftforge.event.entity.player.PlayerXpEvent.LevelChange(this, p_82242_1_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
+ p_82242_1_ = event.getLevels();
+
this.field_71068_ca += p_82242_1_;
if (this.field_71068_ca < 0) {
this.field_71068_ca = 0;
@@ -1703,7 +1826,10 @@
}
public ITextComponent func_145748_c_() {
@@ -437,7 +468,7 @@
return this.func_208016_c(itextcomponent);
}
@@ -1939,4 +2057,44 @@
@@ -1939,4 +2065,44 @@
return this.field_221260_g;
}
}
@@ -17,7 +17,7 @@
BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v);
BlockState blockstate = Blocks.field_222388_bz.func_176223_P();
if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) {
@@ -568,8 +569,10 @@
@@ -568,13 +569,15 @@
return this.field_71133_b.func_71219_W();
}
@@ -28,7 +28,18 @@
this.field_184851_cj = true;
DimensionType dimensiontype = this.field_71093_bK;
if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
@@ -591,8 +594,8 @@
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));
@@ -587,12 +590,13 @@
this.field_71093_bK = p_212321_1_;
ServerWorld serverworld1 = this.field_71133_b.func_71218_a(p_212321_1_);
WorldInfo worldinfo = this.field_70170_p.func_72912_H();
+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(this.field_71135_a.field_147371_a, this);
this.field_71135_a.func_147359_a(new SRespawnPacket(p_212321_1_, worldinfo.func_76067_t(), this.field_71134_c.func_73081_b()));
this.field_71135_a.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
PlayerList playerlist = this.field_71133_b.func_184103_al();
playerlist.func_187243_f(this);
@@ -39,7 +50,7 @@
double d0 = this.field_70165_t;
double d1 = this.field_70163_u;
double d2 = this.field_70161_v;
@@ -601,13 +604,11 @@
@@ -601,13 +605,11 @@
double d3 = 8.0D;
float f2 = f1;
serverworld.func_217381_Z().func_76320_a("moving");
@@ -56,7 +67,7 @@
} 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();
@@ -671,6 +672,7 @@
@@ -671,6 +673,7 @@
this.field_71144_ck = -1;
this.field_71149_ch = -1.0F;
this.field_71146_ci = -1;
@@ -64,7 +75,7 @@
return this;
}
}
@@ -776,11 +778,11 @@
@@ -776,11 +779,11 @@
BlockPos blockpos = new BlockPos(i, j, k);
if (this.field_70170_p.func_175667_e(blockpos)) {
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -78,7 +89,7 @@
blockpos = blockpos1;
blockstate = blockstate1;
}
@@ -819,6 +821,7 @@
@@ -819,6 +822,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;
@@ -86,7 +97,7 @@
return OptionalInt.of(this.field_71139_cq);
}
}
@@ -837,6 +840,7 @@
@@ -837,6 +841,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);
@@ -94,7 +105,7 @@
}
public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) {
@@ -894,6 +898,7 @@
@@ -894,6 +899,7 @@
public void func_71128_l() {
this.field_71070_bA.func_75134_a(this);
@@ -102,7 +113,7 @@
this.field_71070_bA = this.field_71069_bz;
}
@@ -1020,6 +1025,20 @@
@@ -1020,6 +1026,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());
@@ -123,7 +134,7 @@
}
protected void func_70670_a(EffectInstance p_70670_1_) {
@@ -1242,15 +1261,15 @@
@@ -1242,15 +1262,16 @@
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_);
@@ -132,6 +143,7 @@
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();
+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(this.field_71135_a.field_147371_a, this);
this.field_71135_a.func_147359_a(new SRespawnPacket(this.field_71093_bK, worldinfo.func_76067_t(), this.field_71134_c.func_73081_b()));
this.field_71135_a.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
this.field_71133_b.func_184103_al().func_187243_f(this);
@@ -142,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);
@@ -1259,6 +1278,7 @@
@@ -1259,6 +1280,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, serverworld.field_73011_w.func_186058_p(), this.field_71093_bK);
}
}
@@ -1293,6 +1313,8 @@
@@ -1293,6 +1315,8 @@
if (itementity == null) {
return null;
} else {
@@ -14,7 +14,7 @@
}
- if (raytraceresult != null && !flag) {
+ if (raytraceresult != null && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
+ if (raytraceresult != null && raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
this.func_184549_a(raytraceresult);
this.field_70160_al = true;
}
@@ -5,7 +5,7 @@
return !p_213879_1_.func_175149_v() && p_213879_1_ != this.field_190539_a;
}, RayTraceContext.BlockMode.OUTLINE, true);
- if (raytraceresult != null) {
+ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
+ if (raytraceresult != null && raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
this.func_190536_a(raytraceresult);
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/projectile/ProjectileHelper.java
+++ b/net/minecraft/entity/projectile/ProjectileHelper.java
@@ -89,7 +89,7 @@
Vec3d vec3d1 = optional.get();
double d1 = p_221273_1_.func_72436_e(vec3d1);
if (d1 < d0 || d0 == 0.0D) {
- if (entity1.func_184208_bv() == p_221273_0_.func_184208_bv()) {
+ if (entity1.func_184208_bv() == p_221273_0_.func_184208_bv() && !entity1.canRiderInteract()) {
if (d0 == 0.0D) {
entity = entity1;
vec3d = vec3d1;
@@ -0,0 +1,11 @@
--- a/net/minecraft/inventory/container/StonecutterContainer.java
+++ b/net/minecraft/inventory/container/StonecutterContainer.java
@@ -183,7 +183,7 @@
if (!this.func_75135_a(itemstack1, 2, 38, false)) {
return ItemStack.field_190927_a;
}
- } else if (field_217084_c.contains(item)) {
+ } else if (!this.field_217090_i.func_199532_z().func_215370_b(IRecipeType.field_222154_f, new Inventory(itemstack1), this.field_217090_i).isEmpty()) {
if (!this.func_75135_a(itemstack1, 0, 1, false)) {
return ItemStack.field_190927_a;
}
@@ -1,15 +1,34 @@
--- a/net/minecraft/item/BlockItem.java
+++ b/net/minecraft/item/BlockItem.java
@@ -69,7 +69,7 @@
@@ -69,8 +69,8 @@
}
}
- SoundType soundtype = blockstate1.func_215695_r();
- world.func_184133_a(playerentity, blockpos, this.func_219983_a(blockstate1), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F);
+ SoundType soundtype = blockstate1.getSoundType(world, blockpos, p_195942_1_.func_195999_j());
world.func_184133_a(playerentity, blockpos, this.func_219983_a(blockstate1), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F);
+ world.func_184133_a(playerentity, blockpos, this.getPlaceSound(blockstate1, world, blockpos, p_195942_1_.func_195999_j()), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F);
itemstack.func_190918_g(1);
return ActionResultType.SUCCESS;
@@ -189,10 +189,18 @@
}
@@ -78,10 +78,16 @@
}
}
+ @Deprecated //Forge: Use more sensitive version {@link BlockItem#getPlaceSound(BlockState, IBlockReader, BlockPos, Entity) }
protected SoundEvent func_219983_a(BlockState p_219983_1_) {
return p_219983_1_.func_215695_r().func_185841_e();
}
+ //Forge: Sensitive version of BlockItem#getPlaceSound
+ protected SoundEvent getPlaceSound(BlockState state, World world, BlockPos pos, PlayerEntity entity) {
+ return state.getSoundType(world, pos, entity).func_185841_e();
+ }
+
@Nullable
public BlockItemUseContext func_219984_b(BlockItemUseContext p_219984_1_) {
return p_219984_1_;
@@ -189,10 +195,18 @@
}
public Block func_179223_d() {
@@ -27,7 +27,18 @@
if (blockstate.func_177230_c() instanceof IGrowable) {
IGrowable igrowable = (IGrowable)blockstate.func_177230_c();
if (igrowable.func_176473_a(p_195966_1_, p_195966_2_, blockstate, p_195966_1_.field_72995_K)) {
@@ -124,7 +133,7 @@
@@ -84,7 +93,9 @@
}
}
- if (biome == Biomes.field_203614_T || biome == Biomes.field_203617_W) {
+ // FORGE: Use BiomeDictionary here to allow modded warm ocean biomes to spawn coral from bonemeal
+ if (net.minecraftforge.common.BiomeDictionary.hasType(biome, net.minecraftforge.common.BiomeDictionary.Type.OCEAN)
+ && net.minecraftforge.common.BiomeDictionary.hasType(biome, net.minecraftforge.common.BiomeDictionary.Type.HOT)) {
if (i == 0 && p_203173_3_ != null && p_203173_3_.func_176740_k().func_176722_c()) {
blockstate = BlockTags.field_211922_B.func_205596_a(p_203173_1_.field_73012_v).func_176223_P().func_206870_a(DeadCoralWallFanBlock.field_211884_b, p_203173_3_);
} else if (field_77697_d.nextInt(4) == 0) {
@@ -124,7 +135,7 @@
}
BlockState blockstate = p_195965_0_.func_180495_p(p_195965_1_);
@@ -41,7 +41,35 @@
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()));
@@ -147,7 +164,19 @@
@@ -65,7 +82,7 @@
return new ActionResult<>(ActionResultType.FAIL, itemstack);
} else {
BlockState blockstate = p_77659_1_.func_180495_p(blockpos);
- BlockPos blockpos1 = blockstate.func_177230_c() instanceof ILiquidContainer && this.field_77876_a == Fluids.field_204546_a ? blockpos : blockraytraceresult.func_216350_a().func_177972_a(blockraytraceresult.func_216354_b());
+ BlockPos blockpos1 = canBlockContainFluid(p_77659_1_, blockpos, blockstate) ? blockpos : blockraytraceresult.func_216350_a().func_177972_a(blockraytraceresult.func_216354_b());
if (this.func_180616_a(p_77659_2_, p_77659_1_, blockpos1, blockraytraceresult)) {
this.func_203792_a(p_77659_1_, itemstack, blockpos1);
if (p_77659_2_ instanceof ServerPlayerEntity) {
@@ -116,7 +133,8 @@
Material material = blockstate.func_185904_a();
boolean flag = !material.func_76220_a();
boolean flag1 = material.func_76222_j();
- if (p_180616_2_.func_175623_d(p_180616_3_) || flag || flag1 || 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 (p_180616_2_.func_175623_d(p_180616_3_) || flag || flag1 || 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();
@@ -126,7 +144,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_);
}
@@ -147,7 +165,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);
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/item/DyeColor.java
+++ b/net/minecraft/item/DyeColor.java
@@ -43,6 +43,7 @@
@@ -41,6 +41,7 @@
private final int field_196066_w;
private final float[] field_193352_x;
private final int field_196067_y;
@@ -8,19 +8,23 @@
private final int field_218390_z;
private DyeColor(int p_i50049_3_, String p_i50049_4_, int p_i50049_5_, MaterialColor p_i50049_6_, int p_i50049_7_, int p_i50049_8_) {
@@ -55,6 +56,7 @@
@@ -53,6 +54,7 @@
int j = (p_i50049_5_ & '\uff00') >> 8;
int k = (p_i50049_5_ & 255) >> 0;
this.field_196066_w = k << 16 | j << 8 | i << 0;
+ this.tag = new net.minecraft.tags.ItemTags.Wrapper(new net.minecraft.util.ResourceLocation("minecraft", "dyes_" + p_i50049_4_));
+ this.tag = new net.minecraft.tags.ItemTags.Wrapper(new net.minecraft.util.ResourceLocation("forge", "dyes/" + p_i50049_4_));
this.field_193352_x = new float[]{(float)i / 255.0F, (float)j / 255.0F, (float)k / 255.0F};
this.field_196067_y = p_i50049_7_;
}
@@ -120,4 +122,21 @@
@@ -115,4 +117,25 @@
public String func_176610_l() {
return this.field_176785_v;
}
+
+ public int getColorValue() {
+ return field_193351_w;
+ }
+
+ public net.minecraft.tags.Tag<Item> getTag() {
+ return tag;
+ }
@@ -0,0 +1,32 @@
--- a/net/minecraft/item/FishBucketItem.java
+++ b/net/minecraft/item/FishBucketItem.java
@@ -25,11 +25,19 @@
public class FishBucketItem extends BucketItem {
private final EntityType<?> field_203794_a;
+ @Deprecated
public FishBucketItem(EntityType<?> p_i49022_1_, Fluid p_i49022_2_, Item.Properties p_i49022_3_) {
super(p_i49022_2_, p_i49022_3_);
this.field_203794_a = p_i49022_1_;
+ this.fishTypeSupplier = () -> p_i49022_1_;
}
+ public FishBucketItem(java.util.function.Supplier<? extends EntityType<?>> fishTypeIn, java.util.function.Supplier<? extends Fluid> p_i49022_2_, Item.Properties builder) {
+ super(p_i49022_2_, builder);
+ this.field_203794_a = null;
+ this.fishTypeSupplier = fishTypeIn;
+ }
+
public void func_203792_a(World p_203792_1_, ItemStack p_203792_2_, BlockPos p_203792_3_) {
if (!p_203792_1_.field_72995_K) {
this.func_205357_b(p_203792_1_, p_203792_2_, p_203792_3_);
@@ -78,4 +86,9 @@
}
}
+
+ private final java.util.function.Supplier<? extends EntityType<?>> fishTypeSupplier;
+ protected EntityType<?> getFishType() {
+ return fishTypeSupplier.get();
+ }
}
@@ -0,0 +1,12 @@
--- a/net/minecraft/item/FlintAndSteelItem.java
+++ b/net/minecraft/item/FlintAndSteelItem.java
@@ -65,7 +65,8 @@
boolean flag = false;
for(Direction direction : Direction.Plane.HORIZONTAL) {
- if (p_219996_1_.func_180495_p(p_219996_2_.func_177972_a(direction)).func_177230_c() == Blocks.field_150343_Z && ((NetherPortalBlock)Blocks.field_150427_aO).func_201816_b(p_219996_1_, p_219996_2_) != null) {
+ BlockPos framePos = p_219996_2_.func_177972_a(direction);
+ if (p_219996_1_.func_180495_p(framePos).isPortalFrame(p_219996_1_, framePos) && ((NetherPortalBlock)Blocks.field_150427_aO).func_201816_b(p_219996_1_, p_219996_2_) != null) {
flag = true;
}
}
@@ -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);
}
@@ -123,6 +126,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
public static SpawnEggItem func_200889_b(@Nullable EntityType<?> p_200889_0_) {
return field_195987_b.get(p_200889_0_);
}
@@ -0,0 +1,28 @@
--- a/net/minecraft/network/play/server/SJoinGamePacket.java
+++ b/net/minecraft/network/play/server/SJoinGamePacket.java
@@ -19,6 +19,7 @@
private WorldType field_149201_g;
private int field_218729_g;
private boolean field_179745_h;
+ private int dimensionInt;
public SJoinGamePacket() {
}
@@ -40,7 +41,7 @@
this.field_149204_b = (i & 8) == 8;
i = i & -9;
this.field_149205_c = GameType.func_77146_a(i);
- this.field_149202_d = DimensionType.func_186069_a(p_148837_1_.readInt());
+ this.dimensionInt = p_148837_1_.readInt();
this.field_149200_f = p_148837_1_.readUnsignedByte();
this.field_149201_g = WorldType.func_77130_a(p_148837_1_.func_150789_c(16));
if (this.field_149201_g == null) {
@@ -87,7 +88,7 @@
@OnlyIn(Dist.CLIENT)
public DimensionType func_212642_e() {
- return this.field_149202_d;
+ return this.field_149202_d == null ? this.field_149202_d = net.minecraftforge.fml.network.NetworkHooks.getDummyDimType(this.dimensionInt) : this.field_149202_d;
}
@OnlyIn(Dist.CLIENT)
@@ -0,0 +1,28 @@
--- a/net/minecraft/network/play/server/SRespawnPacket.java
+++ b/net/minecraft/network/play/server/SRespawnPacket.java
@@ -14,6 +14,7 @@
private DimensionType field_149088_a;
private GameType field_149087_c;
private WorldType field_149085_d;
+ private int dimensionInt;
public SRespawnPacket() {
}
@@ -29,7 +30,7 @@
}
public void func_148837_a(PacketBuffer p_148837_1_) throws IOException {
- this.field_149088_a = DimensionType.func_186069_a(p_148837_1_.readInt());
+ this.dimensionInt = p_148837_1_.readInt();
this.field_149087_c = GameType.func_77146_a(p_148837_1_.readUnsignedByte());
this.field_149085_d = WorldType.func_77130_a(p_148837_1_.func_150789_c(16));
if (this.field_149085_d == null) {
@@ -46,7 +47,7 @@
@OnlyIn(Dist.CLIENT)
public DimensionType func_212643_b() {
- return this.field_149088_a;
+ return this.field_149088_a == null ? this.field_149088_a = net.minecraftforge.fml.network.NetworkHooks.getDummyDimType(this.dimensionInt) : this.field_149088_a;
}
@OnlyIn(Dist.CLIENT)
@@ -0,0 +1,12 @@
--- a/net/minecraft/pathfinding/PathNavigator.java
+++ b/net/minecraft/pathfinding/PathNavigator.java
@@ -195,7 +195,8 @@
Vec3d vec3d = this.func_75502_i();
this.field_188561_o = this.field_75515_a.func_213311_cf() > 0.75F ? this.field_75515_a.func_213311_cf() / 2.0F : 0.75F - this.field_75515_a.func_213311_cf() / 2.0F;
Vec3d vec3d1 = this.field_75514_c.func_186310_f();
- if (Math.abs(this.field_75515_a.field_70165_t - (vec3d1.field_72450_a + 0.5D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.field_70161_v - (vec3d1.field_72449_c + 0.5D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.field_70163_u - vec3d1.field_72448_b) < 1.0D) {
+ // Forge: fix MC-94054
+ if (Math.abs(this.field_75515_a.field_70165_t - (vec3d1.field_72450_a + (int)(this.field_75515_a.func_213311_cf() + 1) / 2D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.field_70161_v - (vec3d1.field_72449_c + (int)(this.field_75515_a.func_213311_cf() + 1) / 2D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.field_70163_u - vec3d1.field_72448_b) < 1.0D) {
this.field_75514_c.func_75872_c(this.field_75514_c.func_75873_e() + 1);
}
@@ -0,0 +1,12 @@
--- a/net/minecraft/pathfinding/SwimmerPathNavigator.java
+++ b/net/minecraft/pathfinding/SwimmerPathNavigator.java
@@ -68,7 +68,8 @@
int i = 6;
Vec3d vec3d2 = this.field_75514_c.func_186310_f();
- if (Math.abs(this.field_75515_a.field_70165_t - (vec3d2.field_72450_a + 0.5D)) < (double)f1 && Math.abs(this.field_75515_a.field_70161_v - (vec3d2.field_72449_c + 0.5D)) < (double)f1 && Math.abs(this.field_75515_a.field_70163_u - vec3d2.field_72448_b) < (double)(f1 * 2.0F)) {
+ // Forge: fix MC-94054
+ if (Math.abs(this.field_75515_a.field_70165_t - (vec3d2.field_72450_a + (int)(this.field_75515_a.func_213311_cf() + 1) / 2D)) < (double)f1 && Math.abs(this.field_75515_a.field_70161_v - (vec3d2.field_72449_c + (int)(this.field_75515_a.func_213311_cf() + 1) / 2D)) < (double)f1 && Math.abs(this.field_75515_a.field_70163_u - vec3d2.field_72448_b) < (double)(f1 * 2.0F)) {
this.field_75514_c.func_75875_a();
}
@@ -9,7 +9,23 @@
p_213187_0_.setUncaughtExceptionHandler((p_213206_0_, p_213206_1_) -> {
field_147145_h.error(p_213206_1_);
});
@@ -327,6 +327,8 @@
@@ -213,6 +213,7 @@
private final LootTableManager field_200256_aj = new LootTableManager();
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;
@@ -240,6 +241,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_;
}
@@ -327,6 +329,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) {
@@ -347,13 +349,13 @@
@@ -347,13 +351,13 @@
}
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);
}
@@ -395,6 +397,7 @@
@@ -395,6 +399,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 @@
}
}
@@ -552,6 +555,7 @@
@@ -552,6 +557,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);
@@ -592,6 +596,7 @@
@@ -592,6 +598,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()));
@@ -623,9 +628,15 @@
@@ -623,9 +630,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;
@@ -642,6 +653,7 @@
@@ -642,6 +655,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 {
@@ -650,6 +662,7 @@
@@ -650,6 +664,7 @@
} catch (Throwable throwable) {
field_147145_h.error("Exception stopping the server", throwable);
} finally {
@@ -89,7 +105,7 @@
this.func_71240_o();
}
@@ -746,6 +759,7 @@
@@ -746,6 +761,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) {
@@ -760,6 +774,7 @@
@@ -760,6 +776,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) {
@@ -787,6 +802,7 @@
@@ -787,6 +804,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_) {
@@ -794,7 +810,8 @@
@@ -794,7 +812,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());
@@ -806,6 +823,7 @@
@@ -806,6 +825,7 @@
}
this.field_71304_b.func_76320_a("tick");
@@ -131,7 +147,7 @@
try {
serverworld.func_72835_b(p_71190_1_);
@@ -814,12 +832,16 @@
@@ -814,12 +834,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");
@@ -856,6 +878,7 @@
@@ -856,6 +880,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,7 @@
try {
OptionSet optionset = optionparser.parse(p_main_0_);
@@ -887,6 +910,10 @@
@@ -887,6 +912,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 +183,15 @@
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));
@@ -948,7 +975,7 @@
@@ -904,6 +933,7 @@
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
dedicatedserver.func_71263_m(true);
+ LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end.
}
};
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(field_147145_h));
@@ -948,7 +978,7 @@
}
public ServerWorld func_71218_a(DimensionType p_71218_1_) {
@@ -176,7 +200,7 @@
}
public Iterable<ServerWorld> func_212370_w() {
@@ -987,7 +1014,7 @@
@@ -987,7 +1017,7 @@
}
public String getServerModName() {
@@ -185,7 +209,18 @@
}
public CrashReport func_71230_b(CrashReport p_71230_1_) {
@@ -1529,6 +1556,31 @@
@@ -1371,6 +1401,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()) {
@@ -1529,6 +1563,31 @@
public abstract boolean func_213199_b(GameProfile p_213199_1_);
@@ -122,7 +122,7 @@
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_);
@@ -285,12 +310,18 @@
@@ -285,12 +310,19 @@
return ActionResultType.PASS;
}
} else {
@@ -134,11 +134,14 @@
+ if (result != ActionResultType.PASS) return result;
+ }
boolean flag = !p_219441_1_.func_184614_ca().func_190926_b() || !p_219441_1_.func_184592_cb().func_190926_b();
boolean flag1 = p_219441_1_.func_70093_af() && flag;
if (!flag1 && blockstate.func_215687_a(p_219441_2_, p_219441_1_, p_219441_4_, p_219441_5_)) {
- boolean flag1 = p_219441_1_.func_70093_af() && flag;
- if (!flag1 && blockstate.func_215687_a(p_219441_2_, p_219441_1_, p_219441_4_, p_219441_5_)) {
+ boolean flag1 = !(p_219441_1_.func_70093_af() && flag) || (p_219441_1_.func_184614_ca().doesSneakBypassUse(p_219441_2_,blockpos,p_219441_1_) && p_219441_1_.func_184592_cb().doesSneakBypassUse(p_219441_2_,blockpos,p_219441_1_));
+ if (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && flag1 && blockstate.func_215687_a(p_219441_2_, p_219441_1_, p_219441_4_, p_219441_5_)) {
return ActionResultType.SUCCESS;
} else if (!p_219441_3_.func_190926_b() && !p_219441_1_.func_184811_cZ().func_185141_a(p_219441_3_.func_77973_b())) {
- ItemUseContext itemusecontext = new ItemUseContext(p_219441_1_, p_219441_4_, p_219441_5_);
+ if (event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY) return ActionResultType.PASS;
if (this.func_73083_d()) {
int i = p_219441_3_.func_190916_E();
ActionResultType actionresulttype = p_219441_3_.func_196084_a(itemusecontext);
@@ -23,15 +23,16 @@
p_72355_2_.func_70029_a(serverworld);
p_72355_2_.field_71134_c.func_73080_a((ServerWorld)p_72355_2_.field_70170_p);
String s1 = "local";
@@ -121,6 +130,7 @@
@@ -121,6 +130,8 @@
WorldInfo worldinfo = serverworld.func_72912_H();
this.func_72381_a(p_72355_2_, (ServerPlayerEntity)null, serverworld);
ServerPlayNetHandler serverplaynethandler = new ServerPlayNetHandler(this.field_72400_f, p_72355_1_, p_72355_2_);
+ net.minecraftforge.fml.network.NetworkHooks.sendMCRegistryPackets(p_72355_1_, "PLAY_TO_CLIENT");
+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(p_72355_1_, p_72355_2_);
serverplaynethandler.func_147359_a(new SJoinGamePacket(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), serverworld.field_73011_w.func_186058_p(), this.func_72352_l(), worldinfo.func_76067_t(), this.field_72402_d, serverworld.func_82736_K().func_223586_b(GameRules.field_223612_o)));
serverplaynethandler.func_147359_a(new SCustomPayloadPlayPacket(SCustomPayloadPlayPacket.field_209911_b, (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName())));
serverplaynethandler.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
@@ -142,7 +152,7 @@
@@ -142,7 +153,7 @@
this.func_148539_a(itextcomponent.func_211708_a(TextFormatting.YELLOW));
serverplaynethandler.func_147364_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
@@ -40,7 +41,7 @@
this.field_177454_f.put(p_72355_2_.func_110124_au(), p_72355_2_);
this.func_148540_a(new SPlayerListItemPacket(SPlayerListItemPacket.Action.ADD_PLAYER, p_72355_2_));
@@ -163,8 +173,9 @@
@@ -163,8 +174,9 @@
if (compoundnbt != null && compoundnbt.func_150297_b("RootVehicle", 10)) {
CompoundNBT compoundnbt1 = compoundnbt.func_74775_l("RootVehicle");
@@ -51,7 +52,7 @@
});
if (entity1 != null) {
UUID uuid = compoundnbt1.func_186857_a("Attach");
@@ -191,6 +202,7 @@
@@ -191,6 +203,7 @@
}
p_72355_2_.func_71116_b();
@@ -59,7 +60,7 @@
}
protected void func_96456_a(ServerScoreboard p_96456_1_, ServerPlayerEntity p_96456_2_) {
@@ -252,6 +264,7 @@
@@ -252,6 +265,7 @@
compoundnbt1 = compoundnbt;
p_72380_1_.func_70020_e(compoundnbt);
field_148546_d.debug("loading single player");
@@ -67,7 +68,7 @@
} else {
compoundnbt1 = this.field_72412_k.func_75752_b(p_72380_1_);
}
@@ -260,6 +273,7 @@
@@ -260,6 +274,7 @@
}
protected void func_72391_b(ServerPlayerEntity p_72391_1_) {
@@ -75,7 +76,7 @@
this.field_72412_k.func_75753_a(p_72391_1_);
ServerStatisticsManager serverstatisticsmanager = this.field_148547_k.get(p_72391_1_.func_110124_au());
if (serverstatisticsmanager != null) {
@@ -274,6 +288,7 @@
@@ -274,6 +289,7 @@
}
public void func_72367_e(ServerPlayerEntity p_72367_1_) {
@@ -83,7 +84,7 @@
ServerWorld serverworld = p_72367_1_.func_71121_q();
p_72367_1_.func_195066_a(Stats.field_75947_j);
this.func_72391_b(p_72367_1_);
@@ -295,7 +310,7 @@
@@ -295,7 +311,7 @@
p_72367_1_.func_213319_R();
serverworld.func_217434_e(p_72367_1_);
p_72367_1_.func_192039_O().func_192745_a();
@@ -92,7 +93,7 @@
this.field_72400_f.func_201300_aS().func_201382_b(p_72367_1_);
UUID uuid = p_72367_1_.func_110124_au();
ServerPlayerEntity serverplayerentity = this.field_177454_f.get(uuid);
@@ -364,10 +379,18 @@
@@ -364,10 +380,18 @@
}
public ServerPlayerEntity func_72368_a(ServerPlayerEntity p_72368_1_, DimensionType p_72368_2_, boolean p_72368_3_) {
@@ -115,7 +116,7 @@
p_72368_1_.field_71093_bK = p_72368_2_;
PlayerInteractionManager playerinteractionmanager;
if (this.field_72400_f.func_71242_L()) {
@@ -379,6 +402,8 @@
@@ -379,6 +403,8 @@
ServerPlayerEntity serverplayerentity = new ServerPlayerEntity(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), playerinteractionmanager);
serverplayerentity.field_71135_a = p_72368_1_.field_71135_a;
serverplayerentity.func_193104_a(p_72368_1_, p_72368_3_);
@@ -124,7 +125,7 @@
serverplayerentity.func_145769_d(p_72368_1_.func_145782_y());
serverplayerentity.func_184819_a(p_72368_1_.func_184591_cq());
@@ -393,7 +418,7 @@
@@ -393,7 +419,7 @@
if (optional.isPresent()) {
Vec3d vec3d = optional.get();
serverplayerentity.func_70012_b(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 0.0F, 0.0F);
@@ -133,7 +134,15 @@
} else {
serverplayerentity.field_71135_a.func_147359_a(new SChangeGameStatePacket(0, 0.0F));
}
@@ -413,10 +438,11 @@
@@ -404,6 +430,7 @@
}
WorldInfo worldinfo = serverplayerentity.field_70170_p.func_72912_H();
+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(serverplayerentity.field_71135_a.field_147371_a, serverplayerentity);
serverplayerentity.field_71135_a.func_147359_a(new SRespawnPacket(serverplayerentity.field_71093_bK, worldinfo.func_76067_t(), serverplayerentity.field_71134_c.func_73081_b()));
BlockPos blockpos1 = serverworld.func_175694_M();
serverplayerentity.field_71135_a.func_147364_a(serverplayerentity.field_70165_t, serverplayerentity.field_70163_u, serverplayerentity.field_70161_v, serverplayerentity.field_70177_z, serverplayerentity.field_70125_A);
@@ -413,10 +440,11 @@
this.func_72354_b(serverplayerentity, serverworld);
this.func_187243_f(serverplayerentity);
serverworld.func_217433_d(serverplayerentity);
@@ -146,7 +155,7 @@
return serverplayerentity;
}
@@ -736,7 +762,7 @@
@@ -736,7 +764,7 @@
}
public List<ServerPlayerEntity> func_181057_v() {
@@ -155,7 +164,7 @@
}
@Nullable
@@ -766,4 +792,12 @@
@@ -766,4 +794,12 @@
public boolean func_206257_x() {
return this.field_72407_n;
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/tags/NetworkTagManager.java
+++ b/net/minecraft/tags/NetworkTagManager.java
@@ -69,6 +69,7 @@
ItemTags.func_199902_a(this.field_199720_b);
FluidTags.func_206953_a(this.field_205705_c);
EntityTypeTags.func_219759_a(this.field_215299_d);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this));
}, p_215226_6_);
}
@@ -1,6 +1,35 @@
--- a/net/minecraft/tileentity/AbstractFurnaceTileEntity.java
+++ b/net/minecraft/tileentity/AbstractFurnaceTileEntity.java
@@ -169,9 +169,9 @@
@@ -85,6 +85,7 @@
this.field_214014_c = p_i49964_2_;
}
+ @Deprecated //Forge - get burn times by calling ForgeHooks#getBurnTime(ItemStack)
public static Map<Item, Integer> func_214001_f() {
Map<Item, Integer> map = Maps.newLinkedHashMap();
func_213996_a(map, Items.field_151129_at, 20000);
@@ -98,18 +99,8 @@
func_213992_a(map, ItemTags.field_202899_i, 150);
func_213992_a(map, ItemTags.field_212188_k, 300);
func_213992_a(map, ItemTags.field_202900_j, 300);
- func_213996_a(map, Blocks.field_180407_aO, 300);
- func_213996_a(map, Blocks.field_180404_aQ, 300);
- func_213996_a(map, Blocks.field_180408_aP, 300);
- func_213996_a(map, Blocks.field_180403_aR, 300);
- func_213996_a(map, Blocks.field_180406_aS, 300);
- func_213996_a(map, Blocks.field_180405_aT, 300);
- func_213996_a(map, Blocks.field_180390_bo, 300);
- func_213996_a(map, Blocks.field_180392_bq, 300);
- func_213996_a(map, Blocks.field_180391_bp, 300);
- func_213996_a(map, Blocks.field_180386_br, 300);
- func_213996_a(map, Blocks.field_180385_bs, 300);
- func_213996_a(map, Blocks.field_180387_bt, 300);
+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCES_WOODEN, 300);
+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCE_GATES_WOODEN, 300);
func_213996_a(map, Blocks.field_196586_al, 300);
func_213996_a(map, Blocks.field_150342_X, 300);
func_213996_a(map, Blocks.field_222428_lQ, 300);
@@ -169,9 +160,9 @@
super.func_145839_a(p_145839_1_);
this.field_214012_a = NonNullList.func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a);
ItemStackHelper.func_191283_b(p_145839_1_, this.field_214012_a);
@@ -13,7 +42,7 @@
this.field_214019_k = this.func_213997_a(this.field_214012_a.get(1));
int i = p_145839_1_.func_74765_d("RecipesUsedSize");
@@ -185,9 +185,9 @@
@@ -185,9 +176,9 @@
public CompoundNBT func_189515_b(CompoundNBT p_189515_1_) {
super.func_189515_b(p_189515_1_);
@@ -26,7 +55,7 @@
ItemStackHelper.func_191282_a(p_189515_1_, this.field_214012_a);
p_189515_1_.func_74777_a("RecipesUsedSize", (short)this.field_214022_n.size());
int i = 0;
@@ -217,12 +217,14 @@
@@ -217,12 +208,14 @@
this.field_214019_k = this.field_214018_j;
if (this.func_214006_r()) {
flag1 = true;
@@ -43,7 +72,7 @@
}
}
}
@@ -266,10 +268,10 @@
@@ -266,10 +259,10 @@
return true;
} else if (!itemstack1.func_77969_a(itemstack)) {
return false;
@@ -56,7 +85,7 @@
}
}
} else {
@@ -285,7 +287,7 @@
@@ -285,7 +278,7 @@
if (itemstack2.func_190926_b()) {
this.field_214012_a.set(2, itemstack1.func_77946_l());
} else if (itemstack2.func_77973_b() == itemstack1.func_77973_b()) {
@@ -65,27 +94,25 @@
}
if (!this.field_145850_b.field_72995_K) {
@@ -305,7 +307,8 @@
@@ -305,7 +298,7 @@
return 0;
} else {
Item item = p_213997_1_.func_77973_b();
- return func_214001_f().getOrDefault(item, 0);
+ int ret = p_213997_1_.getBurnTime();
+ return net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(p_213997_1_, ret == -1 ? func_214001_f().getOrDefault(item, 0) : ret);
+ return net.minecraftforge.common.ForgeHooks.getBurnTime(p_213997_1_);
}
}
@@ -314,7 +317,8 @@
@@ -314,7 +307,7 @@
}
public static boolean func_213991_b(ItemStack p_213991_0_) {
- return func_214001_f().containsKey(p_213991_0_.func_77973_b());
+ int ret = p_213991_0_.getBurnTime();
+ return net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(p_213991_0_, ret == -1 ? func_214001_f().getOrDefault(p_213991_0_.func_77973_b(), 0) : ret) > 0;
+ return net.minecraftforge.common.ForgeHooks.getBurnTime(p_213991_0_) > 0;
}
public int[] func_180463_a(Direction p_180463_1_) {
@@ -462,4 +466,27 @@
@@ -462,4 +455,27 @@
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/tileentity/ConduitTileEntity.java
+++ b/net/minecraft/tileentity/ConduitTileEntity.java
@@ -131,7 +131,7 @@
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) {
this.field_205046_i.add(blockpos1);
}
@@ -49,15 +49,16 @@
this.field_145850_b.func_175666_e(this.field_174879_c, this.field_195045_e.func_177230_c());
}
}
@@ -139,6 +146,7 @@
@@ -139,6 +146,8 @@
public void func_145843_s() {
this.field_145846_f = true;
+ this.invalidateCaps();
+ requestModelDataUpdate();
}
public void func_145829_t() {
@@ -181,6 +189,13 @@
@@ -181,6 +190,13 @@
return this.field_200663_e;
}
@@ -448,7 +448,17 @@
List<T> list = Lists.newArrayList();
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
@@ -1000,7 +1092,7 @@
@@ -952,7 +1044,8 @@
}
public int func_181545_F() {
- return 63;
+ // FORGE: Allow modded dimensions to customize this value via Dimension
+ return this.func_201675_m().getSeaLevel();
}
public World func_201672_e() {
@@ -1000,7 +1093,7 @@
public int func_175651_c(BlockPos p_175651_1_, Direction p_175651_2_) {
BlockState blockstate = this.func_180495_p(p_175651_1_);
@@ -457,7 +467,7 @@
}
public boolean func_175640_z(BlockPos p_175640_1_) {
@@ -1045,7 +1137,7 @@
@@ -1045,7 +1138,7 @@
}
public long func_72905_C() {
@@ -466,7 +476,7 @@
}
public long func_82737_E() {
@@ -1053,11 +1145,11 @@
@@ -1053,11 +1146,11 @@
}
public long func_72820_D() {
@@ -480,7 +490,7 @@
}
protected void func_217389_a() {
@@ -1069,7 +1161,7 @@
@@ -1069,7 +1162,7 @@
}
public BlockPos func_175694_M() {
@@ -489,7 +499,7 @@
if (!this.func_175723_af().func_177746_a(blockpos)) {
blockpos = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g()));
}
@@ -1078,10 +1170,14 @@
@@ -1078,10 +1171,14 @@
}
public void func_175652_B(BlockPos p_175652_1_) {
@@ -505,7 +515,7 @@
return true;
}
@@ -1149,8 +1245,7 @@
@@ -1149,8 +1246,7 @@
}
public boolean func_180502_D(BlockPos p_180502_1_) {
@@ -515,7 +525,7 @@
}
@Nullable
@@ -1164,11 +1259,11 @@
@@ -1164,11 +1260,11 @@
}
public int func_72940_L() {
@@ -529,7 +539,7 @@
}
public CrashReportCategory func_72914_a(CrashReport p_72914_1_) {
@@ -1199,16 +1294,15 @@
@@ -1199,16 +1295,15 @@
public abstract Scoreboard func_96441_U();
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
@@ -550,7 +560,7 @@
blockstate.func_215697_a(this, blockpos, p_175666_2_, p_175666_1_, false);
}
}
@@ -1287,4 +1381,16 @@
@@ -1287,4 +1382,16 @@
public BlockPos func_205770_a(Heightmap.Type p_205770_1_, BlockPos p_205770_2_) {
return new BlockPos(p_205770_2_.func_177958_n(), this.func_201676_a(p_205770_1_, p_205770_2_.func_177958_n(), p_205770_2_.func_177952_p()), p_205770_2_.func_177952_p());
}
@@ -30,7 +30,7 @@
if (!this.field_76637_e.field_72995_K) {
blockstate.func_196947_b(this.field_76637_e, p_177436_1_, p_177436_2_, p_177436_3_);
- } else if (block1 != block && block1 instanceof ITileEntityProvider) {
+ } else if (block1 != block && blockstate.hasTileEntity()) {
+ } else if ((block1 != block || !p_177436_2_.hasTileEntity()) && blockstate.hasTileEntity()) {
this.field_76637_e.func_175713_t(p_177436_1_);
}
@@ -8,7 +8,24 @@
} else {
ChunkPrimer chunkprimer = new ChunkPrimer(p_222656_3_, upgradedata, achunksection, chunkprimerticklist1, chunkprimerticklist);
ichunk = chunkprimer;
@@ -314,12 +315,22 @@
@@ -198,6 +199,7 @@
}
if (chunkstatus$type == ChunkStatus.Type.LEVELCHUNK) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type));
return new ChunkPrimerWrapper((Chunk)ichunk);
} else {
ChunkPrimer chunkprimer1 = (ChunkPrimer)ichunk;
@@ -231,6 +233,8 @@
chunkprimer1.func_205767_a(generationstage$carving, BitSet.valueOf(compoundnbt5.func_74770_j(s1)));
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type));
+
return chunkprimer1;
}
}
@@ -314,12 +318,22 @@
for(int k = 0; k < chunk.func_177429_s().length; ++k) {
for(Entity entity : chunk.func_177429_s()[k]) {
CompoundNBT compoundnbt3 = new CompoundNBT();
@@ -31,7 +48,7 @@
} else {
ChunkPrimer chunkprimer = (ChunkPrimer)p_222645_1_;
listnbt2.addAll(chunkprimer.func_201652_l());
@@ -363,6 +374,7 @@
@@ -363,6 +377,7 @@
compoundnbt1.func_218657_a("Heightmaps", compoundnbt6);
compoundnbt1.func_218657_a("Structures", func_222649_a(chunkpos, p_222645_1_.func_201609_c(), p_222645_1_.func_201604_d()));
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/ChunkGenerator.java
+++ b/net/minecraft/world/gen/ChunkGenerator.java
@@ -195,7 +195,7 @@
public abstract void func_222537_b(IWorld p_222537_1_, IChunk p_222537_2_);
public int func_222530_f() {
- return 63;
+ return field_222540_a.func_201675_m().getSeaLevel();
}
public abstract int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type p_222529_3_);
@@ -0,0 +1,27 @@
--- a/net/minecraft/world/gen/feature/OreFeatureConfig.java
+++ b/net/minecraft/world/gen/feature/OreFeatureConfig.java
@@ -34,7 +34,7 @@
return new OreFeatureConfig(orefeatureconfig$fillerblocktype, blockstate, i);
}
- public static enum FillerBlockType {
+ public static enum FillerBlockType implements net.minecraftforge.common.IExtensibleEnum {
NATURAL_STONE("natural_stone", (p_214739_0_) -> {
if (p_214739_0_ == null) {
return false;
@@ -67,5 +67,15 @@
public Predicate<BlockState> func_214738_b() {
return this.field_214743_e;
}
+
+ public static FillerBlockType create(String enumName, String p_i50618_3_, Predicate<BlockState> p_i50618_4_) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ @Override
+ @Deprecated
+ public void init() {
+ field_214741_c.put(func_214737_a(), this);
+ }
}
}
@@ -0,0 +1,27 @@
--- a/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java
+++ b/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java
@@ -72,7 +72,7 @@
return this.field_214953_e.size();
}
- public static enum PlacementBehaviour {
+ public static enum PlacementBehaviour implements net.minecraftforge.common.IExtensibleEnum {
TERRAIN_MATCHING("terrain_matching", ImmutableList.of(new GravityStructureProcessor(Heightmap.Type.WORLD_SURFACE_WG, -1))),
RIGID("rigid", ImmutableList.of());
@@ -98,5 +98,15 @@
public ImmutableList<StructureProcessor> func_214937_b() {
return this.field_214941_e;
}
+
+ public static PlacementBehaviour create(String enumName, String p_i50487_3_, ImmutableList<StructureProcessor> p_i50487_4_) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ @Override
+ @Deprecated
+ public void init() {
+ field_214939_c.put(func_214936_a(), this);
+ }
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java
+++ b/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java
@@ -88,7 +88,7 @@
if (!template.func_189962_a(p_214848_2_, p_214848_3_, placementsettings, 18)) {
return false;
} else {
- for(Template.BlockInfo template$blockinfo : Template.func_215387_a(p_214848_2_, p_214848_3_, placementsettings, this.func_214857_a(p_214848_1_, p_214848_3_, p_214848_4_, false))) {
+ for(Template.BlockInfo template$blockinfo : Template.processBlockInfos(template, p_214848_2_, p_214848_3_, placementsettings, this.func_214857_a(p_214848_1_, p_214848_3_, p_214848_4_, false))) {
this.func_214846_a(p_214848_2_, template$blockinfo, p_214848_3_, p_214848_4_, p_214848_6_, p_214848_5_);
}
@@ -0,0 +1,57 @@
--- a/net/minecraft/world/gen/feature/template/StructureProcessor.java
+++ b/net/minecraft/world/gen/feature/template/StructureProcessor.java
@@ -9,8 +9,53 @@
public abstract class StructureProcessor {
@Nullable
- public abstract Template.BlockInfo func_215194_a(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_);
+ @Deprecated
+ public Template.BlockInfo func_215194_a(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_) {
+ return p_215194_4_;
+ }
+ /**
+ * FORGE: Add template parameter
+ *
+ * @param p_215194_1_
+ * @param p_215194_2_
+ * @param p_215194_3_
+ * @param p_215194_4_
+ * @param p_215194_5_
+ * @param template The template being placed, can be null due to deprecated
+ * method calls.
+ * @see #process(IWorldReader, BlockPos,
+ * net.minecraft.world.gen.feature.template.Template.BlockInfo,
+ * net.minecraft.world.gen.feature.template.Template.BlockInfo,
+ * PlacementSettings)
+ */
+ @Nullable
+ public Template.BlockInfo process(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_, @Nullable Template template) {
+ return func_215194_a(p_215194_1_, p_215194_2_, p_215194_3_, p_215194_4_, p_215194_5_);
+ }
+
+ /**
+ * FORGE: Add entity processing.
+ * <p>
+ * Use this method to process entities from a structure in much the same way as
+ * blocks, parameters are analogous.
+ *
+ * @param world
+ * @param seedPos
+ * @param rawEntityInfo
+ * @param entityInfo
+ * @param placementSettings
+ * @param template
+ *
+ * @see #process(IWorldReader, BlockPos,
+ * net.minecraft.world.gen.feature.template.Template.BlockInfo,
+ * net.minecraft.world.gen.feature.template.Template.BlockInfo,
+ * PlacementSettings)
+ */
+ public Template.EntityInfo processEntity(IWorldReader world, BlockPos seedPos, Template.EntityInfo rawEntityInfo, Template.EntityInfo entityInfo, PlacementSettings placementSettings, Template template) {
+ return entityInfo;
+ }
+
protected abstract IStructureProcessorType func_215192_a();
protected abstract <T> Dynamic<T> func_215193_a(DynamicOps<T> p_215193_1_);
@@ -0,0 +1,97 @@
--- a/net/minecraft/world/gen/feature/template/Template.java
+++ b/net/minecraft/world/gen/feature/template/Template.java
@@ -152,6 +152,11 @@
return func_207669_a(p_186266_1_, p_186266_0_.func_186212_b(), p_186266_0_.func_186215_c(), p_186266_0_.func_207664_d());
}
+ // FORGE: Add overload accepting Vec3d
+ public static Vec3d transformedVec3d(PlacementSettings p_186266_0_, Vec3d p_186266_1_) {
+ return func_207667_a(p_186266_1_, p_186266_0_.func_186212_b(), p_186266_0_.func_186215_c(), p_186266_0_.func_207664_d());
+ }
+
public void func_186260_a(IWorld p_186260_1_, BlockPos p_186260_2_, PlacementSettings p_186260_3_) {
p_186260_3_.func_186224_i();
this.func_186253_b(p_186260_1_, p_186260_2_, p_186260_3_);
@@ -177,7 +182,7 @@
int i1 = Integer.MIN_VALUE;
int j1 = Integer.MIN_VALUE;
- for(Template.BlockInfo template$blockinfo : func_215387_a(p_189962_1_, p_189962_2_, p_189962_3_, list)) {
+ for(Template.BlockInfo template$blockinfo : processBlockInfos(this, p_189962_1_, p_189962_2_, p_189962_3_, list)) {
BlockPos blockpos = template$blockinfo.field_186242_a;
if (mutableboundingbox == null || mutableboundingbox.func_175898_b(blockpos)) {
IFluidState ifluidstate = p_189962_3_.func_204763_l() ? p_189962_1_.func_204610_c(blockpos) : null;
@@ -288,7 +293,7 @@
}
if (!p_189962_3_.func_186221_e()) {
- this.func_207668_a(p_189962_1_, p_189962_2_, p_189962_3_.func_186212_b(), p_189962_3_.func_186215_c(), p_189962_3_.func_207664_d(), mutableboundingbox);
+ this.addEntitiesToWorld(p_189962_1_, p_189962_2_, p_189962_3_, p_189962_3_.func_186212_b(), p_189962_3_.func_186215_c(), p_189962_3_.func_207664_d(), p_189962_3_.func_186213_g());
}
return true;
@@ -317,14 +322,19 @@
});
}
+ @Deprecated // FORGE: Add template parameter
public static List<Template.BlockInfo> func_215387_a(IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List<Template.BlockInfo> p_215387_3_) {
+ return processBlockInfos(null, p_215387_0_, p_215387_1_, p_215387_2_, p_215387_3_);
+ }
+
+ public static List<Template.BlockInfo> processBlockInfos(@Nullable Template template, IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List<Template.BlockInfo> p_215387_3_) {
List<Template.BlockInfo> list = Lists.newArrayList();
for(Template.BlockInfo template$blockinfo : p_215387_3_) {
BlockPos blockpos = func_186266_a(p_215387_2_, template$blockinfo.field_186242_a).func_177971_a(p_215387_1_);
Template.BlockInfo template$blockinfo1 = new Template.BlockInfo(blockpos, template$blockinfo.field_186243_b, template$blockinfo.field_186244_c);
- for(Iterator<StructureProcessor> iterator = p_215387_2_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().func_215194_a(p_215387_0_, p_215387_1_, template$blockinfo, template$blockinfo1, p_215387_2_)) {
+ for(Iterator<StructureProcessor> iterator = p_215387_2_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().process(p_215387_0_, p_215387_1_, template$blockinfo, template$blockinfo1, p_215387_2_, template)) {
;
}
@@ -336,13 +346,41 @@
return list;
}
+ // FORGE: Add processing for entities
+ public static List<Template.EntityInfo> processEntityInfos(@Nullable Template template, IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List<Template.EntityInfo> p_215387_3_) {
+ List<Template.EntityInfo> list = Lists.newArrayList();
+
+ for(Template.EntityInfo entityInfo : p_215387_3_) {
+ Vec3d pos = transformedVec3d(p_215387_2_, entityInfo.field_186247_a).func_178787_e(new Vec3d(p_215387_1_));
+ BlockPos blockpos = func_186266_a(p_215387_2_, entityInfo.field_186248_b).func_177971_a(p_215387_1_);
+ Template.EntityInfo entityInfo1 = new Template.EntityInfo(pos, blockpos, entityInfo.field_186249_c);
+
+ for(Iterator<StructureProcessor> iterator = p_215387_2_.func_215221_j().iterator(); entityInfo1 != null && iterator.hasNext(); entityInfo1 = iterator.next().processEntity(p_215387_0_, p_215387_1_, entityInfo, entityInfo1, p_215387_2_, template)) {
+ ;
+ }
+
+ if (entityInfo1 != null) {
+ list.add(entityInfo1);
+ }
+ }
+
+ return list;
+ }
+
+ @Deprecated // FORGE: Add PlacementSettings parameter (below) to pass to entity processors
private void func_207668_a(IWorld p_207668_1_, BlockPos p_207668_2_, Mirror p_207668_3_, Rotation p_207668_4_, BlockPos p_207668_5_, @Nullable MutableBoundingBox p_207668_6_) {
- for(Template.EntityInfo template$entityinfo : this.field_186271_b) {
+ addEntitiesToWorld(p_207668_1_, p_207668_2_, new PlacementSettings().func_186214_a(p_207668_3_).func_186220_a(p_207668_4_).func_207665_a(p_207668_5_).func_186223_a(p_207668_6_), p_207668_3_, p_207668_4_, p_207668_2_, p_207668_6_);
+ }
+
+ private void addEntitiesToWorld(IWorld p_207668_1_, BlockPos p_207668_2_, PlacementSettings placementIn, Mirror p_207668_3_, Rotation p_207668_4_, BlockPos p_207668_5_, @Nullable MutableBoundingBox p_207668_6_) {
+ for(Template.EntityInfo template$entityinfo : processEntityInfos(this, p_207668_1_, p_207668_2_, placementIn, this.field_186271_b)) {
BlockPos blockpos = func_207669_a(template$entityinfo.field_186248_b, p_207668_3_, p_207668_4_, p_207668_5_).func_177971_a(p_207668_2_);
+ blockpos = template$entityinfo.field_186248_b; // FORGE: Position will have already been transformed by processEntityInfos
if (p_207668_6_ == null || p_207668_6_.func_175898_b(blockpos)) {
CompoundNBT compoundnbt = template$entityinfo.field_186249_c;
Vec3d vec3d = func_207667_a(template$entityinfo.field_186247_a, p_207668_3_, p_207668_4_, p_207668_5_);
- Vec3d vec3d1 = vec3d.func_72441_c((double)p_207668_2_.func_177958_n(), (double)p_207668_2_.func_177956_o(), (double)p_207668_2_.func_177952_p());
+ vec3d = vec3d.func_72441_c((double)p_207668_2_.func_177958_n(), (double)p_207668_2_.func_177956_o(), (double)p_207668_2_.func_177952_p());
+ Vec3d vec3d1 = template$entityinfo.field_186247_a; // FORGE: Position will have already been transformed by processEntityInfos
ListNBT listnbt = new ListNBT();
listnbt.add(new DoubleNBT(vec3d1.field_72450_a));
listnbt.add(new DoubleNBT(vec3d1.field_72448_b));
@@ -0,0 +1,14 @@
--- a/net/minecraft/world/lighting/BlockLightEngine.java
+++ b/net/minecraft/world/lighting/BlockLightEngine.java
@@ -117,4 +117,11 @@
this.field_215627_c.func_215532_c();
this.func_215469_a(Long.MAX_VALUE, p_215623_1_.func_218275_a(), 15 - p_215623_2_, true);
}
+
+ // FORGE START
+
+ @Override
+ public int queuedUpdateSize() {
+ return field_215627_c.queuedUpdateSize();
+ }
}
@@ -0,0 +1,21 @@
--- a/net/minecraft/world/lighting/LevelBasedGraph.java
+++ b/net/minecraft/world/lighting/LevelBasedGraph.java
@@ -210,4 +210,18 @@
protected abstract void func_215476_a(long p_215476_1_, int p_215476_3_);
protected abstract int func_215480_b(long p_215480_1_, long p_215480_3_, int p_215480_5_);
+
+ // FORGE START
+
+ protected int queuedUpdateSize() {
+ return field_215488_c.size();
+ }
+
+ public final void bulkCancel(java.util.function.LongPredicate pred) {
+ ((Long2ByteOpenHashMap)field_215488_c).keySet().forEach((long l) -> {
+ if (pred.test(l)) {
+ func_215479_e(l);
+ }
+ });
+ }
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/lighting/LightEngine.java
+++ b/net/minecraft/world/lighting/LightEngine.java
@@ -216,4 +216,8 @@
long i = SectionPos.func_218169_f(SectionPos.func_218166_b(p_223129_1_.field_77276_a, 0, p_223129_1_.field_77275_b));
this.field_215627_c.func_223113_c(i, p_223129_2_);
}
+
+ // FORGE START
+
+ public abstract int queuedUpdateSize();
}
@@ -0,0 +1,14 @@
--- a/net/minecraft/world/lighting/SectionLightStorage.java
+++ b/net/minecraft/world/lighting/SectionLightStorage.java
@@ -154,6 +154,11 @@
int j = SectionPos.func_218142_c(SectionPos.func_218144_c(p_215528_2_));
int k = SectionPos.func_218142_c(SectionPos.func_218153_d(p_215528_2_));
+ // FORGE: Optimize loop when lighting update count is lower than section size
+ if (p_215528_1_.queuedUpdateSize() < 16 * 16 * 16) {
+ p_215528_1_.bulkCancel(l -> SectionPos.func_218162_e(l) == p_215528_2_);
+ return;
+ }
for(int l = 0; l < 16; ++l) {
for(int i1 = 0; i1 < 16; ++i1) {
for(int j1 = 0; j1 < 16; ++j1) {
@@ -0,0 +1,14 @@
--- a/net/minecraft/world/lighting/SkyLightEngine.java
+++ b/net/minecraft/world/lighting/SkyLightEngine.java
@@ -229,4 +229,11 @@
public String func_215614_b(long p_215614_1_) {
return super.func_215614_b(p_215614_1_) + (this.field_215627_c.func_215549_m(p_215614_1_) ? "*" : "");
}
+
+ // FORGE START
+
+ @Override
+ public int queuedUpdateSize() {
+ return 0;
+ }
}
@@ -40,11 +40,11 @@
this.func_219100_a(chunkpos, compoundnbt1);
return true;
} catch (Exception exception) {
@@ -804,6 +809,7 @@
for(int l = i - this.field_219247_A; l <= i + this.field_219247_A; ++l) {
for(int k = j - this.field_219247_A; k <= j + this.field_219247_A; ++k) {
ChunkPos chunkpos = new ChunkPos(l, k);
+ net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_219234_2_, p_219234_1_, chunkpos, field_219255_i);
this.func_219199_a(p_219234_1_, chunkpos, new IPacket[2], !p_219234_2_, p_219234_2_);
}
}
@@ -700,6 +705,7 @@
protected void func_219199_a(ServerPlayerEntity p_219199_1_, ChunkPos p_219199_2_, IPacket<?>[] p_219199_3_, boolean p_219199_4_, boolean p_219199_5_) {
if (p_219199_1_.field_70170_p == this.field_219255_i) {
+ if (p_219199_4_ != p_219199_5_) net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_219199_5_, p_219199_1_, p_219199_2_, field_219255_i);
if (p_219199_5_ && !p_219199_4_) {
ChunkHolder chunkholder = this.func_219219_b(p_219199_2_.func_201841_a());
if (chunkholder != null) {
@@ -73,15 +73,17 @@
}
if (this.func_72912_H().func_76093_s() && this.func_175659_aa() != Difficulty.HARD) {
@@ -280,7 +291,7 @@
@@ -280,8 +291,8 @@
})) {
this.field_73068_P = false;
if (this.func_82736_K().func_223586_b(GameRules.field_223607_j)) {
- long l = this.field_72986_A.func_76073_f() + 24000L;
- this.func_72877_b(l - l % 24000L);
+ long l = this.func_72820_D() + 24000L;
this.func_72877_b(l - l % 24000L);
+ this.func_72877_b(net.minecraftforge.event.ForgeEventFactory.onSleepFinished(this, l - l % 24000L, this.func_72820_D()));
}
this.field_217491_A.stream().filter(LivingEntity::func_70608_bn).forEach((p_217444_0_) -> {
@@ -304,6 +315,7 @@
iprofiler.func_219895_b("portalForcer");
@@ -24,7 +24,7 @@
mobentity.func_70012_b((double)f, (double)k, (double)f1, p_222263_1_.field_73012_v.nextFloat() * 360.0F, 0.0F);
- if (d0 > 16384.0D && mobentity.func_213397_c(d0) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)) {
+ int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(mobentity, p_222263_1_, f, k, f1, null, SpawnReason.NATURAL);
+ if (canSpawn == -1 || (canSpawn == 0 && d0 > 16384.0D && (mobentity.func_213397_c(d0) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)))) {
+ if (canSpawn == -1 || (canSpawn == 0 && (d0 > 16384.0D && mobentity.func_213397_c(d0) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)))) {
break label115;
}
@@ -11,3 +11,18 @@
public static class Builder {
private final ServerWorld field_186474_a;
private final Map<LootParameter<?>, Object> field_216025_b = Maps.newIdentityHashMap();
@@ -87,6 +91,14 @@
this.field_186474_a = p_i46993_1_;
}
+ public Builder(LootContext context) {
+ this.field_186474_a = context.field_186499_b;
+ this.field_216025_b.putAll(context.field_216036_f);
+ this.field_216026_c.putAll(context.field_216037_g);
+ this.field_216027_d = context.field_216035_a;
+ this.field_186475_b = context.field_186498_a;
+ }
+
public LootContext.Builder func_216023_a(Random p_216023_1_) {
this.field_216027_d = p_216023_1_;
return this;
@@ -16,7 +16,23 @@
this.field_216128_f = p_i51265_3_;
this.field_216129_g = LootFunctionManager.func_216241_a(p_i51265_3_);
}
@@ -92,8 +92,8 @@
@@ -77,6 +77,7 @@
}
+ @Deprecated //Use other method or manually call ForgeHooks.modifyLoot
public void func_216120_b(LootContext p_216120_1_, Consumer<ItemStack> p_216120_2_) {
this.func_216114_a(p_216120_1_, func_216124_a(p_216120_2_));
}
@@ -84,6 +85,7 @@
public List<ItemStack> func_216113_a(LootContext p_216113_1_) {
List<ItemStack> list = Lists.newArrayList();
this.func_216120_b(p_216113_1_, list::add);
+ list = net.minecraftforge.common.ForgeHooks.modifyLoot(list, p_216113_1_);
return list;
}
@@ -92,8 +94,8 @@
}
public void func_216117_a(ValidationResults p_216117_1_, Function<ResourceLocation, LootTable> p_216117_2_, Set<ResourceLocation> p_216117_3_, LootParameterSet p_216117_4_) {
@@ -27,7 +43,7 @@
}
for(int j = 0; j < this.field_216128_f.length; ++j) {
@@ -204,6 +204,41 @@
@@ -204,6 +206,41 @@
}
}
@@ -69,7 +85,7 @@
public static class Serializer implements JsonDeserializer<LootTable>, JsonSerializer<LootTable> {
public LootTable deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
JsonObject jsonobject = JSONUtils.func_151210_l(p_deserialize_1_, "loot table");
@@ -229,7 +264,7 @@
@@ -229,7 +266,7 @@
}
}
+6 -2
View File
@@ -1,9 +1,13 @@
rootProject.name = 'Forge'
include ':mcp'
include ':clean'
include ':forge'
project(":mcp").projectDir = file("projects/mcp")
project(":clean").projectDir = file("projects/clean")
project(":forge").projectDir = file("projects/forge")
if (false) {
include ':clean'
project(":clean").projectDir = file("projects/clean")
}
Loaded 100 of 1085 files, more files were not shown because too many files have changed in this diff. Show more