Compare commits

...
573 Commits
Author SHA1 Message Date
LexManos ff0bb8c83c Initial 1.14.3 update. 2019-06-24 19:01:03 -07:00
cpw e5acea60e6 Fix too many registries being sent from server to client
Signed-off-by: cpw <[email protected]>
2019-06-23 19:54:55 -04:00
tterrag 216b536967 Remove OnlyIn on TagCollection#getOwningTags
Fixes Block#getTags crashing on servers
2019-06-23 18:36:27 -04:00
cpw 0a819da0e7 Reorganize sided event dispatch slightly. Dispatch model and entityrenderer
functions at more appropriate times.

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

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

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

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

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

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

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

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

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

tweak logging

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

Signed-off-by: cpw <[email protected]>
2019-02-13 22:13:59 -05:00
cpw 586c24f9d6 Implement a GUI packet and GUIFACTORY for triggering from the server.
Signed-off-by: cpw <[email protected]>
2019-02-13 21:06:39 -05:00
cpw 31c0a70f8e Merge branch 'pull/5451' into 1.13-pre
# Conflicts:
#	patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch
2019-02-13 18:59:43 -05:00
cpw 64a92530d9 Handle bad formats with an exception. Translators MAKE SURE you watch for this error!
Signed-off-by: cpw <[email protected]>
2019-02-13 18:54:43 -05:00
cpw 4441935a4a Handle invalid JAR files more gracefully. Don't crash.
Signed-off-by: cpw <[email protected]>
2019-02-13 18:33:50 -05:00
cpw f1feac76b3 Fix JKS to be stored as binary 2019-02-11 13:51:13 -05:00
cpw d9c4446ccc Enable https to Let's Encrypt endpoints by using an SSL factory with
the two extra Let's Encrypt root certs installed into an auxiliary
keystore.

The keystore was generated using standard commands, documented in the
FixSSL class.

The Let's Encrypt certificates are not provided by default in Java 8
prior to update 101.

Signed-off-by: cpw <[email protected]>
2019-02-10 23:41:40 -05:00
cpw f83500db11 Its 2019. Update licence headers to match.
Signed-off-by: cpw <[email protected]>
2019-02-10 17:57:03 -05:00
cpw fd02d81e73 Fix Terminal Handler and GUI logging on dediserver, hopefully..
Signed-off-by: cpw <[email protected]>
2019-02-10 17:51:25 -05:00
cpw 0d379fdd6b Fix config to use new system properly, without exploding the server.
Separates server specific config into the server config file.

Signed-off-by: cpw <[email protected]>
2019-02-10 16:38:14 -05:00
cpw f6fd800242 Fix up accidental newline removal that broke the console...
Signed-off-by: cpw <[email protected]>
2019-02-10 16:31:49 -05:00
cpw c25214aaf4 Fix #5429 properly, without breaking symlinks on linux..
Signed-off-by: cpw <[email protected]>
2019-02-10 15:58:12 -05:00
cpw c6afb2be3f Move to using Minecrell's terminal logger directly, for better ANSI control and JLine support.
Signed-off-by: cpw <[email protected]>
2019-02-10 14:35:21 -05:00
cpw 13501a8b05 Make a second logger with colour highlighting and control it with a sysproperty:
forge.logging.colourconsole.level (defaults to off)..

Signed-off-by: cpw <[email protected]>
2019-02-10 11:45:36 -05:00
cpw dae5994e9d Tidy up modcontainer building and discovery..
Signed-off-by: cpw <[email protected]>
2019-02-10 11:44:47 -05:00
cpw b28a418bd9 Use a configuration value for the thread count, make it default to
availableProcessors when set to <=0 (default value is -1)

Signed-off-by: cpw <[email protected]>
2019-02-10 11:44:22 -05:00
cpw 64f69cf5c9 Revert "Make sure to create entire path for directory, fixes #5429"
This reverts commit 77dd9eb8

This will completely break symlinks on linux.

