Compare commits

...
223 Commits
Author SHA1 Message Date
SizableShrimp a1eb26aee2 [1.13.x] Update Installer to 2.1.+ (#8288)
* 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:33:15 +10:30
Marc Hermans 638bea3b9c Patch the jenkinsfile so it publishes using the correct credentials provided by Jenkins. (#8276) 2021-12-11 00:23:30 +10:30
Marc Hermans 05cb868bb2 [CVE-2021-44228]: Update Log4J to fix the security issue inside it. (#8273) 2021-12-10 22:56:02 +10:30
Ben Staddon 54d0bafa12 Pass tick counter to custom render handlers (#5744) 2019-07-08 19:46:50 -07:00
LexManos d3e8804dbf Include new library in installer json.
Change order of versions on main menu, to prevent overlap with default window size.
Fix Forge update not displaying version info.
2019-05-27 19:13:55 -07:00
LexManos c509cac02b Fix vanilla structures loosing valid flags, And fix error placement for unsaveable structures. 2019-05-27 13:49:15 -07:00
LexManos 4b5bf760ec Fix tall grass not dropping seeds. Closes #5675 2019-05-27 13:46:19 -07:00
cpw c57c6213ea Enhance crash reports and logging to capture transformers on stack trace elements.
Moved log4j2.xml file to the launcher source set, so it loads first in the client.

Signed-off-by: cpw <[email protected]>
2019-05-27 00:00:45 -04:00
tterrag fb30820e2b Remove cache eviction for model data, optimize 2019-05-23 21:49:39 -04:00
Philipp 61b612c88a dimesnion -> dimension typos (#5684) 2019-05-21 15:43:45 -04:00
ben-mkiv d3edc9dcdc FENCES_NETHER_BRRICK => FENCES_NETHER_BRICK (#5681) 2019-05-21 15:43:45 -04:00
Hugman ba2485b807 GEMS_QUARRTZ -> GEMS_QUARTZ (#5635) 2019-05-21 15:43:45 -04:00
Cadiboo 60c6635af5 Small comment typo fixes for ObfuscationReflectionHelper (#5583) 2019-05-21 15:43:45 -04:00
James Mitchell 9c5134fb6b Fix MC-146650 GuiContainer#keyPressed to return the correct key handled boolean (#5367) 2019-05-21 11:00:47 -07:00
LexManos eae0858de6 Fix build script producing duplicated eclipse source folders.
Fix not including userdev source in sources jar.
Update license header of files that need it.
Delete patches_old folders. Most are unneeded in 1.13+ as the systems they effected were changed significantly. Any that need to be readdressed can be done as PRs.
2019-05-13 19:11:24 -07:00
Vincent Lee d7949d5316 Fix caps not being visible on old player during clone event (#5728) 2019-05-13 09:57:50 -07:00
LexManos 8c44d6d4cb Fix vanilla bug in writing structure templates with multiple palettes. 2019-05-12 23:40:54 -07:00
Vincent Lee 049fae5c65 Add support for vanilla recipes having nbt on result (#5710) Fix #5663 2019-05-12 21:44:46 -07:00
tterrag 41f8459a41 Fix modded TEs not being removed on block change 2019-05-12 15:05:33 -04:00
cpw 5cd82f16f2 Fix #5735 by pushing new build. Shutdown Forge eventbus when errors occur. Closes #5711
Also, improve logging so warnings, errors and fatals are always shown, regardless of marker.

Signed-off-by: cpw <[email protected]>
2019-05-12 13:07:29 -04:00
OhYea777 444ba7a7d5 Update 'build.gradle' to fix run configs for launching forge 2019-05-12 12:51:18 -04:00
tterrag dcd5f1d711 Remove patch causing TEs to be removed on state change 2019-05-11 23:30:46 -04:00
tterrag 18ce494cba Fix default IUnbakedModel bake method using wrong format 2019-05-11 23:22:46 -04:00
tterrag 9e39570d49 Add ModelDataTest to test mods.toml 2019-05-11 23:22:24 -04:00
cpw 6a1337aa92 Updated a couple of libraries. Fixed bug where modid could be in toml but
not found during loading, yet game continued to load.

Signed-off-by: cpw <[email protected]>
2019-05-11 20:47:42 -04:00
tterrag 605c4a0adf Add test mods run configs 2019-05-11 18:58:45 -04:00
tterrag 7c90d9f3e8 Better handle errors from eclipse compiled (non-compiling) bytecode 2019-05-11 18:58:45 -04:00
tterrag 01a0674490 Finish model loader debug mod 2019-05-11 18:58:45 -04:00
tterrag e482793f69 Comment out test Mod/EventBusSubscriber annotations, fix up ModelLoaderRegistryTest 2019-05-11 18:58:45 -04:00
tterrag de14670d4d Fix BakedQuadRetextured calling old BakedQuad ctor 2019-05-11 16:36:16 -04:00
tterrag 9209c3cbfe Add new system for model data, replacing extended states (#5564) 2019-05-09 02:10:38 -04:00
LexManos a7204b5cd3 Bump ForgeSPI version, and add support for DistCleaner stripping interfaces from classes.
Add more detail to VersionChecker log info.
2019-05-06 15:52:12 -07:00
tterrag 616416569b Add explicit return type checks for extensible enums, fix exc 2019-04-25 19:51:20 -04:00
tterrag cab1b9716c Fix EnumRarity, make sure extensible enums have at least one factory candidate 2019-04-25 19:38:03 -04:00
tterrag bda3f1b7c6 Make EnumRarity extensible 2019-04-25 19:29:19 -04:00
tterrag 416bf9e3bf Allow loading json constants outside of _constants 2019-04-25 19:22:43 -04:00
tterrag 102e0095a7 Update skipped_commits.md 2019-04-25 18:32:06 -04:00
Ben Staddon 1fcfd54584 Fix some vertex format changes not being handled correctly (#5368) 2019-04-25 18:31:17 -04:00
Ben Staddon 441a9c9024 Transform vertex normals as well as positions when generating quads (#5242) 2019-04-25 18:29:12 -04:00
Robert WC Seifert f68fdcf703 Fix for SidedInvWrapper isItemValid using wrong slot (#5642) 2019-04-25 18:20:42 -04:00
tterrag d8137f7bcf Add comment to vanilla bugfix, update skipped_commits.md 2019-04-25 15:59:08 -04:00
tterrag 42c27b8845 Change default username to 'Dev', add ability to replace '#' with randomized numbers 2019-04-25 15:52:02 -04:00
tterrag 8408539f1c Fix MC-128441: cross-dimensional teleporting does not work 2019-04-25 15:18:40 -04:00
Ben Staddon 1f0467b864 Add Forge dimension-changing hooks to spectator handling code (#5212) 2019-04-25 15:08:15 -04:00
ichttt 1aae18d4bc Minor performace improvement when building chunks and rendering blocks (#5286) 2019-04-24 13:20:19 -04:00
Ben Staddon 45902676fd Catch json parsing errors from constants/factories files (#5258) 2019-04-24 13:12:03 -04:00
Ben Staddon 931105123e Allow custom DataSerializers to be registered safely (#5245) 2019-04-24 13:05:12 -04:00
tterrag cf35019d07 Further clean up Constants, and add two new BlockFlags 2019-04-24 12:58:09 -04:00
tterrag c636f6edd6 Remove unnecessary patch 2019-04-24 02:13:17 -04:00
tterrag 58b28569e2 Update skipped_commits.md 2019-04-24 01:34:43 -04:00
Pokechu22 73bb013b25 Fail fast when null is used with setTag instead of crashing in writeEntry (#5257) 2019-04-24 01:32:45 -04:00
tterrag d6da893c0c Update Constants for 1.13 2019-04-24 01:26:24 -04:00
Wyn Price 47a7d8e2b7 Added more Constants (#5323) 2019-04-24 01:25:21 -04:00
Thanh-Phuong cb0cf2f04f Add a few events pertaining to villages (#5302) 2019-04-24 01:07:02 -04:00
tterrag a4cf5951ca Sync up canPlaceTorchOnTop logic with BlockTorch#isValidPosition 2019-04-24 00:59:03 -04:00
tterrag 822dce47cd Update skipped_commits.md 2019-04-23 21:12:22 -04:00
Tyler Hancockandtterrag 2ea475ad31 Fix special spawn event not firing in many cases. (#5389)
Co-authored-by: tterrag <[email protected]>
2019-04-23 21:10:37 -04:00
Ben Staddon eed92ba07c Only prompt for missing registries on local worlds (#5348) 2019-04-23 20:45:48 -04:00
tterrag a86317efc8 Reimplement ForgeHooks#onPlaceItemIntoWorld and remove old place events 2019-04-23 20:42:08 -04:00
Christopher Krierandtterrag ca973f053f Add EntityPlaceEvent (#5057)
Co-authored-by: tterrag <[email protected]>
2019-04-23 19:58:09 -04:00
Ben Staddon 119e4a6924 Fix small logic error in ItemTextureQuadConverter (#5463) 2019-04-23 19:03:43 -04:00
Ben Staddon aef224221f Better support for custom bows (#5209) 2019-04-23 18:04:19 -04:00
Ben Staddon 18d0f7ba0d Fix up torch placement logic to handle more vanilla special-casing (#5426) 2019-04-23 17:39:50 -04:00
tterrag dd9077d52d Update skipped_commits.md 2019-04-23 16:51:11 -04:00
LexManos 01cb2117cc Written size does not include int bytes. 2019-04-23 16:30:26 -04:00
LexManos 574f890e58 Extend Region files to support >1MB per chunk.
If the 'sector count' is 255, ask the compressed data header for the proper length.
2019-04-23 16:27:34 -04:00
tterrag e70cc4fcae Simplify custom item rendering by removing GL emissivity hacks 2019-04-23 15:23:12 -04:00
tterrag d02da21a7a Support diffuse lighting flag in item rendering 2019-04-23 15:21:01 -04:00
Ben Staddon 817546e4c8 Add a hook to allow continuously using items through stack changes (#4834) 2019-04-23 15:12:55 -04:00
tterrag 1a7e05a3da Update skipped_commits.md 2019-04-23 14:48:47 -04:00
Ben Staddon f19fed0853 Add redirects to PotionEffect to respect registry replacement (#5213) 2019-04-23 14:47:47 -04:00
tterrag 06f67f7696 Add FieldRedirectTransformer updated to new modlauncher API 2019-04-23 14:39:26 -04:00
Ben Staddon 501f1dc8dc Fix small logic error in emissive item rendering code (#5320) 2019-04-23 12:37:32 -04:00
Ben Staddon 8b5a5ecd74 Ensure slave maps are cleaned up when handling registry overrides (#5250) 2019-04-23 12:31:55 -04:00
tterrag cb3ff19801 Remove hack to force enum configs to strings 2019-04-18 22:13:19 -04:00
tterrag f30d7bc845 Fix #5688 config values are unordered, update Night-Config 2019-04-18 22:13:13 -04:00
ichttt c0aa4c8517 Cleanup/Implement some todos (#5660) 2019-04-17 13:57:32 -07:00
ichttt e868739675 Readd redirecting of stdout and stderr (#5678) 2019-04-16 14:08:08 -07:00
Vincent Lee 991682956d Fix some typos in spawn dimension patches (#5669) 2019-04-15 19:04:24 -07:00
DaemonUmbra e168d8e593 Remove Vanilla Logging Config (#5618)
This will re-enable Forge's logging configuration in "production"
2019-04-15 19:00:11 -07:00
Lars Gerrits 273b1b110a Add GuiContainerEvent.DrawBackground event. (#5595) 2019-04-15 18:56:58 -07:00
0uti bbc92fa51c [1.13.x] Fire InputEvents (#5533) 2019-04-15 18:50:18 -07:00
tterrag 8515b9dd10 Fix compile error in FakePlayer from cherry pick 2019-04-13 21:42:42 -04:00
tterrag a56f894e39 Update skipped_commits.md 2019-04-13 11:18:54 -04:00
LexManos 592b957b77 Fix potential issues with the Minecraft FakePlayer lingering around after world unloads. 2019-04-13 11:17:27 -04:00
tterrag 65cfef1b2e Fix potion remove event not always firing, add expiry event 2019-04-13 11:17:00 -04:00
mcenderdragon 914fe91db5 added PotionHooks, closes #3867, #4375 (#4614) 2019-04-13 11:03:58 -04:00
tterrag 0c19ccc11a Fix EntityDataManager logging level 2019-04-13 10:45:33 -04:00
tterrag 3560e47a77 Fix some typos in cherry-picked commits 2019-04-13 09:47:33 -04:00
tterrag c33cd678f0 Update skipped_commits.md 2019-04-12 20:18:17 -04:00
ichttt a67cce2f91 Add a hook for farmland watering (#4891) 2019-04-12 20:16:34 -04:00
ichttt 72bc39d831 Add logging for data manager key registration errors (#5129) 2019-04-12 20:01:00 -04:00
tterrag abf010ac48 Fix #5659 setdimension command entity filtering, avoid inverting logic 2019-04-12 19:43:41 -04:00
Ben Staddonandtterrag 2baa05ace9 Improve support for custom block path types (#5203)
Co-authored-by: tterrag <[email protected]>
2019-04-12 13:47:48 -04:00
Ben Staddon fa708f93ee Allow items to control the rate of repair from mending (#5102) 2019-04-12 13:26:15 -04:00
tterrag a0a3f9dbfb Update skipped_commits.md 2019-04-12 11:15:31 -04:00
Ben Staddon bda875166a Improve exception handling from server starting events (#5226) 2019-04-12 11:12:15 -04:00
Ben Staddon e376172312 Improve context provided by potion icon rendering hooks (#5111) 2019-04-12 11:05:34 -04:00
MrRiegel d20b1f271e Fix an ObjectHolderRef internal error message (#5214) 2019-04-12 10:49:26 -04:00
tterrag 67da3182c1 Implement rendering for item models with emissive quads (#5047) 2019-04-12 10:45:32 -04:00
Paul Fulham 1280dea111 Fix inaccurate main thread name shown in client log (#5078) 2019-04-12 10:23:08 -04:00
Ben Staddon 3920b7aaa3 Fix Baked Item models with transformations (#5241) 2019-04-12 10:11:15 -04:00
tterrag 52890edfac Update skipped_commits.md 2019-04-11 19:31:04 -04:00
Vincent Lee ed3aea0980 Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) 2019-04-11 19:01:52 -04:00
Ben Staddon 3f70fd49ff Fix missing string parameters in some log messages (#5210) 2019-04-11 18:57:37 -04:00
Ben Staddon 7496e3dbdf Re-add some missing villager profession patches (#5200)
* Fix zombie villagers only spawning with vanilla professions
* Fix spawning modded villagers that do not have their own building
2019-04-11 18:50:01 -04:00
TheIllusiveC4 7c401e9a35 Fix the bed position given to the SleepingTimeCheck event (#5107) 2019-04-11 18:09:01 -04:00
Ben Staddon a02bec7ebe Fix some null returns from defaulted registries (#5235) 2019-04-11 18:05:26 -04:00
Yanbing Zhao 254c1d1531 Only remove synthetic lambda methods referenced in body of SideOnly methods (#5127) 2019-04-11 18:02:34 -04:00
tterrag 971de3e1d0 Update skipped_commits.md 2019-04-11 17:47:13 -04:00
gaudus 7d2c8fa6ef fixed visual bug with guislider 2019-04-11 17:38:01 -04:00
Ben Staddon ac210a3201 Make Forge blockstate variants correctly inherit AO setting from vanilla models (#5190) 2019-04-11 17:35:01 -04:00
Ben Staddon a79975b3ea Make Forge-provided default transforms accessible to custom models 2019-04-11 17:32:31 -04:00
cpw aa7380acc6 Actually parse the i18n exception message into the super constructor,
so the exception has a useful text message, even in crash logs and
on the server.

Signed-off-by: cpw <[email protected]>
2019-04-06 14:22:24 -04:00
cpw cdbd842494 Refactor to use naming service, and provide an MCP naming service when
in userdev. Step 1 to supporting loading SRG mods in userdev.

Signed-off-by: cpw <[email protected]>
2019-04-06 12:10:54 -04:00
Vincent Lee 323fdb014d Fix respawnevent being fired with old player instead of new. Fixes #5658 (#5668) 2019-04-04 19:41:27 -07:00
cpw 3f735b715b Implement API for mods to control their server status response..
Signed-off-by: cpw <[email protected]>
2019-03-31 16:36:49 -04:00
cpw 4ecb04ed9f Merge branch 'pull/5636' into 1.13.x 2019-03-30 15:03:48 -04:00
cpw e0361047f7 Fix StartupQuery to run properly on dedicated server.. Closes #5649
Signed-off-by: cpw <[email protected]>
2019-03-30 14:46:30 -04:00
tterrag 37016ca77f Remove remaining deprecations, improve a few patch comments 2019-03-29 16:58:33 -04:00
tterrag 98ef5049f4 Fix BrandingControl caching text through resource reload 2019-03-29 16:29:26 -04:00
tterrag 98a470d813 Add back EntityPlayer patch to return main inventory in IItemHandler
Fixes #5638
2019-03-26 01:22:58 -04:00
cpw 944d760855 Fire the ModIdRemappingEvent on the Forge Event bus. Closes #5632
Signed-off-by: cpw <[email protected]>
2019-03-25 21:55:34 -04:00
cpw e0e999da0d Remove redundant method call in Minecraft patch. Also fix a translation
string error (closes #5643)

Signed-off-by: cpw <[email protected]>
2019-03-25 21:55:33 -04:00
tterrag 2f486f2bdd Add method to IResourcePack to hide it entirely from the UI (#5525) 2019-03-25 17:24:37 -04:00
JoJoDeveloping 7e4101b3ad Remove game registry comparsion from list ping
Signed-off-by: JoJoDeveloping <[email protected]>
2019-03-25 22:22:29 +01:00
cpw d8d30e1f82 Defer configuration of channel until it is actually available during
connection. Closes #5626

Signed-off-by: cpw <[email protected]>
2019-03-25 17:20:44 -04:00
Brennan Ward 36470f69ad Add class to wrap IItemHandler as IInventory for easier recipe interaction. (#5522) 2019-03-25 12:31:54 -07:00
mezz 5fa732d223 Remove uses of java.awt (#5591)
`java.awt` will statically load itself when `java.awt.Color`, `java.awt.Dimension`, etc are loaded.
This conflicts with lwjgl3 and must be avoided (except for in mojang's server gui).
2019-03-25 12:06:20 -07:00
Vincent Lee 5e7279b0a2 Fix PlayerInteractEvent using Dist when it should be using LogicalSide (#5611) 2019-03-25 11:41:08 -07:00
JoJoDeveloping 4764136d47 Re-Add the list ping compatibility checker
Signed-off-by: JoJoDeveloping <[email protected]>
2019-03-25 15:15:25 +01:00
tterrag 10a06157aa Update Night-Config to 3.5.0, improve defineEnum methods
Closes #5537
2019-03-23 00:12:48 -04:00
tterrag d7ba9a50df Fix loading errors GUI crashing when errors occur during construction 2019-03-22 20:58:10 -04:00
LexManos 18400e8457 Revive CapabilityProvider on entity revive. Madders should NOT need this, as caps are copied via NBT. 2019-03-19 21:21:37 -07:00
LexManos f5375783c6 Do not invalidate caps when entity is being moved across worlds. Should fix #5500 2019-03-19 14:10:29 -07:00
LexManos 8045e48952 Fix NPE in TileEntityPistonRender when class is created to early. 2019-03-17 22:15:52 -07:00
Ben Staddon be18bdee88 Fix getDefaultCreatorModId for enchanted books (#5534) 2019-03-17 13:51:10 -07:00
tterrag 1e34f331da Handle null return from ResourcePackInfo.createResourcePack 2019-03-16 01:52:37 -04:00
cpw d99a55a7d1 Allow login packets to only generate on server based connections
Run injectSnapshot on the client thread, wait for result and
disconnect when injectSnapshot fails.
Fix DevServer to load MOD_CLASSES
Fix LaunchTesting to properly load log4j2 markers (don't use a
static variable in that class!)

Signed-off-by: cpw <[email protected]>
2019-03-15 23:22:28 -04:00
tterrag 0141a959eb Exclude PR builds from discord and changelog 2019-03-14 19:33:50 -04:00
tterrag d04c849a23 Exclude noci branches from travis 2019-03-14 19:02:08 -04:00
Ben Staddon 329e04b068 Fix being unable to plant nether wart (#5572) 2019-03-13 22:37:37 -07:00
LexManos d0c7a496f7 Fix silk touch not working on Ender Chests. 2019-03-13 15:55:18 -07:00
its_meow ff6fa31b1d Fix entity spawn packet pitch (reversed yaw/pitch) (#5603) 2019-03-13 12:53:48 -07:00
LexManos 554952e02a Fix invalid inventory being sent to ItemCraftedEvent Closes #5580
Fixed custom ingredient network serialization by removing unneeded mark. Closes #5577
Changed HorseArmorType constructor to not prefix vanilla paths to custom armors. Closes #5574
Fix removeBlock being called with invalid canHarvest value. Closes #5570
2019-03-11 16:40:59 -07:00
ichttt 00845d5252 Add UI for warnings that occurred during loading (#5530) 2019-03-11 15:32:37 -07:00
LexManos 7113f4400c Fix max entity radius not being settable by making it a instance method on world. Closes #5601
Fix VoidFluidHandler.INSTANCE not being a instance of VoidFluidHandler. Closes #5602
Remove backwards compat code and make IItemHandler.isItemValid non-default. Closes #5598
2019-03-11 15:04:04 -07:00
cpw 7292b63052 Add way to publish the reobf Jar with the maven-publish
task. The standard way does not publish reobfuscated
artifacts.

Signed-off-by: cpw <[email protected]>
2019-03-09 18:43:20 -05:00
cpw 7cfc5c3316 Add in the ability to load modlists from a file.
This is simple: <modfile>.list is a newline separated list
of maven-like coordinates for mods to load into the game.
They are searched for in all known maven roots.

Signed-off-by: cpw <[email protected]>
2019-03-09 17:51:37 -05:00
LexManos 1d0c67d67b Fix rails not being able to be placed on hoppers. 2019-03-08 11:50:41 -08:00
LexManos 47e6b34d2b DimensionManager.registerDimension now returns the DimensionType instance for convienance.
You can still access others in DimensionType.getByName()
Fixed ForgeRegistry rappers not forwarding isEmpty.
2019-03-06 21:01:12 -08:00
LexManos 3003e33074 Refactor Userdev and Forgedev launching.
Locating mods on the classpath in dev should solve linked MC sources when debugging.
As well as loading deobfed mods.
Rewrote how arguments are handled in dev, so users can overwrite any defaults we provide.
Added basic Yggdrasil auth support. Passing in --username and --password arguments.
ONLY USE IF NECESSARY. Forge is NOT responsible for your login information.
2019-03-06 20:59:32 -08:00
LexManos 7bd7b059c4 Make userdev parse out the classifier for the Forge jar that is on the classpath.
Should fix debugging Minecraft at dev time.
2019-03-06 12:06:49 -08:00
cpw 230d69b772 Tidy up network initialization, and force it to classload early in
modloading lifecycle. Closes #5576

Signed-off-by: cpw <[email protected]>
2019-03-04 08:22:46 -05:00
cpw cbfa572acb Tweak log4j2 config and allow access to classdump functionality from
modlauncher.

Signed-off-by: cpw <[email protected]>
2019-03-02 15:31:35 -05:00
cpw 8f5a2be6fd Fix #5584 by copying the zipped resource to a temporary directory if
paulscode is requesting it. This is so icky.

Signed-off-by: cpw <[email protected]>
2019-03-01 22:07:11 -05:00
cpw 45f5f0904a Log a message as well, when we crash.
Signed-off-by: cpw <[email protected]>
2019-03-01 19:48:25 -05:00
cpw 6db8b3c26d Try writing a temporary file to disk when a paulscode thread requests
a resource, because even zipfilesystems return interruptible file channels.

Signed-off-by: cpw <[email protected]>
2019-03-01 19:46:59 -05:00
cpw b4ccafe718 Enforce specversion number for forgeSPI so we don't crash with weird errors later.
Signed-off-by: cpw <[email protected]>
2019-03-01 19:27:22 -05:00
cpw 3c73dc2d0b Put both LogicalSides on NetworkDirection:
Origination (where it came from) and Reception (where it arrived at).

Signed-off-by: cpw <[email protected]>
2019-02-28 21:39:36 -05:00
LexManos 58494f8878 Rewrite the FML Handshake packet formats to include actually syncing the registry data and introduce the concept of caching it locally.
Snapshots are not injected yet due top threading issues.
2019-02-27 23:56:31 -08:00
cpw cb70702ab5 Handle differing network versions for FML gracefully?
Signed-off-by: cpw <[email protected]>
2019-02-28 00:59:27 -05:00
cpw 7f1ea578d6 Fix problem with duplicate mods caused by duplicate classes found during scan.
File Scan results are now sets.

Signed-off-by: cpw <[email protected]>
2019-02-27 23:34:23 -05:00
cpw dd7e7fc122 Try to fix #5573 by peeling the worldclient fetch into a separate handler.
Signed-off-by: cpw <[email protected]>
2019-02-27 13:45:51 -05:00
cpw 0bcc60fbe3 Tidy up server launch. The JAR will resolve it's libraries from a relative
path. We just need to verify what we need is on the classpath, and
try and handle when it's not, cleanly (by recommending running the
installer).

The manifest now embeds the correct launch arguments to allow FML to
resolve - these were _never_ editable, and belong somewhere out of
the way.

Signed-off-by: cpw <[email protected]>
2019-02-26 10:28:48 -05:00
kashike 7766eed754 Add missing constructors in KeyBinding to match existing vanilla constructors. (#5480) 2019-02-25 19:57:11 -08:00
John Hannan 5fa02f53d9 Update MDK Readme to describe new FG3 procedures. (#5553) 2019-02-25 18:11:41 -08:00
LexManos 176e331fc4 Fix Custom Entity Data not persisting between world loads. Closes #5562
Fix BlockRailState inverting flexibility flag. Closes #5550
Disable Forge's hooks on dispensing Buckets until Fluid system re-write. Closes #5545
Fix modifier only keybinds. Closes #5544
2019-02-25 17:06:37 -08:00
Ben Staddon d846f23e80 Fix entity shearing logic (#5566) 2019-02-25 10:41:37 -08:00
Ben Staddon af717ad788 Fix droppers not spawning items in world (#5559) 2019-02-25 00:47:37 -05:00
cpw 2a4e05c982 Allow vanilla connections properly, and allow mods to decide.
Signed-off-by: cpw <[email protected]>
2019-02-24 13:52:26 -05:00
cpw c219416bb8 Patch DimensionSavedDataManager to not spam FS mkdirs requests for
empty files that don't exist yet, and don't contain data. Should
result in a significant performance improvement for those with slower disks.

Signed-off-by: cpw <[email protected]>
2019-02-24 13:03:11 -05:00
cpw 8d1ff45c71 Fix GUI packet dispatch, add additional blockpos helper for common usecase.
Signed-off-by: cpw <[email protected]>
2019-02-24 11:51:53 -05:00
cpw 245d0b6282 Fix startup Query to actually display (fixed commit).
Signed-off-by: cpw <[email protected]>
2019-02-23 20:42:45 -05:00
cpw bbdf52e038 Update to 0.10 modlauncher API with performance improvements..
Signed-off-by: cpw <[email protected]>
2019-02-23 14:36:05 -05:00
LexManos 237f9dec5a Hide the webhook address so people don't spam it. 2019-02-22 01:01:09 -08:00
LexManos d6dc438859 Remove debug leftovers from Jenkinsfile. 2019-02-21 21:30:01 -08:00
LexManos 1469df26db Delete old OreDictionary file, fix type in NUGGETS_IRON field name, and ping discord from jenkins. 2019-02-21 21:26:45 -08:00
LexManos b7f6fbcfcb Merge extra and data jars. As Log4j has issues with it's config being in a different jar then the custom logger. 2019-02-21 04:24:39 -08:00
tterrag 329f26ee20 Add GuiUtils.drawInscribedRect, use in mod list GUI to fix logo rendering 2019-02-19 21:48:34 -05:00
tterrag 57cd8324dc Fix reference to UnsafeHacks in RuntimeEnumExtender 2019-02-19 19:28:17 -05:00
tterrag 8aafbb9441 Fix double tall plants not being shearable, add IShearable to seagrass
Closes #5524
2019-02-19 13:24:22 -05:00
SquidDev e4c2d0a779 Add back missing ItemColors patch (#5474) 2019-02-19 12:46:41 -05:00
mariaum 59a213bdaa Fix entities being killed in one hit. Closes #5511
Fix unloc pattern for tps output
2019-02-19 12:35:32 -05:00
tterrag 4b564b91bf Fix MinecraftForge.initialize not being called.
Fixes UsernameCache and harvest tools
Closes #5529
2019-02-19 12:33:41 -05:00
tterrag 4abfedea68 Make BannerPattern extensible (#5464) 2019-02-19 12:14:14 -05:00
Ben Staddon 7d971a3262 Remove EnumFacing internal ID maps from AT file (#5526) 2019-02-18 23:16:28 -08:00
Merlin Addams b4474a4882 Fix GuiEnchantment using wrong value to index enchantClue array (#5452) 2019-02-18 20:22:53 -08:00
Ben Staddon d1ac90bb3e Fix some minor patch regressions (#5490) 2019-02-18 20:21:03 -08:00
Katrina Swales 785d9b8deb Altered EntityType registry to use a Forge based registry (#5493) 2019-02-18 14:19:25 -08:00
Cadiboo ab92801740 Fix bug with ObfuscationReflectionHelper (#5509) 2019-02-18 14:12:07 -08:00
cpw 1d6536a53b Move unsafehacks to separate JAR built separately..
Signed-off-by: cpw <[email protected]>
2019-02-18 15:54:36 -05:00
tterrag 60315d079b Clean up Entity patches, remove extra method. Closes #5494 2019-02-18 15:52:01 -05:00
tterrag 1a833a9267 Remove now defunct eclipse files from MDK 2019-02-18 15:14:42 -05:00
cpw 70be790b2a Add a simple network API..
Signed-off-by: cpw <[email protected]>
2019-02-18 15:09:03 -05:00
Jack Taylor 2e2c57dbd1 Refactor forge and example run configs based on MinecraftForge/ForgeGradle#546
- Updated run config formats based on the refactored setup
- Removed old 'runclient' and 'runserver' JavaExec tasks, replacing them by creating the run configs using the refactored setup.
- Set 'assetIndex' environment variable from FG
- Updated MDK for new run config setup
2019-02-18 14:39:05 -05:00
tterrag 3fa507d6d1 Make SpawnPlacementType extensible, remove from ArmorMaterial 2019-02-18 12:03:02 -05:00
cpw e47fa70279 Fix connection to vanilla servers. Generate a default mod server config
for mods connecting to servers.

Signed-off-by: cpw <[email protected]>
2019-02-17 16:07:47 -05:00
cpw e248503b0a Fix TPS string
Signed-off-by: cpw <[email protected]>
2019-02-17 15:03:25 -05:00
Vincent Lee 3f2c66dca5 Change openGui to take a Consumer<PacketBuffer> 2019-02-17 20:02:29 +00:00
cpw bd1769b11f Fix author and other strings in the mdk mods toml file, update coremods to 0.3.+
Signed-off-by: cpw <[email protected]>
2019-02-17 14:08:20 -05:00
Jack Taylor af98088d04 Fix World crashing on load Fixes #5499 (#5503) 2019-02-17 00:15:35 -08:00
cpw aa076695b9 Actually dispatch handleWorldDataSave. Closes #5492
Signed-off-by: cpw <[email protected]>
2019-02-16 17:38:12 -05:00
cpw 869964cb2f Merge branch 'pull/5483' into 1.13.x 2019-02-16 17:19:27 -05:00
cpw 579c3ecc0e Fix assetIndexes for 1.13.1
Signed-off-by: cpw <[email protected]>
2019-02-16 17:16:34 -05:00
cpw 63b2ad36e1 Fix travis build for 1.13.x branch
Signed-off-by: cpw <[email protected]>
2019-02-16 17:00:50 -05:00
cpw ae01194a5e Merge branch 'pull/5484' into 1.13.x 2019-02-16 16:59:13 -05:00
gegy1000 3c006c4ca4 Fix lazy ModContainer evaluation skipping thrown loadingExceptions
Fix formatting
2019-02-16 16:58:54 -05:00
cpw 738d54ff4c Fixes #5446 Listening for the same registry event in two different mods fails
Tell the mod event bus not to track phasing for events.

Signed-off-by: cpw <[email protected]>
2019-02-16 16:45:05 -05:00
SquidDev 044bb1c395 Add back missing patch for Item.BLOCK_TO_ITEM 2019-02-16 08:14:33 +00:00
cpw 180f16161c Fix the MDK..
Signed-off-by: cpw <[email protected]>
2019-02-15 21:56:54 -05:00
cpw 7f9e8d059b Fix network syncing of SERVER config. Enable COMMON Config. Fix network
login handling.

Signed-off-by: cpw <[email protected]>
2019-02-15 21:45:28 -05:00
cpw 36ccb3bbfe Fix serverlang loading issue, by frontloading MC and Forge langs,
so error messaging works.

Signed-off-by: cpw <[email protected]>
2019-02-15 20:00:41 -05:00
cpw 1e6f3fc893 Use MC VERSION in the dependencies string for the extra jar
Signed-off-by: cpw <[email protected]>
2019-02-15 01:11:31 -05:00
cpw b4d0ee9b3b Publish to mainline
Signed-off-by: cpw <[email protected]>
2019-02-14 23:15:40 -05:00
cpw 3e516e54b2 Remove Forge ChunkLoader - vanilla has a new system. API will follow.
Signed-off-by: cpw <[email protected]>
2019-02-14 23:15:40 -05:00
tterrag 3baa00decb Fix Block$Properties AT for new class name 2019-02-14 23:13:37 -05:00
cpw 09a96670e6 Fix VillagerRegistry
Signed-off-by: cpw <[email protected]>
2019-02-14 22:20:59 -05:00
cpw 78455ac3c0 Add the language providers to the main classloader as well, so
their resources are available to other classes..

Signed-off-by: cpw <[email protected]>
2019-02-14 21:43:56 -05:00
tterrag 2ec74e5c22 Fix RegistryManager#getRegistry not working for generic registry entries 2019-02-14 18:50:15 -05:00
tterrag 9d56309a05 Fix license headers 2019-02-14 18:49:40 -05:00
tterrag 4139504202 Fix GlowstoneFeature patch name 2019-02-14 18:35:39 -05:00
LexManos 2f547c8c56 Fix javac compile issues. 2019-02-14 15:21:28 -08:00
537 changed files with 10314 additions and 7218 deletions

No files matched your search

+2
View File
@@ -33,3 +33,5 @@ notifications:
branches:
except:
- 1.13-pre
- 1.13.x
- /^noci-.*$/
Vendored
+50 -20
View File
@@ -6,18 +6,32 @@ pipeline {
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
image 'gradle:jdk8'
args '-v forgegc:/home/gradle/.gradle/'
}
}
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') {
stage('notify_start') {
when {
not {
changeRequest()
}
}
steps {
checkout scm
discordSend(
title: "${DISCORD_PREFIX} Started",
successful: true,
result: 'ABORTED', //White border
thumbnail: JENKINS_HEAD,
webhookURL: DISCORD_WEBHOOK
)
}
}
stage('setup') {
@@ -27,11 +41,16 @@ pipeline {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
post {
success {
writeChangelog(currentBuild, 'build/changelog.txt')
}
stage('changelog') {
when {
not {
changeRequest()
}
}
steps {
writeChangelog(currentBuild, 'build/changelog.txt')
}
}
stage('publish') {
when {
@@ -40,20 +59,22 @@ pipeline {
}
}
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 {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
}
}
}
post {
success {
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:forge ${env.MYVERSION} latest")], propagate: false, wait: false
}
//We're testing so use the test group
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.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
@@ -64,9 +85,7 @@ pipeline {
CROWDIN = credentials('forge-crowdin')
}
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
}
@@ -74,9 +93,20 @@ pipeline {
}
post {
always {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
script {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
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
)
}
}
}
}
}
+174 -175
View File
@@ -1,8 +1,7 @@
buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -23,6 +22,7 @@ import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import java.util.stream.Collectors
@@ -64,20 +64,35 @@ project(':clean') {
repositories {
mavenCentral()
}
patcher {
parent = project(':mcp')
patchedSrc = file('src/main/java')
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
mcVersion = MC_VERSION
}
task runclient(type: JavaExec) {
doFirst {
mkdir 'runclient'
patchedSrc = file('src/main/java')
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
runs {
clean_client {
taskName 'clean_client'
main 'net.minecraft.client.main.Main'
workingDirectory project.file('run')
args '--gameDir', '.'
args '--version', MC_VERSION
args '--assetsDir', downloadAssets.output
args '--assetIndex', '{asset_index}'
args '--accessToken', '0'
}
clean_server {
taskName 'clean_server'
main 'net.minecraft.server.MinecraftServer'
workingDirectory project.file('run')
}
}
classpath sourceSets.main.runtimeClasspath
args = ['--accessToken', '0', '--version', MC_VERSION]
main 'net.minecraft.client.main.Main'
workingDir 'runclient'
}
}
@@ -91,49 +106,54 @@ project(':forge') {
apply plugin: 'de.undercouch.download'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
group = 'net.minecraftforge.test' //TODO: remove test when we finish patches and want users to find it
group = 'net.minecraftforge'
sourceSets {
fmllauncher {
java {
srcDir "$rootDir/src/fmllauncher/java"
srcDirs = ["$rootDir/src/fmllauncher/java"]
}
resources {
srcDir "$rootDir/src/fmllauncher/resources"
srcDirs = ["$rootDir/src/fmllauncher/resources"]
}
}
main {
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
java {
srcDir "$rootDir/src/main/java"
srcDirs = ["$rootDir/src/main/java"]
}
resources {
srcDir "$rootDir/src/main/resources"
srcDirs = ["$rootDir/src/main/resources"]
}
}
test {
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
java {
// srcDir "$rootDir/src/test/java" TODO fix later
srcDir "$rootDir/src/fmllaunchertest/java"
srcDirs = [
"$rootDir/src/test/java",
"$rootDir/src/fmllaunchertest/java"
]
}
resources {
srcDir "$rootDir/src/test/resources"
srcDirs = ["$rootDir/src/test/resources"]
}
}
userdev {
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
java {
srcDir "$rootDir/src/userdev/java"
srcDirs = ["$rootDir/src/userdev/java"]
}
resources {
srcDir "$rootDir/src/userdev/resources"
srcDirs = ["$rootDir/src/userdev/resources"]
}
}
}
//Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
repositories {
mavenLocal()
mavenCentral()
@@ -166,46 +186,81 @@ project(':forge') {
version = getVersion()
patcher {
exc = file("$rootDir/src/main/resources/forge.exc")
parent = project(':clean')
patches = file("$rootDir/patches/minecraft")
patchedSrc = file('src/main/java')
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
exc = file("$rootDir/src/main/resources/forge.exc")
srgPatches = true
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
runs {
forge_client = {
main 'net.minecraftforge.fml.LaunchTesting'
environment = [
target: 'fmldevclient',
assetDirectory: downloadAssets.output,
nativesDirectory: extractNatives.output
]
properties = [
// 'org.lwjgl.util.Debug': 'true',
// 'org.lwjgl.util.DebugLoader': 'true',
'org.lwjgl.system.SharedLibraryExtractDirectory': 'lwjgl_dll',
'mc.version': MC_VERSION,
'mcp.version': MCP_VERSION,
'forge.version': project.version.substring(MC_VERSION.length() + 1),
'forge.spec': SPEC_VERSION,
'forge.group': project.group,
'fmllauncher.version': SPEC_VERSION,
'terminal.ansi': 'true'
]
forge_client {
taskName 'forge_client'
main 'net.minecraftforge.userdev.LaunchTesting'
workingDirectory project.file('run')
environment 'target', 'fmldevclient'
environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', downloadAssets.output
environment 'nativesDirectory', extractNatives.output
environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'terminal.ansi', 'true'
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main
source sourceSets.userdev
}
forge_server = {
main 'net.minecraftforge.fml.LaunchTesting'
environment = [
target: 'fmldevserver'
]
properties = [
'mc.version': MC_VERSION,
'mcp.version': MCP_VERSION,
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
'forge.spec': SPEC_VERSION,
'forge.group': project.group,
'fmllauncher.version': SPEC_VERSION
]
forge_test_client {
parent runs.forge_client
taskName 'forge_test_client'
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
mods {
TestMods { sources sourceSets.test }
}
}
forge_server {
taskName 'forge_server'
main 'net.minecraftforge.userdev.LaunchTesting'
workingDirectory project.file('run')
environment 'target', 'fmldevserver'
environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main
source sourceSets.userdev
}
forge_test_server {
parent runs.forge_server
taskName 'forge_test_server'
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
mods {
TestMods { sources sourceSets.test }
}
}
}
}
@@ -265,68 +320,35 @@ project(':forge') {
fmllauncherImplementation.extendsFrom(installer)
}
dependencies {
api 'net.minecraft:client:1.13:extra'
api 'net.minecraft:client:${MC_VERSION}:extra'
installer 'com.paulscode:soundsystem:2018+'
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:0.9.+'
installer 'net.minecraftforge:accesstransformers:0.14.+:shadowed'
installer 'net.minecraftforge:eventbus:0.6.+:service'
installer 'net.minecraftforge:forgespi:0.6.+'
installer 'net.minecraftforge:coremods:0.2.+'
installer 'com.electronwill.night-config:core:3.4.2'
installer 'com.electronwill.night-config:toml:3.4.2'
installer 'cpw.mods:modlauncher:2.1.+'
installer 'cpw.mods:grossjava9hacks:1.1.+'
installer 'net.minecraftforge:accesstransformers:0.16.+:shadowed'
installer 'net.minecraftforge:eventbus:0.9.+:service'
installer 'net.minecraftforge:forgespi:0.13.+'
installer 'net.minecraftforge:coremods:0.5.+'
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.9.0'
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.1'
installer 'org.apache.logging.log4j:log4j-core:2.11.1'
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.1.+'
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'
testImplementation "org.junit.jupiter:junit-jupiter-api:5.0.0"
testImplementation "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
testImplementation "org.hamcrest:hamcrest-all:1.3" // needs advanced matching for list order
}
task runclient(type: JavaExec, dependsOn: [":forge:downloadAssets", ":forge:extractNatives"]) {
doFirst {
mkdir 'runclient'
}
doFirst {
copy {
from sourceSets.main.resources
into "$buildDir/classes/java/main"
}
}
//jvmArgs = ['-verbose:class']
classpath sourceSets.main.runtimeClasspath
main patcher.runs.forge_client.main
systemProperties = patcher.runs.forge_client.properties
environment += patcher.runs.forge_client.environment
workingDir 'runclient'
}
task runserver(type: JavaExec) {
doFirst {
mkdir 'runserver'
}
doFirst {
copy {
from sourceSets.main.resources
into "$buildDir/classes/java/main"
}
}
classpath sourceSets.main.runtimeClasspath
main patcher.runs.forge_server.main
args 'nogui'
systemProperties = patcher.runs.forge_server.properties
environment += patcher.runs.forge_server.environment
workingDir 'runserver'
standardInput = System.in
}
def extraTxts = [
rootProject.file('CREDITS.txt'),
@@ -467,18 +489,7 @@ project(':forge') {
type: 'release',
mainClass: 'cpw.mods.modlauncher.Launcher',
inheritsFrom: MC_VERSION,
logging: [
client: [
argument: '-Dlog4j.configurationFile=${path}',
file: [
id:'client-1.12.xml',
sha1:'ef4f57b922df243d0cef096efe808c72db042149',
size:877,
url:'https://launcher.mojang.com/v1/objects/ef4f57b922df243d0cef096efe808c72db042149/client-1.12.xml'
],
type: 'log4j2-xml'
]
],
logging: {},
arguments: [
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"]
],
@@ -511,7 +522,7 @@ project(':forge') {
ext {
output = file('build/install_profile.json')
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.0.4'
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
}
doFirst {
ext.BIN_PATCHER = 'net.minecraftforge:binarypatcher:' + genClientBinPatches.resolvedVersion
@@ -562,14 +573,6 @@ project(':forge') {
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
],
MC_DATA: [
client: "[net.minecraft:client:${MC_VERSION}:data]",
server: "[net.minecraft:server:${MC_VERSION}:data]"
],
MC_DATA_SHA: [
client: "'${sha1(tasks.getByName('downloadClientData').output)}'",
server: "'${sha1(tasks.getByName('downloadServerData').output)}'"
],
MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}:extra]"
@@ -607,13 +610,11 @@ project(':forge') {
args: [
'--input', '{MINECRAFT_JAR}',
'--slim', '{MC_SLIM}',
'--data', '{MC_DATA}',
'--extra', '{MC_EXTRA}',
'--srg', '{MAPPINGS}'
],
outputs: [
'{MC_SLIM}': '{MC_SLIM_SHA}',
'{MC_DATA}': '{MC_DATA_SHA}',
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
]
], [ // SpecialSource has a bug where it won't create the nessasary directories, remove when they fix that.
@@ -653,7 +654,7 @@ project(':forge') {
}
['client', 'server'].each { side ->
['slim', 'extra', 'data'].each { type ->
['slim', 'extra'].each { type ->
def name = "download${side.capitalize()}${type.capitalize()}"
task "${name}"(type: DownloadMavenArtifact) {
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
@@ -698,47 +699,30 @@ project(':forge') {
}
}
task fmllauncherConfig(type: WriteProperties) {
outputFile file('build/server_launcher.properties')
encoding 'UTF8'
doFirst {
def artifacts = getArtifacts(project, project.configurations.installer, false).values().stream().map{a -> a.downloads.artifact.path}.sorted().collect() + [
"net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-data.jar",
"net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
]
for (int x = 0; x < artifacts.size(); x++) {
property 'library.' + x.toString().padLeft(3, '0'), "libraries/${artifacts.get(x)}"
}
property 'library.count', artifacts.size()
property 'args', [
'--gameDir', '.',
'--launchTarget', 'fmlserver',
'--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
'--fml.mcpVersion', MCP_VERSION,
'--fml.mcVersion', MC_VERSION,
'--fml.forgeGroup', project.group
].join(' ')
}
}
task launcherJar(type: Jar, dependsOn: [fmllauncherConfig]) {
task launcherJar(type: Jar) {
classifier 'launcher'
from sourceSets.fmllauncher.output
from fmllauncherConfig.outputFile
doFirst {
def classpath = new StringBuilder()
def artifacts = getArtifacts(project, project.configurations.installer, false)
artifacts.each { key, lib ->
classpath += "libraries/${lib.downloads.artifact.path} "
}
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-data.jar "
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
MANIFESTS.each{ pkg, values ->
if (pkg == '/') {
manifest.attributes(values += [
'Main-Class': 'net.minecraftforge.server.ServerMain',
'Class-Path': classpath.toString()
'Class-Path': classpath.toString(),
'ServerLaunchArgs': [
'--gameDir', '.',
'--launchTarget', 'fmlserver',
'--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
'--fml.mcpVersion', MCP_VERSION,
'--fml.mcVersion', MC_VERSION,
'--fml.forgeGroup', project.group
].join(' ')
])
} else {
manifest.attributes(values, pkg)
@@ -748,7 +732,7 @@ project(':forge') {
}
task downloadInstaller(type: DownloadMavenArtifact) {
artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
artifact = 'net.minecraftforge:installer:2.1.+:shrunk'
changing = true
}
@@ -836,27 +820,33 @@ project(':forge') {
}
addLibrary("${project.group}:${project.name}:${project.version}:launcher")
runs {
client = {
main 'net.minecraftforge.userdev.UserdevLauncher'
client {
main 'net.minecraftforge.userdev.LaunchTesting'
environment 'target', 'fmluserdevclient'
environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', '{assets_root}'
environment 'nativesDirectory', '{natives}'
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
environment 'FORGE_GROUP', project.group
environment 'MCP_VERSION', MCP_VERSION
environment 'MC_VERSION', MC_VERSION
environment 'MC_VERSION', "${MC_VERSION}"
environment 'FORGE_GROUP', "${project.group}"
environment 'MCP_VERSION', "${MCP_VERSION}"
environment 'MOD_CLASSES', '{source_roots}'
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
server = {
main 'net.minecraftforge.userdev.UserdevLauncher'
server {
main 'net.minecraftforge.userdev.LaunchTesting'
environment 'target', 'fmluserdevserver'
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
environment 'FORGE_GROUP', project.group
environment 'MCP_VERSION', MCP_VERSION
environment 'MC_VERSION', MC_VERSION
environment 'MC_VERSION', "${MC_VERSION}"
environment 'FORGE_GROUP', "${project.group}"
environment 'MCP_VERSION', "${MCP_VERSION}"
environment 'MOD_CLASSES', '{source_roots}'
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
}
}
@@ -905,9 +895,15 @@ project(':forge') {
}
}
applyRangeMap {
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
extractRangeMap {
addDependencies jar.archivePath
addSources sourceSets.userdev.java.srcDirs
}
applyRangeMap {
setSources sourceSets.userdev.java.srcDirs
}
tasks.eclipse.dependsOn('genEclipseRuns')
publishing {
publications {
@@ -953,12 +949,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()
}
@@ -1011,7 +1010,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'
+12 -21
View File
@@ -19,35 +19,26 @@ http://mcforge.readthedocs.io/en/latest/gettingstarted/
Step 1: Open your command-line and browse to the folder where you extracted the zip file.
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
Step 2: You're left with a choice.
If you prefer to use Eclipse:
1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux)
2. Open Eclipse, Import > Existing Gradle Project > Select Folder
or run "gradlew eclipse" to generate the project.
(Current Issue)
4. Open Project > Run/Debug Settings > Edit runClient and runServer > Environment
5. Edit MOD_CLASSES to show [modid]%%[Path]; 2 times rather then the generated 4.
Windows: "gradlew setupDecompWorkspace"
Linux/Mac OS: "./gradlew setupDecompWorkspace"
Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
If you prefer to use IntelliJ, steps are a little different.
If you prefer to use IntelliJ:
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command:
"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
4. Refresh the Gradle Project in IDEA if required.
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.
Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfuscate, and gather required assets to run minecraft, but will not generate human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
or the Forge Project Discord discord.gg/UvedJ9m
Forge source installation
=========================
+80 -42
View File
@@ -1,7 +1,6 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -9,8 +8,9 @@ buildscript {
}
}
apply plugin: 'net.minecraftforge.gradle'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -19,34 +19,49 @@ archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
//accessTransformer = file('my_at.cfg')
// accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
// default run configurations.
// these can be tweaked, removed, or duplicated as needed.
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
@@ -57,22 +72,21 @@ dependencies {
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings
//deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// for more info...
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
@@ -81,12 +95,36 @@ dependencies {
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes(["Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "24.0", // We are version 1 of the modlauncher specification
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact reobfArtifact
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
@@ -1,4 +0,0 @@
#Sun Jun 05 18:58:07 CEST 2011
version=1
eclipse.preferences.version=1
refresh.enabled=true
@@ -1,7 +0,0 @@
#Sun Jun 05 19:03:53 CEST 2011
eclipse.preferences.version=1
org.eclipse.debug.ui.UseContextualLaunch=false
Console.highWaterMark=88000
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<viewBindings>\r\n<view id\="org.eclipse.ui.console.ConsoleView">\r\n<perspective id\="org.eclipse.jdt.ui.JavaPerspective" userAction\="opened"/>\r\n</view>\r\n</viewBindings>\r\n
StringVariablePreferencePage=130,107,107,86,
@@ -1,3 +0,0 @@
#Sun Jun 05 18:58:07 CEST 2011
eclipse.preferences.version=1
org.eclipse.epp.usagedata.gathering.enabled=false
@@ -1,14 +0,0 @@
#Sun Sep 18 16:44:39 NZST 2011
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.source=1.6
@@ -1,4 +0,0 @@
#Sun Jun 05 18:58:05 CEST 2011
spacesForTabs=true
eclipse.preferences.version=1
overviewRuler_migration=migrated_3.1
@@ -1,9 +0,0 @@
#Sun Jun 05 18:58:07 CEST 2011
IMPORT_FILES_AND_FOLDERS_MODE=prompt
IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt
SAVE_ALL_BEFORE_BUILD=true
eclipse.preferences.version=1
tipsAndTricks=true
platformState=1287081747687
quickStart=false
PROBLEMS_FILTERS_MIGRATE=true
@@ -1,3 +0,0 @@
#Sun Jun 05 18:50:08 CEST 2011
eclipse.preferences.version=1
showIntro=false
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/MDKExample"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStart"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="MDKExample"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}/run"/>
</launchConfiguration>
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/MDKExample"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStartServer"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="MDKExample"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}/run"/>
</launchConfiguration>
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchHistory>
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
<mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Client&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Server&quot;/&gt;&#13;&#10;"/>
</mruHistory>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
<mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Client&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Server&quot;/&gt;&#13;&#10;"/>
</mruHistory>
<favorites/>
</launchGroup>
</launchHistory>
@@ -35,7 +35,7 @@ public class ExampleMod
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
// Register ourselves for server, registry and other game events we are interested in
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
@@ -54,28 +54,29 @@ public class ExampleMod
private void enqueueIMC(final InterModEnqueueEvent event)
{
// some example code to dispatch IMC to another mod
InterModComms.sendTo("forge", "helloworld", () -> { LOGGER.info("Hello world"); return "Hello world";});
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
private void processIMC(final InterModProcessEvent event)
{
// some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC", event.getIMCStream().
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.getMessageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public static void onServerStarting(FMLServerStartingEvent event) {
public void onServerStarting(FMLServerStartingEvent event) {
// do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD event bus
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
// Event bus for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
LOGGER.info("HELLO from Register Block");
}
+11 -11
View File
@@ -6,17 +6,9 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[24,)" #mandatory (24 is current forge version)
loaderVersion="[25,)" #mandatory (24 is current forge version)
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
@@ -27,6 +19,14 @@ version="${file.jarVersion}" #mandatory
displayName="Example Mod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
This is a long form description of the mod. You can write whatever you want here
@@ -42,7 +42,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[24,)" #mandatory
versionRange="[25,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
@@ -51,6 +51,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.13]"
versionRange="[1.13.2]"
ordering="NONE"
side="BOTH"
@@ -47,12 +47,17 @@
} else {
return i;
}
@@ -468,8 +470,12 @@
@@ -468,8 +470,17 @@
@Deprecated
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer)) {
+ p_196243_2_.func_175713_t(p_196243_3_);
+ // FORGE: Remove modded TEs when the block changes
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer // Vanilla ITEP classes, they do this themselves
+ || this instanceof net.minecraft.block.BlockBed
+ || this instanceof net.minecraft.block.BlockRedstoneDiode)) {
+ if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ p_196243_2_.func_175713_t(p_196243_3_);
+ }
+ }
}
@@ -60,7 +65,7 @@
public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
return 1;
}
@@ -484,30 +490,30 @@
@@ -484,30 +495,30 @@
if (f == -1.0F) {
return 0.0F;
} else {
@@ -105,7 +110,7 @@
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -529,6 +535,7 @@
@@ -529,6 +540,7 @@
}
@@ -113,7 +118,7 @@
public float func_149638_a() {
return this.field_149781_w;
}
@@ -543,7 +550,7 @@
@@ -543,7 +555,7 @@
}
}
@@ -122,7 +127,7 @@
}
public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
@@ -597,16 +604,22 @@
@@ -597,16 +609,22 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
p_180657_2_.func_71020_j(0.005F);
@@ -147,7 +152,7 @@
protected boolean func_149700_E() {
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
}
@@ -663,6 +676,7 @@
@@ -663,6 +681,7 @@
p_176216_2_.field_70181_x = 0.0D;
}
@@ -155,7 +160,7 @@
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
return new ItemStack(this);
}
@@ -737,6 +751,7 @@
@@ -737,6 +756,7 @@
}
}
@@ -163,7 +168,7 @@
public SoundType func_185467_w() {
return this.field_149762_H;
}
@@ -758,11 +773,11 @@
@@ -758,11 +778,11 @@
}
public static boolean func_196252_e(Block p_196252_0_) {
@@ -177,7 +182,7 @@
}
public static void func_149671_p() {
@@ -1129,7 +1144,7 @@
@@ -1129,7 +1149,7 @@
func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42)));
@@ -186,7 +191,7 @@
func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F)));
func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F)));
func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F)));
@@ -1455,6 +1470,7 @@
@@ -1455,6 +1475,7 @@
func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a()));
func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F)));
@@ -194,7 +199,7 @@
for(Block block85 : IRegistry.field_212618_g) {
for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) {
field_176229_d.func_195867_b(iblockstate);
@@ -1594,4 +1610,83 @@
@@ -1594,4 +1615,83 @@
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
}
}
@@ -28,7 +28,7 @@
f1 = 3.0F;
}
}
@@ -135,15 +137,19 @@
@@ -135,15 +137,20 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
@@ -40,6 +40,7 @@
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ super.getDrops(state, drops, world, pos, 0);
+ {
+ int i = this.func_185527_x(state);
if (i >= this.func_185526_g()) {
@@ -9,3 +9,13 @@
return true;
} else if (p_196250_2_.field_72995_K) {
return true;
@@ -173,4 +173,9 @@
public boolean func_196266_a(IBlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return false;
}
+
+ @Override
+ public boolean canSilkHarvest(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, EntityPlayer player) {
+ return true;
+ }
}
@@ -22,3 +22,12 @@
}
private static boolean func_176530_e(IWorldReaderBase p_176530_0_, BlockPos p_176530_1_) {
@@ -102,7 +102,7 @@
}
}
- return false;
+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_0_, p_176530_1_);
}
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
@@ -9,16 +9,17 @@
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
}
@@ -50,7 +50,7 @@
@@ -50,7 +50,8 @@
}
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
- return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q();
+ return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
+ IBlockState down = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
+ return down.func_185896_q() || down.func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
}
public void func_196259_b(IBlockState p_196259_1_, World p_196259_2_, BlockPos p_196259_3_, IBlockState p_196259_4_) {
@@ -67,19 +67,19 @@
@@ -67,19 +68,19 @@
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_) {
if (!p_189540_2_.field_72995_K) {
@@ -26,25 +27,25 @@
+ RailShape railshape = getRailDirection(p_189540_1_, p_189540_2_, p_189540_3_, null);
boolean flag = false;
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) {
+ if (p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID) {
+ if (!p_189540_1_.func_196955_c(p_189540_2_, p_189540_3_)) {
flag = true;
}
- if (railshape == RailShape.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q()) {
+ if (railshape == RailShape.ASCENDING_EAST && p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_193401_d(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP) != BlockFaceShape.SOLID) {
+ if (railshape == RailShape.ASCENDING_EAST && !p_189540_1_.func_196955_c(p_189540_2_, p_189540_3_.func_177974_f().func_177984_a())) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_WEST && p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_193401_d(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP) != BlockFaceShape.SOLID) {
+ } else if (railshape == RailShape.ASCENDING_WEST && !p_189540_1_.func_196955_c(p_189540_2_, p_189540_3_.func_177976_e().func_177984_a())) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_NORTH && p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_193401_d(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP) != BlockFaceShape.SOLID) {
+ } else if (railshape == RailShape.ASCENDING_NORTH && !p_189540_1_.func_196955_c(p_189540_2_, p_189540_3_.func_177978_c().func_177984_a())) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_SOUTH && p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_193401_d(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP) != BlockFaceShape.SOLID) {
+ } else if (railshape == RailShape.ASCENDING_SOUTH && !p_189540_1_.func_196955_c(p_189540_2_, p_189540_3_.func_177968_d().func_177984_a())) {
flag = true;
}
@@ -111,7 +111,7 @@
@@ -111,7 +112,7 @@
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
@@ -53,7 +54,7 @@
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
}
@@ -123,5 +123,66 @@
@@ -123,5 +124,66 @@
}
}
@@ -14,7 +14,7 @@
- RailShape railshape = p_i47755_3_.func_177229_b(this.field_196922_c.func_176560_l());
- this.field_208513_e = this.field_196922_c.func_208490_b();
+ RailShape railshape = this.field_196922_c.getRailDirection(field_196923_d, p_i47755_1_, p_i47755_2_, null);
+ this.field_208513_e = this.field_196922_c.isFlexibleRail(field_196923_d, p_i47755_1_, p_i47755_2_);
+ this.field_208513_e = !this.field_196922_c.isFlexibleRail(field_196923_d, p_i47755_1_, p_i47755_2_);
+ this.canMakeSlopes = this.field_196922_c.canMakeSlopes(field_196923_d, p_i47755_1_, p_i47755_2_);
this.func_208509_a(railshape);
}
@@ -0,0 +1,40 @@
--- a/net/minecraft/block/BlockSeaGrass.java
+++ b/net/minecraft/block/BlockSeaGrass.java
@@ -23,7 +23,7 @@
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
-public class BlockSeaGrass extends BlockBush implements IGrowable, ILiquidContainer {
+public class BlockSeaGrass extends BlockBush implements IGrowable, ILiquidContainer, net.minecraftforge.common.IShearable {
protected static final VoxelShape field_207798_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
protected BlockSeaGrass(Block.Properties p_i48780_1_) {
@@ -54,11 +54,7 @@
}
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
- if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ) {
- p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
- p_180657_2_.func_71020_j(0.005F);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(this));
- } else {
+ {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
@@ -102,4 +98,15 @@
public int func_200011_d(IBlockState p_200011_1_, IBlockReader p_200011_2_, BlockPos p_200011_3_) {
return Blocks.field_150355_j.func_176223_P().func_200016_a(p_200011_2_, p_200011_3_);
}
+
+ @Override
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return true;
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(this));
+ }
}
@@ -27,7 +27,7 @@
+
+ @Override
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return false;
+ return true;
+ }
+
+ @Override
@@ -9,19 +9,21 @@
ThreadLocal<Object2ByteMap<IBlockState>> field_208776_a = ThreadLocal.withInitial(() -> {
Object2ByteOpenHashMap<IBlockState> object2byteopenhashmap = new Object2ByteOpenHashMap<>();
object2byteopenhashmap.defaultReturnValue((byte)127);
@@ -97,6 +97,7 @@
@@ -97,6 +97,8 @@
return this.func_177230_c().func_149750_m(this);
}
+ @Deprecated //Forge: Use position sensitive version
+ /** @deprecated use {@link IBlockState#isAir(IBlockReader, BlockPos) */
+ @Deprecated
default boolean func_196958_f() {
return this.func_177230_c().func_196261_e(this);
}
@@ -109,6 +110,7 @@
@@ -109,6 +111,8 @@
return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_);
}
+ @Deprecated //Forge: Use position sensitive version
+ /** @deprecated use {@link IBlockState#rotate(IWorld, BlockPos, Rotation) */
+ @Deprecated
default IBlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this, p_185907_1_);
}
@@ -1,6 +1,25 @@
--- a/net/minecraft/client/KeyboardListener.java
+++ b/net/minecraft/client/KeyboardListener.java
@@ -271,10 +271,14 @@
@@ -246,7 +246,8 @@
}
IGuiEventListener iguieventlistener = this.field_197972_a.field_71462_r;
- if (p_197961_5_ == 1 && (!(this.field_197972_a.field_71462_r instanceof GuiControls) || ((GuiControls)iguieventlistener).field_152177_g <= Util.func_211177_b() - 20L)) {
+ if ((!(this.field_197972_a.field_71462_r instanceof GuiControls) || ((GuiControls)iguieventlistener).field_152177_g <= Util.func_211177_b() - 20L)) {
+ if (p_197961_5_ == 1) {
if (this.field_197972_a.field_71474_y.field_152395_am.func_197976_a(p_197961_3_, p_197961_4_)) {
this.field_197972_a.field_195558_d.func_198077_g();
return;
@@ -264,6 +265,8 @@
});
return;
}
+ } else if (p_197961_5_ == 0 /*GLFW_RELEASE*/ && this.field_197972_a.field_71462_r instanceof GuiControls)
+ ((GuiControls)this.field_197972_a.field_71462_r).field_146491_f = null; //Forge: Unset pure modifiers.
}
if (iguieventlistener != null) {
@@ -271,10 +274,14 @@
GuiScreen.func_195121_a(() -> {
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
if (p_197961_5_ == 0) {
@@ -17,7 +36,16 @@
}
}, "keyPressed event handler", iguieventlistener.getClass().getCanonicalName());
@@ -351,12 +355,16 @@
@@ -341,7 +348,7 @@
}
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireKeyInput(p_197961_3_, p_197961_4_, p_197961_5_, p_197961_6_);
}
}
@@ -351,12 +358,16 @@
if (iguieventlistener != null) {
if (Character.charCount(p_197963_3_) == 1) {
GuiScreen.func_195121_a(() -> {
@@ -1,6 +1,23 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -322,7 +322,6 @@
@@ -297,6 +297,7 @@
public Minecraft(GameConfiguration p_i45547_1_) {
this.field_195556_O = p_i45547_1_.field_178743_b;
field_71432_P = this;
+ net.minecraftforge.client.ForgeHooksClient.invalidateLog4jThreadCache();
this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
@@ -314,7 +315,7 @@
supplier = p_211818_2_;
}
- return new ResourcePackInfoClient(p_211818_0_, p_211818_1_, supplier, p_211818_3_, p_211818_4_, p_211818_5_);
+ return new ResourcePackInfoClient(p_211818_0_, p_211818_1_, supplier, p_211818_3_, p_211818_4_, p_211818_5_, p_211818_3_.isHidden());
});
this.field_110448_aq.func_198982_a(this.field_195554_ax);
this.field_110448_aq.func_198982_a(new FolderPackFinder(this.field_130070_K));
@@ -322,7 +323,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
@@ -8,7 +25,7 @@
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;
@@ -409,9 +408,11 @@
@@ -409,9 +409,11 @@
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
this.field_110451_am.func_199006_a(this.field_135017_as);
this.field_71474_y.func_198017_a(this.field_110448_aq);
@@ -20,7 +37,7 @@
this.field_195558_d.func_198098_h();
this.func_147108_a(new GuiScreenLoading());
this.func_195547_ap();
@@ -429,6 +430,8 @@
@@ -429,6 +431,8 @@
this.field_110451_am.func_199006_a(new GrassColorReloadListener());
this.field_110451_am.func_199006_a(new FoliageColorReloadListener());
@@ -29,7 +46,7 @@
this.field_195558_d.func_198076_a("Startup");
GlStateManager.func_179098_w();
GlStateManager.func_179103_j(7425);
@@ -442,19 +445,24 @@
@@ -442,19 +446,24 @@
GlStateManager.func_179096_D();
GlStateManager.func_179128_n(5888);
this.field_195558_d.func_198076_a("Post startup");
@@ -54,7 +71,7 @@
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
this.field_110451_am.func_199006_a(this.field_71460_t);
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
@@ -465,7 +473,10 @@
@@ -465,7 +474,10 @@
this.field_110451_am.func_199006_a(this.field_193995_ae);
GlStateManager.func_179083_b(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);
@@ -66,7 +83,7 @@
if (this.field_71475_ae != null) {
this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
} else {
@@ -474,6 +485,7 @@
@@ -474,6 +486,7 @@
this.field_184132_p = new DebugRenderer(this);
GLFW.glfwSetErrorCallback(this::func_195545_a).free();
@@ -74,7 +91,7 @@
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
this.field_195558_d.func_198077_g();
}
@@ -489,7 +501,7 @@
@@ -489,7 +502,7 @@
});
List<String> list = Lists.newArrayList();
GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> {
@@ -83,7 +100,7 @@
});
if (!GLFW.glfwInit()) {
throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list));
@@ -599,7 +611,7 @@
@@ -599,7 +612,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());
@@ -92,7 +109,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);
@@ -614,6 +626,7 @@
@@ -614,6 +627,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -100,7 +117,7 @@
public void func_110436_a() {
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());
@@ -668,16 +681,20 @@
@@ -668,16 +682,20 @@
}
public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
@@ -125,7 +142,7 @@
if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
this.field_71474_y.field_74330_P = false;
this.field_71456_v.func_146158_b().func_146231_a(true);
@@ -761,7 +778,7 @@
@@ -761,7 +779,7 @@
GLFW.glfwPollEvents();
long i1 = Util.func_211178_c() - l;
this.field_71424_I.func_76318_c("sound");
@@ -134,7 +151,7 @@
this.field_71424_I.func_76319_b();
this.field_71424_I.func_76320_a("render");
GlStateManager.func_179094_E();
@@ -771,11 +788,13 @@
@@ -771,11 +789,13 @@
GlStateManager.func_179098_w();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -148,7 +165,7 @@
}
this.field_71424_I.func_76319_b();
@@ -994,8 +1013,8 @@
@@ -994,8 +1014,8 @@
if (this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -159,7 +176,7 @@
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
}
@@ -1020,7 +1039,7 @@
@@ -1020,7 +1040,7 @@
break;
case BLOCK:
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -168,7 +185,7 @@
this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
break;
}
@@ -1030,6 +1049,7 @@
@@ -1030,6 +1050,7 @@
}
this.field_71439_g.func_184821_cY();
@@ -176,7 +193,7 @@
}
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
@@ -1060,7 +1080,7 @@
@@ -1060,7 +1081,7 @@
break;
case BLOCK:
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -185,7 +202,7 @@
int i = itemstack.func_190916_E();
EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand);
if (enumactionresult == EnumActionResult.SUCCESS) {
@@ -1079,6 +1099,9 @@
@@ -1079,6 +1100,9 @@
}
}
@@ -195,7 +212,7 @@
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
this.field_71460_t.field_78516_c.func_187460_a(enumhand);
return;
@@ -1098,6 +1121,8 @@
@@ -1098,6 +1122,8 @@
--this.field_71467_ac;
}
@@ -204,7 +221,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1220,6 +1245,8 @@
@@ -1220,6 +1246,8 @@
this.field_71424_I.func_76318_c("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -213,11 +230,24 @@
}
private void func_184117_aA() {
@@ -1396,8 +1423,14 @@
NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
@@ -1378,6 +1406,14 @@
guiscreenworking.func_200209_c(new TextComponentString(""));
}
+ if (!net.minecraftforge.fml.StartupQuery.check() || this.field_71437_Z.func_71241_aa()) {
+ this.func_147108_a(null);
+ return;
+ } else {
+ // if we're showing nothing, put the working screen back again
+ if (this.field_71462_r == null)
+ this.func_147108_a(guiscreenworking);
+ }
this.func_195542_b(false);
try {
@@ -1397,7 +1433,12 @@
networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
}));
+ net.minecraftforge.fml.network.NetworkHooks.registerClientLoginChannel(networkmanager);
networkmanager.func_179290_a(new CPacketHandshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN));
- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
+ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e();
@@ -229,7 +259,7 @@
this.field_71453_ak = networkmanager;
}
@@ -1411,6 +1444,7 @@
@@ -1411,6 +1452,7 @@
}
public void func_205055_a(@Nullable WorldClient p_205055_1_, GuiScreen p_205055_2_) {
@@ -237,7 +267,7 @@
if (p_205055_1_ == null) {
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
if (nethandlerplayclient != null) {
@@ -1447,6 +1481,7 @@
@@ -1447,6 +1489,7 @@
}
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_205055_1_);
@@ -245,7 +275,7 @@
if (p_205055_1_ != null) {
if (!this.field_71455_al) {
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
@@ -1493,6 +1528,7 @@
@@ -1493,6 +1536,7 @@
EntityPlayerSP entityplayersp = this.field_71439_g;
this.field_71439_g = this.field_71442_b.func_199681_a(this.field_71441_e, this.field_71439_g == null ? new StatisticsManager() : this.field_71439_g.func_146107_m(), this.field_71439_g == null ? new RecipeBookClient(new RecipeManager()) : this.field_71439_g.func_199507_B());
this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
@@ -253,7 +283,7 @@
this.field_71439_g.field_71093_bK = p_212315_1_;
this.field_175622_Z = this.field_71439_g;
this.field_71439_g.func_70065_x();
@@ -1532,110 +1568,8 @@
@@ -1532,110 +1576,8 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
@@ -366,7 +396,7 @@
}
}
@@ -1712,6 +1646,7 @@
@@ -1712,6 +1654,7 @@
return field_71432_P;
}
@@ -374,7 +404,7 @@
public ListenableFuture<Object> func_175603_A() {
return this.func_152344_a(this::func_110436_a);
}
@@ -1871,6 +1806,8 @@
@@ -1871,6 +1814,8 @@
}
public MusicTicker.MusicType func_147109_W() {
@@ -383,7 +413,7 @@
if (this.field_71462_r instanceof GuiWinGame) {
return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) {
@@ -2010,4 +1947,12 @@
@@ -2010,4 +1955,12 @@
public FontResourceManager func_211500_ak() {
return this.field_211501_aD;
}
@@ -18,6 +18,15 @@
}, "mouseReleased event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
}
}
@@ -103,7 +107,7 @@
}
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireMouseInput(p_198023_3_, p_198023_4_, p_198023_5_);
}
}
@@ -111,7 +115,9 @@
if (p_198020_1_ == Minecraft.func_71410_x().field_195558_d.func_198092_i()) {
double d0 = p_198020_5_ * this.field_198036_a.field_71474_y.field_208033_V;
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/entity/AbstractClientPlayer.java
+++ b/net/minecraft/client/entity/AbstractClientPlayer.java
@@ -114,7 +114,7 @@
f = 1.0F;
}
- if (this.func_184587_cr() && this.func_184607_cu().func_77973_b() == Items.field_151031_f) {
+ if (this.func_184587_cr() && this.func_184607_cu().func_77973_b() instanceof net.minecraft.item.ItemBow) {
int i = this.func_184612_cw();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F) {
@@ -126,6 +126,6 @@
f *= 1.0F - f1 * 0.15F;
}
@@ -1,10 +0,0 @@
--- a/net/minecraft/client/gui/GuiConnecting.java
+++ b/net/minecraft/client/gui/GuiConnecting.java
@@ -62,6 +62,7 @@
GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i, (p_209549_1_) -> {
GuiConnecting.this.func_209514_a(p_209549_1_);
}));
+ net.minecraftforge.fml.network.NetworkHooks.registerClientLoginChannel(GuiConnecting.this.field_146371_g);
GuiConnecting.this.field_146371_g.func_179290_a(new CPacketHandshake(p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN));
GuiConnecting.this.field_146371_g.func_179290_a(new CPacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e()));
} catch (UnknownHostException unknownhostexception) {
@@ -5,7 +5,7 @@
FontRenderer fontrenderer = this.field_146297_k.func_211500_ak().func_211504_a(Minecraft.field_71464_q);
int j2 = 6839882;
- if ((l < i1 + 1 || this.field_146297_k.field_71439_g.field_71068_ca < l1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) {
+ if (((l < i1 + 1 || this.field_146297_k.field_71439_g.field_71068_ca < l1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) || this.field_147075_G.field_185001_h[l] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
+ if (((l < i1 + 1 || this.field_146297_k.field_71439_g.field_71068_ca < l1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) || this.field_147075_G.field_185001_h[i1] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
this.func_73729_b(j1, j + 14 + 19 * i1, 0, 185, 108, 19);
this.func_73729_b(j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16);
fontrenderer.func_78279_b(s1, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1);
@@ -28,7 +28,7 @@
+ // FORGE - Move status icon check down from above so renderHUDEffect will still be called without a status icon
+ if (potion.func_76400_d())
this.func_73729_b(k + 3, l + 3, l1 * 18, 198 + k1 * 18, 18, 18);
+ potion.renderHUDEffect(k, l, potioneffect, field_73839_d, f);
+ potion.renderHUDEffect(potioneffect, this, k, l, this.field_73735_i, f);
}
}
@@ -0,0 +1,19 @@
--- a/net/minecraft/client/gui/GuiScreenResourcePacks.java
+++ b/net/minecraft/client/gui/GuiScreenResourcePacks.java
@@ -84,12 +84,15 @@
resourcepacklist.func_198983_a();
List<ResourcePackInfoClient> list = Lists.newArrayList(resourcepacklist.func_198978_b());
list.removeAll(resourcepacklist.func_198980_d());
+ list.removeIf(net.minecraft.resources.ResourcePackInfo::isHidden); // Forge: Hide some resource packs from the UI entirely
for(ResourcePackInfoClient resourcepackinfoclient : list) {
this.field_146970_i.func_195095_a(new ResourcePackListEntryFound(this, resourcepackinfoclient));
}
- for(ResourcePackInfoClient resourcepackinfoclient1 : Lists.reverse(Lists.newArrayList(resourcepacklist.func_198980_d()))) {
+ java.util.Collection<ResourcePackInfoClient> enabledList = resourcepacklist.func_198980_d();
+ enabledList.removeIf(net.minecraft.resources.ResourcePackInfo::isHidden); // Forge: Hide some resource packs from the UI entirely
+ for(ResourcePackInfoClient resourcepackinfoclient1 : Lists.reverse(Lists.newArrayList(enabledList))) {
this.field_146967_r.func_195095_a(new ResourcePackListEntryFound(this, resourcepackinfoclient1));
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/ServerListEntryNormal.java
+++ b/net/minecraft/client/gui/ServerListEntryNormal.java
@@ -143,6 +143,7 @@
} else if (k1 >= p_194999_1_ - l - 15 - 2 && k1 <= p_194999_1_ - 15 - 2 && l1 >= 0 && l1 <= 8) {
this.field_148303_c.func_146793_a(s);
}
+ net.minecraftforge.fml.client.ClientHooks.drawForgePingInfo(this.field_148303_c, field_148301_e, j, i, p_194999_1_, k1, l1);
if (this.field_148300_d.field_71474_y.field_85185_A || p_194999_5_) {
this.field_148300_d.func_110434_K().func_110577_a(field_178014_d);
@@ -8,7 +8,15 @@
import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
@@ -97,7 +96,8 @@
@@ -68,6 +67,7 @@
int i = this.field_147003_i;
int j = this.field_147009_r;
this.func_146976_a(p_73863_3_, p_73863_1_, p_73863_2_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawBackground(this, p_73863_1_, p_73863_2_));
GlStateManager.func_179101_C();
RenderHelper.func_74518_a();
GlStateManager.func_179140_f();
@@ -97,7 +97,8 @@
int j1 = slot.field_75223_e;
int k1 = slot.field_75221_f;
GlStateManager.func_179135_a(true, true, true, false);
@@ -18,7 +26,7 @@
GlStateManager.func_179135_a(true, true, true, true);
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
@@ -107,6 +107,7 @@
@@ -107,6 +108,7 @@
RenderHelper.func_74518_a();
this.func_146979_b(p_73863_1_, p_73863_2_);
RenderHelper.func_74520_c();
@@ -26,7 +34,7 @@
InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by;
ItemStack itemstack = this.field_147012_x.func_190926_b() ? inventoryplayer.func_70445_o() : this.field_147012_x;
if (!itemstack.func_190926_b()) {
@@ -158,8 +159,10 @@
@@ -158,8 +160,10 @@
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
this.field_73735_i = 200.0F;
this.field_146296_j.field_77023_b = 200.0F;
@@ -38,7 +46,7 @@
this.field_73735_i = 0.0F;
this.field_146296_j.field_77023_b = 0.0F;
}
@@ -203,11 +206,10 @@
@@ -203,11 +207,10 @@
this.field_73735_i = 100.0F;
this.field_146296_j.field_77023_b = 100.0F;
if (itemstack.func_190926_b() && p_146977_1_.func_111238_b()) {
@@ -53,7 +61,7 @@
this.func_175175_a(i, j, textureatlassprite, 16, 16);
GlStateManager.func_179145_e();
flag1 = true;
@@ -268,7 +270,8 @@
@@ -268,7 +271,8 @@
if (super.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_)) {
return true;
} else {
@@ -63,7 +71,7 @@
Slot slot = this.func_195360_a(p_mouseClicked_1_, p_mouseClicked_3_);
long i = Util.func_211177_b();
this.field_146993_M = this.field_146998_K == slot && i - this.field_146997_J < 250L && this.field_146992_L == p_mouseClicked_5_;
@@ -277,6 +280,7 @@
@@ -277,6 +281,7 @@
int j = this.field_147003_i;
int k = this.field_147009_r;
boolean flag1 = this.func_195361_a(p_mouseClicked_1_, p_mouseClicked_3_, j, k, p_mouseClicked_5_);
@@ -71,7 +79,7 @@
int l = -1;
if (slot != null) {
l = slot.field_75222_d;
@@ -302,7 +306,7 @@
@@ -302,7 +307,7 @@
}
} else if (!this.field_147007_t) {
if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) {
@@ -80,7 +88,7 @@
this.func_184098_a(slot, l, p_mouseClicked_5_, ClickType.CLONE);
} else {
boolean flag2 = l != -999 && (InputMappings.func_197956_a(340) || InputMappings.func_197956_a(344));
@@ -326,7 +330,7 @@
@@ -326,7 +331,7 @@
this.field_146987_F = 0;
} else if (p_mouseClicked_5_ == 1) {
this.field_146987_F = 1;
@@ -89,7 +97,7 @@
this.field_146987_F = 2;
}
}
@@ -379,10 +383,13 @@
@@ -379,10 +384,13 @@
}
public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_) {
@@ -103,7 +111,7 @@
int k = -1;
if (slot != null) {
k = slot.field_75222_d;
@@ -396,7 +403,7 @@
@@ -396,7 +404,7 @@
if (func_146272_n()) {
if (!this.field_146994_N.func_190926_b()) {
for(Slot slot2 : this.field_147002_h.field_75151_b) {
@@ -112,7 +120,7 @@
this.func_184098_a(slot2, slot2.field_75222_d, p_mouseReleased_5_, ClickType.QUICK_MOVE);
}
}
@@ -460,7 +467,7 @@
@@ -460,7 +468,7 @@
this.func_184098_a((Slot)null, -999, Container.func_94534_d(2, this.field_146987_F), ClickType.QUICK_CRAFT);
} else if (!this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) {
@@ -121,26 +129,36 @@
this.func_184098_a(slot, k, p_mouseReleased_5_, ClickType.CLONE);
} else {
boolean flag1 = k != -999 && (InputMappings.func_197956_a(340) || InputMappings.func_197956_a(344));
@@ -509,15 +516,15 @@
@@ -509,27 +517,31 @@
if (super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_)) {
return true;
} else {
- if (p_keyPressed_1_ == 256 || this.field_146297_k.field_71474_y.field_151445_Q.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ if (p_keyPressed_1_ == 256 || this.field_146297_k.field_71474_y.field_151445_Q.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.field_146297_k.field_71439_g.func_71053_j();
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
}
this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_);
- this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_);
+ if (this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_))
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) {
- if (this.field_146297_k.field_71474_y.field_74322_I.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, 0, ClickType.CLONE);
- } else if (this.field_146297_k.field_71474_y.field_74316_C.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
+ } else if (this.field_146297_k.field_71474_y.field_74316_C.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, func_146271_m() ? 1 : 0, ClickType.THROW);
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
}
}
@@ -529,7 +536,7 @@
- return true;
+ return false; // Forge MC-146650: Needs to return false when the key is not handled.
}
}
protected boolean func_195363_d(int p_195363_1_, int p_195363_2_) {
if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b() && this.field_147006_u != null) {
for(int i = 0; i < 9; ++i) {
@@ -149,7 +167,7 @@
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP);
return true;
}
@@ -556,4 +563,16 @@
@@ -556,4 +568,16 @@
}
}
@@ -148,7 +148,7 @@
+ boolean rendered = false;
+
+ for(ItemGroup itemgroup : java.util.Arrays.copyOfRange(ItemGroup.field_78032_a, start, end)) {
+ if (itemgroup != null) continue;
+ if (itemgroup == null) continue;
if (this.func_147052_b(itemgroup, p_73863_1_, p_73863_2_)) {
+ rendered = true;
break;
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/multiplayer/ServerData.java
+++ b/net/minecraft/client/multiplayer/ServerData.java
@@ -20,6 +20,7 @@
private ServerData.ServerResourceMode field_152587_j = ServerData.ServerResourceMode.PROMPT;
private String field_147411_m;
private boolean field_181042_l;
+ public net.minecraftforge.fml.client.ExtendedServerListData forgeData = null;
public ServerData(String p_i46420_1_, String p_i46420_2_, boolean p_i46420_3_) {
this.field_78847_a = p_i46420_1_;
@@ -15,3 +15,15 @@
}
public void func_72835_b(BooleanSupplier p_72835_1_) {
@@ -179,6 +181,11 @@
public void func_72900_e(Entity p_72900_1_) {
super.func_72900_e(p_72900_1_);
+ }
+
+ @Override
+ public void removeEntity(Entity p_72900_1_, boolean keepData) {
+ super.removeEntity(p_72900_1_, keepData);
this.field_73032_d.remove(p_72900_1_);
}
@@ -1,6 +1,14 @@
--- a/net/minecraft/client/network/NetHandlerLoginClient.java
+++ b/net/minecraft/client/network/NetHandlerLoginClient.java
@@ -122,6 +122,7 @@
@@ -98,6 +98,7 @@
this.field_209525_d.accept(new TextComponentTranslation("connect.joining"));
this.field_175091_e = p_147390_1_.func_179730_a();
this.field_147393_d.func_150723_a(EnumConnectionState.PLAY);
+ net.minecraftforge.fml.network.NetworkHooks.handleClientLoginSuccess(this.field_147393_d);
this.field_147393_d.func_150719_a(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e));
}
@@ -122,6 +123,7 @@
}
public void func_209521_a(SPacketCustomPayloadLogin p_209521_1_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/network/ServerPinger.java
+++ b/net/minecraft/client/network/ServerPinger.java
@@ -120,6 +120,8 @@
p_147224_1_.func_147407_a((String)null);
}
+ net.minecraftforge.fml.client.ClientHooks.processForgeListPingData(serverstatusresponse, p_147224_1_);
+
this.field_175092_e = Util.func_211177_b();
networkmanager.func_179290_a(new CPacketPing(this.field_175092_e));
this.field_147403_d = true;
@@ -1,15 +1,86 @@
--- a/net/minecraft/client/renderer/BlockModelRenderer.java
+++ b/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -45,7 +45,7 @@
@@ -44,11 +44,17 @@
this.field_187499_a = p_i46575_1_;
}
+ @Deprecated
public boolean func_199324_a(IWorldReader p_199324_1_, IBakedModel p_199324_2_, IBlockState p_199324_3_, BlockPos p_199324_4_, BufferBuilder p_199324_5_, boolean p_199324_6_, Random p_199324_7_, long p_199324_8_) {
- boolean flag = Minecraft.func_71379_u() && p_199324_3_.func_185906_d() == 0 && p_199324_2_.func_177555_b();
+ boolean flag = Minecraft.func_71379_u() && p_199324_3_.getLightValue(p_199324_1_, p_199324_4_) == 0 && p_199324_2_.isAmbientOcclusion(p_199324_3_);
+ return renderModel(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+ public boolean renderModel(IWorldReader p_199324_1_, IBakedModel p_199324_2_, IBlockState p_199324_3_, BlockPos p_199324_4_, BufferBuilder p_199324_5_, boolean p_199324_6_, Random p_199324_7_, long p_199324_8_, net.minecraftforge.client.model.data.IModelData modelData) {
+ boolean flag = Minecraft.func_71379_u() && p_199324_3_.getLightValue(p_199324_1_, p_199324_4_) == 0 && p_199324_2_.isAmbientOcclusion(p_199324_3_);
+ modelData = p_199324_2_.getModelData(p_199324_1_, p_199324_4_, p_199324_3_, modelData);
+
try {
return flag ? this.func_199326_b(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_) : this.func_199325_c(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_);
@@ -120,6 +120,13 @@
- return flag ? this.func_199326_b(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_) : this.func_199325_c(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_);
+ return flag ? this.renderModelSmooth(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, modelData) : this.renderModelFlat(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, modelData);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Tesselating block model");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block model being tesselated");
@@ -58,7 +64,12 @@
}
}
+ @Deprecated
public boolean func_199326_b(IWorldReader p_199326_1_, IBakedModel p_199326_2_, IBlockState p_199326_3_, BlockPos p_199326_4_, BufferBuilder p_199326_5_, boolean p_199326_6_, Random p_199326_7_, long p_199326_8_) {
+ return renderModelSmooth(p_199326_1_, p_199326_2_, p_199326_3_, p_199326_4_, p_199326_5_, p_199326_6_, p_199326_7_, p_199326_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderModelSmooth(IWorldReader p_199326_1_, IBakedModel p_199326_2_, IBlockState p_199326_3_, BlockPos p_199326_4_, BufferBuilder p_199326_5_, boolean p_199326_6_, Random p_199326_7_, long p_199326_8_, net.minecraftforge.client.model.data.IModelData modelData) {
boolean flag = false;
float[] afloat = new float[EnumFacing.values().length * 2];
BitSet bitset = new BitSet(3);
@@ -66,7 +77,7 @@
for(EnumFacing enumfacing : EnumFacing.values()) {
p_199326_7_.setSeed(p_199326_8_);
- List<BakedQuad> list = p_199326_2_.func_200117_a(p_199326_3_, enumfacing, p_199326_7_);
+ List<BakedQuad> list = p_199326_2_.getQuads(p_199326_3_, enumfacing, p_199326_7_, modelData);
if (!list.isEmpty() && (!p_199326_6_ || Block.func_176225_a(p_199326_3_, p_199326_1_, p_199326_4_, enumfacing))) {
this.func_187492_a(p_199326_1_, p_199326_3_, p_199326_4_, p_199326_5_, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
@@ -74,7 +85,7 @@
}
p_199326_7_.setSeed(p_199326_8_);
- List<BakedQuad> list1 = p_199326_2_.func_200117_a(p_199326_3_, (EnumFacing)null, p_199326_7_);
+ List<BakedQuad> list1 = p_199326_2_.getQuads(p_199326_3_, (EnumFacing)null, p_199326_7_, modelData);
if (!list1.isEmpty()) {
this.func_187492_a(p_199326_1_, p_199326_3_, p_199326_4_, p_199326_5_, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
@@ -83,13 +94,18 @@
return flag;
}
+ @Deprecated
public boolean func_199325_c(IWorldReader p_199325_1_, IBakedModel p_199325_2_, IBlockState p_199325_3_, BlockPos p_199325_4_, BufferBuilder p_199325_5_, boolean p_199325_6_, Random p_199325_7_, long p_199325_8_) {
+ return renderModelFlat(p_199325_1_, p_199325_2_, p_199325_3_, p_199325_4_, p_199325_5_, p_199325_6_, p_199325_7_, p_199325_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderModelFlat(IWorldReader p_199325_1_, IBakedModel p_199325_2_, IBlockState p_199325_3_, BlockPos p_199325_4_, BufferBuilder p_199325_5_, boolean p_199325_6_, Random p_199325_7_, long p_199325_8_, net.minecraftforge.client.model.data.IModelData modelData) {
boolean flag = false;
BitSet bitset = new BitSet(3);
for(EnumFacing enumfacing : EnumFacing.values()) {
p_199325_7_.setSeed(p_199325_8_);
- List<BakedQuad> list = p_199325_2_.func_200117_a(p_199325_3_, enumfacing, p_199325_7_);
+ List<BakedQuad> list = p_199325_2_.getQuads(p_199325_3_, enumfacing, p_199325_7_, modelData);
if (!list.isEmpty() && (!p_199325_6_ || Block.func_176225_a(p_199325_3_, p_199325_1_, p_199325_4_, enumfacing))) {
int i = p_199325_3_.func_185889_a(p_199325_1_, p_199325_4_.func_177972_a(enumfacing));
this.func_187496_a(p_199325_1_, p_199325_3_, p_199325_4_, i, false, p_199325_5_, list, bitset);
@@ -98,7 +114,7 @@
}
p_199325_7_.setSeed(p_199325_8_);
- List<BakedQuad> list1 = p_199325_2_.func_200117_a(p_199325_3_, (EnumFacing)null, p_199325_7_);
+ List<BakedQuad> list1 = p_199325_2_.getQuads(p_199325_3_, (EnumFacing)null, p_199325_7_, modelData);
if (!list1.isEmpty()) {
this.func_187496_a(p_199325_1_, p_199325_3_, p_199325_4_, -1, true, p_199325_5_, list1, bitset);
flag = true;
@@ -120,6 +136,13 @@
p_187492_8_.func_187491_a(p_187492_1_, p_187492_2_, p_187492_3_, bakedquad.func_178210_d(), p_187492_6_, p_187492_7_);
p_187492_4_.func_178981_a(bakedquad.func_178209_a());
p_187492_4_.func_178962_a(p_187492_8_.field_178207_c[0], p_187492_8_.field_178207_c[1], p_187492_8_.field_178207_c[2], p_187492_8_.field_178207_c[3]);
@@ -23,7 +94,7 @@
if (bakedquad.func_178212_b()) {
int k = this.field_187499_a.func_186724_a(p_187492_2_, p_187492_1_, p_187492_3_, bakedquad.func_178211_c());
float f = (float)(k >> 16 & 255) / 255.0F;
@@ -229,10 +236,22 @@
@@ -229,10 +252,22 @@
float f = (float)(k >> 16 & 255) / 255.0F;
float f1 = (float)(k >> 8 & 255) / 255.0F;
float f2 = (float)(k & 255) / 255.0F;
@@ -9,7 +9,7 @@
this.field_175025_e = new BlockFluidRenderer();
}
@@ -40,7 +40,7 @@
@@ -40,12 +40,17 @@
if (p_175020_1_.func_185901_i() == EnumBlockRenderType.MODEL) {
IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
long i = p_175020_1_.func_209533_a(p_175020_2_);
@@ -18,16 +18,26 @@
this.field_175027_c.func_199324_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true, this.field_195476_e, i);
}
}
@@ -53,6 +53,8 @@
+ @Deprecated
public boolean func_195475_a(IBlockState p_195475_1_, BlockPos p_195475_2_, IWorldReader p_195475_3_, BufferBuilder p_195475_4_, Random p_195475_5_) {
+ return renderBlock(p_195475_1_, p_195475_2_, p_195475_3_, p_195475_4_, p_195475_5_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderBlock(IBlockState p_195475_1_, BlockPos p_195475_2_, IWorldReader p_195475_3_, BufferBuilder p_195475_4_, Random p_195475_5_, net.minecraftforge.client.model.data.IModelData modelData) {
try {
EnumBlockRenderType enumblockrendertype = p_195475_1_.func_185901_i();
if (enumblockrendertype == EnumBlockRenderType.INVISIBLE) {
@@ -53,7 +58,7 @@
} else {
switch(enumblockrendertype) {
case MODEL:
+ IBakedModel model = this.func_184389_a(p_195475_1_);
+ p_195475_1_ = p_195475_1_.func_177230_c().getExtendedState(p_195475_1_, p_195475_3_, p_195475_2_);
return this.field_175027_c.func_199324_a(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_));
- return this.field_175027_c.func_199324_a(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_));
+ return this.field_175027_c.renderModel(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_), modelData);
case ENTITYBLOCK_ANIMATED:
return false;
@@ -105,4 +107,9 @@
default:
@@ -105,4 +110,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175025_e.func_178268_a();
}
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/renderer/FirstPersonRenderer.java
+++ b/net/minecraft/client/renderer/FirstPersonRenderer.java
@@ -273,7 +273,7 @@
boolean flag1 = true;
if (abstractclientplayer.func_184587_cr()) {
ItemStack itemstack = abstractclientplayer.func_184607_cu();
- if (itemstack.func_77973_b() == Items.field_151031_f) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow) {
flag = abstractclientplayer.func_184600_cs() == EnumHand.MAIN_HAND;
flag1 = !flag;
}
@@ -286,12 +286,14 @@
if (flag) {
float f4 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
@@ -138,7 +138,7 @@
protected void func_78474_d(float p_78474_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.func_201675_m().getWeatherRenderer();
+ if (renderer != null) {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ renderer.render(this.field_78529_t, p_78474_1_, this.field_78531_r.field_71441_e, this.field_78531_r);
+ return;
+ }
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
@@ -30,7 +30,7 @@
this.func_73729_b(i + 6, j + 7, i1 % 12 * 18, 198 + i1 / 12 * 18, 18, 18);
}
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
+ potion.renderInventoryEffect(potioneffect, this, i, j, this.field_73735_i);
+ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; }
String s1 = I18n.func_135052_a(potion.func_76393_a());
if (potioneffect.func_76458_c() == 1) {
@@ -16,7 +16,18 @@
this.field_184395_f = p_i46552_3_;
}
@@ -97,7 +98,7 @@
@@ -74,6 +75,10 @@
}
private void func_191967_a(IBakedModel p_191967_1_, int p_191967_2_, ItemStack p_191967_3_) {
+ if (net.minecraftforge.common.ForgeConfig.CLIENT.allowEmissiveItems.get()) {
+ net.minecraftforge.client.ForgeHooksClient.renderLitItem(this, p_191967_1_, p_191967_2_, p_191967_3_);
+ return;
+ }
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_176599_b);
@@ -97,7 +102,7 @@
if (p_180454_2_.func_188618_c()) {
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179091_B();
@@ -25,7 +36,7 @@
} else {
this.func_191961_a(p_180454_2_, p_180454_1_);
if (p_180454_1_.func_77962_s()) {
@@ -163,7 +164,7 @@
@@ -163,7 +168,7 @@
k = k | -16777216;
}
@@ -34,7 +45,7 @@
}
}
@@ -224,11 +225,8 @@
@@ -224,11 +229,8 @@
GlStateManager.func_179147_l();
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.func_179094_E();
@@ -48,7 +59,7 @@
this.func_180454_a(p_184394_1_, p_184394_2_);
GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
@@ -259,7 +257,7 @@
@@ -259,7 +261,7 @@
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.func_180452_a(p_191962_2_, p_191962_3_, p_191962_4_.func_177556_c());
@@ -57,7 +68,7 @@
this.func_180454_a(p_191962_1_, p_191962_4_);
GlStateManager.func_179118_c();
GlStateManager.func_179101_C();
@@ -298,6 +296,7 @@
@@ -298,6 +300,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_184391_2_.func_77973_b());
});
@@ -65,7 +76,7 @@
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_184391_2_.func_77952_i());
});
@@ -329,9 +328,12 @@
@@ -329,9 +332,12 @@
GlStateManager.func_179147_l();
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
@@ -79,7 +90,7 @@
GlStateManager.func_179140_f();
GlStateManager.func_179097_i();
GlStateManager.func_179090_x();
@@ -339,11 +341,9 @@
@@ -339,11 +345,9 @@
GlStateManager.func_179084_k();
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
@@ -94,7 +105,7 @@
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
GlStateManager.func_179147_l();
@@ -382,4 +382,9 @@
@@ -382,4 +386,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();
}
@@ -110,7 +110,7 @@
public void func_195465_a(float p_195465_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ renderer.render(this.field_72773_u, p_195465_1_, this.field_72769_h, this.field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) {
@@ -0,0 +1,26 @@
--- a/net/minecraft/client/renderer/chunk/ChunkRenderTask.java
+++ b/net/minecraft/client/renderer/chunk/ChunkRenderTask.java
@@ -19,11 +19,14 @@
private CompiledChunk field_178547_f;
private ChunkRenderTask.Status field_178548_g = ChunkRenderTask.Status.PENDING;
private boolean field_178554_h;
+ private java.util.Map<net.minecraft.util.math.BlockPos, net.minecraftforge.client.model.data.IModelData> modelData;
public ChunkRenderTask(RenderChunk p_i46560_1_, ChunkRenderTask.Type p_i46560_2_, double p_i46560_3_) {
this.field_178553_a = p_i46560_1_;
this.field_178549_d = p_i46560_2_;
this.field_188229_e = p_i46560_3_;
+
+ modelData = net.minecraftforge.client.model.ModelDataManager.getModelData(net.minecraft.client.Minecraft.func_71410_x().field_71441_e, new net.minecraft.util.math.ChunkPos(p_i46560_1_.func_178568_j()));
}
public ChunkRenderTask.Status func_178546_a() {
@@ -128,4 +131,8 @@
REBUILD_CHUNK,
RESORT_TRANSPARENCY;
}
+
+ public net.minecraftforge.client.model.data.IModelData getModelData(net.minecraft.util.math.BlockPos pos) {
+ return modelData.getOrDefault(pos, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
}
@@ -19,7 +19,7 @@
VisGraph lvt_11_1_ = new VisGraph();
HashSet lvt_12_1_ = Sets.newHashSet();
if (lvt_10_1_ != null) {
@@ -142,22 +143,23 @@
@@ -142,22 +143,24 @@
lvt_11_1_.func_178606_a(blockpos$mutableblockpos);
}
@@ -41,13 +41,14 @@
IFluidState ifluidstate = lvt_10_1_.func_204610_c(blockpos$mutableblockpos);
- if (!ifluidstate.func_206888_e()) {
- BlockRenderLayer blockrenderlayer1 = ifluidstate.func_180664_k();
+ net.minecraftforge.client.model.data.IModelData modelData = p_178581_4_.getModelData(blockpos$mutableblockpos);
+ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) {
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1);
+ if (!ifluidstate.func_206888_e() && ifluidstate.canRenderInLayer(blockrenderlayer1)) {
int j = blockrenderlayer1.ordinal();
BufferBuilder bufferbuilder = p_178581_4_.func_178545_d().func_179039_a(j);
if (!compiledchunk.func_178492_d(blockrenderlayer1)) {
@@ -168,17 +170,18 @@
@@ -168,17 +171,18 @@
aboolean[j] |= blockrendererdispatcher.func_205318_a(blockpos$mutableblockpos, lvt_10_1_, bufferbuilder, ifluidstate);
}
@@ -64,7 +65,8 @@
this.func_178573_a(bufferbuilder1, blockpos);
}
aboolean[k] |= blockrendererdispatcher.func_195475_a(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random);
- aboolean[k] |= blockrendererdispatcher.func_195475_a(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random);
+ aboolean[k] |= blockrendererdispatcher.renderBlock(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random, modelData);
}
+ }
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
@@ -0,0 +1,33 @@
--- a/net/minecraft/client/renderer/color/ItemColors.java
+++ b/net/minecraft/client/renderer/color/ItemColors.java
@@ -22,7 +22,8 @@
@OnlyIn(Dist.CLIENT)
public class ItemColors {
- private final ObjectIntIdentityMap<IItemColor> field_186732_a = new ObjectIntIdentityMap<>(32);
+ // FORGE: Use RegistryDelegates as non-Vanilla item ids are not constant
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Item>, IItemColor> field_186732_a = new java.util.HashMap<>();
public static ItemColors func_186729_a(BlockColors p_186729_0_) {
ItemColors itemcolors = new ItemColors();
@@ -80,17 +81,18 @@
itemcolors.func_199877_a((p_210237_0_, p_210237_1_) -> {
return p_210237_1_ == 0 ? -1 : ItemMap.func_190907_h(p_210237_0_);
}, Items.field_151098_aY);
+ net.minecraftforge.client.ForgeHooksClient.onItemColorsInit(itemcolors, p_186729_0_);
return itemcolors;
}
public int func_186728_a(ItemStack p_186728_1_, int p_186728_2_) {
- IItemColor iitemcolor = this.field_186732_a.func_148745_a(IRegistry.field_212630_s.func_148757_b(p_186728_1_.func_77973_b()));
+ IItemColor iitemcolor = this.field_186732_a.get(p_186728_1_.func_77973_b().delegate);
return iitemcolor == null ? -1 : iitemcolor.getColor(p_186728_1_, p_186728_2_);
}
public void func_199877_a(IItemColor p_199877_1_, IItemProvider... p_199877_2_) {
for(IItemProvider iitemprovider : p_199877_2_) {
- this.field_186732_a.func_148746_a(p_199877_1_, Item.func_150891_b(iitemprovider.func_199767_j()));
+ this.field_186732_a.put(iitemprovider.func_199767_j().delegate, p_199877_1_);
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java
+++ b/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java
@@ -43,7 +43,7 @@
GlStateManager.func_179114_b(-5.0F, 0.0F, 1.0F, 0.0F);
float f1 = 0.375F;
GlStateManager.func_179152_a(0.375F, -0.375F, 0.375F);
- } else if (item == Items.field_151031_f) {
+ } else if (item instanceof net.minecraft.item.ItemBow) {
GlStateManager.func_179109_b(0.0F, 0.125F, -0.125F);
GlStateManager.func_179114_b(-45.0F, 0.0F, 1.0F, 0.0F);
float f2 = 0.625F;
@@ -0,0 +1,20 @@
--- a/net/minecraft/client/renderer/entity/model/ModelSkeleton.java
+++ b/net/minecraft/client/renderer/entity/model/ModelSkeleton.java
@@ -42,7 +42,7 @@
this.field_187076_m = ModelBiped.ArmPose.EMPTY;
this.field_187075_l = ModelBiped.ArmPose.EMPTY;
ItemStack itemstack = p_78086_1_.func_184586_b(EnumHand.MAIN_HAND);
- if (itemstack.func_77973_b() == Items.field_151031_f && ((AbstractSkeleton)p_78086_1_).func_184725_db()) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow && ((AbstractSkeleton)p_78086_1_).func_184725_db()) {
if (p_78086_1_.func_184591_cq() == EnumHandSide.RIGHT) {
this.field_187076_m = ModelBiped.ArmPose.BOW_AND_ARROW;
} else {
@@ -57,7 +57,7 @@
super.func_78087_a(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_);
ItemStack itemstack = ((EntityLivingBase)p_78087_7_).func_184614_ca();
AbstractSkeleton abstractskeleton = (AbstractSkeleton)p_78087_7_;
- if (abstractskeleton.func_184725_db() && (itemstack.func_190926_b() || itemstack.func_77973_b() != Items.field_151031_f)) {
+ if (abstractskeleton.func_184725_db() && (itemstack.func_190926_b() || !(itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow))) {
float f = MathHelper.func_76126_a(this.field_78095_p * (float)Math.PI);
float f1 = MathHelper.func_76126_a((1.0F - (1.0F - this.field_78095_p) * (1.0F - this.field_78095_p)) * (float)Math.PI);
this.field_178723_h.field_78808_h = 0.0F;
@@ -1,6 +1,14 @@
--- a/net/minecraft/client/renderer/model/BakedQuadRetextured.java
+++ b/net/minecraft/client/renderer/model/BakedQuadRetextured.java
@@ -17,10 +17,15 @@
@@ -10,17 +10,22 @@
private final TextureAtlasSprite field_178218_d;
public BakedQuadRetextured(BakedQuad p_i46217_1_, TextureAtlasSprite p_i46217_2_) {
- super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a());
+ super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a(), p_i46217_1_.shouldApplyDiffuseLighting(), p_i46217_1_.getFormat());
this.field_178218_d = p_i46217_2_;
this.func_178217_e();
}
private void func_178217_e() {
for(int i = 0; i < 4; ++i) {
@@ -1,15 +1,17 @@
--- a/net/minecraft/client/renderer/model/IBakedModel.java
+++ b/net/minecraft/client/renderer/model/IBakedModel.java
@@ -10,7 +10,7 @@
@@ -10,7 +10,9 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public interface IBakedModel {
+public interface IBakedModel extends net.minecraftforge.client.extensions.IForgeBakedModel {
+
+ @Deprecated
List<BakedQuad> func_200117_a(@Nullable IBlockState p_200117_1_, @Nullable EnumFacing p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,7 +21,8 @@
@@ -21,7 +23,8 @@
TextureAtlasSprite func_177554_e();
@@ -17,6 +17,6 @@
- IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_);
+ @Deprecated
+ default IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) {
+ return bake(p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a);
+ return bake(p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java
@@ -67,6 +67,7 @@
}
private boolean func_188186_a(BlockPos p_188186_1_, IBlockState p_188186_2_, BufferBuilder p_188186_3_, World p_188186_4_, boolean p_188186_5_) {
+ if (field_178462_c == null) field_178462_c = Minecraft.func_71410_x().func_175602_ab();
return this.field_178462_c.func_175019_b().func_199324_a(p_188186_4_, this.field_178462_c.func_184389_a(p_188186_2_), p_188186_2_, p_188186_1_, p_188186_3_, p_188186_5_, new Random(), p_188186_2_.func_209533_a(p_188186_1_));
}
}
@@ -0,0 +1,32 @@
--- a/net/minecraft/client/resources/ResourcePackInfoClient.java
+++ b/net/minecraft/client/resources/ResourcePackInfoClient.java
@@ -23,8 +23,13 @@
@Nullable
private ResourceLocation field_195810_b;
+ @Deprecated
public ResourcePackInfoClient(String p_i48113_1_, boolean p_i48113_2_, Supplier<IResourcePack> p_i48113_3_, IResourcePack p_i48113_4_, PackMetadataSection p_i48113_5_, ResourcePackInfo.Priority p_i48113_6_) {
- super(p_i48113_1_, p_i48113_2_, p_i48113_3_, p_i48113_4_, p_i48113_5_, p_i48113_6_);
+ this(p_i48113_1_, p_i48113_2_, p_i48113_3_, p_i48113_4_, p_i48113_5_, p_i48113_6_, false);
+ }
+
+ public ResourcePackInfoClient(String p_i48113_1_, boolean p_i48113_2_, Supplier<IResourcePack> p_i48113_3_, IResourcePack p_i48113_4_, PackMetadataSection p_i48113_5_, ResourcePackInfo.Priority p_i48113_6_, boolean hidden) {
+ super(p_i48113_1_, p_i48113_2_, p_i48113_3_, p_i48113_4_, p_i48113_5_, p_i48113_6_, hidden);
NativeImage nativeimage = null;
try (InputStream inputstream = p_i48113_4_.func_195763_b("pack.png")) {
@@ -36,8 +41,13 @@
this.field_195809_a = nativeimage;
}
+ @Deprecated
public ResourcePackInfoClient(String p_i48114_1_, boolean p_i48114_2_, Supplier<IResourcePack> p_i48114_3_, ITextComponent p_i48114_4_, ITextComponent p_i48114_5_, PackCompatibility p_i48114_6_, ResourcePackInfo.Priority p_i48114_7_, boolean p_i48114_8_, @Nullable NativeImage p_i48114_9_) {
- super(p_i48114_1_, p_i48114_2_, p_i48114_3_, p_i48114_4_, p_i48114_5_, p_i48114_6_, p_i48114_7_, p_i48114_8_);
+ this(p_i48114_1_, p_i48114_2_, p_i48114_3_, p_i48114_4_, p_i48114_5_, p_i48114_6_, p_i48114_7_, p_i48114_8_, p_i48114_9_, false);
+ }
+
+ public ResourcePackInfoClient(String p_i48114_1_, boolean p_i48114_2_, Supplier<IResourcePack> p_i48114_3_, ITextComponent p_i48114_4_, ITextComponent p_i48114_5_, PackCompatibility p_i48114_6_, ResourcePackInfo.Priority p_i48114_7_, boolean p_i48114_8_, @Nullable NativeImage p_i48114_9_, boolean hidden) {
+ super(p_i48114_1_, p_i48114_2_, p_i48114_3_, p_i48114_4_, p_i48114_5_, p_i48114_6_, p_i48114_7_, p_i48114_8_, hidden);
this.field_195809_a = p_i48114_9_;
}
@@ -94,7 +94,7 @@
return this.field_74512_d.equals(p_197983_1_.field_74512_d);
}
@@ -153,14 +173,94 @@
@@ -153,14 +173,110 @@
}
public String func_197978_k() {
@@ -120,6 +120,14 @@
+ /**
+ * Convenience constructor for creating KeyBindings with keyConflictContext set.
+ */
+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, final InputMappings.Type inputType, final int keyCode, String category)
+ {
+ this(description, keyConflictContext, inputType.func_197944_a(keyCode), category);
+ }
+
+ /**
+ * Convenience constructor for creating KeyBindings with keyConflictContext set.
+ */
+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, InputMappings.Input keyCode, String category)
+ {
+ this(description, keyConflictContext, net.minecraftforge.client.settings.KeyModifier.NONE, keyCode, category);
@@ -128,6 +136,14 @@
+ /**
+ * Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
+ */
+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, net.minecraftforge.client.settings.KeyModifier keyModifier, final InputMappings.Type inputType, final int keyCode, String category)
+ {
+ this(description, keyConflictContext, keyModifier, inputType.func_197944_a(keyCode), category);
+ }
+
+ /**
+ * Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
+ */
+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, net.minecraftforge.client.settings.KeyModifier keyModifier, InputMappings.Input keyCode, String category)
+ {
+ this.field_74515_c = description;
@@ -0,0 +1,32 @@
--- a/net/minecraft/command/impl/TeleportCommand.java
+++ b/net/minecraft/command/impl/TeleportCommand.java
@@ -54,7 +54,7 @@
private static int func_201126_a(CommandSource p_201126_0_, Collection<? extends Entity> p_201126_1_, Entity p_201126_2_) {
for(Entity entity : p_201126_1_) {
- func_201127_a(p_201126_0_, entity, p_201126_0_.func_197023_e(), p_201126_2_.field_70165_t, p_201126_2_.field_70163_u, p_201126_2_.field_70161_v, EnumSet.noneOf(SPacketPlayerPosLook.EnumFlags.class), p_201126_2_.field_70177_z, p_201126_2_.field_70125_A, (TeleportCommand.Facing)null);
+ func_201127_a(p_201126_0_, entity, (WorldServer) p_201126_2_.func_130014_f_(), p_201126_2_.field_70165_t, p_201126_2_.field_70163_u, p_201126_2_.field_70161_v, EnumSet.noneOf(SPacketPlayerPosLook.EnumFlags.class), p_201126_2_.field_70177_z, p_201126_2_.field_70125_A, (TeleportCommand.Facing)null); // Forge: Fix MC-128441 cross-dimension teleporting does not work
}
if (p_201126_1_.size() == 1) {
@@ -135,9 +135,9 @@
p_201127_1_.func_70034_d(f);
} else {
WorldServer worldserver = (WorldServer)p_201127_1_.field_70170_p;
- worldserver.func_72900_e(p_201127_1_);
+ worldserver.removeEntity(p_201127_1_, true); //Forge: Delay invalidating caps until we copy.
p_201127_1_.field_71093_bK = p_201127_2_.field_73011_w.func_186058_p();
- p_201127_1_.field_70128_L = false;
+ p_201127_1_.revive();
Entity entity = p_201127_1_;
p_201127_1_ = p_201127_1_.func_200600_R().func_200721_a(p_201127_2_);
if (p_201127_1_ == null) {
@@ -152,7 +152,7 @@
p_201127_2_.func_72838_d(p_201127_1_);
p_201127_1_.field_98038_p = flag;
p_201127_2_.func_72866_a(p_201127_1_, false);
- entity.field_70128_L = true;
+ entity.remove(false); //Forge: now invalidate everything.
}
}
@@ -8,7 +8,25 @@
}
public String func_71501_a() {
@@ -132,6 +133,7 @@
@@ -115,23 +116,13 @@
throwable.setStackTrace(this.field_71511_b.getStackTrace());
}
- String s;
- try {
- stringwriter = new StringWriter();
- printwriter = new PrintWriter(stringwriter);
- throwable.printStackTrace(printwriter);
- s = stringwriter.toString();
- } finally {
- IOUtils.closeQuietly((Writer)stringwriter);
- IOUtils.closeQuietly((Writer)printwriter);
- }
-
- return s;
+ return net.minecraftforge.fml.CrashReportExtender.generateEnhancedStackTrace(throwable);
}
public String func_71502_e() {
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append("---- Minecraft Crash Report ----\n");
@@ -6,7 +6,7 @@
IBlockState iblockstate2 = p_185266_1_.func_180495_p(blockpos$mutableblockpos1);
- if (iblockstate2.func_185904_a() == Material.field_151586_h && iblockstate2.func_177229_b(BlockFlowingFluid.field_176367_b) == 0 && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1)) {
+ boolean isFull = iblockstate2.func_177230_c() == Blocks.field_150355_j && iblockstate2.func_177229_b(BlockFlowingFluid.field_176367_b) == 0; //TODO: Forge, modded waters?
+ if (iblockstate2.func_185904_a() == Material.field_151586_h && isFull && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1)) {
+ if (iblockstate2.func_185904_a() == Material.field_151586_h && isFull && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, new net.minecraftforge.common.util.BlockSnapshot(p_185266_1_, blockpos$mutableblockpos1.func_185334_h(), iblockstate2), net.minecraft.util.EnumFacing.UP)) {
p_185266_1_.func_175656_a(blockpos$mutableblockpos1, iblockstate);
p_185266_1_.func_205220_G_().func_205360_a(blockpos$mutableblockpos1.func_185334_h(), Blocks.field_185778_de, MathHelper.func_76136_a(p_185266_0_.func_70681_au(), 60, 120));
}
@@ -15,7 +15,15 @@
private final EntityType<?> field_200606_g;
private int field_145783_c;
public boolean field_70156_m;
@@ -192,6 +193,7 @@
@@ -132,6 +133,7 @@
public boolean field_70133_I;
protected boolean field_70134_J;
private boolean field_174835_g;
+ @Deprecated //Forge: Use isAlive, remove(boolean) and revive() instead of directly accessing this field. To allow the entity to react to and better control this information.
public boolean field_70128_L;
public float field_70130_N;
public float field_70131_O;
@@ -192,6 +194,7 @@
private long field_191506_aJ;
public Entity(EntityType<?> p_i48580_1_, World p_i48580_2_) {
@@ -23,7 +31,7 @@
this.field_145783_c = field_70152_a++;
this.field_184244_h = Lists.newArrayList();
this.field_70121_D = field_174836_a;
@@ -221,6 +223,8 @@
@@ -221,6 +224,8 @@
this.field_70180_af.func_187214_a(field_184234_aB, false);
this.field_70180_af.func_187214_a(field_189655_aD, false);
this.func_70088_a();
@@ -32,15 +40,21 @@
}
public EntityType<?> func_200600_R() {
@@ -290,6 +294,7 @@
@@ -289,7 +294,13 @@
}
public void func_70106_y() {
+ this.remove(false);
+ }
+
+ public void remove(boolean keepData) {
this.field_70128_L = true;
+ this.invalidateCaps();
+ if (!keepData)
+ this.invalidateCaps();
}
public void func_184174_b(boolean p_184174_1_) {
@@ -324,6 +329,7 @@
@@ -324,6 +335,7 @@
this.field_70165_t = p_70107_1_;
this.field_70163_u = p_70107_3_;
this.field_70161_v = p_70107_5_;
@@ -48,7 +62,7 @@
float f = this.field_70130_N / 2.0F;
float f1 = this.field_70131_O;
this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f));
@@ -697,7 +703,7 @@
@@ -697,7 +709,7 @@
int k1 = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(j1, k, k1);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -57,7 +71,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
Block block1 = iblockstate1.func_177230_c();
@@ -735,7 +741,7 @@
@@ -735,7 +747,7 @@
this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(d21 * d21 + d23 * d23) * 0.6D);
this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d21 * d21 + d22 * d22 + d23 * d23) * 0.6D);
@@ -66,7 +80,7 @@
this.field_70150_b = this.func_203009_ad();
if (this.func_70090_H()) {
Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this;
@@ -749,7 +755,7 @@
@@ -749,7 +761,7 @@
} else {
this.func_180429_a(blockpos, iblockstate);
}
@@ -75,7 +89,7 @@
this.field_191959_ay = this.func_191954_d(this.field_82151_R);
}
}
@@ -795,6 +801,7 @@
@@ -795,6 +807,7 @@
this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
this.field_70163_u = axisalignedbb.field_72338_b;
this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
@@ -83,7 +97,7 @@
}
protected SoundEvent func_184184_Z() {
@@ -846,7 +853,7 @@
@@ -846,7 +859,7 @@
protected void func_180429_a(BlockPos p_180429_1_, IBlockState p_180429_2_) {
if (!p_180429_2_.func_185904_a().func_76224_d()) {
@@ -92,7 +106,7 @@
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -1041,6 +1048,7 @@
@@ -1041,6 +1054,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -100,7 +114,7 @@
if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
this.field_70170_p.func_195594_a(new BlockParticleData(Particles.field_197611_d, iblockstate), this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, this.func_174813_aQ().field_72338_b + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, -this.field_70159_w * 4.0D, 1.5D, -this.field_70179_y * 4.0D);
}
@@ -1054,7 +1062,7 @@
@@ -1054,7 +1068,7 @@
double d0 = this.field_70163_u + (double)this.func_70047_e();
BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v);
IFluidState ifluidstate = this.field_70170_p.func_204610_c(blockpos);
@@ -109,7 +123,7 @@
}
}
@@ -1123,6 +1131,7 @@
@@ -1123,6 +1137,7 @@
this.field_70126_B -= 360.0F;
}
@@ -117,7 +131,7 @@
this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
this.func_70101_b(p_70080_7_, p_70080_8_);
}
@@ -1371,6 +1380,7 @@
@@ -1371,6 +1386,7 @@
if (this.field_184238_ar) {
p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
}
@@ -125,26 +139,28 @@
if (!this.field_184236_aF.isEmpty()) {
NBTTagList nbttaglist = new NBTTagList();
@@ -1382,6 +1392,9 @@
@@ -1382,6 +1398,10 @@
p_189511_1_.func_74782_a("Tags", nbttaglist);
}
+ NBTTagCompound caps = serializeCaps();
+ if (caps != null) p_189511_1_.func_74782_a("ForgeCaps", caps);
+ if (entityData != null) p_189511_1_.func_74782_a("ForgeData", entityData);
+
this.func_70014_b(p_189511_1_);
if (this.func_184207_aI()) {
NBTTagList nbttaglist1 = new NBTTagList();
@@ -1467,6 +1480,8 @@
@@ -1467,6 +1487,9 @@
this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
+ if (p_70020_1_.func_150297_b("ForgeData", 10)) entityData = p_70020_1_.func_74775_l("ForgeData");
+ if (p_70020_1_.func_150297_b("CanUpdate", 99)) this.canUpdate(p_70020_1_.func_74767_n("CanUpdate"));
+ if (p_70020_1_.func_150297_b("ForgeCaps", 10)) deserializeCaps(p_70020_1_.func_74775_l("ForgeCaps"));
if (p_70020_1_.func_150297_b("Tags", 9)) {
this.field_184236_aF.clear();
NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8);
@@ -1547,6 +1562,8 @@
@@ -1547,6 +1570,8 @@
} else {
EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_);
entityitem.func_174869_p();
@@ -153,7 +169,7 @@
this.field_70170_p.func_72838_d(entityitem);
return entityitem;
}
@@ -1596,6 +1613,7 @@
@@ -1596,6 +1621,7 @@
this.field_70159_w = 0.0D;
this.field_70181_x = 0.0D;
this.field_70179_y = 0.0D;
@@ -161,7 +177,7 @@
this.func_70071_h_();
if (this.func_184218_aH()) {
entity.func_184232_k(this);
@@ -1637,6 +1655,7 @@
@@ -1637,6 +1663,7 @@
}
}
@@ -169,7 +185,7 @@
if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
if (this.func_184218_aH()) {
this.func_184210_p();
@@ -1664,6 +1683,7 @@
@@ -1664,6 +1691,7 @@
public void func_184210_p() {
if (this.field_184239_as != null) {
Entity entity = this.field_184239_as;
@@ -177,7 +193,7 @@
this.field_184239_as = null;
entity.func_184225_p(this);
}
@@ -1790,10 +1810,15 @@
@@ -1790,6 +1818,7 @@
return !this.func_184188_bt().isEmpty();
}
@@ -185,15 +201,7 @@
public boolean func_205710_ba() {
return true;
}
+ public boolean canBeRiddenInWater(Entity rider) {
+ return func_205710_ba();
+ }
+
public boolean func_70093_af() {
return this.func_70083_f(1);
}
@@ -1991,7 +2016,7 @@
@@ -1991,7 +2020,7 @@
func_207712_c(itextcomponent1);
return itextcomponent1;
} else {
@@ -202,7 +210,7 @@
}
}
@@ -2054,6 +2079,14 @@
@@ -2054,6 +2083,14 @@
@Nullable
public Entity func_212321_a(DimensionType p_212321_1_) {
@@ -210,14 +218,14 @@
+ return changeDimension(p_212321_1_, this.func_184102_h().func_71218_a(p_212321_1_).func_85176_s());
+ }
+
+ @Nullable // Forge: Entities that require custom handling should override this method, not the other
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter)
+ {
+ @Nullable
+ @Override
+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null;
if (!this.field_70170_p.field_72995_K && !this.field_70128_L) {
this.field_70170_p.field_72984_F.func_76320_a("changeDimension");
MinecraftServer minecraftserver = this.func_184102_h();
@@ -2061,7 +2094,7 @@
@@ -2061,25 +2098,25 @@
WorldServer worldserver = minecraftserver.func_71218_a(dimensiontype);
WorldServer worldserver1 = minecraftserver.func_71218_a(p_212321_1_);
this.field_71093_bK = p_212321_1_;
@@ -226,8 +234,11 @@
worldserver1 = minecraftserver.func_71218_a(DimensionType.OVERWORLD);
this.field_71093_bK = DimensionType.OVERWORLD;
}
@@ -2070,16 +2103,16 @@
this.field_70128_L = false;
- this.field_70170_p.func_72900_e(this);
- this.field_70128_L = false;
+ this.field_70170_p.removeEntity(this, true); //Forge: Keep data until we copy.
+ this.revive();
this.field_70170_p.field_72984_F.func_76320_a("reposition");
BlockPos blockpos;
- if (p_212321_1_ == DimensionType.THE_END) {
@@ -249,7 +260,7 @@
d0 = MathHelper.func_151237_a(d0 * 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D);
d1 = MathHelper.func_151237_a(d1 * 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D);
}
@@ -2088,8 +2121,7 @@
@@ -2088,8 +2125,7 @@
d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872);
float f = this.field_70177_z;
this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F);
@@ -259,7 +270,7 @@
blockpos = new BlockPos(this);
}
@@ -2098,7 +2130,7 @@
@@ -2098,7 +2134,7 @@
Entity entity = this.func_200600_R().func_200721_a(worldserver1);
if (entity != null) {
entity.func_180432_n(this);
@@ -268,11 +279,22 @@
BlockPos blockpos1 = worldserver1.func_205770_a(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.func_175694_M());
entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A);
} else {
@@ -2592,4 +2624,56 @@
@@ -2112,7 +2148,7 @@
worldserver1.func_72866_a(entity, false);
}
- this.field_70128_L = true;
+ this.remove(false); //Forge: now invalidate old entity
this.field_70170_p.field_72984_F.func_76319_b();
worldserver.func_82742_i();
worldserver1.func_82742_i();
@@ -2592,4 +2628,63 @@
public double func_212107_bY() {
return this.field_211517_W;
}
+
+ /* ================================== Forge Start =====================================*/
+
+ private boolean canUpdate = true;
+ @Override
+ public void canUpdate(boolean value) {
@@ -308,7 +330,6 @@
+ && this.field_70130_N * this.field_70130_N * this.field_70131_O > 0.512F;
+ }
+
+ /* ================================== Forge Start =====================================*/
+ /**
+ * Internal use for keeping track of entities that are tracked by a world, to
+ * allow guarantees that entity position changes will force a chunk load, avoiding
@@ -324,4 +345,10 @@
+
+ @Override
+ public void onRemovedFromWorld() { this.isAddedToWorld = false; }
+
+ @Override
+ public void revive() {
+ this.field_70128_L = false;
+ this.reviveCaps();
+ }
}
@@ -47,15 +47,16 @@
while(i > 0) {
int j = EntityXPOrb.func_70527_a(i);
i -= j;
@@ -412,6 +418,7 @@
public void func_70604_c(@Nullable EntityLivingBase p_70604_1_) {
this.field_70755_b = p_70604_1_;
this.field_70756_c = this.field_70173_aa;
+ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_);
}
public EntityLivingBase func_110144_aD() {
@@ -584,8 +591,10 @@
@@ -534,7 +540,7 @@
Potion potion = iterator.next();
PotionEffect potioneffect = this.field_70713_bf.get(potion);
if (!potioneffect.func_76455_a(this)) {
- if (!this.field_70170_p.field_72995_K) {
+ if (!this.field_70170_p.field_72995_K && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionExpiryEvent(this, potioneffect))) {
iterator.remove();
this.func_70688_c(potioneffect);
}
@@ -584,8 +590,10 @@
this.func_82142_c(false);
} else {
Collection<PotionEffect> collection = this.field_70713_bf.values();
@@ -68,7 +69,19 @@
this.func_82142_c(this.func_70644_a(MobEffects.field_76441_p));
}
@@ -622,6 +631,27 @@
@@ -614,7 +622,10 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
- this.func_70688_c(iterator.next());
+ PotionEffect effect = iterator.next();
+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, effect))) continue;
+
+ this.func_70688_c(effect);
iterator.remove();
}
@@ -622,6 +633,27 @@
}
}
@@ -83,7 +96,7 @@
+ Iterator<PotionEffect> itr = this.field_70713_bf.values().iterator();
+ while (itr.hasNext()) {
+ PotionEffect effect = itr.next();
+ if (effect.isCurativeItem(curativeItem)) {
+ if (effect.isCurativeItem(curativeItem) && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, effect))) {
+ this.func_70688_c(effect);
+ itr.remove();
+ ret = true;
@@ -96,7 +109,33 @@
public Collection<PotionEffect> func_70651_bq() {
return this.field_70713_bf.values();
}
@@ -714,6 +744,8 @@
@@ -644,6 +676,7 @@
return false;
} else {
PotionEffect potioneffect = this.field_70713_bf.get(p_195064_1_.func_188419_a());
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionAddedEvent(this, potioneffect, p_195064_1_));
if (potioneffect == null) {
this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_);
this.func_70670_a(p_195064_1_);
@@ -658,6 +691,9 @@
}
public boolean func_70687_e(PotionEffect p_70687_1_) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ if (event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DEFAULT) return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
if (this.func_70668_bt() == CreatureAttribute.UNDEAD) {
Potion potion = p_70687_1_.func_188419_a();
if (potion == MobEffects.field_76428_l || potion == MobEffects.field_76436_u) {
@@ -678,6 +714,7 @@
}
public boolean func_195063_d(Potion p_195063_1_) {
+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, p_195063_1_))) return false;
PotionEffect potioneffect = this.func_184596_c(p_195063_1_);
if (potioneffect != null) {
this.func_70688_c(potioneffect);
@@ -714,6 +751,8 @@
}
public void func_70691_i(float p_70691_1_) {
@@ -105,7 +144,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -730,6 +762,7 @@
@@ -730,6 +769,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -113,7 +152,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -790,8 +823,8 @@
@@ -790,8 +830,8 @@
if (entity1 instanceof EntityPlayer) {
this.field_70718_bc = 100;
this.field_70717_bb = (EntityPlayer)entity1;
@@ -124,7 +163,7 @@
if (entitywolf.func_70909_n()) {
this.field_70718_bc = 100;
this.field_70717_bb = null;
@@ -941,11 +974,12 @@
@@ -941,11 +981,12 @@
}
public void func_70669_a(ItemStack p_70669_1_) {
@@ -138,7 +177,7 @@
if (!this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
EntityLivingBase entitylivingbase = this.func_94060_bK();
@@ -960,15 +994,16 @@
@@ -960,15 +1001,16 @@
this.field_70729_aU = true;
this.func_110142_aN().func_94549_h();
if (!this.field_70170_p.field_72995_K) {
@@ -159,7 +198,7 @@
}
this.field_70170_p.func_72960_a(this, (byte)3);
@@ -984,6 +1019,9 @@
@@ -984,6 +1026,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -169,7 +208,7 @@
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
this.field_70160_al = true;
float f = MathHelper.func_76133_a(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_);
@@ -1028,12 +1066,7 @@
@@ -1028,12 +1073,7 @@
} else {
BlockPos blockpos = new BlockPos(i, j, k);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -183,7 +222,7 @@
}
}
@@ -1053,6 +1086,9 @@
@@ -1053,6 +1093,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -193,7 +232,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
PotionEffect potioneffect = this.func_70660_b(MobEffects.field_76430_j);
float f = potioneffect == null ? 0.0F : (float)(potioneffect.func_76458_c() + 1);
@@ -1065,7 +1101,7 @@
@@ -1065,7 +1108,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!iblockstate.func_196958_f()) {
@@ -202,7 +241,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1134,6 +1170,8 @@
@@ -1134,6 +1177,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -211,7 +250,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_;
@@ -1144,10 +1182,11 @@
@@ -1144,10 +1189,11 @@
((EntityPlayerMP)p_70665_1_.func_76346_g()).func_195067_a(StatList.field_212735_F, Math.round(f1 * 10.0F));
}
@@ -220,11 +259,11 @@
float f2 = this.func_110143_aJ();
- this.func_70606_j(f2 - p_70665_2_);
this.func_110142_aN().func_94547_a(p_70665_1_, f2, p_70665_2_);
+ this.func_70606_j(f1 - p_70665_2_); // Forge: moved to fix MC-121048
+ this.func_70606_j(f2 - p_70665_2_); // Forge: moved to fix MC-121048
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1189,6 +1228,8 @@
@@ -1189,6 +1235,8 @@
}
public void func_184609_a(EnumHand p_184609_1_) {
@@ -233,7 +272,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;
@@ -1373,18 +1414,18 @@
@@ -1373,18 +1421,18 @@
double d12 = d6 + d10;
AxisAlignedBB axisalignedbb1 = axisalignedbb.func_72317_d(d9, 0.0D, d10);
if (this.field_70170_p.func_195586_b(this, axisalignedbb1)) {
@@ -255,7 +294,7 @@
d1 = d11;
d13 = this.field_70163_u + 2.0D;
d14 = d12;
@@ -1439,15 +1480,16 @@
@@ -1439,15 +1487,16 @@
}
this.field_70160_al = true;
@@ -274,7 +313,7 @@
}
protected float func_189749_co() {
@@ -1518,7 +1560,7 @@
@@ -1518,7 +1567,7 @@
try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)) {
if (this.field_70122_E) {
@@ -283,7 +322,7 @@
}
float f8 = 0.16277137F / (f7 * f7 * f7);
@@ -1532,7 +1574,7 @@
@@ -1532,7 +1581,7 @@
this.func_191958_b(p_191986_1_, p_191986_2_, p_191986_3_, f9);
f7 = 0.91F;
if (this.field_70122_E) {
@@ -292,7 +331,7 @@
}
if (this.func_70617_f_()) {
@@ -1663,6 +1705,7 @@
@@ -1663,6 +1712,7 @@
}
public void func_70071_h_() {
@@ -300,7 +339,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1694,7 +1737,9 @@
@@ -1694,7 +1744,9 @@
ItemStack itemstack1 = this.func_184582_a(entityequipmentslot);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -310,10 +349,14 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(entityequipmentslot));
}
@@ -2134,11 +2179,18 @@
@@ -2133,12 +2185,21 @@
protected void func_184608_ct() {
if (this.func_184587_cr()) {
if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
- if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
+ ItemStack itemstack = this.func_184586_b(this.func_184600_cs());
+ if (net.minecraftforge.common.ForgeHooks.canContinueUsing(this.field_184627_bm, itemstack)) this.field_184627_bm = itemstack;
+ if (itemstack == this.field_184627_bm) {
+
+ if (!this.field_184627_bm.func_190926_b()) {
+ field_184628_bn = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_184627_bm, field_184628_bn);
@@ -330,7 +373,7 @@
this.func_71036_o();
}
} else {
@@ -2172,8 +2224,10 @@
@@ -2172,8 +2233,10 @@
public void func_184598_c(EnumHand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@@ -342,7 +385,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == EnumHand.OFF_HAND);
@@ -2229,6 +2283,9 @@
@@ -2229,6 +2292,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);
@@ -352,7 +395,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(Particles.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);
}
@@ -2237,7 +2294,9 @@
@@ -2237,7 +2303,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);
@@ -363,7 +406,7 @@
this.func_184602_cy();
}
@@ -2257,6 +2316,7 @@
@@ -2257,6 +2325,7 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -371,7 +414,7 @@
this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv());
}
@@ -2363,4 +2423,60 @@
@@ -2363,4 +2432,62 @@
@OnlyIn(Dist.CLIENT)
public void func_191987_a(BlockPos p_191987_1_, boolean p_191987_2_) {
}
@@ -417,7 +460,7 @@
+
+ @Override
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable EnumFacing facing) {
+ if (!this.field_70128_L && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
+ if (facing == null) return handlers[2].cast();
+ else if (facing.func_176740_k().func_200128_b()) return handlers[0].cast();
+ else if (facing.func_176740_k().func_176722_c()) return handlers[1].cast();
@@ -426,9 +469,11 @@
+ }
+
+ @Override
+ public void func_70106_y() {
+ super.func_70106_y();
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ public void remove(boolean keepData) {
+ super.remove(keepData);
+ if (!keepData) {
+ for (int x = 0; x < handlers.length; x++)
+ handlers[x].invalidate();
+ }
+ }
}
@@ -8,13 +8,17 @@
field_209347_a.put(p_209346_0_, new EntitySpawnPlacementRegistry.Entry(p_209346_2_, p_209346_1_, p_209346_3_));
}
@@ -109,5 +110,20 @@
public static enum SpawnPlacementType {
@@ -106,8 +107,23 @@
}
}
- public static enum SpawnPlacementType {
+ public static enum SpawnPlacementType implements net.minecraftforge.common.IExtensibleEnum {
ON_GROUND,
IN_WATER;
+
+ public static SpawnPlacementType create(String name, net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReaderBase, net.minecraft.util.math.BlockPos, EntityType<? extends EntityLiving>> predicate) {
+ return null;
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ private net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReaderBase, net.minecraft.util.math.BlockPos, EntityType<? extends EntityLiving>> predicate;
@@ -9,7 +9,15 @@
private static final Logger field_200731_aJ = LogManager.getLogger();
public static final EntityType<EntityAreaEffectCloud> field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.func_201757_a(EntityAreaEffectCloud.class, EntityAreaEffectCloud::new));
public static final EntityType<EntityArmorStand> field_200789_c = func_200712_a("armor_stand", EntityType.Builder.func_201757_a(EntityArmorStand.class, EntityArmorStand::new));
@@ -386,15 +386,53 @@
@@ -263,6 +263,7 @@
@Nullable
public T func_208050_a(World p_208050_1_, @Nullable NBTTagCompound p_208050_2_, @Nullable ITextComponent p_208050_3_, @Nullable EntityPlayer p_208050_4_, BlockPos p_208050_5_, boolean p_208050_6_, boolean p_208050_7_) {
T t = this.func_210761_b(p_208050_1_, p_208050_2_, p_208050_3_, p_208050_4_, p_208050_5_, p_208050_6_, p_208050_7_);
+ if (t instanceof net.minecraft.entity.EntityLiving && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((EntityLiving) t, p_208050_1_, p_208050_5_.func_177958_n(), p_208050_5_.func_177956_o(), p_208050_5_.func_177952_p(), null)) return null;
p_208050_1_.func_72838_d(t);
return t;
}
@@ -386,15 +387,53 @@
return p_200719_1_ == null ? null : p_200719_1_.func_200721_a(p_200719_0_);
}
@@ -63,7 +71,7 @@
}
public static <T extends Entity> EntityType.Builder<T> func_201757_a(Class<? extends T> p_201757_0_, Function<? super World, ? extends T> p_201757_1_) {
@@ -417,12 +455,26 @@
@@ -417,12 +456,26 @@
return this;
}
@@ -91,7 +99,7 @@
if (SharedConstants.field_206244_b) {
throw illegalstateexception;
}
@@ -431,7 +483,7 @@
@@ -431,7 +484,7 @@
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/NpcMerchant.java
+++ b/net/minecraft/entity/NpcMerchant.java
@@ -36,7 +36,7 @@
@Nullable
public MerchantRecipeList func_70934_b(EntityPlayer p_70934_1_) {
- return this.field_70936_c;
+ return net.minecraftforge.event.ForgeEventFactory.listTradeOffers(this, p_70934_1_, this.field_70936_c);
}
public void func_70930_a(@Nullable MerchantRecipeList p_70930_1_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/EntityAIAttackRangedBow.java
+++ b/net/minecraft/entity/ai/EntityAIAttackRangedBow.java
@@ -35,7 +35,7 @@
}
protected boolean func_188498_f() {
- return !this.field_188499_a.func_184614_ca().func_190926_b() && this.field_188499_a.func_184614_ca().func_77973_b() == Items.field_151031_f;
+ return !this.field_188499_a.func_184614_ca().func_190926_b() && this.field_188499_a.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow;
}
public boolean func_75253_b() {
@@ -8,7 +8,13 @@
if (!flag1 && BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - (double)0.01F, this.field_70161_v)))) {
this.field_70122_E = false;
return;
@@ -149,7 +150,7 @@
@@ -144,12 +145,12 @@
if (iblockstate.func_177230_c() != Blocks.field_196603_bb) {
this.func_70106_y();
if (!this.field_145808_f) {
- if (iblockstate.func_185904_a().func_76222_j() && (flag1 || !BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(blockpos1.func_177977_b()))) && this.field_70170_p.func_180501_a(blockpos1, this.field_175132_d, 3)) {
+ if (iblockstate.func_185904_a().func_76222_j() && (flag1 || !BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(blockpos1.func_177977_b()))) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(this, new net.minecraftforge.common.util.BlockSnapshot(func_130014_f_(), func_180425_c(), iblockstate), net.minecraft.util.EnumFacing.UP) && this.field_70170_p.func_180501_a(blockpos1, this.field_175132_d, 3)) {
if (block instanceof BlockFalling) {
((BlockFalling)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, iblockstate);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/EntityMinecartContainer.java
+++ b/net/minecraft/entity/item/EntityMinecartContainer.java
@@ -120,10 +120,11 @@
@@ -120,18 +120,26 @@
return 64;
}
@@ -14,15 +14,23 @@
}
public void func_70106_y() {
@@ -132,6 +133,7 @@
+ super.func_70106_y();
+ }
+
+ @Override
+ public void remove(boolean keepData) {
if (this.field_94112_b) {
InventoryHelper.func_180176_a(this.field_70170_p, this, this);
}
super.func_70106_y();
+ itemHandler.invalidate();
- super.func_70106_y();
+ super.remove(keepData);
+ if (!keepData)
+ itemHandler.invalidate();
}
public void func_184174_b(boolean p_184174_1_) {
@@ -164,6 +166,7 @@
@@ -164,6 +172,7 @@
}
public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) {
@@ -30,7 +38,7 @@
if (!this.field_70170_p.field_72995_K) {
p_184230_1_.func_71007_a(this);
}
@@ -216,9 +219,9 @@
@@ -216,9 +225,9 @@
random = new Random(this.field_184291_d);
}
@@ -42,7 +50,7 @@
}
loottable.func_186460_a(this, random, lootcontext$builder.func_186471_a());
@@ -239,4 +242,13 @@
@@ -239,4 +248,13 @@
public ResourceLocation func_184276_b() {
return this.field_184290_c;
}
@@ -51,7 +59,7 @@
+
+ @Override
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable net.minecraft.util.EnumFacing facing) {
+ if (!this.field_70128_L && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
+ return itemHandler.cast();
+ return super.getCapability(capability, facing);
+ }
@@ -18,7 +18,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else {
@@ -178,6 +180,7 @@
@@ -178,12 +180,14 @@
public void func_70100_b_(EntityPlayer p_70100_1_) {
if (!this.field_70170_p.field_72995_K) {
if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) {
@@ -26,3 +26,22 @@
p_70100_1_.field_71090_bL = 2;
p_70100_1_.func_71001_a(this, 1);
ItemStack itemstack = EnchantmentHelper.func_92099_a(Enchantments.field_185296_A, p_70100_1_);
if (!itemstack.func_190926_b() && itemstack.func_77951_h()) {
- int i = Math.min(this.func_184514_c(this.field_70530_e), itemstack.func_77952_i());
- this.field_70530_e -= this.func_184515_b(i);
+ float ratio = itemstack.func_77973_b().getXpRepairRatio(itemstack);
+ int i = Math.min(roundAverage(this.field_70530_e * ratio), itemstack.func_77952_i());
+ this.field_70530_e -= roundAverage(i / ratio);
itemstack.func_196085_b(itemstack.func_77952_i() - i);
}
@@ -261,4 +265,9 @@
public boolean func_70075_an() {
return false;
}
+
+ private static int roundAverage(float value) {
+ double floor = Math.floor(value);
+ return (int) floor + (Math.random() < value - floor ? 1 : 0);
+ }
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/entity/monster/AbstractSkeleton.java
+++ b/net/minecraft/entity/monster/AbstractSkeleton.java
@@ -161,7 +161,7 @@
this.field_70714_bg.func_85156_a(this.field_85038_e);
this.field_70714_bg.func_85156_a(this.field_85037_d);
ItemStack itemstack = this.func_184614_ca();
- if (itemstack.func_77973_b() == Items.field_151031_f) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow) {
int i = 20;
if (this.field_70170_p.func_175659_aa() != EnumDifficulty.HARD) {
i = 40;
@@ -178,6 +178,8 @@
public void func_82196_d(EntityLivingBase p_82196_1_, float p_82196_2_) {
EntityArrow entityarrow = this.func_190726_a(p_82196_2_);
+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow)
+ entityarrow = ((net.minecraft.item.ItemBow) this.func_184614_ca().func_77973_b()).customizeArrow(entityarrow);
double d0 = p_82196_1_.field_70165_t - this.field_70165_t;
double d1 = p_82196_1_.func_174813_aQ().field_72338_b + (double)(p_82196_1_.field_70131_O / 3.0F) - entityarrow.field_70163_u;
double d2 = p_82196_1_.field_70161_v - this.field_70161_v;
@@ -20,6 +20,15 @@
return false;
} else {
return this.field_179475_a.func_70681_au().nextInt(2000) == 0;
@@ -373,7 +375,7 @@
IBlockState iblockstate = iworld.func_180495_p(blockpos);
IBlockState iblockstate1 = iworld.func_180495_p(blockpos.func_177977_b());
IBlockState iblockstate2 = this.field_179475_a.func_195405_dq();
- if (iblockstate2 != null && this.func_195924_a(iworld, blockpos, iblockstate2, iblockstate, iblockstate1)) {
+ if (iblockstate2 != null && this.func_195924_a(iworld, blockpos, iblockstate2, iblockstate, iblockstate1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(field_179475_a, new net.minecraftforge.common.util.BlockSnapshot(field_179475_a.field_70170_p, blockpos, iblockstate), net.minecraft.util.EnumFacing.UP)) {
iworld.func_180501_a(blockpos, iblockstate2, 3);
this.field_179475_a.func_195406_b((IBlockState)null);
}
@@ -395,7 +397,7 @@
public boolean func_75250_a() {
if (this.field_179473_a.func_195405_dq() != null) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/monster/EntityIllusionIllager.java
+++ b/net/minecraft/entity/monster/EntityIllusionIllager.java
@@ -181,6 +181,8 @@
public void func_82196_d(EntityLivingBase p_82196_1_, float p_82196_2_) {
EntityArrow entityarrow = this.func_193097_t(p_82196_2_);
+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow)
+ entityarrow = ((net.minecraft.item.ItemBow) this.func_184614_ca().func_77973_b()).customizeArrow(entityarrow);
double d0 = p_82196_1_.field_70165_t - this.field_70165_t;
double d1 = p_82196_1_.func_174813_aQ().field_72338_b + (double)(p_82196_1_.field_70131_O / 3.0F) - entityarrow.field_70163_u;
double d2 = p_82196_1_.field_70161_v - this.field_70161_v;
@@ -1,5 +1,14 @@
--- a/net/minecraft/entity/monster/EntitySlime.java
+++ b/net/minecraft/entity/monster/EntitySlime.java
@@ -113,7 +113,7 @@
public void func_70071_h_() {
if (!this.field_70170_p.field_72995_K && this.field_70170_p.func_175659_aa() == EnumDifficulty.PEACEFUL && this.func_70809_q() > 0) {
- this.field_70128_L = true;
+ this.func_70106_y(); //Forge: Kill entity with notification to caps/subclasses.
}
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
@@ -122,6 +122,7 @@
if (this.field_70122_E && !this.field_175452_bi) {
int i = this.func_70809_q();
@@ -27,12 +27,17 @@
this.func_184747_a(false);
itemstack.func_77972_a(1, p_184645_1_);
}
@@ -166,4 +166,10 @@
@@ -166,4 +166,15 @@
public void func_184724_a(boolean p_184724_1_) {
}
+
+ @Override
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return this.func_184748_o();
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ this.func_184747_a(false);
+ return new java.util.ArrayList<>();
@@ -0,0 +1,16 @@
--- a/net/minecraft/entity/monster/EntitySpider.java
+++ b/net/minecraft/entity/monster/EntitySpider.java
@@ -120,7 +120,12 @@
}
public boolean func_70687_e(PotionEffect p_70687_1_) {
- return p_70687_1_.func_188419_a() == MobEffects.field_76436_u ? false : super.func_70687_e(p_70687_1_);
+ if (p_70687_1_.func_188419_a() == MobEffects.field_76436_u) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
+ }
+ return super.func_70687_e(p_70687_1_);
}
public boolean func_70841_p() {
@@ -32,6 +32,15 @@
if (p_70037_1_.func_150297_b("ConversionTime", 99) && p_70037_1_.func_74762_e("ConversionTime") > -1) {
this.func_191991_a(p_70037_1_.func_186855_b("ConversionPlayer") ? p_70037_1_.func_186857_a("ConversionPlayer") : null, p_70037_1_.func_74762_e("ConversionTime"));
}
@@ -76,7 +84,7 @@
@Nullable
public IEntityLivingData func_204210_a(DifficultyInstance p_204210_1_, @Nullable IEntityLivingData p_204210_2_, @Nullable NBTTagCompound p_204210_3_) {
- this.func_190733_a(this.field_70170_p.field_73012_v.nextInt(6));
+ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(this, this.field_70170_p.field_73012_v);
return super.func_204210_a(p_204210_1_, p_204210_2_, p_204210_3_);
}
@@ -145,7 +153,7 @@
protected void func_190738_dp() {
EntityVillager entityvillager = new EntityVillager(this.field_70170_p);
@@ -8,7 +8,7 @@
}
protected void func_110232_cE() {
@@ -960,4 +961,19 @@
@@ -960,4 +961,22 @@
return p_204210_2_;
}
@@ -17,14 +17,17 @@
+
+ @Override
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable net.minecraft.util.EnumFacing facing) {
+ if (!this.field_70128_L && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && itemHandler != null)
+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && itemHandler != null)
+ return itemHandler.cast();
+ return super.getCapability(capability, facing);
+ }
+
+ @Override
+ public void func_70106_y() {
+ super.func_70106_y();
+ itemHandler.invalidate();
+ public void remove(boolean keepData) {
+ super.remove(keepData);
+ if (!keepData && itemHandler != null) {
+ itemHandler.invalidate();
+ itemHandler = null;
+ }
+ }
}
@@ -34,7 +34,7 @@
+
+ @Override
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return !this.func_70631_g_();
+ return !this.func_70892_o() && !this.func_70631_g_();
+ }
+
+ @Override
@@ -121,7 +121,12 @@
} else {
this.field_82189_bL = null;
}
@@ -473,11 +512,10 @@
@@ -469,15 +508,14 @@
this.func_175554_cu();
}
- return this.field_70963_i;
+ return net.minecraftforge.event.ForgeEventFactory.listTradeOffers(this, p_70934_1_, field_70963_i);
}
private void func_175554_cu() {
@@ -17,12 +17,14 @@
private HorseArmorType(int p_i46799_3_) {
this.field_188588_g = p_i46799_3_;
@@ -29,6 +30,15 @@
@@ -29,6 +30,17 @@
this.field_188587_f = p_i46800_5_;
}
+ private HorseArmorType(int strength, String texture, String hash, Item item) {
+ this(strength, texture, hash);
+ this.field_188588_g = strength;
+ this.field_188586_e = texture;
+ this.field_188587_f = hash;
+ this.item = item;
+ }
+
@@ -33,7 +35,7 @@
public int func_188579_a() {
return this.ordinal();
}
@@ -48,25 +58,38 @@
@@ -48,25 +60,38 @@
return this.field_188586_e;
}
@@ -140,7 +140,7 @@
}
public void func_70037_a(NBTTagCompound p_70037_1_) {
@@ -740,6 +765,14 @@
@@ -740,6 +765,17 @@
this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced");
}
@@ -148,14 +148,17 @@
+ NBTTagCompound data = (NBTTagCompound)e;
+ ResourceLocation dim = new ResourceLocation(data.func_74779_i("Dim"));
+ this.spawnPosMap.put(dim, new BlockPos(data.func_74762_e("SpawnX"), data.func_74762_e("SpawnY"), data.func_74762_e("SpawnZ")));
+ this.spawnForcedMap.put(dim, data.func_74767_n("DpawnForced"));
+ this.spawnForcedMap.put(dim, data.func_74767_n("SpawnForced"));
+ });
+ this.spawnDimension = net.minecraft.world.dimension.DimensionType.func_186069_a(p_70037_1_.func_150297_b("SpawnDimension", 99) ? p_70037_1_.func_74762_e("SpawnDimension") : 0);
+ net.minecraft.world.dimension.DimensionType spawnDim = null;
+ if (p_70037_1_.func_150297_b("SpawnDimension", net.minecraftforge.common.util.Constants.NBT.TAG_STRING))
+ spawnDim = net.minecraft.world.dimension.DimensionType.func_193417_a(new ResourceLocation(p_70037_1_.func_74779_i("SpawnDimension")));
+ this.spawnDimension = spawnDim != null ? spawnDim : net.minecraft.world.dimension.DimensionType.OVERWORLD;
+
this.field_71100_bB.func_75112_a(p_70037_1_);
this.field_71075_bZ.func_75095_b(p_70037_1_);
if (p_70037_1_.func_150297_b("EnderItems", 9)) {
@@ -786,9 +819,26 @@
@@ -786,9 +822,26 @@
p_70014_1_.func_74782_a("ShoulderEntityRight", this.func_192025_dl());
}
@@ -173,7 +176,7 @@
+ });
+ p_70014_1_.func_74782_a("Spawns", spawnlist);
+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ p_70014_1_.func_74768_a("SpawnDimension", spawnDimension.func_186068_a());
+ p_70014_1_.func_74778_a("SpawnDimension", spawnDimension.getRegistryName().toString());
+ }
}
@@ -182,7 +185,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) {
@@ -824,7 +874,7 @@
@@ -824,7 +877,7 @@
protected void func_190629_c(EntityLivingBase p_190629_1_) {
super.func_190629_c(p_190629_1_);
@@ -191,7 +194,7 @@
this.func_190777_m(true);
}
@@ -845,11 +895,13 @@
@@ -845,11 +898,13 @@
}
protected void func_184590_k(float p_184590_1_) {
@@ -206,7 +209,7 @@
if (enumhand == EnumHand.MAIN_HAND) {
this.func_184201_a(EntityEquipmentSlot.MAINHAND, ItemStack.field_190927_a);
} else {
@@ -877,11 +929,14 @@
@@ -877,11 +932,14 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -221,7 +224,7 @@
float f1 = f - p_70665_2_;
if (f1 > 0.0F && f1 < 3.4028235E37F) {
this.func_195067_a(StatList.field_212738_J, Math.round(f1 * 10.0F));
@@ -935,6 +990,8 @@
@@ -935,6 +993,8 @@
return EnumActionResult.PASS;
} else {
@@ -230,7 +233,7 @@
ItemStack itemstack = this.func_184586_b(p_190775_2_);
ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l();
if (p_190775_1_.func_184230_a(this, p_190775_2_)) {
@@ -942,6 +999,10 @@
@@ -942,6 +1002,10 @@
itemstack.func_190920_e(itemstack1.func_190916_E());
}
@@ -241,7 +244,7 @@
return EnumActionResult.SUCCESS;
} else {
if (!itemstack.func_190926_b() && p_190775_1_ instanceof EntityLivingBase) {
@@ -951,6 +1012,7 @@
@@ -951,6 +1015,7 @@
if (itemstack.func_111282_a(this, (EntityLivingBase)p_190775_1_, p_190775_2_)) {
if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) {
@@ -249,7 +252,7 @@
this.func_184611_a(p_190775_2_, ItemStack.field_190927_a);
}
@@ -973,6 +1035,7 @@
@@ -973,6 +1038,7 @@
}
public void func_71059_n(Entity p_71059_1_) {
@@ -257,7 +260,7 @@
if (p_71059_1_.func_70075_an()) {
if (!p_71059_1_.func_85031_j(this)) {
float f = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e();
@@ -1000,8 +1063,11 @@
@@ -1000,8 +1066,11 @@
boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(MobEffects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof EntityLivingBase;
flag2 = flag2 && !this.func_70051_ag();
@@ -270,7 +273,7 @@
}
f = f + f1;
@@ -1097,8 +1163,10 @@
@@ -1097,8 +1166,10 @@
}
if (!itemstack1.func_190926_b() && entity instanceof EntityLivingBase) {
@@ -281,7 +284,7 @@
this.func_184611_a(EnumHand.MAIN_HAND, ItemStack.field_190927_a);
}
}
@@ -1140,7 +1208,7 @@
@@ -1140,7 +1211,7 @@
}
if (this.field_70146_Z.nextFloat() < f) {
@@ -290,7 +293,7 @@
this.func_184602_cy();
this.field_70170_p.func_72960_a(this, (byte)30);
}
@@ -1188,7 +1256,11 @@
@@ -1188,7 +1259,11 @@
}
public EntityPlayer.SleepResult func_180469_a(BlockPos p_180469_1_) {
@@ -303,16 +306,16 @@
if (!this.field_70170_p.field_72995_K) {
if (this.func_70608_bn() || !this.func_70089_S()) {
return EntityPlayer.SleepResult.OTHER_PROBLEM;
@@ -1198,7 +1270,7 @@
@@ -1198,7 +1273,7 @@
return EntityPlayer.SleepResult.NOT_POSSIBLE_HERE;
}
- if (this.field_70170_p.func_72935_r()) {
+ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, this.field_71081_bT)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, p_180469_1_)) {
return EntityPlayer.SleepResult.NOT_POSSIBLE_NOW;
}
@@ -1223,7 +1295,7 @@
@@ -1223,7 +1298,7 @@
this.func_192030_dh();
this.func_175145_a(StatList.field_199092_j.func_199076_b(StatList.field_203284_n));
this.func_70105_a(0.2F, 0.2F);
@@ -321,7 +324,7 @@
float f1 = 0.5F + (float)enumfacing.func_82601_c() * 0.4F;
float f = 0.5F + (float)enumfacing.func_82599_e() * 0.4F;
this.func_175139_a(enumfacing);
@@ -1248,6 +1320,8 @@
@@ -1248,6 +1323,8 @@
private boolean func_190774_a(BlockPos p_190774_1_, EnumFacing p_190774_2_) {
if (Math.abs(this.field_70165_t - (double)p_190774_1_.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)p_190774_1_.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)p_190774_1_.func_177952_p()) <= 3.0D) {
return true;
@@ -330,7 +333,7 @@
} else {
BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d());
return Math.abs(this.field_70165_t - (double)blockpos.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)blockpos.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)blockpos.func_177952_p()) <= 3.0D;
@@ -1260,16 +1334,19 @@
@@ -1260,16 +1337,19 @@
}
public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) {
@@ -354,7 +357,7 @@
}
this.field_71083_bS = false;
@@ -1285,29 +1362,30 @@
@@ -1285,29 +1365,30 @@
}
private boolean func_175143_p() {
@@ -391,7 +394,7 @@
switch(enumfacing) {
case SOUTH:
return 90.0F;
@@ -1339,23 +1417,67 @@
@@ -1339,23 +1420,67 @@
public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) {
}
@@ -403,11 +406,11 @@
+ /**
+ * A dimension aware version of getBedLocation.
+ * @param dimension The dimension to get the bed spawn for
+ * @param dim The dimension to get the bed spawn for
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public BlockPos getBedLocation(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71081_bT : spawnPosMap.get(dim);
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71081_bT : spawnPosMap.get(dim.getRegistryName());
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -420,11 +423,11 @@
+ * A dimension aware version of isSpawnForced.
+ * Noramally isSpawnForced is used to determine if the respawn system should check for a bed or not.
+ * This just extends that to be dimension aware.
+ * @param dimension The dimension to get whether to check for a bed before spawning for
+ * @param dim The dimension to get whether to check for a bed before spawning for
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public boolean isSpawnForced(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim, false);
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false);
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -444,9 +447,9 @@
+ * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension.
+ * @param pos The spawn point to set as the player-specific spawn point for the dimension
+ * @param forced Whether or not the respawn code should check for a bed at this location (true means it won't check for a bed)
+ * @param dimension Which dimension to apply the player-specific respawn point to
+ * @param dim Which dimension to apply the player-specific respawn point to
+ */
+ public void setSpawnPoint(BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) {
+ public void setSpawnPoint(@Nullable BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) {
+ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return;
+ if (dim != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ if (pos == null) {
@@ -468,7 +471,7 @@
}
public void func_195066_a(ResourceLocation p_195066_1_) {
@@ -1525,6 +1647,8 @@
@@ -1525,6 +1650,8 @@
}
super.func_180430_e(p_180430_1_, p_180430_2_);
@@ -477,7 +480,7 @@
}
}
@@ -1786,7 +1910,10 @@
@@ -1786,7 +1913,10 @@
}
public ITextComponent func_145748_c_() {
@@ -489,7 +492,7 @@
return this.func_208016_c(itextcomponent);
}
@@ -1806,7 +1933,7 @@
@@ -1806,7 +1936,7 @@
}
public float func_70047_e() {
@@ -498,7 +501,7 @@
if (this.func_70608_bn()) {
f = 0.2F;
} else if (!this.func_203007_ba() && !this.func_184613_cA() && this.field_70131_O != 0.6F) {
@@ -1973,6 +2100,30 @@
@@ -1973,6 +2103,54 @@
return this.field_71075_bZ.field_75098_d && this.func_184840_I() >= 2;
}
@@ -525,6 +528,30 @@
+ public Collection<ITextComponent> getSuffixes() {
+ return this.suffixes;
+ }
+
+ private final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>
+ playerMainHandler = net.minecraftforge.common.util.LazyOptional.of(
+ () -> new net.minecraftforge.items.wrapper.PlayerMainInvWrapper(field_71071_by));
+
+ private final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>
+ playerEquipmentHandler = net.minecraftforge.common.util.LazyOptional.of(
+ () -> new net.minecraftforge.items.wrapper.CombinedInvWrapper(
+ new net.minecraftforge.items.wrapper.PlayerArmorInvWrapper(field_71071_by),
+ new net.minecraftforge.items.wrapper.PlayerOffhandInvWrapper(field_71071_by)));
+
+ private final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>
+ playerJoinedHandler = net.minecraftforge.common.util.LazyOptional.of(
+ () -> new net.minecraftforge.items.wrapper.PlayerInvWrapper(field_71071_by));
+
+ @Override
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable EnumFacing facing) {
+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
+ if (facing == null) return playerJoinedHandler.cast();
+ else if (facing.func_176740_k().func_200128_b()) return playerMainHandler.cast();
+ else if (facing.func_176740_k().func_176722_c()) return playerEquipmentHandler.cast();
+ }
+ return super.getCapability(capability, facing);
+ }
+
public static enum EnumChatVisibility {
FULL(0, "options.chat.visibility.full"),
@@ -119,3 +119,29 @@
}
protected void func_70670_a(PotionEffect p_70670_1_) {
@@ -1174,13 +1198,13 @@
this.func_184210_p();
if (p_200619_1_ == this.field_70170_p) {
this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
- } else {
+ } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_200619_1_.field_73011_w.func_186058_p())) {
WorldServer worldserver = this.func_71121_q();
this.field_71093_bK = p_200619_1_.field_73011_w.func_186058_p();
- this.field_71135_a.func_147359_a(new SPacketRespawn(this.field_71093_bK, worldserver.func_175659_aa(), worldserver.func_72912_H().func_76067_t(), this.field_71134_c.func_73081_b()));
+ this.field_71135_a.func_147359_a(new SPacketRespawn(this.field_71093_bK, p_200619_1_.func_175659_aa(), p_200619_1_.func_72912_H().func_76067_t(), this.field_71134_c.func_73081_b())); // Forge: Use new dimensions information
this.field_71133_b.func_184103_al().func_187243_f(this);
- worldserver.func_72973_f(this);
- this.field_70128_L = false;
+ worldserver.removeEntityDangerously(this, true); //Forge: The player entity itself is moved, and not cloned. So we need to keep the data alive with no matching invalidate call later.
+ this.revive();
this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
if (this.func_70089_S()) {
worldserver.func_72866_a(this, false);
@@ -1194,6 +1218,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);
}
}
@@ -12,13 +12,21 @@
BlockDispenser.func_199774_a(Items.field_203797_aN, ibehaviordispenseitem);
BlockDispenser.func_199774_a(Items.field_203795_aL, ibehaviordispenseitem);
BlockDispenser.func_199774_a(Items.field_204272_aO, ibehaviordispenseitem);
+ BlockDispenser.func_199774_a(Items.field_151117_aB, net.minecraftforge.fluids.DispenseFluidContainer.getInstance());
+ BlockDispenser.func_199774_a(Items.field_151133_ar, net.minecraftforge.fluids.DispenseFluidContainer.getInstance());
+ if (false)
+ /*BlockDispenser.registerDispenseBehavior(Items.MILK_BUCKET, net.minecraftforge.fluids.DispenseFluidContainer.getInstance());
+ BlockDispenser.registerDispenseBehavior(Items.BUCKET, net.minecraftforge.fluids.DispenseFluidContainer.getInstance());
+ if (false)*/
BlockDispenser.func_199774_a(Items.field_151133_ar, new BehaviorDefaultDispenseItem() {
private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem();
@@ -429,6 +433,7 @@
@@ -420,6 +424,7 @@
PaintingType.func_200831_a();
StatList.func_212734_a();
IRegistry.func_212613_e();
+ net.minecraftforge.fml.common.registry.VillagerRegistry.instance();
if (SharedConstants.field_206244_b) {
func_210839_a("block", IRegistry.field_212618_g, Block::func_149739_a);
func_210839_a("biome", IRegistry.field_212624_m, Biome::func_210773_k);
@@ -429,6 +434,7 @@
func_210839_a("entity", IRegistry.field_212629_r, EntityType::func_210760_d);
}
@@ -4,7 +4,7 @@
protected void func_75208_c(ItemStack p_75208_1_) {
if (this.field_75237_g > 0) {
p_75208_1_.func_77980_a(this.field_75238_b.field_70170_p, this.field_75238_b, this.field_75237_g);
+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, this.field_75224_c);
+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, this.field_75239_a);
}
((IRecipeHolder)this.field_75224_c).func_201560_d(this.field_75238_b);
@@ -1,20 +0,0 @@
--- a/net/minecraft/item/ArmorMaterial.java
+++ b/net/minecraft/item/ArmorMaterial.java
@@ -10,7 +10,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public enum ArmorMaterial implements IArmorMaterial {
+public enum ArmorMaterial implements IArmorMaterial, net.minecraftforge.common.IExtensibleEnum {
LEATHER("leather", 5, new int[]{1, 2, 3, 1}, 15, SoundEvents.field_187728_s, 0.0F, () -> {
return Ingredient.func_199804_a(Items.field_151116_aA);
}),
@@ -77,4 +77,8 @@
public float func_200901_e() {
return this.field_189417_k;
}
+
+ public static ArmorMaterial create(String name, String p_i48533_3_, int p_i48533_4_, int[] p_i48533_5_, int p_i48533_6_, SoundEvent p_i48533_7_, float p_i48533_8_, Supplier<Ingredient> p_i48533_9_) {
+ throw new IllegalStateException("Enum not extended");
+ }
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/item/EnumRarity.java
+++ b/net/minecraft/item/EnumRarity.java
@@ -2,7 +2,7 @@
import net.minecraft.util.text.TextFormatting;
-public enum EnumRarity {
+public enum EnumRarity implements net.minecraftforge.common.IExtensibleEnum {
COMMON(TextFormatting.WHITE),
UNCOMMON(TextFormatting.YELLOW),
RARE(TextFormatting.AQUA),
@@ -13,4 +13,8 @@
private EnumRarity(TextFormatting p_i48837_3_) {
this.field_77937_e = p_i48837_3_;
}
+
+ public static EnumRarity create(String enumName, TextFormatting p_i48837_3_) {
+ throw new IllegalStateException("Enum not extended");
+ }
}
@@ -1,14 +1,16 @@
--- a/net/minecraft/item/Item.java
+++ b/net/minecraft/item/Item.java
@@ -48,7 +48,7 @@
@@ -48,8 +48,8 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public class Item implements IItemProvider {
- public static final Map<Block, Item> field_179220_a = Maps.newHashMap();
+public class Item extends net.minecraftforge.registries.ForgeRegistryEntry<Item> implements IItemProvider, net.minecraftforge.common.extensions.IForgeItem {
public static final Map<Block, Item> field_179220_a = Maps.newHashMap();
+ public static final Map<Block, Item> field_179220_a = net.minecraftforge.registries.GameData.getBlockItemMap();
private static final IItemPropertyGetter field_185046_b = (p_210306_0_, p_210306_1_, p_210306_2_) -> {
return p_210306_0_.func_77951_h() ? 1.0F : 0.0F;
};
@@ -96,6 +96,10 @@
this.field_77700_c = p_i48487_1_.field_200922_c;
this.field_77699_b = p_i48487_1_.field_200921_b;
@@ -1,6 +1,15 @@
--- a/net/minecraft/item/ItemBow.java
+++ b/net/minecraft/item/ItemBow.java
@@ -56,15 +56,19 @@
@@ -22,7 +22,7 @@
if (p_210310_2_ == null) {
return 0.0F;
} else {
- return p_210310_2_.func_184607_cu().func_77973_b() != Items.field_151031_f ? 0.0F : (float)(p_210310_0_.func_77988_m() - p_210310_2_.func_184605_cv()) / 20.0F;
+ return !(p_210310_2_.func_184607_cu().func_77973_b() instanceof ItemBow) ? 0.0F : (float)(p_210310_0_.func_77988_m() - p_210310_2_.func_184605_cv()) / 20.0F;
}
});
this.func_185043_a(new ResourceLocation("pulling"), (p_210309_0_, p_210309_1_, p_210309_2_) -> {
@@ -56,18 +56,23 @@
EntityPlayer entityplayer = (EntityPlayer)p_77615_3_;
boolean flag = entityplayer.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantments.field_185312_x, p_77615_1_) > 0;
ItemStack itemstack = this.func_185060_a(entityplayer);
@@ -22,7 +31,11 @@
if (!p_77615_2_.field_72995_K) {
ItemArrow itemarrow = (ItemArrow)(itemstack.func_77973_b() instanceof ItemArrow ? itemstack.func_77973_b() : Items.field_151032_g);
EntityArrow entityarrow = itemarrow.func_200887_a(p_77615_2_, itemstack, entityplayer);
@@ -130,6 +134,10 @@
+ entityarrow = this.customizeArrow(entityarrow);
entityarrow.func_184547_a(entityplayer, entityplayer.field_70125_A, entityplayer.field_70177_z, 0.0F, f * 3.0F, 1.0F);
if (f == 1.0F) {
entityarrow.func_70243_d(true);
@@ -130,6 +135,10 @@
public ActionResult<ItemStack> func_77659_a(World p_77659_1_, EntityPlayer p_77659_2_, EnumHand p_77659_3_) {
ItemStack itemstack = p_77659_2_.func_184586_b(p_77659_3_);
boolean flag = !this.func_185060_a(p_77659_2_).func_190926_b();
@@ -33,3 +46,12 @@
if (!p_77659_2_.field_71075_bZ.field_75098_d && !flag) {
return flag ? new ActionResult<>(EnumActionResult.PASS, itemstack) : new ActionResult<>(EnumActionResult.FAIL, itemstack);
} else {
@@ -141,4 +150,8 @@
public int func_77619_b() {
return 1;
}
+
+ public EntityArrow customizeArrow(EntityArrow arrow) {
+ return arrow;
+ }
}
@@ -8,7 +8,7 @@
+ // special case for handling block placement with water lilies
+ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_1_, blockpos1);
p_77659_1_.func_180501_a(blockpos1, Blocks.field_196651_dG.func_176223_P(), 11);
+ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.EnumFacing.UP, p_77659_3_).isCanceled()) {
+ if (net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.EnumFacing.UP)) {
+ blocksnapshot.restore(true, false);
+ return new ActionResult<ItemStack>(EnumActionResult.FAIL, itemstack);
+ }
@@ -25,7 +25,7 @@
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockReader world, BlockPos pos) {
+ return net.minecraftforge.common.EnumPlantType.Crop;
+ return this.field_195978_a.func_177230_c() == net.minecraft.init.Blocks.field_150388_bm ? net.minecraftforge.common.EnumPlantType.Nether : net.minecraftforge.common.EnumPlantType.Crop;
+ }
+
+ @Override
@@ -74,6 +74,7 @@
- BlockPos blockpos = p_196084_1_.func_195995_a();
- BlockWorldState blockworldstate = new BlockWorldState(p_196084_1_.func_195991_k(), blockpos, false);
- if (entityplayer != null && !entityplayer.field_71075_bZ.field_75099_e && !this.func_206847_b(p_196084_1_.func_195991_k().func_205772_D(), blockworldstate)) {
+ if (!p_196084_1_.field_196006_g.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(p_196084_1_);
+ return onItemUse(p_196084_1_, (c) -> func_77973_b().func_195939_a(p_196084_1_));
+ }
+
@@ -82,7 +83,6 @@
+ }
+
+ private EnumActionResult onItemUse(ItemUseContext context, java.util.function.Function<ItemUseContext, EnumActionResult> callback) {
+ //if (!context.world.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(context);
+ EntityPlayer entityplayer = context.func_195999_j();
+ BlockPos blockpos = context.func_195995_a();
+ BlockWorldState blockworldstate = new BlockWorldState(context.func_195991_k(), blockpos, false);
@@ -80,20 +80,17 @@
public static Ingredient func_193369_a(ItemStack... p_193369_0_) {
return func_209357_a(Arrays.stream(p_193369_0_).map((p_209356_0_) -> {
return new Ingredient.SingleItemList(p_209356_0_);
@@ -145,7 +173,12 @@
}
@@ -146,6 +174,9 @@
public static Ingredient func_199566_b(PacketBuffer p_199566_0_) {
+ p_199566_0_.markReaderIndex();
int i = p_199566_0_.func_150792_a();
+ if (i == -1) {
+ p_199566_0_.resetReaderIndex();
+ return net.minecraftforge.common.crafting.CraftingHelper.getIngredient(p_199566_0_.func_192575_l(), p_199566_0_);
+ }
return func_209357_a(Stream.generate(() -> {
return new Ingredient.SingleItemList(p_199566_0_.func_150791_c());
}).limit((long)i));
@@ -153,6 +186,8 @@
@@ -153,6 +184,8 @@
public static Ingredient func_199802_a(@Nullable JsonElement p_199802_0_) {
if (p_199802_0_ != null && !p_199802_0_.isJsonNull()) {
@@ -102,7 +99,7 @@
if (p_199802_0_.isJsonObject()) {
return func_209357_a(Stream.of(func_199803_a(p_199802_0_.getAsJsonObject())));
} else if (p_199802_0_.isJsonArray()) {
@@ -173,6 +208,11 @@
@@ -173,6 +206,11 @@
}
public static Ingredient.IItemList func_199803_a(JsonObject p_199803_0_) {
@@ -114,7 +111,7 @@
if (p_199803_0_.has("item") && p_199803_0_.has("tag")) {
throw new JsonParseException("An ingredient entry is either a tag or an item, not both");
} else if (p_199803_0_.has("item")) {
@@ -196,6 +236,12 @@
@@ -196,6 +234,12 @@
}
}
@@ -89,7 +89,13 @@
}
if (i > 0 && astring[0].length() != s.length()) {
@@ -258,6 +277,7 @@
@@ -253,11 +272,12 @@
throw new JsonParseException("Disallowed data tag found");
} else {
int i = JsonUtils.func_151208_a(p_199798_0_, "count", 1);
- return new ItemStack(item, i);
+ return net.minecraftforge.common.crafting.CraftingHelper.getItemStack(p_199798_0_, true);
}
}
public static class Serializer implements IRecipeSerializer<ShapedRecipe> {
@@ -1,6 +1,14 @@
--- a/net/minecraft/nbt/NBTTagCompound.java
+++ b/net/minecraft/nbt/NBTTagCompound.java
@@ -389,6 +389,7 @@
@@ -71,6 +71,7 @@
}
public void func_74782_a(String p_74782_1_, INBTBase p_74782_2_) {
+ if (p_74782_2_ == null) throw new IllegalArgumentException("Invalid null NBT value with key " + p_74782_1_);
this.field_74784_a.put(p_74782_1_, p_74782_2_);
}
@@ -389,6 +390,7 @@
}
private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException {
@@ -8,7 +16,7 @@
return p_152447_0_.readByte();
}
@@ -397,6 +398,7 @@
@@ -397,6 +399,7 @@
}
static INBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) throws IOException {
@@ -1,14 +1,40 @@
--- a/net/minecraft/network/NetworkManager.java
+++ b/net/minecraft/network/NetworkManager.java
@@ -264,6 +264,7 @@
@@ -75,6 +75,7 @@
private float field_211397_t;
private int field_211398_u;
private boolean field_211399_v;
+ private java.util.function.Consumer<NetworkManager> activationHandler;
public NetworkManager(EnumPacketDirection p_i46004_1_) {
this.field_179294_g = p_i46004_1_;
@@ -84,6 +85,7 @@
super.channelActive(p_channelActive_1_);
this.field_150746_k = p_channelActive_1_.channel();
this.field_150743_l = this.field_150746_k.remoteAddress();
+ if (activationHandler != null) activationHandler.accept(this);
try {
this.func_150723_a(EnumConnectionState.HANDSHAKING);
@@ -264,7 +266,9 @@
@OnlyIn(Dist.CLIENT)
public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) {
+ if (p_181124_0_ instanceof java.net.Inet6Address) System.setProperty("java.net.preferIPv4Stack", "false");
final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
+ networkmanager.activationHandler = net.minecraftforge.fml.network.NetworkHooks::registerClientLoginChannel;
Class<? extends SocketChannel> oclass;
LazyLoadBase<? extends EventLoopGroup> lazyloadbase;
@@ -383,6 +384,14 @@
if (Epoll.isAvailable() && p_181124_2_) {
@@ -292,6 +296,7 @@
@OnlyIn(Dist.CLIENT)
public static NetworkManager func_150722_a(SocketAddress p_150722_0_) {
final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
+ networkmanager.activationHandler = net.minecraftforge.fml.network.NetworkHooks::registerClientLoginChannel;
(new Bootstrap()).group(field_179296_e.func_179281_c()).handler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel p_initChannel_1_) throws Exception {
p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager);
@@ -383,6 +388,14 @@
return this.field_211397_t;
}
@@ -1,6 +1,23 @@
--- a/net/minecraft/network/ServerStatusResponse.java
+++ b/net/minecraft/network/ServerStatusResponse.java
@@ -26,6 +26,7 @@
@@ -19,13 +19,24 @@
private ServerStatusResponse.Players field_151324_b;
private ServerStatusResponse.Version field_151325_c;
private String field_151323_d;
+ private transient net.minecraftforge.fml.network.FMLStatusPing forgeData;
+ public net.minecraftforge.fml.network.FMLStatusPing getForgeData() {
+ return this.forgeData;
+ }
+
+ public void setForgeData(net.minecraftforge.fml.network.FMLStatusPing data){
+ this.forgeData = data;
+ invalidateJson();
+ }
+
public ITextComponent func_151317_a() {
return this.field_151326_a;
}
public void func_151315_a(ITextComponent p_151315_1_) {
this.field_151326_a = p_151315_1_;
@@ -8,7 +25,7 @@
}
public ServerStatusResponse.Players func_151318_b() {
@@ -34,6 +35,7 @@
@@ -34,6 +45,7 @@
public void func_151319_a(ServerStatusResponse.Players p_151319_1_) {
this.field_151324_b = p_151319_1_;
@@ -16,7 +33,7 @@
}
public ServerStatusResponse.Version func_151322_c() {
@@ -42,16 +44,51 @@
@@ -42,16 +54,51 @@
public void func_151321_a(ServerStatusResponse.Version p_151321_1_) {
this.field_151325_c = p_151321_1_;
@@ -68,3 +85,25 @@
public static class Players {
private final int field_151336_a;
private final int field_151334_b;
@@ -143,6 +190,10 @@
serverstatusresponse.func_151320_a(JsonUtils.func_151200_h(jsonobject, "favicon"));
}
+ if (jsonobject.has("forgeData")) {
+ serverstatusresponse.setForgeData(net.minecraftforge.fml.network.FMLStatusPing.Serializer.deserialize(JsonUtils.func_152754_s(jsonobject, "forgeData"), p_deserialize_3_));
+ }
+
return serverstatusresponse;
}
@@ -164,6 +215,10 @@
jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d());
}
+ if(p_serialize_1_.getForgeData() != null){
+ jsonobject.add("forgeData", net.minecraftforge.fml.network.FMLStatusPing.Serializer.serialize(p_serialize_1_.getForgeData(), p_serialize_3_));
+ }
+
return jsonobject;
}
}
Loaded 100 of 537 files, more files were not shown because too many files have changed in this diff. Show more