Signed-off-by: cpw <[email protected]>
2019-02-10 10:26:21 -05:00
m00nl1ght-dev 8084ca43b9 Port CommandEvent and custom entity selectors to 1.13 (#5411) 2019-02-08 17:41:50 -08:00
LexManos 2e5f25d8ae Finish off most old patches, fix issue for mounted entities. 2019-02-08 17:40:07 -08:00
Vincent Lee 04b0d24678 Patch direct accesses to Entity.type to use getter instead (#5308) 2019-02-07 19:11:45 -08:00
Vincent Lee 153e7a1806 Tentatively reintroduce a container-opening system 2019-02-07 20:31:17 -06:00
tterrag 065ebd748a Add synchronized modifier to runtime enhanced enum methods 2019-02-07 17:01:40 -05:00
tterrag 79c17cb542 Add IExtensibleEnum, fix DimensionType create method 2019-02-07 16:36:30 -05:00
LexManos 9245975955 Change IRenderHandler to an interface Closes #4640 2019-02-07 12:03:13 -08:00
mcenderdragon 6ea19ec8bf Made functional interface IChunkGeneratorFactory public (#5395) 2019-02-06 23:18:47 -08:00
Bartosz Skrzypczak b527bf8ab3 Fix leaking unclosed InputStream in Scanner.fileVisitor (#5432) 2019-02-06 22:57:00 -08:00
LexManos 0b1b3c68fa Invalidate capabilities that we attach to vanilla entities and TileEntities. Closes #5307 2019-02-06 22:55:17 -08:00
LexManos d930c8ae8b 'Fix' Specific y-levels in water behaving like you're in air. Closes #5341 2019-02-06 21:43:37 -08:00
LexManos 053c5300ed Reintroduce ObfuscationReflestionHelper closes #5373 2019-02-06 20:46:21 -08:00
LexManos e8ae18efda Fixed Crosshair attack indicator texture issue Closes #5442
Add friendlier error message for @Mod annotations with missing mods.toml entry. Closes #5440
Remove Log4J console highlighting. As it doesn't work on many consoles, and prints invalid characters. Closes #5420
2019-02-06 18:18:01 -08:00
Merlin Addams 39965c55ac Let ItemGroup provide it's own tabs image resource location (#5330) 2019-02-06 16:30:43 -08:00
Merlin Addams f87dca2ad4 Allow GuiContainer and ItemGroup to specify slot hover colors (#5332) 2019-02-06 15:29:12 -08:00
Jack Taylor 3e02903d19 Port Minecraft client patch for 'ClientTickEvent' (#5397) 2019-02-06 15:14:18 -08:00
Merlin Addams febae7f8f2 Fix statistics gui crashing when handling input events (#5435) 2019-02-06 15:12:15 -08:00
LexManos 71dd5c9f4d Properly set context classloader in mod loading threads. 2019-02-05 22:42:21 -08:00
LexManos aa91af865d Rework server launching at runtime to include needed default arguments and validate libraries exist.
Move Forge config loading to manual while config system is in development.
2019-02-04 18:23:58 -08:00
Girafi 9119e395d4 Added 'create'-method for EnumCreatureType (#5400) 2019-02-04 11:40:03 -08:00
Merlin Addams 68433924c7 Fix redstone power calculation (#5433) 2019-02-04 11:38:54 -08:00
Merlin Addams 87b67cb45a Fix wrong grass block being used for comparisons (#5434) 2019-02-04 11:38:01 -08:00
tterrag 77dd9eb883 Make sure to create entire path for directory, fixes #5429 2019-02-04 12:31:47 -05:00
cpw e000fd2f8f Put the FMLModContainer back in it's cage. Delete the ClasspathLocator.
Signed-off-by: cpw <[email protected]>
2019-02-01 20:37:04 -05:00
cpw e4d20a80ed Use the resource pack directly in the GuiModList, skip the resourcepackinfo.
Closes #5418

Signed-off-by: cpw <[email protected]>
2019-02-01 16:55:28 -05:00
LexManos 36866fed10 Fix inventory items not properly being synced to client. Closes ##5421 & #5417 2019-02-01 10:41:48 -08:00
cpw 55691fce4e Expose the ModFile in the scan data, so languages can read it and make
mod construction decisions.

Signed-off-by: cpw <[email protected]>
2019-01-31 23:09:47 -05:00
Justin d2a3b5bed8 Fix RuntimeEnumExtender creating new enums with incorrect ordinal value (#5402) 2019-01-30 12:51:14 -08:00
cpw 6365674a2a Config watching and config events now actually work!
Also fixed small bug with MOD_CLASSES not defaulting to empty string.

Signed-off-by: cpw <[email protected]>
2019-01-29 15:42:56 -05:00
cpw 7a02ccc3a8 ConfigEvents - the beginning.
Signed-off-by: cpw <[email protected]>
2019-01-28 22:42:37 -05:00
cpw 2918864248 Merge branch 'pull/5405' into 1.13-pre 2019-01-28 20:50:12 -05:00
cpw 9fbfe2b98e Fix 5408 by making Paths from the default provider (not inside jars)
offer a FileInputStream rather than Files.newInputStream. Fun. Stupid
ancient paulscode.

Signed-off-by: cpw <[email protected]>
2019-01-28 20:37:25 -05:00
LexManos b40e2cc59e More old patch work, cleaned up static methods added to ItemStack, and various networking functions. 2019-01-28 16:25:49 -08:00
ichttt 3eac9c536b Config option implemented 2019-01-27 22:02:58 +01:00
ichttt ad32b01d85 Reimplement update checker 2019-01-27 21:23:24 +01:00
ichttt da33233762 Update for ForgeSPI change, revert back to VersionStatus checking 2019-01-27 20:51:35 +01:00
ichttt c2a7fe4019 Bring back the forge beta warning. Use a check to see if the forge minor version is zero, as ForgeVersion.getStatus() is not implemented 2019-01-27 19:50:59 +01:00
cpw 0067d3edce Merge branch 'pull/5404' into 1.13-pre 2019-01-27 11:45:08 -05:00
cpw ebf038231e Use recommended approach to applying version data to mdk.
Signed-off-by: cpw <[email protected]>
2019-01-27 11:42:47 -05:00
cpw f767b7096c Fix mdk properties - now the mdk offers default console debug logging
with various useful channels for development enabled.

Signed-off-by: cpw <[email protected]>
2019-01-27 11:42:46 -05:00
GoryMoon 161227b1de Fixed missed OptionalCapabilityInstance to LazyOptional refactors in patches 2019-01-27 14:47:27 +01:00
tterrag 8e43dfa7a6 Refactor OptionalCapabilityInstance to LazyOptional; clean up
- Move to util package, rename to LazyOptional
- Clean up existing javadocs, add javadocs to everything missing them
- Add more NonNull functional interfaces, and use them everywhere
- Move orEmpty() to Capability, works better here anyways
2019-01-27 01:41:07 -05:00
cpw 0a11ffb827 More logging tweaks, including some aimed at userdev.
`forge.logging.markers=<LIST OF MARKERS>` will enable markers.

Signed-off-by: cpw <[email protected]>
2019-01-27 00:06:57 -05:00
cpw 3c55b46ca0 Big cleanup of logging. Might do some tweaks of the userdev logging, but this should be good for vanilla..
Signed-off-by: cpw <[email protected]>
2019-01-26 22:18:28 -05:00
mezz 7d21e5d328 Cherry pick mezz's logging improvements..
Signed-off-by: cpw <[email protected]>
2019-01-26 21:09:43 -05:00
cpw 043069dc8a Update to 0.9.0 of modlauncher..
Signed-off-by: cpw <[email protected]>
2019-01-26 17:38:59 -05:00
cpw ea26434987 Merge branch 'ichttt-fixDuplicateNamespace' into 1.13-pre 2019-01-26 17:37:06 -05:00
ichttt 9ee34f57f5 Fix some of minecraft's resources loading twice, as minecraft is on the list of namespaces as minecraft and as an empty string 2019-01-26 23:23:05 +01:00
cpw d539dc12a1 Fix modsorter to not crash on soft dependencies that don't exist.
Signed-off-by: cpw <[email protected]>
2019-01-26 17:07:17 -05:00
cpw c578cae676 Fix resource pack info generator - use the first modid as part of the
pack prefix.

Signed-off-by: cpw <[email protected]>
2019-01-26 16:56:10 -05:00
cpw 8b74b32909 Make MOD_CLASSES available to the forge development environment as well.
Signed-off-by: cpw <[email protected]>
2019-01-26 13:07:30 -05:00
cpw 1d1133123b Change MOD_CLASSES to support %% separated paths, that are grouped into
<prefix>%%<path> sets. Allows for multiple mods to be located in UserDev.

Signed-off-by: cpw <[email protected]>
2019-01-26 12:29:55 -05:00
cpw 0bdafb976e Fix handing the "minecraft" dependency properly by adding it to the list
of mods.

Signed-off-by: cpw <[email protected]>
2019-01-26 11:23:51 -05:00
Vincent Lee 13f9418201 Send head yaw, use setPositionAndRotation 2019-01-26 10:25:20 -05:00
Vincent Lee a771a3ea06 Add license header 2019-01-26 10:25:20 -05:00
Vincent Lee 39633eef4f Clean up patch a bit, check for net.minecraft. 2019-01-26 10:25:19 -05:00
Vincent Lee 1f11ac76fa Readd modded entity spawning/tracking support 2019-01-26 10:25:19 -05:00
mariaum 2e1456517a Fix first call to ToolType.get always returning null (#5396) 2019-01-25 22:40:03 -05:00
tterrag 4db208332e Fix NPE in ItemGroup concurrency patch 2019-01-25 19:07:37 -05:00
SquidDev 659091c565 A couple of minor improvements and fixes to ForgeConfigSpec (#5394)
- Use the config file's path instead of the config object in error messages.
 - Print the dotted path of each config key instead of the array version (group.item instead of [group item]).
 - Fix comments causing a config file to be considered incorrect.
 - Pass each list element to the element validator, rather than the whole list.
2019-01-25 13:43:06 -08:00
mezz c8c54113d0 Add RecipesUpdatedEvent, fired when recipes are downloaded from the server. (#5303) 2019-01-25 13:36:42 -08:00
Vincent Lee 69f8e57cea [1.13] A sweep through deprecations (#5345) 2019-01-25 13:29:52 -08:00
ShetiPhian 06a6fac23a Add a RayTraceResult method to Block that can be can be overridden (#5354) 2019-01-25 13:29:07 -08:00
Vincent Lee fa939a890c [1.13] Make Caps, TESR, Entity renderers, and keybinds thread safe to call during parallel init (#5359) 2019-01-25 13:14:49 -08:00
Adubbz 2c8ab76240 [1.13] Check canSustainPlant for valid ground in BlockBush (#5362) 2019-01-25 13:12:34 -08:00
LexManos 7a651b8c1f Repatch missed hasTileEntity redirects. And cleanup related patches. Closes #5369 2019-01-25 13:11:06 -08:00
Merlin Addams d04df43b27 Fixed fence and iron bars block placement (#5372) 2019-01-25 11:24:56 -08:00
mcenderdragon d3c9db906f Make ChunkGeneratorType.Settings accessible for modders (#5376) 2019-01-25 11:24:24 -08:00
mcenderdragon f6e2c5c1f0 Make ItemGroup constructor threadsafe (#5384) 2019-01-25 11:23:34 -08:00
mariaum cc682fd786 Fix item interaction in creative mode. (#5385) 2019-01-25 11:21:03 -08:00
mariaum 6643997304 Fix #5365: Some chat messages lose their formatting (#5386) 2019-01-25 11:19:49 -08:00
LexManos 7b867d0069 Fix vanilla trying to load the constants json as an recipe. Closes #5388
Force constant names to use namespace of their json file. To prevent conflicts.
2019-01-25 11:18:25 -08:00
Brennan Ward a15c4dc9b0 Add recipe types for faster runtime iteration. (#5312) 2019-01-25 10:22:41 -08:00
tterrag 7c11fe1022 Fix capability attach event not firing with base type 2019-01-24 21:04:50 -05:00
Jack Taylor 66f816971f Port Minecraft client patch for 'RenderTickEvent' (#5329) 2019-01-24 12:27:25 -08:00
SquidDev 98c6d5a5f6 Add back several missing patches for FML events (#5390) 2019-01-24 12:27:05 -08:00
tterrag 0b2a98f956 Fix dependents not being loaded into mod sorter 2019-01-23 20:04:57 -05:00
liach c01b336095 Improves topological sort
This can be used for mod sorting, dependencies between registries, etc.
e.g. https://github.com/MinecraftForge/MinecraftForge/pull/4694#issuecomment-412520302

New features:
Now accepts guava graph
Performance improvement: no longer reverse the graph; changed dfs to bfs
Accepets a comparator for secondary order, e.g. natural order, index by map
Now properly reports all cycles in a graph with Tarjan's strongly connected component algorithm
Adds a test to prove the validity of the sort and cycle detection
Modified build.gradle for test source directory and dependencies

Mod loading changes:
Sort mod file info instead of suppliers (we don't have suppliers instances)
Moves cycle error reporting out of topological sort and into mod sorter
Prevent mod file dependencies between mods that share the same file

Signed-off-by: liach <[email protected]>
2019-01-21 03:06:27 +00:00
cpw 040cc4bf16 Expose a couple of mods.toml properties properly. Half-implemented
override namespace - still needs to be reviewed and determined how this
might work in detail.

Signed-off-by: cpw <[email protected]>
2019-01-20 21:26:31 -05:00
SquidDev eefc4d3e84 Use the reply logical side when enqueing work
When receiving a packet, NetworkDirection.getLogicalSide details where
the packet was the packet was sent from. Therefore, on a client it'll
be SERVER (and vice virsa), and so the work is queued on the sever
thread, instead of using Minecraft.
2019-01-20 12:31:12 -05:00
ichttt c3c979f11a Use minecraft's util class to open files 2019-01-20 12:23:44 -05:00
ichttt 276d0c49c1 Validate mod ids 2019-01-20 12:23:44 -05:00
cpw 7c840dce35 Fix classcast in autoeventsubscriber, also actually make progression
work properly. This whole thing is a bit of a gross hack.

Signed-off-by: cpw <[email protected]>
2019-01-20 12:20:27 -05:00
alexbegt 2bee5f7ac6 Fix recipe constants being overridden by a blank map. Closes #5380 2019-01-20 16:03:09 +00:00
cpw 60524f0f3e Fix case error in AutomaticEventSubscriber
Signed-off-by: cpw <[email protected]>
2019-01-20 00:32:11 -05:00
cpw 1170772a4f Tell travis to skip 1.13 builds - they don't work there.
Signed-off-by: cpw <[email protected]>
2019-01-19 23:35:20 -05:00
cpw f4d2d1a24b Move Registry Events to the mod event bus.
Add infrastructure to allow parallel or synchronous dispatch of
mod events, and pass-through of events to the dispatch system.

Signed-off-by: cpw <[email protected]>
2019-01-19 23:27:27 -05:00
tterrag ff2e35c243 Greatly improve DeferredWorkQueue API (#5357) 2019-01-18 21:10:22 -05:00
tterrag 0d1a2f2af3 Add utilities that RuntimeEnumExtender expects to exist 2019-01-17 13:11:54 -05:00
LexManos 3b029ba031 Re-introduce patch for injecting registry mappings during world loading.
And re-introduce registry freezing to ONLY the Register events.
Filter ObjectHolders by registry type and fire between every Register event.
2019-01-16 12:28:13 -08:00
tterrag cd21f7b927 Implement ConfigValue as a wrapper around ForgeConfigSpec results (#5361) 2019-01-15 23:28:40 -05:00
cpw 755eff7415 Fix exploded directory locator to actually scan all paths for a file. 2019-01-15 22:14:23 -05:00
cpw 0d3f28bd52 Update MDK for new naming scheme 2019-01-14 22:43:17 -05:00
cpw 56a3926b86 Fix up event naming, move them to sensible packages and document everything a bit. 2019-01-14 22:43:17 -05:00
Vincent Lee 220bf8730a [1.13] Expand tag deserializer to add optional values and remove values without overwriting everything. (#5350) 2019-01-14 19:23:36 -08:00
mezz 118eac8f39 Fix mod lifecycle event names 2019-01-14 14:00:15 -08:00
cpw 99452a8b45 Update a bunch of libs, rename some of the mod events to more
meaningful names.
2019-01-14 00:39:00 -05:00
LexManos eb42614288 Add list support to ForgeConfigSpec.
Fix incorrect Supplier used in ForgeConfigSpec.
Port ForgeChunkManager config to new system.
Delete old Configuration classes. It's finally gone!
2019-01-11 23:01:08 -08:00
tterrag 5238eca241 Add list of so-far skipped 1.12 commits 2019-01-11 18:32:17 -05:00
InsomniaKitten 94af6c7f9d Add CreativeTabs#getLabelColor
Patch skipped, was already applied in https://github.com/MinecraftForge/MinecraftForge/commit/47a11b9a7e35c2a2273b6828bd802f2cb06f5cd7#diff-0ea0358443c2ecf3b8682228736149b3R71
2019-01-11 18:32:17 -05:00
XCompWizandtterrag f2b54acd67 Allow providing a BufferedImage for banner render generation (#5041)
Ported to 1.13 using NativeImage

Co-authored-by: tterrag <[email protected]>
2019-01-11 18:32:17 -05:00
Tim 497bc10d0a Fix Mesa biome entry tags in the BiomeDictionary (#5177) 2019-01-11 18:32:17 -05:00
Ben Staddon c1bb5cb250 Patch PotionHelper to use registry delegates (#5142) 2019-01-11 18:32:17 -05:00
mezz 51910fe83b Update github stale so issues can be Assigned 2019-01-11 18:32:16 -05:00
tterragandGabriel Harris-Rouquette 958bbf6c9a Fix MC-136995 - Chunk loading and unloading issue with entities placed in exact positions. (#5160)
This includes three commits from 1.12.x:
https://github.com/MinecraftForge/MinecraftForge/commit/c20a5e8805f64097430cf0722011f20862a8df9c
https://github.com/MinecraftForge/MinecraftForge/commit/93b704b459c6f537d3b1651008c49ce1db2e0ca1
https://github.com/MinecraftForge/MinecraftForge/commit/ee0d43bbde37e258c36de1003436dbe3fcf88077

Scatter gun patches to improve entity tracking and position tracking.
Provided by Aikar through the Paper project, this commit of patches combines the following patches:

https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch

Co-authored-by: Gabriel Harris-Rouquette <[email protected]>
2019-01-11 18:32:16 -05:00
David Quintana e98951ee65 Fix blockstate id map calculation. (#5279) 2019-01-11 14:52:30 -08:00
LexManos 3765d912a5 Move @EventBusSubscriber application to just after construction instead of pre-init. 2019-01-11 12:28:06 -08:00
Vincent Lee 849bc00b46 Make Block.Builder methods accessible. Closes #5310 (#5313) 2019-01-11 11:47:51 -08:00
Vincent Lee f3715c3e2e Fix exception mismatch for entity types (#5344) 2019-01-11 11:47:36 -08:00
Vincent Lee 985a48f02e Fix datapack walking not working for mod datapacks. Closes #5334 (#5335) 2019-01-09 20:59:40 -08:00
Vincent Lee 4e196a445a Add missing setSeed calls to ForgeBlockModelRenderer (#5338) 2019-01-09 20:57:55 -08:00
LexManos 36d2e67b07 Reimplement @ObjectHolder scanning, and expose system for others to add handlers.
Fix forgedev and userdev run configs.
Fix issue in log functions assuming String arguments.
2019-01-09 20:57:01 -08:00
LexManos 34568a0a74 Fix reference to IForgeDimension.SleepResult being through Dimension, thus causing a Srg2Source issue.
And improper getWorld patch.
2019-01-08 05:52:25 -08:00
LexManos f7acc73282 Update userdev and runconfigs for ForgeGradle changes. 2019-01-08 00:29:36 -08:00
cpw 60926ad6ea Fix some translation strings. Will pull a big string update from crowdin too. 2019-01-06 21:02:08 -05:00
cpw f734e614e4 Fire registry events before preinit and after construct. 2019-01-06 17:19:18 -05:00
cpw 997a15c0f2 Update to 0.4.0 of modlauncher 2019-01-06 16:34:32 -05:00
cpw 1b40618f02 Fix classloading properly. ModLoadingClassLoader doesn't work
with the proper delegation model. Abandoned it, in favour of injecting
locators into the Transformer classloader directly.
2019-01-06 16:24:32 -05:00
cpw 58c78560fa Fix up some stuff with resource packs, so the guilist works properly. 2019-01-05 10:19:47 -05:00
cpw 1d1ec57909 Update mdk with some tweaks for building 2019-01-05 00:14:07 -05:00
cpw fd9c83b65f Finish up classloading system. Use ModJARURL to locate resources
and enable ModLauncher to use those instead. This allows all mods to load
within the scope of the game classloader, removing weird conflicts and
class discovery problems.
2019-01-04 23:56:10 -05:00
cpw 6baddc7e26 client and server work standalone and in forge dev. Next up userdev.
Moved some launchplugin code to the launcher. Moved servermain to
the launcher.

server currently needs cmdline arguments  --fml.forgeVersion=24.0.51-1.13-pre --fml.mcVersion=1.13 --fml.mcpVersion=2018.09.12.04.11.00 --fml.forgeGroup=net.minecraftforge.test
2019-01-01 21:35:23 -05:00
cpw e9580877b4 fix up some discovery code, and make regular runtime _mostly_ work.
Still WIP and doesn't quite get to main screen yet.
2019-01-01 16:50:04 -05:00
LexManos 440649bb95 Fix new launcher jar packaging.
Run license checker over new code.
2018-12-31 16:48:23 -08:00
cpw 48846bc0ba separated fmllauncher code from main forge mod code. This enables much
stronger classloader separation between the two sides. Forge now
loads as a regular mod.

Still needs a bunch of debugging, but structure looks good and game loads
in forge dev.
2018-12-31 16:34:33 -05:00
cpw 558e1d2fb0 ResourceLocation Utils for doing things.. 2018-12-31 16:34:33 -05:00
tterrag 0b26047ea8 Better documentation for IForgeWorldType, TERFast, TERAnimation
Also rename AnimationTESR to TileEntityRendererAnimation
2018-12-29 12:18:10 -05:00
tterrag 7f5a57f4af Fix patch mistake in IForgeWorldType: CUSTOMIZED -> BUFFET 2018-12-29 12:01:41 -05:00
mezz dc12cda505 Clean progress bar code and fix TextureMap patch (#5304) 2018-12-28 18:05:05 -08:00
mezz b4cf6f7f36 Implement GuiScreen events for mouse and keyboard (#5297) 2018-12-23 23:46:42 -08:00
mezz f2f04407a4 Add the sender to NetworkEvent.Context for server-side event handlers (#5295) 2018-12-22 23:24:11 -08:00
tterrag 8a11e3bac4 Port most of the world patches (#5294) 2018-12-22 10:31:18 -08:00
LexManos 4879b0611a Change how Forge itself is located to be loaded similar to a real mod.
Fixes Minecraft/Forge annotation data missing.
Fix Capability injection.
2018-12-21 16:07:39 -08:00
tterrag d11a67499d FastTESR -> TileEntityRendererFast 2018-12-21 17:53:01 -05:00
tterrag b3b8c78527 Rendering patches (#5262) 2018-12-21 14:45:35 -08:00
mcenderdragon 0bfa76251d Added JVM argument so lwjgl dll extraction works with unicode os usernames, closes #5282 (#5283) 2018-12-20 12:09:34 -08:00
LexManos a992a4325b Change getWorld function name to prevent inheritance change in Chunk 2018-12-18 16:11:03 -08:00
David Quintana c1225f3876 Fix the path handling for mod jar resource packs. (#5228) 2018-12-18 12:48:39 -08:00
David Quintana 152836c907 Add raytrace logic to the GuiOverlayDebugForge, so that the debug overlay can show the currently targetted block and liquid. (#5278) 2018-12-16 12:47:16 -08:00
David Quintana e47a4ea514 Fix typo in patch, that was preventing the key assigned to the chat keybind from working while in a searchable tab in the creative GUI. (#5276) 2018-12-16 11:04:37 -08:00
David Quintana 52b6da1759 Fix classloading issues in userdev (and possibly also for things like tests within forgedev) (#5275) 2018-12-13 15:33:35 -08:00
LexManos f13465012b World and TileEntity patch work.
TerrtainGen events are removed, 1.13's world gen re-write invalidates them all.
2018-12-13 01:15:53 -08:00
David Quintana b7b5dd5bea Create a userdev-specific main, and include it as an injected file in the userdev jar. (#5231) 2018-12-11 20:04:23 -08:00
LexManos 7265900c62 More entity patch work. ISpecialArmor deleted. 2018-12-10 22:19:43 -08:00
Jamie Mansfield 7a77298a60 Port some patches to 1.13 (#5267) 2018-12-10 12:37:14 -08:00
David Quintana 0177e7558e Fix vanilla exception mismatch: DataFixerUpper throws IllegalArgumentException but Minecraft tries to catch IllegalStateException instead, causing a hard crash instead of a soft one. (#5229) 2018-12-10 12:05:34 -08:00
Liqueur Librazy 719ea50d1a Use getRawSchemeSpecificPart to preserve escape characters in uri, fix #5236 (#5237) 2018-12-10 11:07:50 -08:00
LexManos bbf1ea41b8 world.gen.feature patches, worldgen should be stable with vanilla. In all places I looked. 2018-12-06 18:09:47 -08:00
LexManos eb22f42fea More patch work, our async chunk loading doesn't appear to be viable for 1.13. 2018-12-05 18:08:27 -08:00
LexManos dd32e74e34 Entity patches progress. 2018-12-05 01:16:33 -08:00
malte0811 e1b4a150c3 Fix race condition causing the FML handshake to hang (#5222) 2018-12-04 12:22:01 -08:00
LexManos 76d912c0ba Include project group in ForgeVersion and determine path to patched jar.
While testing we install to net.minecraftforge.test. So don't hardcode it.
2018-12-04 11:55:50 -08:00
LexManos a3c8e04ee6 Item and NBT patches, IShearable blocks are responsible for setting themselves to air, to allow for setting other states. 2018-12-03 18:04:37 -08:00
LexManos bf9158172f Most client patches done except the render pipeline.
Someone who has more in depth knowledge of that rendering system will need to do it.
2018-11-28 22:15:05 -08:00
LexManos b687180e12 Add my 'patches_old' directory, so that people can see my "progress".
Once the old folder is done, then patches are done.
Want to know whats still to do? Look in that folder.
Now stop asking.
2018-11-22 13:43:17 -08:00
LexManos 47a11b9a7e GUI Patches 2018-11-21 21:23:24 -08:00
LexManos b6ddb0a7cf More patchwork. 2018-11-19 19:55:46 -08:00
LexManos acb7acd661 Fix imports, remember to re-run gen patches! 2018-11-16 23:19:04 -08:00
LexManos 7c0d94ce9c Patch work, most of block classes, and fix eclipse run configs. 2018-11-16 23:15:39 -08:00
LexManos 763b3e806e Add a a test publish stage to jenkins file for PRs. Should allow for full publish cycle test without actually publishing. 2018-11-15 14:00:18 -08:00
malte0811 b5264cacf0 Fix crash when placing furnaces or brewing stands in 1.13 (#5225) 2018-11-15 13:55:18 -08:00
LexManos f1552ef20d Fix changelog classifier, and prevent jenkins from running concurrent builds.
And remove caching from setup, as it doesn't use the rangemap.
2018-11-15 12:40:30 -08:00
LexManos de7eeed916 Make Forge group/name dynamic in MDK as well. 2018-11-14 13:42:11 -08:00
LexManos 93eabce1bc Include changelog in published artifacts. 2018-11-14 13:39:56 -08:00
LexManos e693dd4923 Fix jenkinsfile version detection and attempt caching rangemap again. 2018-11-13 20:29:42 -08:00
LexManos 7f9acac469 Fix version number not having MC prefix, and build artifacts. 2018-11-13 16:49:03 -08:00
LexManos 506d5b18de Workaround for gradle issue with jar signing. 2018-11-13 16:32:55 -08:00
LexManos 5110796591 Setup instead of build. 2018-11-12 22:29:46 -08:00
LexManos eafeba9fed Change checkout process. 2018-11-12 20:24:14 -08:00
LexManos b7a1676b15 Disable tests until we re-make them. 2018-11-12 20:21:02 -08:00
LexManos 72b63e7b36 Move cache again, documentation is vague. 2018-11-12 20:18:43 -08:00
LexManos fe3fcef7a9 Potentially fix cache in Jenkinsfile. 2018-11-12 20:13:59 -08:00
LexManos 714b09ddcb Fix missing quote. 2018-11-12 20:00:15 -08:00
LexManos 1f65388118 Create jenkins file for new jenkins.
Change version scheme to tag based versions.
2018-11-12 19:54:39 -08:00
David Quintana 64c8f67939 Add missing license headers. (#5192) 2018-10-19 20:35:29 -07:00
LexManos 20fea3f49d MDK progress. 2018-10-11 18:54:05 -07:00
tterrag 2997448073 Widen scope of gitignored eclipse files 2018-10-11 19:30:15 -04:00
tterrag f7b35b968b AdvancementRewards 1.13 patch 2018-10-11 19:27:34 -04:00
tterrag 74703e2a60 Fix mod asset loading 2018-10-11 18:06:16 -04:00
tterrag 9d41c173df Fix diffuse lighting being broken on vanilla pipeline (#5185) 2018-10-11 11:21:44 -07:00
cpw 43ed744d46 run textcomponenttranslations through the ForgeI18N message format translator as well. 2018-10-05 22:21:30 -04:00
cpw e199e78a4f load languages on the server as well as the client, and fix up a bunch of data packs. 2018-10-05 21:42:15 -04:00
cpw 1c9b5fae5e Server run profile, also setup logging for client profile. 2018-10-05 01:25:27 -04:00
cpw 2b23eb96fb Tweak library locating code. Works well on vanilla and dev now. 2018-10-04 23:24:02 -04:00
cpw bdcc7d966f Fix the forge version presented to the game (remove MC prefix) 2018-10-04 20:04:03 -04:00
cpw ca765b857b Move the version packages somewhere that is now filtered so it doesn't
load twice.
2018-10-04 19:28:45 -04:00
cpw 978d0ff2e3 Fall colours
🎃🎃🎃🎃🎃🎃🎃🎃🎃🎃
2018-10-04 18:40:34 -04:00
cpw 129870dbe8 Missing language now presents to the UI. 2018-10-04 11:31:08 -04:00
cpw d5e04dbcb5 Better error passing from early to game client launch. 2018-10-04 00:57:08 -04:00
cpw c6e7bbe18b Use the maven artifact code rather than our very outdated copy 2018-10-03 22:47:07 -04:00
LexManos 4630741c7c Add SHAs for post processors to allow the installer to skip if matching.
SpecialSource needs a update to stabilize output before it can be cached.
2018-10-02 13:13:33 -07:00
cpw 0b11b0e6bb Launch in the vanilla launcher now. 2018-10-02 00:32:41 -04:00
LexManos 39307856b5 More installer related tweaks. 2018-10-01 20:27:05 -07:00
LexManos 2b4f7b1a86 Specify version information using Java 8's Package Version system. 2018-10-01 19:19:25 -07:00
LexManos e8329ad2c2 Fix builds without crowdin key, and installer work.
Started moving version out of code.
Include expected vanilla class hashes in universal so we can validate them at runtime.
2018-10-01 16:59:46 -07:00
cpw 486d5afa68 fix up the examplemod for new FML and add a couple of extra bits. 2018-09-30 14:29:14 -04:00
cpw 6485a48d79 Use latest paulscode (removes need for soundfix transformer) and fix gitignore. 2018-09-30 14:29:14 -04:00
cpw fe12687ec1 Branding fixup. 2018-09-30 14:29:14 -04:00
cpw 0024d9d283 Config GUI tweaks, and MCP is now part of the "minecraft" entry. 2018-09-30 14:29:14 -04:00
LexManos b8d305b869 Installer work, universal obfed to srg names, and binpatches against SRG named clients. 2018-09-30 02:54:20 -07:00
cpw 015ac2547e Fixup the config GUI and get things working again. 2018-09-29 01:29:49 -04:00
LexManos b54bd33332 Work on installer json generation. 2018-09-28 20:50:01 -07:00
cpw bb9eca96a8 Basic error display GUI. 2018-09-28 21:07:46 -04:00
LexManos dec65732ce Work on publishing tasks.
Userdev/universal/mdk done.
mdk needs updating once FG3 user side is finished.
Installer waiting on Interaller project re-write to do install time deobf/patching.
2018-09-25 00:29:20 -07:00
cpw 09e2aeaec4 Some tweaks to get the launcher working. 2018-09-24 00:07:33 -04:00
LexManos 94e1a8e0a4 Update mappings to 09/21 snapshots.
Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
2018-09-22 03:40:22 -07:00
LexManos 5ed03945a0 Disable eclipse compiler and switch to SRG patches. 2018-09-22 00:38:21 -07:00
tterrag d08f8e1a78 Fix remaining issues preventing compilation, launching, and loading worlds (#5156)
Fix duplicate ID for ingredient serializers
Fix KeyBinding compile errors. No GuiKeyBindingList patches yet.
Implement controls GUI and WorldServer patches
2018-09-21 19:07:48 -07:00
LexManos c191851ec0 Fixed all compile errors except the 4 in KeyBinding. 2018-09-21 15:50:37 -07:00
LexManos a0e217b1dc More because git likes to split to many 2018-09-21 02:17:20 -07:00
LexManos e2a17ac31b Ran License checker to fix the headers of files missing them. 2018-09-21 02:15:03 -07:00
LexManos cdfa7caaeb More work on compile errors, New system for ToolClasses, using a ToolType class instead to de-stringify things. 2018-09-21 01:47:12 -07:00
Anthony Anderson 0cd21ebe7e Block patches and event work (#5138) 2018-09-20 13:11:02 -07:00
LexManos b25f92b0c0 Add concept of pushing/poping levels to ForgeConfigSpec as well as comments on those levels. 2018-09-18 12:19:19 -07:00
tterrag 86d10d355f Fix borked Item patch 2018-09-18 00:14:27 -04:00
tterrag c4cf950863 Fix the rest of the "easy" compile errors (#5151)
* Add Entity.changeDimension patch and transitively required patches

* Fix throws declaration on CommandSetDimension#execute

* Fix rest of errors in fluid package

* Add PLAYER_REACH attribute

* Fix compile errors in fml.client.config and add GuiButton patch

* Delete unnecessary client.config classes, fix all config errors

* Comment some fluid errors in models

* Fix all errors in common package root, except ForgeHooks

* Mass comment network package

* Experimental conversion of extended states to generic base class

* Fix errors in common.util

* Remove config annotation stuff cuz lex said so

* Make extended state stuff compile fully
2018-09-18 00:04:02 -04:00
LexManos 6814cbf0df Beginning work on redesigning Config API. 2018-09-17 20:40:42 -07:00
LexManos 02c31cc867 More work on recipes, custom ingredients, recipes, and constants should work now. 2018-09-17 03:41:16 -07:00
cpw 03d19f2e70 Tweak to remove javac compile errors related to generics on registries.
Also remove the recipes registry call - they're gone from registries completely.
2018-09-16 22:27:08 -04:00
cpw abacf8e141 Net handling pass 2. Tidied up login packet sourcing, generate registry packets. 2018-09-16 20:59:25 -04:00
cpw 9f2c7c881c Net Handshake phase 1. Validates pairings on client and server. 2018-09-16 20:56:10 -04:00
LexManos afead63381 Migrate most of the OreDictionary to tags. 2018-09-16 16:28:21 -07:00
tterrag 231dfeee31 Enforce bounds on min/max registry IDs 2018-09-16 16:59:08 -04:00
LexManos c77d00efe4 Recipe work. No longer a registry. OreDictionary related code removed in favor of Tags. Started moving some OreDict items to tags.
Added code to RuntimeEnumExtender to return existing enum values with the same name if they exist instead of creating more.
2018-09-16 04:20:28 -07:00
tterrag e3a931bf96 Fix errors in commands and getDimension->getId 2018-09-15 15:02:38 -04:00
tterrag c59caa4b92 Revert unintentional change to FG version 2018-09-15 14:25:36 -04:00
LexManos b4c23aba8e Command work, and Added TileEntityType as a Forge Registry. 2018-09-15 00:59:19 -07:00
tterrag 3f743887e7 More compile cleanups. (#5139) 2018-09-14 09:30:56 -07:00
LexManos dbf649225a Update MCPConfig to use new ForgeFlower to fix AccessTransformer issues on inner classes. 2018-09-12 04:17:41 -07:00
tterrag 949a62a0da Fix most of the compile errors in the client package (#5137)
* Add KeyBinding#getKey and clean up errors in KeyModifier

* Add dimension IRenderHandler patches

* Fix most of the compile errors in client package.

The rest are missing Block/KeyBinding patches

* Disable selective reloads until configs are finished

* Add OnlyIn on IForgeDimension to match those of Dimension
2018-09-11 21:42:29 -04:00
LexManos a0cef07a0b Pin MCPConfig version
Cleanup and implement BrewingRecipes
Delete client command related things
Cleanup some biome stuff.
2018-09-11 18:25:25 -07:00
cpw f72a7e02e3 Fix vanilla bug with GLFW init error display - actually the error, not the memory address containing the message
Load natives from the environment var, not hardcoding.
2018-09-10 20:31:51 -04:00
LexManos bec9214d0c Fix launching in dev 2018-09-10 13:08:35 -07:00
tterrag f95da817c4 Fix AnvilChunkLoader not having access to chunk cap dispatcher 2018-09-10 02:45:06 -04:00
cpw a4f2802306 Add I18n accessor, fix up some mod log messages, make the EnumExtender work. 2018-09-09 23:35:02 -04:00
tterrag 334d925972 Port capability patches to 1.13 and refactor to new system (#5134)
* resource package and misc leftover rendering stuff

* Port Item and ItemStack patches

* Extract most item patches to interface

* Refactor Item#setNoRepair to be part of Item.Builder

* Adapt AnimationItemOverrideList to new cap system

* Improve null contract of OptionalCapabilityInstance

* Remove Capability.cast

* Update CapabilityAnimation to new cap system

* Remove OptionalCapabilityInstance#flatMap and add NonNullConsumer

* Add capability patch to Entity, not everything yet

* Fix Entity patch and add missing methods to IForgeEntity

* Fix null contract of CapabilityDispatcher

* Add TileEntity caps

* Adapt FluidUtil to new cap system

* Add world caps

* Add chunk caps

* Clean up cap patches

* Replace all tabs with spaces

* Move builder methods on Item to Item.Builder

Whitepsace fix

* Sided stuff take 2

* Prevent OptionalCapabilityInstance creating additional empty instances

* Cache getCapability result in AnimationTESR

* Fix imports in TileEntity patch

* Pull out cap code to base class, add village caps
2018-09-09 17:27:15 -04:00
mezz f851b37aa0 Initial blind port of the mod error screens 2018-09-09 12:46:56 -07:00
tterrag dde7dccef1 Porting Forge rendering code to 1.13 (#5132) 2018-09-08 13:34:59 -07:00
LexManos eac693e785 Introduce rework of Capability provider. And reduce errors to <2000 2018-09-06 06:27:24 -07:00
LexManos 12869710de Remove old paulscode libraries.
Re-work EnumHelper and ObjectHolder systems to bypass JITer of final fields.
Other cleanups.
2018-09-06 04:39:01 -07:00
LexManos 2798080f60 More error cleanup, reinstanted IForgeReigstryEntry.
The abstract class will be used as the default, and to enable delegates but we should keep it api simple by keeping the interface.
Removed some patches that didnt get removed in the rebase.
2018-09-05 20:06:18 -07:00
LexManos ff6fa2cfaf Add some missing libraries and work on GuiIngameForge. Down 700 errors. 2018-09-05 18:00:14 -07:00
cpw f818cc8f71 Tweak 2018-09-05 13:14:16 -07:00
cpw d7e9217695 Network init 2018-09-05 13:14:16 -07:00
cpw b50b768852 Server starts 2018-09-05 13:13:53 -07:00
cpw 330db1a54d Patches deleted 2018-09-05 12:58:49 -07:00
cpw 77c3310711 Zeroth pass on 1.13 2018-09-05 12:56:01 -07:00
cpw 6e99f84e91 Moving some stuff around, network and server events. 2018-09-05 12:37:20 -07:00
cpw 689ebd8036 Dediserver runs and talks to clients. 2018-09-05 12:35:31 -07:00
cpw 506b51f189 A much more straightforward networking system. 2018-09-05 12:33:38 -07:00
cpw 4636365e30 Some beginnings of a network again. 2018-09-05 12:31:47 -07:00
cpw d0ab0e166c Well, it works, for a game, now. 2018-09-05 12:30:02 -07:00
cpw 06b16aaa19 Some more stuffs. ObjectHolder's replacement? 2018-09-05 11:58:31 -07:00
cpw baa9dfe55a Things. they work. Obviously still WAY more to do. 2018-09-05 11:53:54 -07:00
cpw 1b1ee6f0b8 more things. Moving ModContainer around. 2018-09-05 11:49:48 -07:00
cpw f279a07586 metadata is dead 2018-09-05 11:40:48 -07:00
cpw 3b78e97ad8 Fidgeting while the world burns 🔥🔥🔥🔥🔥🔥 2018-09-05 11:40:48 -07:00
cpw f942eb184a WOW 😲 such broken. Many brokes. 2018-09-05 11:40:47 -07:00
cpw c1f0e1b68f Holy Moly, it's a big fat commit of broken code! 2018-09-05 11:16:33 -07:00
cpw 5b05e103f4 Starting to put the launch itself together 2018-09-05 10:56:03 -07:00
cpw 7e5bd4ecdb Access Transformer. Starting to try and launch things. 2018-09-05 10:56:03 -07:00
cpw c38d2e48cd Early signs of modloading 2018-09-05 10:55:15 -07:00
cpw 66b6150027 Coremod 2018-09-05 10:55:15 -07:00
cpw 9f8a9196d8 Update NewFML.md 2018-09-05 10:54:20 -07:00
cpw ceabad3253 Add documentation explaining changes. 2018-09-05 10:54:20 -07:00
cpw 14ac77e444 Goodbye @Mod, it was lovely knowing you! 2018-09-05 10:54:20 -07:00
cpw d23850ff98 Goodbye @Mod, it was lovely knowing you! 2018-09-05 10:49:33 -07:00
cpw 3e4f3ff142 Delete MarkerTransformer. I don't think this has been used in years. 2018-09-05 10:47:56 -07:00
2182 changed files with 61210 additions and 98125 deletions

No files matched your search

+1
View File
@@ -13,3 +13,4 @@
*.pyd binary
*.cfg text eol=lf
*.py text eol=lf
*.jks binary
+3 -5
View File
@@ -6,15 +6,15 @@ staleLabel: Stale
unmarkComment: false
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Issues with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- Assigned
pulls:
# Number of days of inactivity before a Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Pull Request is closed
daysUntilClose: 14
# Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- Assigned
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This pull request has been automatically marked as stale because it has not had recent
@@ -30,8 +30,6 @@ issues:
daysUntilStale: 180
# Number of days of inactivity before a stale Issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale. Set to `[]` to disable
exemptLabels: []
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had activity
+18 -6
View File
@@ -1,7 +1,8 @@
#eclipse
/bin
/.settings
/.classpath
**/bin
**/.settings
**/.classpath
*.project
#In case people make their workspace in the repo
/eclipse/
@@ -14,11 +15,20 @@
#gradle
/build
/.gradle
/mdk/.gradle
/mdk/build
#occupational hazards
/projects/
/projects/mcp/
/projects/clean/
/projects/forge/
/projects/**/build/
/projects/**/out/
/projects/**/run/
/projects/**/*.launch
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
/patches-/
@@ -26,7 +36,9 @@
# FML changelog
changelog.txt
/patches_old/
/patches_old_bak/
*.py
*.7z
/logs/
gradle.properties
!/mdk/gradle.properties
+8
View File
@@ -28,3 +28,11 @@ script:
notifications:
email: false
# skip building travis on 1.13+ - it doesn't work there
branches:
except:
- 1.13-pre
- 1.13.x
- 1.14.x
- /^noci-.*$/
+1 -1
View File
@@ -10,7 +10,7 @@ alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptian
of me taking over the project, who knows what Minecraft modding would be today.
Secondly, someone who has worked with me, and developed some of the core features
that allow modding to he as functional, and as simple as it is, cpw. For developing
that allow modding to be as functional, and as simple as it is, cpw. For developing
FML, which stabelized the client and server modding ecosystem. As well as the base
loading system that allows us to modify Minecraft's code as elegently as possible.
Vendored
+110
View File
@@ -0,0 +1,110 @@
@Library('forge-shared-library')_
pipeline {
options {
disableConcurrentBuilds()
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
stage('notify_start') {
when {
not {
changeRequest()
}
}
steps {
discordSend(
title: "${DISCORD_PREFIX} Started",
successful: true,
result: 'ABORTED', //White border
thumbnail: JENKINS_HEAD,
webhookURL: DISCORD_WEBHOOK
)
}
}
stage('setup') {
steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
}
stage('changelog') {
when {
not {
changeRequest()
}
}
steps {
writeChangelog(currentBuild, 'build/changelog.txt')
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
CROWDIN = credentials('forge-crowdin')
KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
}
}
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
when {
changeRequest()
}
environment {
CROWDIN = credentials('forge-crowdin')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
}
}
post {
always {
script {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
if (env.CHANGE_ID == null) { // This is unset for non-PRs
discordSend(
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
description: '```\n' + getChanges(currentBuild) + '\n```',
successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"),
result: currentBuild.currentResult,
thumbnail: JENKINS_HEAD,
webhookURL: DISCORD_WEBHOOK
)
}
}
}
}
}
-10
View File
@@ -1,10 +0,0 @@
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,40 +0,0 @@
SoundSystem CodecIBXM Class License:
You are free to use this class for any purpose, commercial or otherwise.
You may modify this class or source code, and distribute it any way you
like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any
unmodified portion of it.
2) You may not copyright this class or a modified version of it and then
sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes
made before redistributing the modified source code, so other users know
it is not the original code.
4) You are not required to give me credit for this class in any derived
work, but if you do, you must also mention my website:
http://www.paulscode.com
5) I the author will not be responsible for any damages (physical,
financial, or otherwise) caused by the use if this class or any
portion of it.
6) I the author do not guarantee, warrant, or make any representations,
either expressed or implied, regarding the use of this class or any
portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the IBXM library available from
http://www.geocities.com/sunet2000/
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1 -1
View File
@@ -1,5 +1,5 @@
Minecraft Forge
Copyright (c) 2016-2018.
Copyright (c) 2016-2019.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
+2 -8
View File
@@ -3,8 +3,8 @@ parts herein are licensed under the terms of the LGPL 2.1 found
here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and
copied below.
Homepage: http://MinecraftForge.net/
http://github.com/MinecraftForge/MinecraftForge
Homepage: http://minecraftforge.net/
https://github.com/MinecraftForge/MinecraftForge
A note on authorship:
@@ -57,12 +57,6 @@ This software contains a partial repackaging of javaxdelta, a BSD licensed progr
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
authored by genman, heikok, pivot.
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
This software contains potions of Paulscodee IBXM library, a BSD liceensed library for
loading and playing IBXM formated auto. No modifications havee beeen made. The associated
licenses can be found along side this one, or at
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20IBXM%20Library.txt
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20SoundSystem%20CodecIBXM.txt
=========================================================================
+127
View File
@@ -0,0 +1,127 @@
# FML
Entrypoint : ```FMLServiceProvider.onLoad```
- Verify environment
-- Check all libraries are present: ```accesstransformer```, ```coremod```, ```deobfuscator```
-- Check versions are suitable: ```modlauncher```, ```accesstransformer```, ```coremod```, ```deobfuscator```
- Find deobfuscated and patched MC
-- If not found, trigger job to generate that (loaded later at FMLLaunchProvider.launch)
Injected arguments:
- ```mods``` : CSV list of mod files to load
- ```modlist``` : JSON formatted list of mod files in a maven-like repository format
Entrypoint : ```FMLServiceProvider.initializer```
- Setup paths
-- ```mods``` folder
-- ```config``` folder
- FML config file read (JSON?)
- Trigger initial loading
Entrypoint : ```FMLLaunchProvider.launch```
- Launches the patched and deobfuscated game
- - If that wasn't found it'll be generated from the vanilla jar and patch/deobf files (see above)
- Possible we'll use an alternative launch for the development environment
(A goal is that we pre-generate this JAR during forge installation or modpack installation)
## Loading
- First we discover all mods
- - IModLocator instances present in system are found and queried to compile a master list of all mod artifacts of the three types
- LANGPROVIDERs are added to the supported language system : IModLanguageProvider
- The MODS from the list have their META-INF/mods.json file queried for mod instances to load
- - MODS are cross-referenced for their language being available
- - MODS are cross-referenced for their libraries being available
- - MODS are cross-referenced for their MOD dependencies being available
- - MODS with META-INF/coremods.json specification are loaded into the COREMOD system
- - MODS with META-INF/accesstransformer.json are loaded into the ACCESSTRANSFORMER system
- - MODS are enqueued to the background loading system
- FMLLaunchProvider will be triggered from the ModLauncher to start the game
## Game loading
- Events triggered from loadGame will launch various phases of modloading as before
-- Deprecation of old "FML" events in favour of Forge events
-- If a mod hasn't completed scanning there might be a pause waiting for it to complete before loading (testing indicates this should be a very rare occurrence and isn't worse than existing status quo where all scanning and loading is on-thread)
### ```IModLocator```
Finds mods from various sources of various types
manifest is queried for type: FMLModType
- MOD : this file will be scanned as a mod. This is default if nothing is present
- LIBRARY : this file will be added to the classpath and no further processing is done
- LANGPROVIDER : this file will be loaded as a language provider
#### ```ModsFolderLocator```
- scans for jar files from mods folder
-- able to load all types
-- loads in all environments
-- maybe able to do runtime name transformation for dev time?
Standard mechanism to find and load mods
#### ```ExplodedDirectoryLocator```
- loads a directory as a mod
-- only able to load mods
-- should only load in dev env
Intended as a mechanism to allow development of mods easily by pointing at a compiled output directory
#### ```ArgumentModsLocator``` : NYI
- loads mods from the arguments on the command line
-- able to load all types
-- loads in all environments
### ```IModLanguageProvider```
Provides mod and language provider services
- Provides a means to transform a Mod File (from the IModLocator) into a list of modcontainer objects based on mods.json
- Scanning work will be done in background threads
- Language providers can be provided as JARs via the modlocator for ease of distribution
#### ```FMLModLanguageProvider```
This is the standard Java @Mod implementation provider
- provided by default (always supported)
- All scanning for @Mod will be done in the background thread
#### ```ScalaModLanguageProvider```
This is the scala language provider. It'll be provided separately as a JAR mod download.
- API contract will need definition
Other languages? Kotlin? Alternative Scala versions? Javascript?
## Coremods
Coremods are now forcefully separated into _injection_ and _runtime_ phases.
### Injection
Injection is the act of intercepting the loading of a class and modifying the inbound class with alterations such as additions, replacements and deletions
Injections will be written using Javascript. Two functions are required: a function providing the list of injection sites, and the function to transform the injection site.
All injection sites will need to be pre-specified by the coremod in their metadata. Lookup services should be provided in the Javascript API.
Javascript API for common coremod injection tasks needs to be developed, to allow common best-practice tooling for these complex tasks.
Runtime coremod code (code that has been injected) is Java as usual.
## Background loading thread
Early in loading, a background thread is triggered which will perform scanning tasks for common resources, such as @Mod instances and other annotations. This thread will also be responsible for loading any cached resources, either those defined at build time or pre-computed from previous runs. It may also be tasked with writing those precomputed resources.
There will be a IPreLoaderJobProvider that will allow extension of the scope of these tasks
+1060 -436
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+1 -2
View File
@@ -1,6 +1,5 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
Vendored
+59 -51
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
##############################################################################
##
@@ -6,47 +6,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
Vendored
+4 -10
View File
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
+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
=========================
+105 -51
View File
@@ -1,77 +1,131 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'net.minecraftforge.gradle'
// 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
archivesBaseName = 'modid'
version = "1.0"
group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
version = "@VERSION@"
runDir = "run"
// 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.
mappings = "@MAPPINGS@"
// 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('build/resources/main/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
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 {
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
}
}
}
}
}
dependencies {
// 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
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
// 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'
// 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"
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// 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
// for more info...
// 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'
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
// 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": "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>
+3
View File
@@ -20,3 +20,6 @@ build
# other
eclipse
run
# Files from Forge MDK
forge*changelog.txt
+1
View File
@@ -1,3 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
@@ -1,31 +1,84 @@
package com.example.examplemod;
import net.minecraft.init.Blocks;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
import java.util.stream.Collectors;
// The value here should match an entry in the META-INF/mods.toml file
@Mod("examplemod")
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String NAME = "Example Mod";
public static final String VERSION = "1.0";
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
private static Logger logger;
public ExampleMod() {
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
// Register the enqueueIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
// Register the processIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
@EventHandler
public void init(FMLInitializationEvent event)
private void setup(final FMLCommonSetupEvent event)
{
// some example code
logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
// some preinit code
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
}
private void doClientStuff(final FMLClientSetupEvent event) {
// do something that can only be done on the client
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
}
private void enqueueIMC(final InterModEnqueueEvent event)
{
// some example code to dispatch IMC to another mod
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().
map(m->m.getMessageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
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 for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
LOGGER.info("HELLO from Register Block");
}
}
}
+56
View File
@@ -0,0 +1,56 @@
# This is an example mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# 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="[26,)" #mandatory (26 is current forge version)
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="examplemod" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${file.jarVersion}" #mandatory
# A display name for the mod
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
Have some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional
# the modid of the dependency
modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[26,)" #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
side="BOTH"
# Here's another dependency
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.14.2]"
ordering="NONE"
side="BOTH"
-16
View File
@@ -1,16 +0,0 @@
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
+2 -2
View File
@@ -1,7 +1,7 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 3,
"_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
"pack_format": 4,
"_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods."
}
}
+66
View File
@@ -0,0 +1,66 @@
# The name of the mod loader type to load
modLoader="javafml"
# A version range to match for said mod loader
loaderVersion="[2.0,)"
# A URL to query for updates
updateJSONURL="http://myurl.me/"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/"
# Extra mod loader property
randomScalaProperty="fishy"
# Arbitrary key-value property pairs available to mods
[properties]
key="value"
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]]
# The modid of the mod
modId="inventorysorter"
# The version number of the mod
version="1.1"
# A display name for the mod
displayName="Inventory Sorter"
# The description text for the mod (multi line!)
description='''
This is my mod, there may be
others, but this one is mine
'''
# Override the default resourcelocation namespace with this instead
# Currently not implemented
namespace="invsorter"
# A random extra property for a mod loader
randomExtraProperty="somevalue"
# Arbitrary key-value pairs
[modproperties.inventorysorter]
key="value"
# A list of dependencies
[[dependencies.inventorysorter]]
# the modid of the dependency
modid="forge"
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true
# The version range of the dependency
versionRange="[14.23.2.0,)"
# 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
side="BOTH"
# Here's another dependency
[[dependencies.inventorysorter]]
modid="minecraft"
mandatory=true
versionRange="[1.12.2]"
ordering="NONE"
side="BOTH"
# Here's another mod in this jar
[[mods]]
# Note that other mod types may want to add additional key-value pairs in here
modId="inventorysortertoo"
# ${file.jarVersion} will read the Implementation-Version of the jar file
version="${file.jarVersion}"
displayName="Inventory Sorter as well"
description='''
This is also my mod, there may be
others, but this one is mine
'''
@@ -0,0 +1,24 @@
--- a/com/mojang/blaze3d/platform/GLX.java
+++ b/com/mojang/blaze3d/platform/GLX.java
@@ -115,6 +115,10 @@
p_212906_0_.put(1286, "Operation on incomplete framebuffer");
});
+ /* Stores the last values sent into glMultiTexCoord2f */
+ public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f;
+
public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) {
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938));
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936));
@@ -913,6 +917,10 @@
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
}
+ if (p_glMultiTexCoord2f_0_ == GL_TEXTURE1) {
+ lastBrightnessX = p_glMultiTexCoord2f_1_;
+ lastBrightnessY = p_glMultiTexCoord2f_2_;
+ }
}
public static void glBlendFuncSeparate(int p_glBlendFuncSeparate_0_, int p_glBlendFuncSeparate_1_, int p_glBlendFuncSeparate_2_, int p_glBlendFuncSeparate_3_) {
@@ -0,0 +1,14 @@
--- a/com/mojang/blaze3d/platform/TextureUtil.java
+++ b/com/mojang/blaze3d/platform/TextureUtil.java
@@ -44,7 +44,10 @@
}
public static void prepareImage(NativeImage.PixelFormatGLCode p_prepareImage_0_, int p_prepareImage_1_, int p_prepareImage_2_, int p_prepareImage_3_, int p_prepareImage_4_) {
- bind(p_prepareImage_1_);
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
+ {
+ bind(p_prepareImage_1_);
+ }
if (p_prepareImage_2_ >= 0) {
GlStateManager.texParameter(3553, 33085, p_prepareImage_2_);
GlStateManager.texParameter(3553, 33082, 0);
@@ -1,10 +0,0 @@
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementManager.java
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementManager.java
@@ -66,6 +66,7 @@
field_192784_c.func_192087_a();
Map<ResourceLocation, Advancement.Builder> map = this.func_192781_c();
this.func_192777_a(map);
+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map);
field_192784_c.func_192083_a(map);
for (Advancement advancement : field_192784_c.func_192088_b())
@@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementRewards.java
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementRewards.java
@@ -49,7 +49,7 @@
public void func_192113_a(final EntityPlayerMP p_192113_1_)
{
p_192113_1_.func_71023_q(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186471_a();
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // Forge: add player & luck to LootContext
boolean flag = false;
--- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java
@@ -43,7 +43,7 @@
for (ResourceLocation resourcelocation : this.field_192116_c)
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
p_192113_1_.func_195068_e(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
boolean flag = false;
for(ResourceLocation resourcelocation : this.field_192116_c) {
@@ -1,13 +0,0 @@
--- ../src-base/minecraft/net/minecraft/advancements/DisplayInfo.java
+++ ../src-work/minecraft/net/minecraft/advancements/DisplayInfo.java
@@ -132,7 +132,9 @@
{
Item item = JsonUtils.func_188180_i(p_193221_0_, "item");
int i = JsonUtils.func_151208_a(p_193221_0_, "data", 0);
- return new ItemStack(item, 1, i);
+ ItemStack ret = new ItemStack(item, 1, i);
+ ret.func_77982_d(net.minecraftforge.common.util.JsonUtils.readNBT(p_193221_0_, "nbt"));
+ return ret;
}
}
@@ -1,21 +1,19 @@
--- ../src-base/minecraft/net/minecraft/advancements/PlayerAdvancements.java
+++ ../src-work/minecraft/net/minecraft/advancements/PlayerAdvancements.java
@@ -196,6 +196,9 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -187,6 +187,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_)
{
+ // Forge: don't grant advancements for fake players
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
+
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -214,6 +217,8 @@
{
this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[] {this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()}));
}
+
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
+ // Forge: don't grant advancements for fake players
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -199,6 +201,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
}
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
}
@@ -1,16 +0,0 @@
--- ../src-base/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
+++ ../src-work/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
@@ -104,6 +104,13 @@
if (p_192492_0_ != null && !p_192492_0_.isJsonNull())
{
JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item");
+ if (jsonobject.has("type"))
+ {
+ final ResourceLocation rl = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "type"));
+ final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> map = net.minecraftforge.advancements.critereon.ItemPredicates.getPredicates();
+ if (map.containsKey(rl)) return map.get(rl).apply(jsonobject);
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
+ }
MinMaxBounds minmaxbounds = MinMaxBounds.func_192515_a(jsonobject.get("count"));
MinMaxBounds minmaxbounds1 = MinMaxBounds.func_192515_a(jsonobject.get("durability"));
Integer integer = jsonobject.has("data") ? JsonUtils.func_151203_m(jsonobject, "data") : null;
@@ -0,0 +1,38 @@
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
@@ -25,6 +25,8 @@
import net.minecraft.util.registry.Registry;
public class ItemPredicate {
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> custom_predicates = new java.util.HashMap<>();
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates);
public static final ItemPredicate field_192495_a = new ItemPredicate();
@Nullable
private final Tag<Item> field_200018_b;
@@ -93,6 +95,11 @@
public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) {
if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) {
JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item");
+ if (jsonobject.has("type")) {
+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type"));
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
+ }
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
if (jsonobject.has("data")) {
@@ -181,6 +188,14 @@
}
}
+ public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) {
+ custom_predicates.put(name, deserializer);
+ }
+
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
+ return unmod_predicates;
+ }
+
public static class Builder {
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
@Nullable
@@ -0,0 +1,96 @@
--- a/net/minecraft/block/AbstractRailBlock.java
+++ b/net/minecraft/block/AbstractRailBlock.java
@@ -35,7 +35,7 @@
}
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
- RailShape railshape = p_220053_1_.func_177230_c() == this ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
+ RailShape railshape = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
}
@@ -57,7 +57,7 @@
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (!p_220069_2_.field_72995_K) {
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
boolean flag = false;
BlockPos blockpos = p_220069_3_.func_177977_b();
if (!func_220064_c(p_220069_2_, blockpos)) {
@@ -115,7 +115,7 @@
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) {
+ if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) {
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
}
@@ -127,5 +127,66 @@
}
}
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
public abstract IProperty<RailShape> func_176560_l();
+
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Return true if the rail can make corners.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make corners.
+ */
+ public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
+ {
+ return !this.field_196277_c;
+ }
+
+ /**
+ * Returns true if the rail can make up and down slopes.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make slopes.
+ */
+ public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
+ return true;
+ }
+
+ /**
+ * Return the rail's direction.
+ * Can be used to make the cart think the rail is a different shape,
+ * for example when making diamond junctions or switches.
+ * The cart parameter will often be null unless it it called from EntityMinecart.
+ *
+ * @param world The world.
+ * @param pos Block's position in world
+ * @param state The BlockState
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
+ * @return The direction.
+ */
+ public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @javax.annotation.Nullable net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
+ return state.func_177229_b(func_176560_l());
+ }
+
+ /**
+ * Returns the max speed of the rail at the specified position.
+ * @param world The world.
+ * @param cart The cart on the rail, may be null.
+ * @param pos Block's position in world
+ * @return The max speed of the current rail.
+ */
+ public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
+ return 0.4f;
+ }
+
+ /**
+ * This function is called by any minecart that passes over this rail.
+ * It is called once per update tick that the minecart is on the rail.
+ * @param world The world.
+ * @param cart The cart on the rail.
+ * @param pos Block's position in world
+ */
+ public void onMinecartPass(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) { }
}
@@ -0,0 +1,13 @@
--- a/net/minecraft/block/BedBlock.java
+++ b/net/minecraft/block/BedBlock.java
@@ -85,7 +85,9 @@
}
}
- if (p_220051_2_.field_73011_w.func_76567_e() && p_220051_2_.func_180494_b(p_220051_3_) != Biomes.field_76778_j) {
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_220051_2_.field_73011_w.canSleepAt(p_220051_4_, p_220051_3_);
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
if (p_220051_1_.func_177229_b(field_176471_b)) {
p_220051_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
return true;
File diff suppressed because it is too large. Load diff
@@ -1,43 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBanner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java
@@ -90,16 +90,9 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_);
-
- if (itemstack.func_190926_b())
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
- else
- {
- func_180635_a(p_180653_1_, p_180653_2_, itemstack);
- }
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -126,6 +119,23 @@
return BlockFaceShape.UNDEFINED;
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntity te = world.func_175625_s(pos);
+
+ if (te instanceof TileEntityBanner)
+ {
+ TileEntityBanner tileentitybanner = (TileEntityBanner)te;
+ ItemStack itemstack = tileentitybanner.func_190615_l();
+ drops.add(itemstack);
+ }
+ else
+ {
+ drops.add(new ItemStack(Items.field_179564_cE, 1, 0));
+ }
+ }
+
public static class BlockBannerHanging extends BlockBanner
{
protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D);
@@ -1,14 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBed.java
@@ -84,8 +84,10 @@
}
}
- if (p_180639_1_.field_73011_w.func_76567_e() && p_180639_1_.func_180494_b(p_180639_2_) != Biomes.field_76778_j)
+ net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = p_180639_1_.field_73011_w.canSleepAt(p_180639_4_, p_180639_2_);
+ if (sleepResult != net.minecraft.world.WorldProvider.WorldSleepResult.BED_EXPLODES)
{
+ if (sleepResult == net.minecraft.world.WorldProvider.WorldSleepResult.DENY) return true;
if (((Boolean)p_180639_3_.func_177229_b(field_176471_b)).booleanValue())
{
EntityPlayer entityplayer = this.func_176470_e(p_180639_1_, p_180639_2_);
@@ -1,70 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
@@ -17,7 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockBush extends Block
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
{
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
@@ -40,7 +40,8 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()));
+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected boolean func_185514_i(IBlockState p_185514_1_)
@@ -70,6 +71,11 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_180671_3_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+ {
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
+ }
return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
}
@@ -94,6 +100,36 @@
return false;
}
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_185773_cZ) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
+ return net.minecraftforge.common.EnumPlantType.Plains;
+ }
+
+ @Override
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
+
@SideOnly(Side.CLIENT)
public BlockRenderLayer func_180664_k()
{
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -98,7 +98,7 @@
if (p_181088_2_ == EnumFacing.UP)
{
- return block == Blocks.field_150438_bZ || !func_193384_b(block) && flag;
+ return iblockstate.func_185896_q() || !func_193384_b(block) && flag;
}
else
{
@@ -1,67 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -20,7 +20,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockCactus extends Block
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D);
@@ -36,6 +36,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update
BlockPos blockpos = p_180650_2_.func_177984_a();
if (p_180650_1_.func_175623_d(blockpos))
@@ -51,6 +52,8 @@
{
int j = ((Integer)p_180650_3_.func_177229_b(field_176587_a)).intValue();
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, true))
+ {
if (j == 15)
{
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
@@ -62,6 +65,8 @@
{
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176587_a, Integer.valueOf(j + 1)), 4);
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
+ }
}
}
}
@@ -112,8 +117,8 @@
}
}
- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
+ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b());
+ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
}
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
@@ -137,6 +142,18 @@
return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue();
}
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return net.minecraftforge.common.EnumPlantType.Desert;
+ }
+
+ @Override
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return func_176223_P();
+ }
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176587_a});
@@ -1,31 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -470,7 +470,7 @@
if (block == this)
{
- if (this.func_176457_m(p_189418_1_, blockpos))
+ if (!p_189418_3_ && this.func_176457_m(p_189418_1_, blockpos)) // Forge: fix MC-99321
{
return null;
}
@@ -538,7 +538,7 @@
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
{
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l();
+ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).doesSideBlockChestOpening(p_176456_1_, p_176456_2_.func_177984_a(), EnumFacing.DOWN);
}
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
@@ -608,4 +608,10 @@
BASIC,
TRAP;
}
+
+ /* ======================================== FORGE START =====================================*/
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ return !func_176454_e(world, pos) && super.rotateBlock(world, pos, axis);
+ }
}
@@ -1,19 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChorusFlower.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChorusFlower.java
@@ -55,7 +55,7 @@
{
int i = ((Integer)p_180650_3_.func_177229_b(field_185607_a)).intValue();
- if (i < 5 && p_180650_4_.nextInt(1) == 0)
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, p_180650_4_.nextInt(1) == 0))
{
boolean flag = false;
boolean flag1 = false;
@@ -144,6 +144,7 @@
{
this.func_185605_c(p_180650_1_, p_180650_2_);
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -1,44 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -44,13 +44,14 @@
{
this.func_176500_f(p_180650_1_, p_180650_2_, p_180650_3_);
}
- else if (p_180650_1_.field_73012_v.nextInt(5) == 0)
+ else
{
int i = ((Integer)p_180650_3_.func_177229_b(field_176501_a)).intValue();
- if (i < 2)
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(5) == 0))
{
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176501_a, Integer.valueOf(i + 1)), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -132,7 +133,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- int i = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ int i = ((Integer)state.func_177229_b(field_176501_a)).intValue();
int j = 1;
if (i >= 2)
@@ -142,7 +150,7 @@
for (int k = 0; k < j; ++k)
{
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
+ drops.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
}
}
@@ -1,81 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -70,6 +70,7 @@
{
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9)
{
int i = this.func_185527_x(p_180650_3_);
@@ -78,9 +79,10 @@
{
float f = func_180672_a(this, p_180650_1_, p_180650_2_);
- if (p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0)
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0))
{
p_180650_1_.func_180501_a(p_180650_2_, this.func_185528_e(i + 1), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -116,11 +118,11 @@
float f1 = 0.0F;
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
+ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
{
f1 = 1.0F;
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j)))
{
f1 = 3.0F;
}
@@ -161,7 +163,8 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected Item func_149866_i()
@@ -174,11 +177,32 @@
return Items.field_151015_O;
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, 0);
+ int age = func_185527_x(state);
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+
+ if (age >= func_185526_g())
+ {
+ int k = 3 + fortune;
+
+ for (int i = 0; i < 3 + fortune; ++i)
+ {
+ if (rand.nextInt(2 * func_185526_g()) <= age)
+ {
+ drops.add(new ItemStack(this.func_149866_i(), 1, 0));
+ }
+ }
+ }
+ }
+
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this.
{
int i = this.func_185527_x(p_180653_3_);
@@ -1,23 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
@@ -17,7 +17,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockDeadBush extends BlockBush
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
{
protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
@@ -68,4 +68,11 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I));
+ }
}
@@ -1,28 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
@@ -203,7 +203,7 @@
flag1 = true;
}
- 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()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP))
{
p_189540_2_.func_175698_g(p_189540_3_);
flag1 = true;
@@ -247,13 +247,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- if (p_176196_2_.func_177956_o() >= 255)
+ if (p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1)
{
return false;
}
else
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return (state.func_185896_q() || state.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
}
}
@@ -1,81 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
@@ -24,7 +24,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockDoublePlant extends BlockBush implements IGrowable
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> field_176493_a = PropertyEnum.<BlockDoublePlant.EnumPlantType>func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> field_176492_b = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
@@ -87,6 +87,8 @@
Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c());
Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this);
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
+
if (block == this)
{
p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2);
@@ -95,17 +97,13 @@
if (block1 == this)
{
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
-
- if (!flag)
- {
- this.func_176226_b(p_176475_1_, blockpos1, p_176475_3_, 0);
- }
}
}
}
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
{
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
@@ -160,7 +158,6 @@
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_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
@@ -220,8 +217,6 @@
else
{
p_176489_4_.func_71029_a(StatList.func_188055_a(this));
- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a();
- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i));
return true;
}
}
@@ -290,6 +285,24 @@
return Block.EnumOffsetType.XZ;
}
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
+ return ret;
+ }
+
public static enum EnumBlockHalf implements IStringSerializable
{
UPPER,
@@ -1,29 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java
@@ -48,7 +48,7 @@
private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_)
{
- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
+ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -61,7 +61,7 @@
p_180683_1_.func_175698_g(p_180683_2_);
BlockPos blockpos;
- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}
@@ -95,7 +95,7 @@
{
BlockPos blockpos = p_180684_2_.func_177982_a(p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16), p_180684_1_.field_73012_v.nextInt(8) - p_180684_1_.field_73012_v.nextInt(8), p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16));
- if (p_180684_1_.func_180495_p(blockpos).func_177230_c().field_149764_J == Material.field_151579_a)
+ if (p_180684_1_.func_175623_d(blockpos))
{
if (p_180684_1_.field_72995_K)
{
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDropper.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDropper.java
@@ -43,7 +43,7 @@
{
ItemStack itemstack = tileentitydispenser.func_70301_a(i);
- if (!itemstack.func_190926_b())
+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, tileentitydispenser, i, itemstack))
{
EnumFacing enumfacing = (EnumFacing)p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
BlockPos blockpos = p_176439_2_.func_177972_a(enumfacing);
@@ -1,60 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
@@ -26,6 +26,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
int j = 1;
@@ -67,7 +68,7 @@
}
}
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
{
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
@@ -118,7 +119,7 @@
{
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
{
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
return;
}
@@ -166,6 +167,7 @@
}
else
{
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
}
}
@@ -187,7 +189,7 @@
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
{
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
{
return p_176374_3_;
}
@@ -254,11 +256,12 @@
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
{
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
+ Material mat = p_176372_3_.func_185904_a();
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
{
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
}
else
{
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockEnchantmentTable.java
+++ ../src-work/minecraft/net/minecraft/block/BlockEnchantmentTable.java
@@ -64,7 +64,7 @@
{
BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j);
- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X)
+ if (net.minecraftforge.common.ForgeHooks.getEnchantPower(p_180655_2_, blockpos) > 0)
{
if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2)))
{
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockEnderChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockEnderChest.java
@@ -100,7 +100,7 @@
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
{
- if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).func_185915_l())
+ if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).doesSideBlockChestOpening(p_180639_1_, p_180639_2_.func_177984_a(), EnumFacing.DOWN))
{
return true;
}
@@ -1,32 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
@@ -47,7 +47,7 @@
private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_)
{
- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0)
+ if ((p_176503_1_.func_175623_d(p_176503_2_.func_177977_b()) || func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b()))) && p_176503_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -62,17 +62,18 @@
}
else
{
+ IBlockState state = p_176503_1_.func_180495_p(p_176503_2_);
p_176503_1_.func_175698_g(p_176503_2_);
BlockPos blockpos;
- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_176503_2_.func_177977_b(); (p_176503_1_.func_175623_d(blockpos) || func_185759_i(p_176503_1_.func_180495_p(blockpos))) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}
if (blockpos.func_177956_o() > 0)
{
- p_176503_1_.func_175656_a(blockpos.func_177984_a(), this.func_176223_P());
+ p_176503_1_.func_175656_a(blockpos.func_177984_a(), state); //Forge: Fix loss of state information during world gen.
}
}
}
@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -72,7 +72,7 @@
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
{
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof EntityLivingBase && (p_180658_3_ instanceof EntityPlayer || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.field_70130_N * p_180658_3_.field_70130_N * p_180658_3_.field_70131_O > 0.512F)
+ if (net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) // Forge: Move logic to Entity#canTrample
{
func_190970_b(p_180658_1_, p_180658_2_);
}
@@ -95,7 +95,7 @@
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
{
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
- return block instanceof BlockCrops || block instanceof BlockStem;
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
}
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
@@ -1,38 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFence.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFence.java
@@ -165,7 +165,10 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return p_176221_1_.func_177226_a(field_176526_a, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176525_b, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))).func_177226_a(field_176527_M, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176528_N, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST)));
+ return p_176221_1_.func_177226_a(field_176526_a, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176525_b, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST))
+ .func_177226_a(field_176527_M, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176528_N, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST));
}
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
@@ -201,6 +204,23 @@
return new BlockStateContainer(this, new IProperty[] {field_176526_a, field_176525_b, field_176528_N, field_176527_M});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ return func_176524_e(world, pos.func_177972_a(facing), facing.func_176734_d());
+ }
+
+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ BlockPos other = pos.func_177972_a(facing);
+ Block block = world.func_180495_p(other).func_177230_c();
+ return block.canBeConnectedTo(world, other, facing.func_176734_d()) || func_176524_e(world, other, facing.func_176734_d());
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER;
@@ -1,35 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFenceGate.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFenceGate.java
@@ -59,7 +59,7 @@
{
EnumFacing.Axis enumfacing$axis = ((EnumFacing)p_176221_1_.func_177229_b(field_185512_D)).func_176740_k();
- if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() == Blocks.field_150463_bK) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() == Blocks.field_150463_bK))
+ if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() instanceof BlockWall))
{
p_176221_1_ = p_176221_1_.func_177226_a(field_176467_M, Boolean.valueOf(true));
}
@@ -192,6 +192,23 @@
return new BlockStateContainer(this, new IProperty[] {field_185512_D, field_176466_a, field_176465_b, field_176467_M});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() instanceof BlockFenceGate &&
+ state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE)
+ {
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
+ return connector instanceof BlockFence || connector instanceof BlockWall;
+ }
+ return false;
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
if (p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN)
@@ -1,218 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -39,7 +39,15 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P();
+ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
+ {
+ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))
+ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))
+ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))
+ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST))
+ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN));
+ }
+ return this.func_176223_P();
}
protected BlockFire()
@@ -92,6 +100,7 @@
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
{
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
}
@@ -126,19 +135,15 @@
{
if (p_180650_1_.func_82736_K().func_82766_b("doFireTick"))
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
if (!this.func_176196_c(p_180650_1_, p_180650_2_))
{
p_180650_1_.func_175698_g(p_180650_2_);
}
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
- boolean flag = block == Blocks.field_150424_aL || block == Blocks.field_189877_df;
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
- {
- flag = true;
- }
-
int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue();
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F)
@@ -159,7 +164,7 @@
{
if (!this.func_176533_e(p_180650_1_, p_180650_2_))
{
- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3)
+ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3)
{
p_180650_1_.func_175698_g(p_180650_2_);
}
@@ -167,7 +172,7 @@
return;
}
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
{
p_180650_1_.func_175698_g(p_180650_2_);
return;
@@ -182,12 +187,12 @@
j = -50;
}
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i, EnumFacing.WEST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i, EnumFacing.EAST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i, EnumFacing.UP);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i, EnumFacing.DOWN);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i, EnumFacing.SOUTH);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i, EnumFacing.NORTH);
for (int k = -1; k <= 1; ++k)
{
@@ -246,22 +251,30 @@
return false;
}
+ @Deprecated // Use Block.getFlammability
public int func_176532_c(Block p_176532_1_)
{
Integer integer = this.field_149848_b.get(p_176532_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use Block.getFireSpreadSpeed
public int func_176534_d(Block p_176534_1_)
{
Integer integer = this.field_149849_a.get(p_176534_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use tryCatchFire with face below
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
{
- int i = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
+ }
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
+ {
+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
+
if (p_176536_4_.nextInt(p_176536_3_) < i)
{
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -293,7 +306,7 @@
{
for (EnumFacing enumfacing : EnumFacing.values())
{
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
{
return true;
}
@@ -314,7 +327,7 @@
for (EnumFacing enumfacing : EnumFacing.values())
{
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
}
return i;
@@ -326,9 +339,10 @@
return false;
}
+ @Deprecated // Use canCatchFire with face sensitive version below
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
{
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -372,9 +386,9 @@
p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false);
}
- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b()))
+ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP))
{
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST))
{
for (int j = 0; j < 2; ++j)
{
@@ -385,7 +399,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST))
{
for (int k = 0; k < 2; ++k)
{
@@ -396,7 +410,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH))
{
for (int l = 0; l < 2; ++l)
{
@@ -407,7 +421,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH))
{
for (int i1 = 0; i1 < 2; ++i1)
{
@@ -418,7 +432,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN))
{
for (int j1 = 0; j1 < 2; ++j1)
{
@@ -462,6 +476,21 @@
return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R});
}
+ /*================================= Forge Start ======================================*/
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param pos Block position
+ * @param face The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
+ }
+ /*================================= Forge Start ======================================*/
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -1,64 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -152,12 +152,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID);
}
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_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
+ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b());
+ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID)
{
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
p_189540_2_.func_175698_g(p_189540_3_);
@@ -166,13 +168,6 @@
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
-
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
- {
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- }
-
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
@@ -398,6 +393,30 @@
return BlockFaceShape.UNDEFINED;
}
+
+ /*============================FORGE START=====================================*/
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
+ if (te != null && te.func_145965_a() != null)
+ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
+ }
+ @Override
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool)
+ {
+ super.func_180657_a(world, player, pos, state, te, tool);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/
+
public static enum EnumFlowerType implements IStringSerializable
{
EMPTY("empty"),
@@ -1,42 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -38,7 +38,8 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
}
@@ -58,7 +59,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a());
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos);
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2)
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P());
}
@@ -96,18 +97,11 @@
{
if (j >= i / 16)
{
- if (p_176474_1_.func_180495_p(blockpos1).func_177230_c().field_149764_J == Material.field_151579_a)
+ if (p_176474_1_.func_175623_d(blockpos1))
{
if (p_176474_2_.nextInt(8) == 0)
{
- BlockFlower.EnumFlowerType blockflower$enumflowertype = p_176474_1_.func_180494_b(blockpos1).func_180623_a(p_176474_2_, blockpos1);
- BlockFlower blockflower = blockflower$enumflowertype.func_176964_a().func_180346_a();
- IBlockState iblockstate = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), blockflower$enumflowertype);
-
- if (blockflower.func_180671_f(p_176474_1_, blockpos1, iblockstate))
- {
- p_176474_1_.func_180501_a(blockpos1, iblockstate, 3);
- }
+ p_176474_1_.func_180494_b(blockpos1).plantFlower(p_176474_1_, p_176474_2_, blockpos1);
}
else
{
@@ -1,23 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
@@ -222,6 +222,20 @@
return new BlockStateContainer(this, new IProperty[] {field_176380_a});
}
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : (java.util.Set<IProperty<?>>)state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("variant"))
+ {
+ world.func_175656_a(pos, state.func_177231_a(prop));
+ return true;
+ }
+ }
+ return false;
+ }
+
public static enum EnumType implements IStringSerializable
{
NORTH_WEST(1, "north_west"),
@@ -1,29 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
@@ -41,9 +41,14 @@
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
p_180657_2_.func_71020_j(0.005F);
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
{
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
+ items.add(this.func_180643_i(p_180657_4_));
+
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
+ for (ItemStack is : items)
+ func_180635_a(p_180657_1_, p_180657_3_, is);
}
else
{
@@ -54,7 +59,9 @@
}
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
+ harvesters.set(p_180657_2_);
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
+ harvesters.set(null);
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a();
if (material.func_76230_c() || material.func_76224_d())
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -158,6 +158,8 @@
return new BlockStateContainer(this, new IProperty[] {field_176382_a});
}
+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -1,139 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -17,7 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public abstract class BlockLeaves extends Block
+public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable
{
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
@@ -53,9 +53,9 @@
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -83,7 +83,8 @@
this.field_150128_a = new int[32768];
}
- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5)))
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks
+ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt
{
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
@@ -96,9 +97,9 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
Block block = iblockstate.func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
- if (iblockstate.func_185904_a() == Material.field_151584_j)
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2;
}
@@ -205,40 +206,7 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
- {
- int i = this.func_176232_d(p_180653_3_);
-
- if (p_180653_5_ > 0)
- {
- i -= 2 << p_180653_5_;
-
- if (i < 10)
- {
- i = 10;
- }
- }
-
- if (p_180653_1_.field_73012_v.nextInt(i) == 0)
- {
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
- }
-
- i = 200;
-
- if (p_180653_5_ > 0)
- {
- i -= 10 << p_180653_5_;
-
- if (i < 40)
- {
- i = 40;
- }
- }
-
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, i);
- }
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
@@ -274,6 +242,51 @@
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
+ {
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
+ }
+ }
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int chance = this.func_176232_d(state);
+
+ if (fortune > 0)
+ {
+ chance -= 2 << fortune;
+ if (chance < 10) chance = 10;
+ }
+
+ if (rand.nextInt(chance) == 0)
+ {
+ ItemStack drop = new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state));
+ if (!drop.func_190926_b())
+ drops.add(drop);
+ }
+
+ chance = 200;
+ if (fortune > 0)
+ {
+ chance -= 10 << fortune;
+ if (chance < 40) chance = 40;
+ }
+
+ this.captureDrops(true);
+ if (world instanceof World)
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
+ drops.addAll(this.captureDrops(false));
+ }
+
+
@SideOnly(Side.CLIENT)
public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_)
{
@@ -1,49 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -284,14 +284,14 @@
if (integer.intValue() == 0)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
if (integer.intValue() <= 4)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
@@ -452,4 +452,29 @@
{
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ @SideOnly (Side.CLIENT)
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
+ {
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks);
+
+ if (state.func_185904_a().func_76224_d())
+ {
+ float height = 0.0F;
+ if (state.func_177230_c() instanceof BlockLiquid)
+ {
+ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F;
+ }
+ float f1 = (float) (pos.func_177956_o() + 1) - height;
+ if (viewport.field_72448_b > (double)f1)
+ {
+ BlockPos upPos = pos.func_177984_a();
+ IBlockState upState = world.func_180495_p(upPos);
+ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
+ }
+ }
+
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
+ }
}
@@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -34,9 +34,9 @@
{
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -69,6 +69,9 @@
}
}
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
public static enum EnumAxis implements IStringSerializable
{
X("x"),
@@ -1,19 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -40,10 +40,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- int i = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
}
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public boolean func_149662_c(IBlockState p_149662_1_)
{
return false;
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -89,7 +89,7 @@
}
else
{
- return p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate);
+ return p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
}
else
@@ -1,21 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
@@ -39,7 +39,8 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
}
@@ -53,7 +54,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos);
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a());
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2)
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
}
@@ -1,60 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -42,25 +42,28 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
int i = ((Integer)p_180650_3_.func_177229_b(field_176486_a)).intValue();
- if (i < 3 && p_180650_4_.nextInt(10) == 0)
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(10) == 0))
{
- p_180650_3_ = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
- p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_, 2);
+ IBlockState newState = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
+ p_180650_1_.func_180501_a(p_180650_2_, newState, 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, newState);
}
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
}
+ @SuppressWarnings("unused")
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ if (false && !p_180653_1_.field_72995_K)
{
int i = 1;
@@ -106,6 +109,23 @@
return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue();
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int count = 1;
+
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
+ {
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
+ }
+
+ for (int i = 0; i < count; i++)
+ {
+ drops.add(new ItemStack(Items.field_151075_bm));
+ }
+ }
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176486_a});
@@ -1,13 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
@@ -106,4 +106,10 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4));
+ }
}
@@ -1,23 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
@@ -63,7 +63,9 @@
if (tileentity instanceof TileEntityNote)
{
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
+ int old = tileentitynote.field_145879_a;
tileentitynote.func_145877_a();
+ if (old == tileentitynote.field_145879_a) return false;
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
p_180639_4_.func_71029_a(StatList.field_188087_U);
}
@@ -103,6 +105,10 @@
public boolean func_189539_a(IBlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_)
{
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_5_, p_189539_4_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
+ p_189539_4_ = e.getInstrument().ordinal();
+ p_189539_5_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_189539_5_ - 12) / 12.0D);
p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, this.func_185576_e(p_189539_4_), SoundCategory.RECORDS, 3.0F, f);
p_189539_2_.func_175688_a(EnumParticleTypes.NOTE, (double)p_189539_3_.func_177958_n() + 0.5D, (double)p_189539_3_.func_177956_o() + 1.2D, (double)p_189539_3_.func_177952_p() + 0.5D, (double)p_189539_5_ / 24.0D, 0.0D, 0.0D);
@@ -1,15 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java
+++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java
@@ -145,4 +145,12 @@
{
return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7));
}
+
+ /* ======================================== FORGE START =====================================*/
+ @Override
+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
+ {
+ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos);
+ }
+ /* ========================================= FORGE END ======================================*/
}
@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
@@ -101,11 +101,16 @@
if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ)
{
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a()));
}
else
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a()));
+ }
}
@@ -1,50 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -78,34 +78,39 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ }
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
{
int i = 0;
if (this == Blocks.field_150365_q)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
+ i = MathHelper.func_76136_a(rand, 0, 2);
}
else if (this == Blocks.field_150482_ag)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150412_bA)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150369_x)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(rand, 2, 5);
}
else if (this == Blocks.field_150449_bY)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(rand, 2, 5);
}
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
+ return i;
}
+ return 0;
}
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
@@ -1,39 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -112,7 +112,10 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()), p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()), p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()), p_176221_3_.func_177976_e(), EnumFacing.EAST))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()), p_176221_3_.func_177974_f(), EnumFacing.WEST)));
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -197,6 +200,24 @@
return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ BlockPos offset = pos.func_177972_a(facing);
+ return func_193393_b(world, world.func_180495_p(offset), offset, facing.func_176734_d());
+ }
+
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
+ {
+ BlockPos other = pos.func_177972_a(dir);
+ IBlockState state = world.func_180495_p(other);
+ return state.func_177230_c().canBeConnectedTo(world, other, dir.func_176734_d()) || func_193393_b(world, state, other, dir.func_176734_d());
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THIN : BlockFaceShape.CENTER_SMALL;
@@ -1,45 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -241,7 +241,7 @@
}
}
- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
+ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_189539_2_, blockpos) && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
{
this.func_176319_a(p_189539_2_, p_189539_3_, enumfacing, false);
}
@@ -307,7 +307,7 @@
return false;
}
- return !block.func_149716_u();
+ return !block.hasTileEntity(p_185646_0_);
}
else
{
@@ -353,7 +353,9 @@
{
BlockPos blockpos1 = list2.get(j);
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1);
- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0);
+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f;
+ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0);
p_176319_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 4);
--k;
aiblockstate[k] = iblockstate;
@@ -434,6 +436,13 @@
return new BlockStateContainer(this, new IProperty[] {field_176387_N, field_176320_b});
}
+ /* ======================================== FORGE START =====================================*/
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return !state.func_177229_b(field_176320_b) && super.rotateBlock(world, pos, axis);
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
p_193383_2_ = this.func_176221_a(p_193383_2_, p_193383_1_, p_193383_3_);
@@ -1,37 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
@@ -116,7 +116,7 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out
{
TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_);
@@ -126,6 +126,7 @@
iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0);
}
}
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, 1, p_180653_5_); // mimic vanilla behavior from above and ignore chance
}
@Nullable
@@ -210,6 +211,17 @@
return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b});
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos);
+ if (tileentitypiston != null)
+ {
+ IBlockState pushed = tileentitypiston.func_174927_b();
+ drops.addAll(pushed.func_177230_c().getDrops(world, pos, pushed, fortune)); // use the old method until it gets removed, for backward compatibility
+ }
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPortal.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPortal.java
@@ -111,7 +111,7 @@
{
BlockPortal.Size blockportal$size = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.X);
- if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0)
+ if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size))
{
blockportal$size.func_150859_c();
return true;
@@ -120,7 +120,7 @@
{
BlockPortal.Size blockportal$size1 = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.Z);
- if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0)
+ if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size1))
{
blockportal$size1.func_150859_c();
return true;
@@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
@@ -27,7 +27,7 @@
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops
{
if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0)
{
@@ -40,4 +40,12 @@
{
return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()];
}
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0)
+ drops.add(new ItemStack(Items.field_151170_bI));
+ }
}
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
@@ -136,7 +136,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP);
}
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
@@ -1,29 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java
+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java
@@ -108,6 +108,26 @@
return new BlockStateContainer(this, new IProperty[] {field_176335_a});
}
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("variant") && prop.func_177699_b() == EnumType.class)
+ {
+ EnumType current = (EnumType)state.func_177229_b(prop);
+ EnumType next = current == EnumType.LINES_X ? EnumType.LINES_Y :
+ current == EnumType.LINES_Y ? EnumType.LINES_Z :
+ current == EnumType.LINES_Z ? EnumType.LINES_X : current;
+ if (next == current)
+ return false;
+ world.func_175656_a(pos, state.func_177226_a(prop, next));
+ return true;
+ }
+ }
+ return false;
+ }
+
public static enum EnumType implements IStringSerializable
{
DEFAULT(0, "default", "default"),
@@ -1,230 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -34,7 +34,7 @@
public static boolean func_176563_d(IBlockState p_176563_0_)
{
Block block = p_176563_0_.func_177230_c();
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
+ return block instanceof BlockRailBase;
}
protected BlockRailBase(boolean p_i45389_1_)
@@ -57,7 +57,7 @@
public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_)
{
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? (BlockRailBase.EnumRailDirection)p_185496_1_.func_177229_b(this.func_176560_l()) : null;
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? getRailDirection(p_185496_2_, p_185496_3_, p_185496_1_, null) : null;
return blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.func_177018_c() ? field_190959_b : field_185590_a;
}
@@ -73,7 +73,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP);
}
public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_)
@@ -93,27 +93,27 @@
{
if (!p_189540_2_.field_72995_K)
{
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_189540_1_.func_177229_b(this.func_176560_l());
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = getRailDirection(p_189540_2_, p_189540_3_, p_189540_2_.func_180495_p(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()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP))
{
flag = true;
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q())
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).isSideSolid(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).isSideSolid(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).isSideSolid(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).isSideSolid(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP))
{
flag = true;
}
@@ -154,7 +154,7 @@
{
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
- if (((BlockRailBase.EnumRailDirection)p_180663_3_.func_177229_b(this.func_176560_l())).func_177018_c())
+ if (getRailDirection(p_180663_1_, p_180663_2_, p_180663_3_, null).func_177018_c())
{
p_180663_1_.func_175685_c(p_180663_2_.func_177984_a(), this, false);
}
@@ -166,8 +166,101 @@
}
}
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
public abstract IProperty<BlockRailBase.EnumRailDirection> func_176560_l();
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Return true if the rail can make corners.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make corners.
+ */
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
+ {
+ return !this.field_150053_a;
+ }
+
+ /**
+ * Returns true if the rail can make up and down slopes.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make slopes.
+ */
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
+
+ /**
+ * Return the rail's direction.
+ * Can be used to make the cart think the rail is a different shape,
+ * for example when making diamond junctions or switches.
+ * The cart parameter will often be null unless it it called from EntityMinecart.
+ *
+ * @param world The world.
+ * @param pos Block's position in world
+ * @param state The BlockState
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
+ * @return The direction.
+ */
+ public EnumRailDirection getRailDirection(IBlockAccess world, BlockPos pos, IBlockState state, @javax.annotation.Nullable net.minecraft.entity.item.EntityMinecart cart)
+ {
+ return state.func_177229_b(func_176560_l());
+ }
+
+ /**
+ * Returns the max speed of the rail at the specified position.
+ * @param world The world.
+ * @param cart The cart on the rail, may be null.
+ * @param pos Block's position in world
+ * @return The max speed of the current rail.
+ */
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ return 0.4f;
+ }
+
+ /**
+ * This function is called by any minecart that passes over this rail.
+ * It is called once per update tick that the minecart is on the rail.
+ * @param world The world.
+ * @param cart The cart on the rail.
+ * @param pos Block's position in world
+ */
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ }
+
+ /**
+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit).
+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the
+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations.
+ * The method should return true if the rotation was successful though.
+ *
+ * @param world The world
+ * @param pos Block position in world
+ * @param axis The axis to rotate around
+ * @return True if the rotation was successful, False if the rotation failed, or is not possible
+ */
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("shape"))
+ {
+ world.func_175656_a(pos, state.func_177231_a(prop));
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /* ======================================== FORGE END =====================================*/
+
public static enum EnumRailDirection implements IStringSerializable
{
NORTH_SOUTH(0, "north_south"),
@@ -238,6 +331,7 @@
private IBlockState field_180366_e;
private final boolean field_150656_f;
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
+ private final boolean canMakeSlopes;
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
{
@@ -245,8 +339,9 @@
this.field_180367_c = p_i45739_3_;
this.field_180366_e = p_i45739_4_;
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(this.field_180365_d.func_176560_l());
- this.field_150656_f = this.field_180365_d.field_150053_a;
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = field_180365_d.getRailDirection(p_i45739_2_, p_i45739_3_, p_i45739_4_, null);
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
+ this.canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
this.func_180360_a(blockrailbase$enumraildirection);
}
@@ -438,7 +533,7 @@
}
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -451,7 +546,7 @@
}
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -594,7 +689,7 @@
}
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -607,7 +702,7 @@
}
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailDetector.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailDetector.java
@@ -163,6 +163,8 @@
{
if (((Boolean)p_180641_1_.func_177229_b(field_176574_M)).booleanValue())
{
+ List<EntityMinecart> carts = this.func_176571_a(p_180641_2_, p_180641_3_, EntityMinecart.class);
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>func_176571_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class);
if (!list.isEmpty())
@@ -1,29 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailPowered.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailPowered.java
@@ -23,9 +23,17 @@
});
public static final PropertyBool field_176569_M = PropertyBool.func_177716_a("powered");
+ private final boolean isActivator;
+
protected BlockRailPowered()
{
+ this(false);
+ }
+
+ protected BlockRailPowered(boolean isActivator)
+ {
super(true);
+ this.isActivator = isActivator;
this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH).func_177226_a(field_176569_M, Boolean.valueOf(false)));
}
@@ -146,7 +154,7 @@
{
IBlockState iblockstate = p_176567_1_.func_180495_p(p_176567_2_);
- if (iblockstate.func_177230_c() != this)
+ if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator)
{
return false;
}
@@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
@@ -319,6 +319,21 @@
return this.func_176223_P().func_177226_a(field_185512_D, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
}
+ @Override
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
+ {
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World) world).field_72995_K)
+ {
+ func_189540_a(world.func_180495_p(pos), (World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor);
+ }
+ }
+
+ @Override
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
+
public static enum Mode implements IStringSerializable
{
COMPARE("compare"),
@@ -1,54 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
@@ -39,12 +39,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() ? super.func_176196_c(p_176196_1_, p_176196_2_) : false;
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) ? super.func_176196_c(p_176196_1_, p_176196_2_) : false;
}
public boolean func_176409_d(World p_176409_1_, BlockPos p_176409_2_)
{
- return p_176409_1_.func_180495_p(p_176409_2_.func_177977_b()).func_185896_q();
+ IBlockState downState = p_176409_1_.func_180495_p(p_176409_2_.func_177977_b());
+ return downState.func_185896_q() || downState.func_193401_d(p_176409_1_, p_176409_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
}
public void func_180645_a(World p_180645_1_, BlockPos p_180645_2_, IBlockState p_180645_3_, Random p_180645_4_)
@@ -227,6 +229,8 @@
{
EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D);
BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d());
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d()), false).isCanceled())
+ return;
p_176400_1_.func_190524_a(blockpos, this, p_176400_2_);
p_176400_1_.func_175695_a(blockpos, this, enumfacing);
}
@@ -307,6 +311,25 @@
return BlockRenderLayer.CUTOUT;
}
+ /* ======================================== FORGE START =====================================*/
+ @Override
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ if (super.rotateBlock(world, pos, axis))
+ {
+ IBlockState state = world.func_180495_p(pos);
+ state = func_180675_k(state);
+ world.func_175656_a(pos, state);
+
+ if (func_176404_e(world, pos, state))
+ {
+ world.func_175684_a(pos, this, 1);
+ }
+ return true;
+ }
+ return false;
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return p_193383_4_ == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED;
@@ -1,22 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
@@ -92,12 +92,16 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ if (this.func_180660_a(state, RANDOM, fortune) != Item.func_150898_a(this))
{
- int i = 1 + p_180653_1_.field_73012_v.nextInt(5);
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
+ return 1 + RANDOM.nextInt(5);
}
+ return 0;
}
@SideOnly(Side.CLIENT)
Loaded 100 of 2182 files, more files were not shown because too many files have changed in this diff. Show more