Compare commits

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: cpw <[email protected]>
2020-02-23 22:15:34 -05:00
Julian Dunskus 30d4520c6b Make TransformationHelper.slerp for quaternions public (#6528) 2020-02-23 18:32:33 +01:00
DaemonUmbra daff482092 Fixed Conduit and Beacon Activation on Vanilla Servers (#6438) 2020-02-17 11:01:38 -08:00
Richard Freimer a740044e21 Fix ITeleporter being ignored when teleporting from the end to the overworld (#6505)
* Fix custom teleporters triggering end credits when returning from the end
* Fix setdimension command ignoring position
2020-02-17 17:16:46 +01:00
Vincent Lee 1a4955f9fd Fix missing call to itemstack TER (#6445) 2020-02-14 22:43:31 +01:00
Vincent Lee 2c4042c17c Fix missed modeldata passing in BlockModelRenderer (#6442) 2020-02-14 22:33:27 +01:00
Robert Skalko e95ba8a3dc Fix NPE when players rejoin the server in a dimension that was deleted (#6511) 2020-02-14 12:34:41 -08:00
Rigner 63cb030cba Fix a wrong RenderState name MC-167447 (#6501) 2020-02-14 12:12:52 -08:00
Daniël Goossens 743fc70a7f Fix client not informing server when it attempts to interact with things, and is canceled by a client side handler. 2020-02-14 12:04:38 -08:00
ewewukek c14ffa3264 Fix wrong arguments passed to ForgeHooksClient.renderSpecificFirstPersonHand() (#6496) 2020-02-14 12:03:08 -08:00
malte0811 3f292d5d42 Fixed ChunkWatchEvent.(Un)Watch not firing correctly (#6453) 2020-02-14 12:02:47 -08:00
Unnoen 886e89ccb2 Update version and support data on README. (#6429) 2020-02-14 12:02:00 -08:00
Joseph Tarbit 977428e42c Fixed Food not using effect suppliers, to better support delayed initialization and registry replacements. (#6411) 2020-02-14 12:00:40 -08:00
Parker Hawke 1c02312ae6 Fixed displaying item names when only more sensitive version changes (#6402) 2020-02-14 11:55:27 -08:00
David Quintana 8fbd84515f Fix gui_light for forge's item parent models. 2020-02-14 19:03:11 +01:00
Richard Freimer f93289e01c Allows custom blocks to define if they should use the fluid overlay instead of the flowing texture when in a fluid (#6493) 2020-02-06 23:53:37 +01:00
LexManos 982ed69776 Fix a small patch misalignment. 2020-02-03 13:21:18 -08:00
Richard Freimer 1f46169e1e Add FluidStack support to the Forge packet buffer. (#6353) (#6485) 2020-02-03 12:46:14 -08:00
Richard Freimer 7bac75f370 Make Minecarts work with modded powered/activator rails. (#6486)
Re-adds functionality for rails to have different maximum speeds.
2020-02-03 12:45:36 -08:00
ichttt 06d9b6531c Revert game data to frozen on disconnect from a remote server or when terminating a local server. Closes #6487 (#6497) 2020-02-03 12:21:10 -08:00
David Quintana 2991e767dd Remove unintended changes. 2020-02-02 23:05:04 +01:00
David Quintana a901d80dd5 Implement fluid overlay texture rendering for custom fluids. 2020-02-02 23:02:56 +01:00
DaemonUmbra d86f58a0df Fixed Attacks/Punches not Registering (#6481)
Replaced incorrect magic number with constant
2020-01-29 22:12:04 -08:00
Vincent Lee 0ad574257e Clean up a bunch of render events (#6444)
* Delete RenderHandEvent as RenderSpecificHandEvent can do everything it does and more. Rename RenderSpecificHandEvent to RenderHandEvent as it's now the only hand rendering event.
* Pass MatrixStack and IRenderTypeBuffer into the event whenever they are available. If they're available, that means we're in a batching environment and the modder should not be using the tessellator or other buffers on their own, or they risk "Already building" crashes.
2020-01-30 00:46:22 +01:00
Bartosz Skrzypczak 4839d18c73 Fix NullPointerException on java 8u242 in dev environment. (#6473)
Java 8u242 no longer re-initializes internal sys_paths and usr_paths fields in loadLibrary when they are null, so the value can't be set to null.
2020-01-29 13:55:07 -08:00
Vincent Lee e539e7ecbb Fix incorrectly ported patch for restoreBlurMipmap (#6450) 2020-01-29 13:13:08 -08:00
Daniël Goossens 1b618fae90 Fix RightClickBlock code differences between client and server implementation (#6451) 2020-01-29 13:11:50 -08:00
Yamahari f12a93fe1e Defer material getting for ChestTileEntityRenderer into seperate function (#6465) 2020-01-29 13:05:12 -08:00
Cadiboo 617159c825 Small Forge config fixes (#6466) 2020-01-29 13:04:35 -08:00
LexManos c72d6e9122 Fix ChunkDataEvent.Load not firing, it now fires in the aync thread. Be careful. Closes #6471 2020-01-29 12:18:13 -08:00
LexManos 69ae178bf4 Fix incorrect keybinding modifiers patch. Closes #6478 2020-01-29 11:57:10 -08:00
LexManos d391299340 Fix PlayerChangedDimensionEvent using incorrect from dimension argument in ServerPlayerEntity.teleport. Closes #6457 2020-01-29 11:56:38 -08:00
LexManos 40091678a8 Fix default mod resources loosing it's sort order. 2020-01-29 11:31:31 -08:00
LexManos 2b43aa6301 Fix WakeupEvent patch misalign. Closes #6474 2020-01-29 11:31:02 -08:00
mcenderdragon 44d9fff2b4 [1.15] Reimplemented the ITeleporter interface (#6404) 2020-01-29 09:18:07 -08:00
David Quintana 509a28efd3 Hook "gui_light" value from the model into the IBakedModel implementations.
Apply some of the suggestions from the 1.14 models PR.
2020-01-23 22:54:54 +01:00
LexManos c4e000dbe7 1.15.2 Initial Update 2020-01-22 13:44:03 -08:00
ichttt 0bcc2e3fbd Cleanup fml packages removing old deprecated classes related to GUIs/Configs and fix HoverChecker (#6437)
Fixed ModListWidget name to avoid confusion and collision.
Delete CheckBox, as vanilla has it's own CheckBox now which looks much better
Rename ModConfigEvent.ConfigReloading to ModConfigEvent.Reloading
2020-01-22 14:09:58 -07:00
Daniël Goossens e6c440a4f7 Fixed parameter name issue in ISTER rename. #6461 (#6468) 2020-01-22 13:38:13 -07:00
LexManos 575af22cee Fix default widget foreground color. 2020-01-22 11:56:05 -08:00
Daniël Goossens dea08be906 Updated method names referencing ItemStackTileEntityRenderer (#6461) 2020-01-22 12:26:34 -07:00
Cadiboo 0f27975f77 Fix Widget Foreground Color not allowing pure black (#6460) 2020-01-22 12:25:35 -07:00
Wyn Price 2d30419a31 Fixed rounding issue with entity navigation fix (#6455) (#6456) 2020-01-22 12:24:20 -07:00
Brennan Ward 68ce113c5b Fixed RenderTypeLookup loosing mappings for registry replacements. (#6452) 2020-01-22 12:23:42 -07:00
Take Weiland ad7e4e95ae Use extended version of getLightValue in all places (#6433) 2020-01-22 12:22:35 -07:00
Scotteh 345387645e [1.15.x] Added entity nameplate rendering event hook (#6416) 2020-01-22 12:22:04 -07:00
tterrag 380366e25f Remove emissive items hook, add small utility for bakedquad lighting 2020-01-20 22:44:26 -05:00
David Quintana 1936eb1f36 Fix breaking overlay weirdness. applyBakedNormals was not transforming the baked normals when applying them. Fixes #6432 2020-01-16 03:29:46 +01:00
Daniël Goossens 088fc6b67f [1.15] Add new InputEvent.ClickInputEvent, addresses #5802 (#6047) 2020-01-15 16:30:01 -08:00
David Quintana 983a47a7d6 Fix dark spots in fullbright quad rendering.
Fix multi-layer model not declaring dependency on the particle texture.
Fix mistake in 2c054fca which I didn't intend to push when I did.
2020-01-13 23:20:46 +01:00
David Quintana c1840abb0a Fix multi-layer model loader to actually work in a sane way. No more "base" model involved, and now transforms and overrides work as expected. 2020-01-13 19:38:52 +01:00
David Quintana 2c054fca76 Attempt to fix fullbright lighting.
Fix lightmap value calculation.
2020-01-13 13:19:36 +01:00
tterrag d5b94aa9c8 Add constructor for FishBucketItem that accepts suppliers 2020-01-09 17:26:11 -05:00
David Quintana c4c760bfb3 Fix QuadTransformer normal processing. 2020-01-07 23:52:51 +01:00
Choonster TheMage dd0260c476 Fix validation in RotationBuilder#angle (fixes #6323) (#6408) 2020-01-07 14:21:12 -08:00
Richard Freimer ca62702ff9 Add support for custom nether portal frame blocks (#6389) 2020-01-07 14:20:37 -08:00
RANKSHANK 0d50b4c39f InputEvent.RawMouseEvent fix (#6395) 2020-01-07 13:19:46 -08:00
DaemonUmbra c37e44efb6 Fixed Big Mushrooms not generating (#6390)
Removed vanilla negation from Forge logic that negated the vanilla logic it was replacing
also ran datagen to update the dirt tag to reflect changes that were previously made in the datagen code
2020-01-07 13:15:11 -08:00
tterrag df04ae11ef Fix dyes tag containing dye items instead of tags
Update generated data
2020-01-05 19:03:49 -05:00
Choonster TheMage 6e8b976089 [1.15.x] Remove unused parameter from ElementBuilder#rotation (fixes #6321) (#6407) 2020-01-05 14:29:45 -05:00
tterrag bc878ddf19 Refactor BlockStateProvider to encapsulate a BlockModelProvider
Make most protected methods of data generators public
2020-01-05 14:27:20 -05:00
tterrag 3096608d4a Fix crash when building BakedQuadBuilder
Add javadocs and move sprite to constructor where possible
2020-01-05 13:36:06 -05:00
tterrag 7c99b756f9 Fix incorrect check for missing texture in DynamicBucketModel 2020-01-04 23:50:17 -05:00
tterrag 90035ab084 Remove custom vertex format from BakedQuad 2020-01-04 23:36:56 -05:00
David Quintana b6c12f5fff A few more binary-breaking changes, before it's too late:
- Move CompositeModel out of its package.
- Move a few inner classes from the OBJ loader.
- Rename the bucket model and fluid model classes to match the naming convention.
- Remove BiomeEvent.* and WorldTypeEvent.InitBiomeGens as they are not currently implemented and they haven't been in the previous version either.
2020-01-04 17:18:28 +01:00
David Quintana 4b9920bcb3 Cherry-pick ca819e09 from the 1.14.x branch. Removes a patch from NativeImage which was invalid. 2020-01-04 17:18:27 +01:00
LexManos 1e053298be Fix the particle renderer not setting GL state between each type. MC-168672 2020-01-02 19:02:42 -08:00
David Quintana ca031ca33f Fix CompositeModel not respecting "display" transforms.
Remove leftovers from discarded feature.
2020-01-02 06:21:43 +01:00
David Quintana ecb56054bc Allow model jsons to override the material library used by OBJ models.
Fix model loader test mod resources.
Update licenses.
2020-01-01 17:15:49 +01:00
tterrag 53747b0cb5 Apply baked-in lightmap data to rendering
- Fix ForgeHooksClient.fillNormal injecting data to lightmap
- Fix OBJModel not filling lightmap data
- Fix NewModelLoaderTest blockitem not linking with block
2019-12-30 16:12:14 -05:00
David Quintana e1b0a8c153 Fix LightUtil.unpack to set the 4th component to 1 when expanding an xyz position into a 4-component vector.
Add TRSRTransformer test mod.
Fix signature of the bindTileEntityRenderer method, to account for covariance.
2019-12-29 17:16:27 +01:00
David Quintana fc189c9aaf More model/rendering fixes:
- Breaking change: Change ClientRegistry.bindTileEntityRenderer to a factory, so mods don't have to manually specify the dispatcher.
- Breaking change: Delete obsolete SimpleModelState (the class was duplicated by mistake, see SimpleModelTransform) and ICustomModelState (part of the old loader API).
- Breaking change: Rename getTextureDependencies to getTextures, for consistency.
- Reinstate the getRenderLayer method, fixed appropriately to return the new RenderType value.
- Fix OBJ loader applying the model transform in the wrong reference frame.
- Fix vanilla bug in TransformationMatrix#func_227986_a_
- Fix QuadTransformer logic.
- Added new method to IModelConfiguration to retrieve the owner IUnbakedModel, needed in order to construct ItemOverrideLists when baking custom models.
- Reintroduce multi-layer model through the new model loader system.
2019-12-29 02:13:58 +01:00
David Quintana e8ce61d4cd New batch of Model/rendering fixes:
- PerspectiveMapWrapper did not pass IModelData through to the wrapped model.
- CompositeModel did not store the returned textures from getTextureDependencies.
- VertexFormat used COLOR instead of UV to detect UV presence.
- QuadTransformer would crash due to index out of bounds.
- Small cleanup of TransformationHelper
2019-12-24 13:12:38 +01:00
David Quintana ac61018806 Fix obj models having all faces in the same mesh, breaking material assignments and visibility in the process.
Reintroduce lost patch from the model loader, which would cause the custom values to be missing from generated models.
2019-12-20 18:14:09 +01:00
tterrag 18e97a487d Fix diffuse lighting being baked into models, fixes dark items 2019-12-19 23:13:28 -05:00
David Quintana c3b1f47754 Fix item quads not using the existing vertex color when applying tint colors. 2019-12-20 04:50:40 +01:00
David Quintana 503d277033 Fix bucket model. Some mask textures were not added to the repository, and the bucket override generation was broken.
Fix OBJ loading crash due to a float value being parsed as int.
Fixes 6377
2019-12-20 02:44:27 +01:00
bl4ckscor3 40de19f16e Fix game crashing when modded entities are present (#6364) 2019-12-19 00:56:01 -05:00
ichttt 83ebdcd8f2 Fix warning screen about missing minecraft registry entries (#6363) 2019-12-18 21:02:20 -08:00
Richard Freimer 47a1f7529a Fix capabilities becoming inaccessible on returning from end (#6368) 2019-12-18 20:40:36 -08:00
ichttt 747cb0f151 Some code cleanup for 1.15 (#6362) 2019-12-18 20:39:41 -08:00
tterrag 30b530836a Fix MainMenuScreen patch 2019-12-17 21:10:49 -05:00
tterrag 49596dcacc Mod list GUI detail pass
- Make padding consistent on all elements
- Properly horizontally center the "Search" text
- Update and resize forge/mcp logos
- Enable linear filtering on logo rendering by default
  - Can be disabled with the "logoBlur" mods.toml property
2019-12-17 20:58:26 -05:00
ichttt 5df687dddc Fix mod list screen (#6367) 2019-12-17 20:03:11 -05:00
David Quintana 599a754b60 Fix items in ground being too small, we were applying perspectives twice.
Restore forge patch and fix a tiny mistake in it.
2019-12-18 00:46:29 +01:00
Tobias Hotz eaac0c17a4 Fix keybinds not loading/saving correctly 2019-12-17 18:30:51 -05:00
tterrag faaebe7a07 Remove uvlock hook, fixes broken stair/fence/etc models 2019-12-17 17:37:39 -05:00
tterrag 6256ba336e Update fallback spec version 2019-12-17 17:15:09 -05:00
tterrag 5987d917b8 Update to 1.15.1 2019-12-17 14:37:34 -05:00
David Quintana 738abbb360 Finish converting the code from javax.vecmath to the vanilla vector classes. Forge is now vecmath-free! 2019-12-17 19:14:52 +01:00
tterrag 1558362583 Remove deprecations 2019-12-17 04:50:13 -05:00
tterrag 5b67354e24 Fix incorrect item lighting 2019-12-16 23:46:45 -05:00
tterrag dec91dec68 Revert fluid change to use Material, fixes server crash 2019-12-16 23:22:13 -05:00
1933d05e36 Update to 1.15
Due to the massive rendering changes, certain features, such as emissive item rendering and the forge block rendering/lighting pipeline are currently disabled.

Co-authored-by: David Quintana <[email protected]>
Co-authored-by: tterrag <[email protected]>
Co-authored-by: Unnoen <[email protected]>
2019-12-17 03:38:12 +01:00
King Lemming 9e5ecaaf75 Added a couple of raytraceresult.getType() != MISS checks in places where they were absent. This corrects a couple of vanilla oversights and also greatly reduces Forge bus event spam for arrows and llama spit. (#6355)
Signed-off-by: King Lemming <[email protected]>
2019-12-15 14:39:41 -08:00
Luke Tonon 3701ec06d0 Restored canRiderInteract boolean in IForgeEntity (#6347) 2019-12-10 11:56:07 -08:00
Daniël Goossens 5d0fb2967c Split DrawBlockHighlightEvent into subevents to make usage clearer, addresses #2190 (#6269) 2019-12-10 11:46:01 -08:00
tterrag 5c88451f6f Allow classpath locator to discover jars via FMLModType attribute 2019-12-05 22:56:05 -05:00
cpw cfc53c939e Tidy up some output and also add libraries from the modfile detection into the transforming classloader.
Signed-off-by: cpw <[email protected]>
2019-12-05 22:47:39 -05:00
tterrag 3ba78225c3 Fix swapped yaw/pitch in camera setup event 2019-12-02 19:10:59 -05:00
liach d8e6181058 Restore camera setup render event (#6335) 2019-12-02 14:54:46 -08:00
DaemonUmbra bb4e78da90 Fixed invocation of Vanilla spawn logic (#6334)
Forge's replacement of the Vanilla logic gets inverted, so the Vanilla logic inside that replacement must be inverted to correct for this.
(Fixes #6332)
2019-12-02 14:54:00 -08:00
bl4ckscor3 4dd32d6f72 Add item tag 'beacon_payment' for items that can activate a beacon (#6328) 2019-12-02 14:52:45 -08:00
Luke Tonon 68b0075fe6 Added FENCES_WOODEN and FENCE_GATES_WOODEN tags as fuels in AbstractFurnaceTileEntity (#6327) 2019-12-02 14:36:30 -08:00
Paul Becker f9686cf098 New SleepFinishedTimeEvent allowing control of world time when waking up. (#6043) 2019-12-02 14:08:14 -08:00
tterrag ca28877fd5 Fix EntityLootTables not calling addTables 2019-11-25 01:49:24 -05:00
tterrag c18d26c7d8 Make EntityLootTables reusable for modders 2019-11-25 01:03:24 -05:00
nikita488 241db39cea Fix emissive items not working 2019-11-24 19:08:46 -05:00
cpw 31da9a4878 Fix the hang on startup problem when windows' broken device enumeration
causes a huge glfwInit slowdown. Log a message too when this is detected.

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

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

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

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

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

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

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

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

Fix forge fading in wrongly.

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

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

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

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

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

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

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

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

Signed-off-by: cpw <[email protected]>
2019-09-16 20:14:25 -04:00
Brennan Ward 79ce18ac3e Update furnace fuels to not recreate it's list every query, and update when tags are reloaded. Add Tag update events. (#6140) 2019-09-16 14:04:32 -07:00
Nightenom bb83e11a7c Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128) 2019-09-16 13:36:43 -07:00
Unnoen 0f888dde49 Update README badges to fix wrong version. (#6141) 2019-09-16 13:21:17 -07:00
MrCrayfish f4215d121c Reimplemented "MouseEvent" as RawMouseEvent for 1.14.X (#6144) 2019-09-16 13:03:10 -07:00
Take Weiland 60eecb98a6 Fix patch for vanilla spawning in WorldEntitySpawner (#6130) 2019-09-12 11:10:51 -07:00
LexManos 3cc76a3f60 Fix Entity.getPersistentData function name. Closes #6131
Bump spec version for first 1.14.4 RB.
2019-09-12 09:12:30 -07:00
Justin ffdeeb95b7 Fix ParticleFactoryRegisterEvent not firing (#6126) 2019-09-12 09:01:43 -07:00
David Quintana 58335d7bc0 Minor fixes to the fluids (#6150)
* Fixed vanilla rendering of fluids to take into account the alpha bits of the color, and fix usages accordingly.
* Fixed missing texture derp.
2019-09-12 17:33:19 +02:00
David Quintana b0c9d7cce9 Some (sadly breaking) improvements to the Fluid API (#6110)
* Some (sadly breaking) improvements to the API, after feedback and concerns provided by users:
  - Moved calculation of the translation key to the FluidAttributes constructor, so that builders can be shared between still & flowing sub-fluids.
  - Moved biome-based coloring to a dedicated FluidAttributes.Water variant, which is not used by default.
  - Added logic to automatically gather fluid textures into the list of textures to bake.
  - Patched BucketItem and FlowingFluidBlock to avoid eager access to the fluid objects.
  - Added a ForgeFlowingFluid class, as a more user-friendly way to construct a new FlowingFluid.
2019-09-11 16:00:32 +02:00
LexManos 281ef5a152 Add new DeferredRegistry helper, and change RegistryObject to update when overrides are registered. 2019-09-10 16:02:07 -07:00
LexManos 9183c2fa0d Delay Block loot table name generation until needed, as calling early will result in an empty name as the block is not registered yet. 2019-09-10 16:00:57 -07:00
LexManos 389751beae Fix slimes splitting more times then they should. Closes #6138 2019-09-09 15:30:11 -07:00
tterrag 2b4e3bcf54 Fix a couple places not calling forge getLightValue 2019-09-08 23:32:27 -04:00
tterrag 3dce85c49f Properly fix missing attribute issue, add vanilla bug ID 2019-09-08 02:23:16 -04:00
tterrag 185ce79a68 Fix vanilla typo causing errors when client is missing entity attributes 2019-09-08 02:05:01 -04:00
tterrag f777aba227 Remove StructureArgument to work around vanilla issue, clean up custom arguments 2019-09-08 02:01:17 -04:00
tterrag 5efa373d7f Fix SCommandListPacket underflowing buffer when encountering a missing argument type 2019-09-08 01:33:21 -04:00
cpw b6cd19b4ae Fix problem with network connections timing out frequently. Turns out
there's a race condition - and the extra work forge does causes it to
happen much more frequently than vanilla (though I'm sure it's a vanilla
issue). Closes #6124, #5767 and probably lots more.

Signed-off-by: cpw <[email protected]>
2019-09-07 18:42:50 -04:00
tterrag fc5573333d Make /locate command support modded structures 2019-09-07 01:09:42 -04:00
tterrag 55fe7c470f Make STRUCTURE_FEATURE registry a slave map of the FEATURE registry
Also convert Feature.STRUCTURES to a slave map
2019-09-06 23:42:19 -04:00
LexManos 3ef1d6919c Fix REGISTER packet encode/decode issues.
Changed ForgeConfig values to return the default value if the config is not loaded, and exposed the value objects as a internal config.
2019-09-05 15:38:14 -07:00
LexManos e1863383ff Fix naming conflicts with official names. 2019-09-04 22:33:17 -07:00
LexManos 4dc34b7d5b Fix item used stat not triggering properly on last item in the stack. 2019-09-03 19:58:57 -07:00
LexManos 2c8c022034 Add a bunch of tags from the omnibus.
Fix test imports. And update patches for line numbers.
2019-09-03 18:51:09 -07:00
bl4ckscor3 b5b43a5a36 Add spawn reason to spawn events (#6096) 2019-09-03 15:15:48 -07:00
Wire Segal c09fe57031 Add collisionExtendsVertically hook to allow modded blocks that extend collision into the block above similar to fences. (#6092) 2019-09-03 14:50:27 -07:00
Daniël Goossens 68524ddde9 Fixed PlayerInteractEvent.LeftClickBlock useItem/useBlock (#6045) 2019-09-03 14:41:46 -07:00
Daniël Goossens 55bdd4d937 Readded IForgeItem#getHighlightTip hook. (#6036) 2019-09-03 14:30:41 -07:00
mcenderdragon 3f089e3add Added gravity as attribute to Entities (#5630) 2019-09-03 13:20:44 -07:00
ichttt ddb90a69d3 Fix CME on chunk unload in FarmlandTicketManager (#5998) 2019-09-03 12:59:35 -07:00
cpw bdce8d0494 Add a modfolderfactory. Fix up login payload exposure.
Signed-off-by: cpw <[email protected]>
2019-09-01 14:40:39 -04:00
cpw 734a3d76aa Peel IModLocator into the SPI package and extract a small IModFile
interface as well. This allows building external IModLocator
implementations.

Signed-off-by: cpw <[email protected]>
2019-09-01 11:31:09 -04:00
cpw a4aa85259e Add in some client only player connectivity events. Closes #5536
Signed-off-by: cpw <[email protected]>
2019-08-31 13:55:46 -04:00
cpw ea1c7a7339 Add in MC REGISTER nonsense. Shut up #5730
Tweak network a bit to fix initialization order stupidity. (Constants don't
load classes!)

Signed-off-by: cpw <[email protected]>
2019-08-31 13:55:46 -04:00
Tobias Hotz 185f7344fa move default log level for debug file to debug instead of trace, and remove millis from console and GUI. Also remove unused config xmls 2019-08-31 13:55:46 -04:00
GirafiStudios 26e4bf92a0 Added getters for FMLPlayMessages.SpawnEntity 2019-08-31 13:55:46 -04:00
cpw 68cb017be1 Move indexFor and biConsumer into FMLHandshakeHandler and expose them publicly, so mods can add additional
login messages. Closes #6087

Signed-off-by: cpw <[email protected]>
2019-08-31 13:55:45 -04:00
David Quintana 68ff1afac1 Hookup BlockEvent.FluidPlaceBlockEvent (#6103) 2019-08-31 14:15:08 +02:00
cpw 0d448a5e4f Update libs to 1.0 versions, bump grgit, and fix tag search behaviour that resulted.
Signed-off-by: cpw <[email protected]>
2019-08-29 23:39:49 -04:00
David Quintana d9f6659f2c Fluid rework derp fixes. (#6098)
* Fix nulls returning from non-null methods, and null-check of non-nullable values.
* Fix missed computation of the isEmpty flag in FluidStack
* Cleanup getAmount/isEmpty calls.
* Remove redundant suppliers. That info is readily available from the vanilla Fluid / FluidState.
2019-08-29 21:09:42 +02:00
Vincent Lee bae2ee0420 Minor model system cleanup/documentation (#6089) 2019-08-28 21:33:49 -07:00
ichttt 799e864d93 Fix Digging particle sometimes using the wrong block pos to get additional model data (#6077) 2019-08-28 21:33:15 -07:00
DaemonUmbra aa38f62bae Change fml.modloading.brokenfile.optifine to not imply that Forge is responsible for Forge-Optifine compatibility. (#6080) 2019-08-28 21:32:33 -07:00
ichttt 06c3e255b3 Add a config comment that lists the available constants of enums (#6079) 2019-08-28 21:28:21 -07:00
bl4ckscor3 d5e20b13b9 Restore PotionShiftEvent (#6042) 2019-08-28 21:15:55 -07:00
Daniël Goossens c83d4d29e4 Added new InputEvent.MouseScrollEvent, fixes #5811 (#6037) 2019-08-28 21:13:31 -07:00
Brennan Ward ee1c06085b Add Villager Trading Events (#6016) 2019-08-28 20:34:07 -07:00
BlakeBr0 336d53b692 Strip side annotations from CropsBlock.getSeedsItem (#6013) 2019-08-28 20:14:41 -07:00
Wyn Price 95c58ba75c Updated constants to 1.14 (#6012) 2019-08-28 20:13:47 -07:00
valoeghese 56857cf5e7 Added hook to allow biomes to specify custom river variants. (#5969) 2019-08-28 20:12:52 -07:00
Vincent Lee 838998b885 Add particle factory registration event (#6018) 2019-08-28 18:42:17 -07:00
David Quintana a9b3b48273 Make FluidStacks non-nullable, and implement some TODOs. 2019-08-29 03:18:42 +02:00
David Quintana a788e8a475 Fix license headers so gradlew build is happy. 2019-08-29 03:18:42 +02:00
David Quintana b7e1cc5f6b Fluid API rework (#5983)
- Moved forge fluids into FluidAttributes companion object to the vanilla Fluid. By gigaherz
- Redesigned the Fluid API to be closer to the Items API. By King Lemming
Co-authored-by: King Lemming <[email protected]>
2019-08-29 03:18:41 +02:00
LexManos e784a7f606 Recipe system cleanup. (#6014) 2019-08-29 03:18:41 +02:00
Managarmr 3e9bc3c434 Fix regular arrows giving off particles after a world reload (MC-107941) (#6061) 2019-08-28 18:12:47 -07:00
ichttt dd340b8ef2 Fix coremod not redirecting to the correct method (#6078) 2019-08-28 17:49:46 -07:00
LexManos 7deb479676 Fix blocks being placed in adventure mode. Closes #6085
Add early error for setting invalid world directory. Closes #6084
Fix PlayerTickEvent not firing when dead, even if player isn't removed from world yet. Closes #6074
Fix PlayerDestroyItemEvent not firing for some cases. Closes #6067
2019-08-28 12:57:25 -07:00
LexManos 1ab40e0b3f Fix Javac generics breakage. 2019-08-20 15:40:36 -07:00
LexManos 283c3d1664 Prevent worlds from unloading while players are in out-of-world states by tracking all worlds references by every player in the server's player list. 2019-08-20 15:31:08 -07:00
LexManos 5291ea7270 Add Argument serializer for ModIdArgument. EnumArgument can't as vanilla doesn't support extra data. 2019-08-20 15:29:26 -07:00
LexManos 0c1c1b65e1 Sort server.properties while writing. 2019-08-20 15:27:31 -07:00
LexManos b0787e9f40 Fix chunk load failure when entering End portal Closes #6068 2019-08-19 19:46:00 -07:00
LexManos dc0eacb80f Fix Configs not generating correctly on first load Closes #6069 2019-08-19 19:45:32 -07:00
Vincent Lee 8c04651301 Add hook to load custom mrls/rls not attached to a block or item. (#6010) 2019-08-15 11:03:57 -07:00
bl4ckscor3 94621fecd1 Cover more cases for RightClickBlock event and restore onItemUseFirst (#6009) 2019-08-15 10:34:59 -07:00
kirderf1 5e392e3300 Make DimensionManager.SavedEntry save sky light consistently (#6019) 2019-08-15 10:17:28 -07:00
LexManos 88595dd26b Fix extract inheritance not using proper classpath and update buildscript for FG asm changes. 2019-08-14 16:13:15 -07:00
cpw 4323c6d845 Grrr. Stupid error. Sorry lex: I fixed it.
Signed-off-by: cpw <[email protected]>
2019-08-05 08:56:42 -04:00
cpw 81ec8b99ac Actually reload config when it changes on disk. Closes #5541 and #5959
Signed-off-by: cpw <[email protected]>
2019-08-04 22:37:43 -04:00
cpw 1af7b7603d Move fml's PlayerEvent and TickEvent to forge. Update
`import net.minecraftforge.fml.common.gameevent.PlayerEvent;`
to
`import net.minecraftforge.event.entity.player.PlayerEvent;`
and
`import net.minecraftforge.fml.common.gameevent.TickEvent;`
to
`import net.minecraftforge.event.TickEvent;`

Signed-off-by: cpw <[email protected]>
2019-08-04 22:34:14 -04:00
cpw 0fd8fa2211 Bump modlauncher to 3.2.x. Add a sender modid and document IMC. Closes #5746
Signed-off-by: cpw <[email protected]>
2019-08-04 22:19:02 -04:00
cpw 5048739b7f Turned minecraft into a proper Mod, with a "dummy" language provider.
Also fixed the "translations" not being available early if an exception occurs
by force loading the forge and MC ones. Closes #5984

Signed-off-by: cpw <[email protected]>
2019-08-04 20:16:01 -04:00
DaemonUmbra 44f3f9e2d0 Fix a crash I caused by misunderstanding formatToString (#6007) 2019-08-02 18:48:46 -07:00
LexManos ed1c55508f Fix userdev setup by moving SAS concept to FG. 2019-08-02 18:03:27 -07:00
its_meow 50e411b82a Add piston events (#5798) 2019-08-02 14:12:21 -07:00
its_meow a8a0306f98 Fix AT for EntitySpawnPlacementRegistry.register 2019-08-02 14:06:05 -07:00
desht 19b7d26bc2 Make ParticleManager.IParticleMetaFactory public (#5926) 2019-08-02 14:05:32 -07:00
JoJoModding c7940e70ed Add button to open mods folder (#5986) 2019-08-02 14:00:54 -07:00
DaemonUmbra 58ede2c80a Change ModLoadingException to display ModID instead of ModInfo instance identifier. (#5999) 2019-08-02 13:44:56 -07:00
henkelmax e83e00520f Fixed PlayerInteractEvents not working (#5976) 2019-08-02 13:44:17 -07:00
Gamebuster 9a50c208f0 Fixed Buttons in the error screen are incorrectly rendered if they are extremely long Closes #5687 (#5924) 2019-08-02 13:42:58 -07:00
Gamebuster 7acb380ba8 Fix LazyOptional throwing NPE to consumers when owners null. (#5772) 2019-08-02 13:42:13 -07:00
LexManos 48fa2f458c Make Villager profession unlocalized name use modids when not 'minecraft' Closes #5977
Fixed trees able to be generated through water. Closes #6000
Change Block#toString to use getRegistryName instead of getNameForObject Closes #5937
Allow Cooking Recipes to deserialize results with stack sizes. Closes #5960
2019-08-02 13:37:02 -07:00
LexManos 318fc6ffe8 Fixed DimensionType.getRegistryName() returning null Closes #5992
Fixed RegisterDimensionEvent not firing for new worlds. Closes #5987
2019-07-31 22:43:46 -07:00
LexManos b009cedc0c Introduce new Side Annotation Stripper system to semi-automate the shipment of Sided methods and cleanup patches.
New forge:checkSAS task to validate this config file. Closes #5995
2019-07-31 21:15:39 -07:00
ichttt c6dd475610 Move world unload patch to tick function to prevent duplicate unloading, fix log message in dim manager, fix javadoc for unload method (#5964) 2019-07-30 16:39:05 -07:00
bl4ckscor3 61285a098a fix melon and pumpkin seeds being peaceable on more than just farmland (#5980) 2019-07-30 16:35:23 -07:00
Paul Becker 995a8b8d35 Fixed possible ClassCastException with dye-able armor. (#5985) 2019-07-30 16:30:12 -07:00
cpw 5d33697cb1 Fix naming for dev launch providers - they're in MCP..
Signed-off-by: cpw <[email protected]>
2019-07-29 20:19:50 -04:00
cpw ae09fc6b6d Register a config command. Currently one subcommand: showfile, which
when passed a modid and a type (CLIENT, COMMON or SERVER) will display
a link in the caller's chat to open that file in the OS file viewer of choice.

Signed-off-by: cpw <[email protected]>
2019-07-28 21:09:15 -04:00
cpw cd826f7bcf Load default configs from the defaultconfig directory by default. (Can
be overridden in the fml.toml config file if desired).

Will load any type of config tracked file from there - client, common, server
or custom tracked file. This means you can ship defaults for your pack
in a defaultconfig directory. I am thinking about ways to force a specific
config override for an existing config.

Signed-off-by: cpw <[email protected]>
2019-07-28 13:44:18 -04:00
cpw 283ece29e8 Fix vanilla bug that hardcore death doesn't clean up properly, leaving
a running server and a broken GUI. Vanilla bug MC-148865

Signed-off-by: cpw <[email protected]>
2019-07-27 12:47:59 -04:00
LexManos 1918148b8e Fixed network ticking player entity while it is dead. And explicitly prevent overworld from unloading. Closes #5978 2019-07-27 02:35:06 -07:00
cpw e17714583f Crash report extended to show ModLauncher FML and Forge data.
Signed-off-by: cpw <[email protected]>
2019-07-26 20:02:21 -04:00
cpw 4c05c63a04 Fix potion transformer to look up the right name depending on context.
Signed-off-by: cpw <[email protected]>
2019-07-26 00:35:03 -04:00
cpw 0bdc2d04b4 Added a coremod, shush, don't tell Lex.
Seriously, this is how to do targeted changes to specific classes.

In this case, adding a fieldtomethod redirect for EffectInstance.potion
to allow substitution.

Signed-off-by: cpw <[email protected]>
2019-07-25 23:02:05 -04:00
LexManos 57d4d60a33 Fix Slimes not splitting on death Closes #5973 2019-07-25 17:59:57 -07:00
LexManos 731e1920d2 Fix @ObjectHolderRegistry not properly detecting vanilla class level references. Closes #5958 2019-07-25 17:59:08 -07:00
LexManos 7411b444d3 Fixed missed patch causing blocks to not dropping EXP and BreakEvent to not fire. 2019-07-24 11:15:23 -07:00
David Quintana ae3d002ac6 Fix & Improve state comparison when checking vanilla block replacements (#5922) 2019-07-22 19:23:20 -07:00
LexManos 1bd70ac5ab Keep player cap data until they have revived. Closes #5956 2019-07-22 15:45:38 -07:00
cpw c90b1732e9 Fix objloader registering at wrong time. Closes #5847. Added test
class as suggested in the issue.

Note: most tests are commented out at the present time, pending
rework. Tests that work, work.

Signed-off-by: cpw <[email protected]>
2019-07-20 21:04:00 -04:00
cpw fcd9582133 Fix datafixer exception catch: Closes #5951
Signed-off-by: cpw <[email protected]>
2019-07-20 19:59:08 -04:00
cpw 9d82d822db Fix error when ModsDiscoverer visits a non existent mods dir.
Closes cpw/modlauncher#30

Signed-off-by: cpw <[email protected]>
2019-07-20 19:37:54 -04:00
cpw 186d91c03f Merge branch 'pull/5948' into 1.14.x 2019-07-20 19:35:26 -04:00
cpw eec5809097 Realms' removal has removed the need for additional jar transformation.
Signed-off-by: cpw <[email protected]>
2019-07-20 19:33:54 -04:00
cpw 4582a29ec1 Make I18N format errors less spammy, also remove single apostrophes from
current translations in en_us.json. Other langs may still have problems.

Closes #5952
Signed-off-by: cpw <[email protected]>
2019-07-20 19:14:17 -04:00
JoJoModding 2f83234ccb Fix spam during startup (#5957) 2019-07-20 14:55:21 -07:00
ichttt bef52c945b Fix forge 1.14.4 startup in obfed enviroment (#5955) 2019-07-20 12:59:23 -07:00
Thomas Aunvik 1de4ad735b Updated Example Version Range for 1.14.4 (#5950)
* Updated Example Version Range for 1.14.4

* Also changed loader version and version range
2019-07-20 12:06:06 -04:00
LexManos 00fc29d40d Fix javac compile issues. 2019-07-19 23:27:31 -07:00
cpw 27afdc8a27 Provisional update to 1.14.4. Missing a lot of playerinteractionmanager patches because everything moved and I'm tired.
Fix up immediate problems.

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

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

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

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

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

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

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

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

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

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

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

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

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

tweak logging

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

No files matched your search

+7
View File
@@ -14,3 +14,10 @@
*.cfg text eol=lf
*.py text eol=lf
*.jks binary
# Disable autocrlf on generated files, they always generate with LF
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
src/generated_test/**/.cache/cache text eol=lf
src/generated_test/**/*.json text eol=lf
-4
View File
@@ -1,4 +0,0 @@
<!-- Thank you for reporting! -->
<!-- Please go to the forum first for support with crashes and issues. -->
<!-- http://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
+13
View File
@@ -0,0 +1,13 @@
---
name: Feature request
about: Want to request a feature?
title: ''
labels: Feature
assignees: ''
---
<!-- Please note, feature requests that are submitted as GitHub issues here are rarely implemented. -->
<!-- If you'd like to see something in Forge, you should be ready to implement it as a PR. -->
<!-- If you're not sure, open a Draft PR or discuss it in the Discord server. -->
<!-- Discord: https://discord.gg/UvedJ9m -->
+26
View File
@@ -0,0 +1,26 @@
---
name: Issue report
about: Visit the forum first for issues with crashes.
title: ''
labels: Triage
assignees: ''
---
<!-- Thank you for reporting! -->
<!-- For support with crashes and issues, please create a post on the forum instead: -->
<!-- https://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
**Minecraft Version:** {Minecraft version}
**Forge Version:** {Forge version. *Version number, not latest/rb*}
**Logs:** {Link(s) to GitHub Gist with full latest.log and/or crash report}
**Steps to Reproduce:**
1. Do this
2. Then do that
3. ...
**Description of issue:**
+28
View File
@@ -0,0 +1,28 @@
name: Publish
on:
push:
branches: [ '1.15.x' ]
permissions:
contents: read
jobs:
build:
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
with:
java: 8
gradle_tasks: 'setup build publish'
artifact_name: 'forge'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
# Unused for now until we upgrade gradle
# SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
# SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
# SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}
# SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
+10 -3
View File
@@ -15,13 +15,20 @@
#gradle
/build
/.gradle
/mdk/.gradle
/mdk/build
/**/.gradle
/**/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-/
-35
View File
@@ -1,35 +0,0 @@
sudo: required
dist: trusty
language: java
jdk: oraclejdk8
env:
- BUILD_NUMBER=9999
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $TRAVIS_BUILD_DIR/build/localCache/Forge/
before_install: chmod +x gradlew
install:
- ./gradlew --refresh-dependencies
- ./gradlew ciWriteBuildNumber
script:
- travis_wait ./gradlew build -x createExe -S
- ./gradlew -p projects/Forge test -S -i
notifications:
email: false
# skip building travis on 1.13 - it doesn't work there
branches:
except:
- 1.13-pre
Vendored
-82
View File
@@ -1,82 +0,0 @@
@Library('forge-shared-library')_
pipeline {
options {
disableConcurrentBuilds()
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
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()
}
}
post {
success {
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 {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
}
//We're testing so use the test group
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.forge/${MYVERSION}'
}
}
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
when {
changeRequest()
}
environment {
CROWDIN = credentials('forge-crowdin')
}
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
}
}
}
+2 -16
View File
@@ -1,16 +1,2 @@
Minecraft Forge
Copyright (c) 2016-2019.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation version 2.1
of the License.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (c) Forge Development LLC and contributors
SPDX-License-Identifier: LGPL-2.1-only
-37
View File
@@ -1,37 +0,0 @@
# How to install Forge: For Players
Go to [the Forge website](http://files.minecraftforge.net)
and select the minecraft version you wish to get forge for from the list.
You can download the installer for the *Recommended Build* or the
*Latest build* there. Latest builds may have newer features but may be
more unstable as a result. The installer will attempt to install forge
into your vanilla launcher environment, where you can then create a new
profile using that version and play the game!
For support and questions, visit [the Support Forum](http://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
Here is a short video from Rorax showing how to install and setup Forge:
[![HOWTO Install Forge](https://img.youtube.com/vi/lB3ArN_-3Oc/0.jpg)](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
# How to install Forge: For Modders
[See the "Getting Started" section in the Forge Documentation](http://mcforge.readthedocs.io/en/latest/gettingstarted/).
# How to install Forge: For those wishing to work on Forge itself
If you wish to actually inspect Forge, submit PRs or otherwise work
with Forge itself, you're in the right place!
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
## Pull requests
[See the "Making Changes and Pull Requests" section in the Forge documentation](http://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
### Contributor License Agreement
We require all contributors to acknowledge the [Forge Contributor
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
associated with your github account to do this. If you have previously
signed it, you should be OK.
+547 -288
View File
File diff suppressed because it is too large. Load diff
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
+68
View File
@@ -0,0 +1,68 @@
<img src="assets/Forge_logo.svg">
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.15.2-&query=$.promos["1.15.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.15.2-&query=$.promos["1.15.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/Flocker-Merch-blueviolet.svg)](https://forgedev.flocker.tv/)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.15.x | Active |
| 1.14.x | LTS |
* [Download]
* [Forum]
* [Discord]
* [Documentation]
#### Notes:
- Introduced in 1.13 was a new FML, information found [here](NewFML.md).
# Installing Forge
Go to [the Forge website](https://files.minecraftforge.net)
and select the Minecraft version you wish to get Forge for from the list.
You can download the installer for the *Recommended Build* or the
*Latest build* there. Latest builds may have newer features but may be
more unstable as a result. The installer will attempt to install Forge
into your vanilla launcher environment, where you can then create a new
profile using that version and play the game!
For support and questions, visit [the Support Forum](https://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
[Here is a short video from Rorax showing how to install and setup Forge.](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
# Creating Mods
[See the "Getting Started" section in the Forge Documentation](https://mcforge.readthedocs.io/en/latest/gettingstarted/).
# Contribute to Forge
If you wish to actually inspect Forge, submit PRs or otherwise work
with Forge itself, you're in the right place!
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
### Pull requests
[See the "Making Changes and Pull Requests" section in the Forge documentation](https://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
Please read the contributing guidelines found [here](CONTRIBUTING.md) before making a pull request.
### Contributor License Agreement
We require all contributors to acknowledge the [Forge Contributor
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
associated with your GitHub account to do this. If you have previously
signed it, you should be OK.
#### Donate
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos) or buying some [cool merch](https://forgedev.flocker.tv/).*
[Download]: https://files.minecraftforge.net/
[Forum]: https://www.minecraftforge.net/forum/
[Discord]: https://discord.gg/UvedJ9m
[Documentation]: https://mcforge.readthedocs.io
View File
File renamed without changes.
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 164.072 372.466 294.41 46.56" version="1.1" viewBox="164.072 372.466 294.41 46.56" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="#DFA86A">
<polygon points="266.16 417.99 277.12 417.99 277.12 401.05 295.09 401.05 295.09 390.78 277.12 390.78 277.12 383.77 296.18 383.77 296.18 373.5 266.16 373.5"/>
<path d="m337.33 378.7c-2.103-2.057-4.629-3.64-7.51-4.704-2.743-1.015-5.786-1.528-9.041-1.528l-0.356 2e-3c-3.362 0-6.503 0.556-9.338 1.651-2.857 1.106-5.357 2.707-7.434 4.761-2.073 2.052-3.714 4.559-4.877 7.45-1.158 2.876-1.748 6.104-1.748 9.59 0 3.417 0.59 6.582 1.753 9.403 1.163 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.834 1.096 5.975 1.651 9.339 1.651h0.023c3.402-0.043 6.57-0.639 9.42-1.772 2.863-1.142 5.375-2.757 7.465-4.804 2.091-2.051 3.742-4.524 4.91-7.358 1.162-2.823 1.75-5.987 1.75-9.402 0-3.487-0.588-6.705-1.748-9.568-1.168-2.874-2.82-5.371-4.913-7.425zm-4.644 16.762c0 1.96-0.302 3.782-0.896 5.413-0.587 1.607-1.42 3.011-2.479 4.167-1.05 1.147-2.335 2.065-3.821 2.728-1.479 0.656-3.164 0.99-5.008 0.99-1.84 0-3.514-0.333-4.973-0.988-1.47-0.662-2.747-1.578-3.799-2.729-1.062-1.156-1.895-2.559-2.479-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.298-3.497 0.887-5.044 0.584-1.536 1.419-2.894 2.479-4.037 1.048-1.132 2.323-2.03 3.792-2.674 1.465-0.642 3.145-0.968 4.988-0.968 1.848 0 3.539 0.326 5.025 0.971 1.481 0.643 2.766 1.541 3.812 2.671 1.062 1.143 1.896 2.501 2.479 4.036 0.589 1.548 0.889 3.245 0.889 5.044z"/>
<path d="m376.27 395.65c1.902-2.327 2.867-5.221 2.867-8.603 0-2.614-0.508-4.84-1.506-6.613-0.997-1.762-2.354-3.188-4.035-4.234-1.603-0.995-3.445-1.705-5.482-2.114-1.938-0.388-3.969-0.583-6.037-0.583h-16.021v44.487h10.961v-17.282h2.35l9.447 17.282h13.127l-11.199-18.646c2.262-0.728 4.116-1.964 5.528-3.694zm-19.254-12.223h4.426c0.844 0 1.73 0.054 2.636 0.16 0.784 0.094 1.503 0.283 2.132 0.568 0.496 0.225 0.888 0.553 1.193 0.998 0.283 0.415 0.428 1.031 0.428 1.836 0 0.931-0.16 1.643-0.459 2.06-0.34 0.472-0.771 0.813-1.32 1.046-0.686 0.289-1.459 0.477-2.301 0.554-0.975 0.089-1.963 0.136-2.938 0.136h-3.795l-2e-3 -7.358z"/>
<path d="m394.82 386.38c1.05-1.132 2.325-2.03 3.793-2.674 1.464-0.642 3.144-0.968 4.988-0.968 1.843 0 3.611 0.311 5.26 0.921 1.609 0.599 2.992 1.449 4.107 2.531l1.314 1.278 8.019-8.105-1.454-1.298c-2.355-2.103-5.066-3.586-8.058-4.407-2.879-0.789-5.987-1.189-9.247-1.189-3.361 0-6.503 0.556-9.339 1.651-2.856 1.106-5.355 2.707-7.431 4.761-2.074 2.052-3.716 4.559-4.88 7.45-1.158 2.876-1.746 6.104-1.746 9.59 0 3.417 0.59 6.582 1.752 9.403 1.164 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.832 1.096 5.975 1.651 9.339 1.651 6.501 0 12.475-1.432 17.751-4.25l0.979-0.522v-23.814h-19.313v10.27h8.354v6.639c-0.871 0.397-1.834 0.709-2.881 0.933-1.5 0.314-3.127 0.478-4.83 0.478-1.841 0-3.514-0.333-4.973-0.988-1.472-0.662-2.748-1.578-3.801-2.729-1.06-1.156-1.893-2.559-2.478-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.299-3.497 0.887-5.044 0.586-1.54 1.421-2.897 2.479-4.041z"/>
<polygon points="437.69 407.72 437.69 400.36 456.41 400.36 456.41 390.09 437.69 390.09 437.69 383.77 457.44 383.77 457.44 373.5 426.72 373.5 426.72 417.99 458.48 417.99 458.48 407.72"/>
</g>
<path d="m243.63 379.09l-37.842-1.852 46.229-0.034v-3.727h-52.125l-1e-3 7.798v6.201c0 0.115-1.52-9.144-1.87-11.734h-4.098v13.029c0 0.123-1.753-10.888-1.939-12.264h-27.914c1.902 1.648 12.401 10.598 19.865 14.28 3.741 1.846 8.33 1.86 12.414 1.974 2.075 0.06 4.25 0.217 5.803 1.754 2.255 2.236 2.758 5.704 0.814 8.33-1.922 2.594-7.335 3.156-7.335 3.156l-4.509 5.531v6.424h10.251l0.319-6.348 8.863-6.285c-0.946 0.757-3.058 2.783-6.229 7.666-0.717 1.102-1.275 2.306-1.711 3.49 2.238-1.896 6.84-3.194 12.153-3.194 5.307 0 9.903 1.295 12.146 3.188-0.437-1.185-0.994-2.385-1.709-3.483-3.172-4.883-5.284-6.909-6.229-7.666l8.863 6.285 0.32 6.348h9.565v-6.424l-4.507-5.531s-6.675-0.425-8.423-3.156c-5.032-7.869 2.115-20.082 18.836-23.756z" fill="#1E2D41"/>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

+1 -1
View File
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+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
=========================
+98 -43
View File
@@ -1,7 +1,6 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -9,44 +8,80 @@ buildscript {
}
}
apply plugin: 'net.minecraftforge.gradle'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
//Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
//accessTransformer = file('my_at.cfg')
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// default run configurations.
// these can be tweaked, removed, or duplicated as needed.
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
@@ -57,22 +92,21 @@ dependencies {
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings
//deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// for more info...
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
@@ -81,12 +115,33 @@ dependencies {
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes(["Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "24.0", // We are version 1 of the modlauncher specification
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
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>
+5
View File
@@ -0,0 +1,5 @@
# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
@@ -1,7 +1,7 @@
package com.example.examplemod;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@@ -35,7 +35,7 @@ public class ExampleMod
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
// Register ourselves for server, registry and other game events we are interested in
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
@@ -54,28 +54,29 @@ public class ExampleMod
private void enqueueIMC(final InterModEnqueueEvent event)
{
// some example code to dispatch IMC to another mod
InterModComms.sendTo("forge", "helloworld", () -> { LOGGER.info("Hello world"); return "Hello world";});
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
private void processIMC(final InterModProcessEvent event)
{
// some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC", event.getIMCStream().
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.getMessageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public static void onServerStarting(FMLServerStartingEvent event) {
public void onServerStarting(FMLServerStartingEvent event) {
// do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD event bus
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
// Event bus for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
LOGGER.info("HELLO from Register Block");
}
+12 -12
View File
@@ -6,17 +6,9 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[24,)" #mandatory (24 is current forge version)
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
@@ -27,6 +19,14 @@ version="${file.jarVersion}" #mandatory
displayName="Example Mod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
This is a long form description of the mod. You can write whatever you want here
@@ -42,7 +42,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[24,)" #mandatory
versionRange="[31,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
@@ -51,6 +51,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.13]"
versionRange="[1.15.2]"
ordering="NONE"
side="BOTH"
side="BOTH"
+2 -2
View File
@@ -1,7 +1,7 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 4,
"_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods."
"pack_format": 5,
"_comment": "A pack_format of 5 requires json lang files and some texture changes from 1.15. Note: we require v5 pack meta for all mods."
}
}
@@ -0,0 +1,20 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
@@ -579,10 +579,17 @@
GL13.glClientActiveTexture(p_227747_0_);
}
+ /* Stores the last values sent into glMultiTexCoord2f */
+ public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f;
@Deprecated
public static void func_227640_a_(int p_227640_0_, float p_227640_1_, float p_227640_2_) {
RenderSystem.assertThread(RenderSystem::isOnRenderThread);
GL13.glMultiTexCoord2f(p_227640_0_, p_227640_1_, p_227640_2_);
+ if (p_227640_0_ == GL13.GL_TEXTURE1) {
+ lastBrightnessX = p_227640_1_;
+ lastBrightnessY = p_227640_2_;
+ }
}
public static void func_227706_d_(int p_227706_0_, int p_227706_1_, int p_227706_2_, int p_227706_3_) {
@@ -0,0 +1,25 @@
--- a/com/mojang/blaze3d/vertex/IVertexBuilder.java
+++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java
@@ -18,7 +18,7 @@
import org.lwjgl.system.MemoryStack;
@OnlyIn(Dist.CLIENT)
-public interface IVertexBuilder {
+public interface IVertexBuilder extends net.minecraftforge.client.extensions.IForgeVertexBuilder {
Logger field_227884_f_ = LogManager.getLogger();
IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_);
@@ -96,11 +96,12 @@
f5 = p_227890_3_[k] * p_227890_6_;
}
- int l = p_227890_7_[k];
+ int l = applyBakedLighting(p_227890_7_[k], bytebuffer);
float f9 = bytebuffer.getFloat(16);
float f10 = bytebuffer.getFloat(20);
Vector4f vector4f = new Vector4f(f, f1, f2, 1.0F);
vector4f.func_229372_a_(matrix4f);
+ applyBakedNormals(vector3f, bytebuffer, p_227890_1_.func_227872_b_());
this.func_225588_a_(vector4f.func_195910_a(), vector4f.func_195913_b(), vector4f.func_195914_c(), f3, f4, f5, 1.0F, f9, f10, p_227890_8_, l, vector3f.func_195899_a(), vector3f.func_195900_b(), vector3f.func_195902_c());
}
}
@@ -0,0 +1,18 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
@@ -64,6 +64,15 @@
super.tick();
}
+ @Override
+ public boolean keyPressed(int key, int scanCode, int modifiers) {
+ if (key == org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE) {
+ Realms.setScreen(this.field_224228_a);
+ return true;
+ }
+ return super.keyPressed(key, scanCode, modifiers);
+ }
+
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
this.renderBackground();
this.drawCenteredString(this.field_224229_b, this.width() / 2, 80, 16777215);
@@ -0,0 +1,10 @@
--- a/net/minecraft/advancements/AdvancementList.java
+++ b/net/minecraft/advancements/AdvancementList.java
@@ -96,6 +96,7 @@
}
}
+ net.minecraftforge.common.AdvancementLoadFix.buildSortedTrees(this.field_192093_c);
field_192091_a.info("Loaded {} advancements", (int)this.field_192092_b.size());
}
@@ -0,0 +1,15 @@
--- a/net/minecraft/advancements/AdvancementManager.java
+++ b/net/minecraft/advancements/AdvancementManager.java
@@ -36,7 +36,11 @@
Map<ResourceLocation, Advancement.Builder> map = Maps.newHashMap();
p_212853_1_.forEach((p_223387_1_, p_223387_2_) -> {
try {
- Advancement.Builder advancement$builder = field_192783_b.fromJson(p_223387_2_, Advancement.Builder.class);
+ Advancement.Builder advancement$builder = net.minecraftforge.common.crafting.ConditionalAdvancement.read(field_192783_b, p_223387_1_, p_223387_2_);
+ if (advancement$builder == null) {
+ field_192782_a.info("Skipping loading advancement {} as it's conditions were not met", p_223387_1_);
+ return;
+ }
map.put(p_223387_1_, advancement$builder);
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
field_192782_a.error("Parsing error loading custom advancement {}: {}", p_223387_1_, jsonparseexception.getMessage());
@@ -1,11 +1,11 @@
--- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java
@@ -41,7 +41,7 @@
@@ -43,7 +43,7 @@
public void func_192113_a(EntityPlayerMP p_192113_1_) {
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_186472_a(p_192113_1_).func_204313_a(new BlockPos(p_192113_1_)).func_186471_a();
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_204313_a(new BlockPos(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
- 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,6 +1,14 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -174,6 +174,8 @@
@@ -154,6 +154,7 @@
}
this.func_192748_e();
+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.field_192759_g, this.field_192760_h, this.field_192758_f, this.field_192761_i, this::func_192738_c); else
this.func_192752_d();
this.func_192751_c();
}
@@ -187,6 +188,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
@@ -9,9 +17,9 @@
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -186,6 +188,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_82766_b("announceAdvancements")) {
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(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
@@ -199,6 +202,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
@@ -24,6 +24,8 @@
import net.minecraft.util.registry.IRegistry;
@@ -26,6 +26,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<>();
@@ -9,19 +9,19 @@
public static final ItemPredicate field_192495_a = new ItemPredicate();
@Nullable
private final Tag<Item> field_200018_b;
@@ -90,6 +92,11 @@
@@ -105,6 +107,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");
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);
+ 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 @@
@@ -204,6 +211,14 @@
}
}
@@ -30,9 +30,9 @@
+ }
+
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
+ return unmod_predicates;
+ return unmod_predicates;
+ }
+
public static class Builder {
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
@Nullable
private final List<EnchantmentPredicate> field_226657_b_ = Lists.newArrayList();
@@ -0,0 +1,96 @@
--- a/net/minecraft/block/AbstractRailBlock.java
+++ b/net/minecraft/block/AbstractRailBlock.java
@@ -36,7 +36,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;
}
@@ -56,7 +56,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);
}
@@ -134,5 +134,66 @@
return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH);
}
+ //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,16 @@
--- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java
@@ -91,10 +91,11 @@
if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) {
p_225534_2_.func_175655_b(p_225534_3_, true);
} else if (p_225534_1_.func_177229_b(field_220266_f) == 0) {
- if (p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9) {
+ if (true) {
int i = this.func_220260_b(p_225534_2_, p_225534_3_) + 1;
- if (i < 16) {
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9)) {
this.func_220258_a(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_, i);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_);
}
}
@@ -0,0 +1,13 @@
--- a/net/minecraft/block/BedBlock.java
+++ b/net/minecraft/block/BedBlock.java
@@ -88,7 +88,9 @@
}
}
- if (p_225533_2_.field_73011_w.func_76567_e() && p_225533_2_.func_226691_t_(p_225533_3_) != Biomes.field_76778_j) {
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_225533_2_.field_73011_w.canSleepAt(p_225533_4_, p_225533_3_);
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return ActionResultType.SUCCESS;
if (p_225533_1_.func_177229_b(field_176471_b)) {
if (!this.func_226861_a_(p_225533_2_, p_225533_3_)) {
p_225533_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
@@ -7,22 +7,42 @@
-public class Block implements IItemProvider {
+public class Block extends net.minecraftforge.registries.ForgeRegistryEntry<Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock {
protected static final Logger field_196273_d = LogManager.getLogger();
- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<>();
- public static final ObjectIntIdentityMap<BlockState> field_176229_d = new ObjectIntIdentityMap<>();
+ @Deprecated //Forge: Do not use, use GameRegistry
+ public static final ObjectIntIdentityMap<IBlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
private static final EnumFacing[] field_212556_a = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.UP};
protected final int field_149784_t;
protected final float field_149782_v;
@@ -298,7 +299,7 @@
+ public static final ObjectIntIdentityMap<BlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
private static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
public Boolean load(VoxelShape p_load_1_) {
@@ -151,7 +152,7 @@
@Deprecated
public boolean func_196253_a(IBlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
- return this.field_149764_J.func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
+ return p_196253_1_.func_185904_a().func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
public boolean func_220067_a(BlockState p_220067_1_, IBlockReader p_220067_2_, BlockPos p_220067_3_, EntityType<?> p_220067_4_) {
- return p_220067_1_.func_224755_d(p_220067_2_, p_220067_3_, Direction.UP) && this.field_149784_t < 14;
+ return p_220067_1_.func_224755_d(p_220067_2_, p_220067_3_, Direction.UP) && p_220067_1_.getLightValue(p_220067_2_, p_220067_3_) < 14;
}
@Deprecated
@@ -310,8 +311,9 @@
@@ -246,6 +247,10 @@
this.field_149781_w = p_i48440_1_.field_200958_f;
this.field_149782_v = p_i48440_1_.field_200959_g;
this.field_149789_z = p_i48440_1_.field_200960_h;
+ this.harvestLevel = p_i48440_1_.harvestLevel;
+ this.harvestTool = p_i48440_1_.harvestTool;
+ final ResourceLocation lootTableCache = p_i48440_1_.field_222381_j;
+ this.lootTableSupplier = lootTableCache != null ? () -> lootTableCache : p_i48440_1_.lootTableSupplier != null ? p_i48440_1_.lootTableSupplier : () -> new ResourceLocation(this.getRegistryName().func_110624_b(), "blocks/" + this.getRegistryName().func_110623_a());
this.field_149765_K = p_i48440_1_.field_200961_i;
this.field_226886_f_ = p_i48440_1_.field_226893_j_;
this.field_226887_g_ = p_i48440_1_.field_226894_k_;
@@ -297,7 +302,7 @@
@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
- return this.field_149764_J.func_76222_j() && (p_196253_2_.func_195996_i().func_190926_b() || p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j());
+ return p_196253_1_.func_185904_a().func_76222_j() && (p_196253_2_.func_195996_i().func_190926_b() || p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j());
}
@Deprecated
@@ -314,8 +319,9 @@
return this.field_149789_z;
}
@@ -33,34 +53,19 @@
}
@Deprecated
@@ -322,11 +324,11 @@
@@ -471,10 +477,9 @@
@Deprecated
@OnlyIn(Dist.CLIENT)
public int func_185484_c(IBlockState p_185484_1_, IWorldReader p_185484_2_, BlockPos p_185484_3_) {
- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
+ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab) {
p_185484_3_ = p_185484_3_.func_177977_b();
p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_);
- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
+ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
} else {
return i;
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) {
p_196243_2_.func_175713_t(p_196243_3_);
}
@@ -468,8 +470,12 @@
-
}
@Deprecated
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer)) {
+ p_196243_2_.func_175713_t(p_196243_3_);
+ }
}
+ @Deprecated //Forge: Use fortune/location sensitive version
public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
return 1;
}
@@ -484,30 +490,30 @@
@@ -483,8 +488,8 @@
if (f == -1.0F) {
return 0.0F;
} else {
@@ -71,41 +76,35 @@
}
}
@Deprecated
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- if (!p_196255_2_.field_72995_K) {
- int i = this.func_196251_a(p_196255_1_, p_196255_5_, p_196255_2_, p_196255_3_, p_196255_2_.field_73012_v);
-
- for(int j = 0; j < i; ++j) {
- if (!(p_196255_4_ < 1.0F) || !(p_196255_2_.field_73012_v.nextFloat() > p_196255_4_)) {
- Item item = this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_).func_199767_j();
- if (item != Items.field_190931_a) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(item));
- }
- }
+ if (!p_196255_2_.field_72995_K && !p_196255_2_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
+ NonNullList<ItemStack> drops = NonNullList.func_191196_a();
+ getDrops(p_196255_1_, drops, p_196255_2_, p_196255_3_, p_196255_5_);
+ p_196255_4_ = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(drops, p_196255_2_, p_196255_3_, p_196255_1_, p_196255_5_, p_196255_4_, false, harvesters.get());
+ for (ItemStack stack : drops) {
+ if (p_196255_2_.field_73012_v.nextFloat() <= p_196255_4_)
+ func_180635_a(p_196255_2_, p_196255_3_, stack);
}
-
@@ -494,8 +499,7 @@
public ResourceLocation func_220068_i() {
if (this.field_220085_g == null) {
- ResourceLocation resourcelocation = Registry.field_212618_g.func_177774_c(this);
- this.field_220085_g = new ResourceLocation(resourcelocation.func_110624_b(), "blocks/" + resourcelocation.func_110623_a());
+ this.field_220085_g = this.lootTableSupplier.get();
}
return this.field_220085_g;
@@ -555,7 +559,7 @@
}
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) {// do not drop items while restoring blockstates, prevents item dupe
+ if (captureDrops.get()) {
+ capturedDrops.get().add(p_180635_2_);
+ return;
+ }
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -529,6 +535,7 @@
@@ -567,7 +571,7 @@
}
public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
while(p_180637_3_ > 0) {
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
p_180637_3_ -= i;
@@ -577,6 +581,7 @@
}
@@ -113,135 +112,86 @@
public float func_149638_a() {
return this.field_149781_w;
}
@@ -543,7 +550,7 @@
}
}
- return raytraceresult;
+ return p_180636_0_.func_177230_c().getRayTraceResult(p_180636_0_, p_180636_1_, p_180636_2_, p_180636_3_, p_180636_4_, raytraceresult);
}
public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
@@ -597,16 +604,22 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
p_180657_2_.func_71020_j(0.005F);
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
+ NonNullList<ItemStack> items = NonNullList.func_191196_a();
ItemStack itemstack = this.func_180643_i(p_180657_4_);
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
+ if (!itemstack.func_190926_b()) items.add(itemstack);
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
+ items.forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
} else {
+ harvesters.set(p_180657_2_);
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, i);
+ harvesters.set(null);
}
}
+ @Deprecated //Use state sensitive version
protected boolean func_149700_E() {
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
}
@@ -663,6 +676,7 @@
p_176216_2_.field_70181_x = 0.0D;
@@ -675,6 +680,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
}
+ @Deprecated // Forge: Use more sensitive version below: getPickBlock
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
return new ItemStack(this);
}
@@ -737,6 +751,7 @@
@@ -688,6 +694,7 @@
return Fluids.field_204541_a.func_207188_f();
}
+ @Deprecated //Forge: Use more sensitive version
public float func_208618_m() {
return this.field_149765_K;
}
@@ -716,6 +723,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
}
+ @Deprecated //Forge: Use more sensitive version
public boolean func_149659_a(Explosion p_149659_1_) {
return true;
}
@@ -760,6 +768,7 @@
}
}
+ @Deprecated //Forge: Use more sensitive version {@link IForgeBlockState#getSoundType(IWorldReader, BlockPos, Entity) }
public SoundType func_185467_w() {
public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H;
}
@@ -758,11 +773,11 @@
}
public static boolean func_196252_e(Block p_196252_0_) {
- return p_196252_0_ == Blocks.field_150348_b || p_196252_0_ == Blocks.field_196650_c || p_196252_0_ == Blocks.field_196654_e || p_196252_0_ == Blocks.field_196656_g;
+ return net.minecraftforge.common.Tags.Blocks.STONE.func_199685_a_(p_196252_0_);
}
public static boolean func_196245_f(Block p_196245_0_) {
- return p_196245_0_ == Blocks.field_150346_d || p_196245_0_ == Blocks.field_196660_k || p_196245_0_ == Blocks.field_196661_l;
+ return net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(p_196245_0_);
}
public static void func_149671_p() {
@@ -1129,7 +1144,7 @@
func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42)));
- func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
+ func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true));
func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F)));
func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F)));
func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F)));
@@ -1455,6 +1470,7 @@
func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a()));
func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F)));
+ if(false) // Processed in GameData.BlockCallbacks#onBake
for(Block block85 : IRegistry.field_212618_g) {
for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) {
field_176229_d.func_195867_b(iblockstate);
@@ -1594,4 +1610,83 @@
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
@@ -769,7 +778,7 @@
this.field_220086_i = Item.func_150898_a(this);
}
- return this.field_220086_i;
+ return this.field_220086_i.delegate.get(); //Forge: Vanilla caches the items, update with registry replacements.
}
public boolean func_208619_r() {
@@ -777,13 +786,81 @@
}
public String toString() {
- return "Block{" + Registry.field_212618_g.func_177774_c(this) + "}";
+ return "Block{" + getRegistryName() + "}";
}
@OnlyIn(Dist.CLIENT)
public void func_190948_a(ItemStack p_190948_1_, @Nullable IBlockReader p_190948_2_, List<ITextComponent> p_190948_3_, ITooltipFlag p_190948_4_) {
}
+ /* ======================================== FORGE START =====================================*/
+ protected Random RANDOM = new Random();
+ protected ThreadLocal<EntityPlayer> harvesters = new ThreadLocal<>();
+ private net.minecraftforge.common.ToolType harvestTool;
+ private int harvestLevel;
+ protected static ThreadLocal<Boolean> captureDrops = ThreadLocal.withInitial(() -> false);
+ protected static ThreadLocal<NonNullList<ItemStack>> capturedDrops = ThreadLocal.withInitial(NonNullList::func_191196_a);
+ protected NonNullList<ItemStack> captureDrops(boolean start)
+ {
+ if (start) {
+ captureDrops.set(true);
+ capturedDrops.get().clear();
+ return NonNullList.func_191196_a();
+ } else {
+ captureDrops.set(false);
+ return capturedDrops.get();
+ }
+ }
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::getGeneration, BlockTags::func_199896_a);
+ private final java.util.function.Supplier<ResourceLocation> lootTableSupplier;
+
+ @Override
+ public float getSlipperiness(IBlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
+ return this.field_149765_K;
+ }
+
+ @Override
+ public boolean canSilkHarvest(IBlockState state, IWorldReader world, BlockPos pos, EntityPlayer player) {
+ return this.func_149700_E() && !state.hasTileEntity();
+ }
+
+ @Nullable
+ @Override
+ public net.minecraftforge.common.ToolType getHarvestTool(IBlockState state) {
+ public net.minecraftforge.common.ToolType getHarvestTool(BlockState state) {
+ return harvestTool; //TODO: RE-Evaluate
+ }
+
+ @Override
+ public int getHarvestLevel(IBlockState state) {
+ public int getHarvestLevel(BlockState state) {
+ return harvestLevel; //TODO: RE-Evaluate
+ }
+
+ @Override
+ public boolean canSustainPlant(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing, net.minecraftforge.common.IPlantable plantable) {
+ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
+ net.minecraftforge.common.EnumPlantType type = plantable.getPlantType(world, pos.func_177972_a(facing));
+ public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, net.minecraftforge.common.IPlantable plantable) {
+ BlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
+ net.minecraftforge.common.PlantType type = plantable.getPlantType(world, pos.func_177972_a(facing));
+
+ if (plant.func_177230_c() == Blocks.field_150434_aF)
+ return this.getBlock() == Blocks.field_150434_aF || this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_196611_F;
@@ -249,18 +199,18 @@
+ if (plant.func_177230_c() == Blocks.field_196608_cF && this == Blocks.field_196608_cF)
+ return true;
+
+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_200014_a_(state, world, pos))
+ if (plantable instanceof BushBlock && ((BushBlock)plantable).func_200014_a_(state, world, pos))
+ return true;
+
+ switch (type) {
+ case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof BlockGlazedTerracotta;
+ case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof GlazedTerracottaBlock;
+ case Nether: return this.getBlock() == Blocks.field_150425_aM;
+ case Crop: return this.getBlock() == Blocks.field_150458_ak;
+ case Cave: return state.func_185896_q();
+ case Plains: return this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150458_ak;
+ case Water: return state.func_185904_a() == Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper)
+ case Crop: return this.getBlock() == Blocks.field_150458_ak;
+ case Cave: return Block.func_220056_d(state, world, pos, Direction.UP);
+ case Plains: return this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(this) || this.getBlock() == Blocks.field_150458_ak;
+ case Water: return state.func_185904_a() == Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper)
+ case Beach:
+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150354_m;
+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(this) || this.getBlock() == Blocks.field_150354_m;
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h ||
@@ -270,6 +220,11 @@
+ return false;
+ }
+
+ @Override
+ public final java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ static {
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
+ block.harvestTool = tool;
@@ -277,4 +232,51 @@
+ });
+ }
+ /* ========================================= FORGE END ======================================*/
}
+
public static enum OffsetType {
NONE,
XZ,
@@ -805,6 +882,9 @@
private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true;
private boolean field_208772_j;
+ private int harvestLevel = -1;
+ private net.minecraftforge.common.ToolType harvestTool;
+ private java.util.function.Supplier<ResourceLocation> lootTableSupplier;
private Properties(Material p_i48616_1_, MaterialColor p_i48616_2_) {
this.field_200953_a = p_i48616_1_;
@@ -837,6 +917,8 @@
block$properties.field_226893_j_ = p_200950_0_.func_226891_m_();
block$properties.field_208772_j = p_200950_0_.field_208621_p;
block$properties.field_226895_m_ = p_200950_0_.field_226888_j_;
+ block$properties.harvestLevel = p_200950_0_.harvestLevel;
+ block$properties.harvestTool = p_200950_0_.harvestTool;
return block$properties;
}
@@ -901,13 +983,23 @@
return this;
}
+ public Block.Properties harvestLevel(int harvestLevel) {
+ this.harvestLevel = harvestLevel;
+ return this;
+ }
+
+ public Block.Properties harvestTool(net.minecraftforge.common.ToolType harvestTool) {
+ this.harvestTool = harvestTool;
+ return this;
+ }
+
public Block.Properties func_222380_e() {
this.field_222381_j = LootTables.field_186419_a;
return this;
}
public Block.Properties func_222379_b(Block p_222379_1_) {
- this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this;
}
}
@@ -1,22 +0,0 @@
--- a/net/minecraft/block/BlockAbstractBanner.java
+++ b/net/minecraft/block/BlockAbstractBanner.java
@@ -51,7 +51,7 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- func_180635_a(p_196255_2_, p_196255_3_, this.func_185473_a(p_196255_2_, p_196255_3_, p_196255_1_));
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
}
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_) {
@@ -75,4 +75,10 @@
public EnumDyeColor func_196285_M_() {
return this.field_196286_a;
}
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ TileEntity te = world.func_175625_s(pos);
+ drops.add((te instanceof TileEntityBanner) ? ((TileEntityBanner)te).func_190615_l(state) : func_185473_a(world, pos, state));
+ }
}
@@ -1,52 +0,0 @@
--- a/net/minecraft/block/BlockAbstractSkull.java
+++ b/net/minecraft/block/BlockAbstractSkull.java
@@ -38,6 +38,7 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
}
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) {
@@ -45,6 +46,7 @@
TileEntitySkull.func_195486_a(p_176208_1_, p_176208_2_);
}
+ this.func_196255_a(p_176208_3_, p_176208_1_, p_176208_2_, 1.0f, 0);
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
}
@@ -55,7 +57,7 @@
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() && !p_196243_2_.field_72995_K) {
TileEntity tileentity = p_196243_2_.func_175625_s(p_196243_3_);
- if (tileentity instanceof TileEntitySkull) {
+ if (false && tileentity instanceof TileEntitySkull) { //Forge: Moved to getDrops
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
if (tileentityskull.func_195487_d()) {
ItemStack itemstack = this.func_185473_a(p_196243_2_, p_196243_3_, p_196243_1_);
@@ -74,6 +76,24 @@
}
}
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ TileEntity te = world.func_175625_s(pos);
+ if (te instanceof TileEntitySkull) {
+ TileEntitySkull skull = (TileEntitySkull)te;
+ if (skull.func_195487_d()) {
+ ItemStack ret = func_185473_a(world, pos, state);
+ Block block = skull.func_195044_w().func_177230_c();
+ if ((block == Blocks.field_196710_eS || block == Blocks.field_196709_eR) && skull.func_152108_a() != null) {
+ NBTTagCompound nbt = new NBTTagCompound();
+ NBTUtil.func_180708_a(nbt, skull.func_152108_a());
+ ret.func_196082_o().func_74782_a("SkullOwner", nbt);
+ }
+ drops.add(ret);
+ }
+ }
+ }
+
@OnlyIn(Dist.CLIENT)
public BlockSkull.ISkullType func_196292_N_() {
return this.field_196293_a;
@@ -1,13 +0,0 @@
--- a/net/minecraft/block/BlockBed.java
+++ b/net/minecraft/block/BlockBed.java
@@ -67,7 +67,9 @@
}
}
- if (p_196250_2_.field_73011_w.func_76567_e() && p_196250_2_.func_180494_b(p_196250_3_) != Biomes.field_76778_j) {
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_196250_2_.field_73011_w.canSleepAt(p_196250_4_, p_196250_3_);
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
if (p_196250_1_.func_177229_b(field_176471_b)) {
EntityPlayer entityplayer = this.func_176470_e(p_196250_2_, p_196250_3_);
if (entityplayer != null) {
@@ -1,32 +0,0 @@
--- a/net/minecraft/block/BlockBush.java
+++ b/net/minecraft/block/BlockBush.java
@@ -10,7 +10,7 @@
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReaderBase;
-public class BlockBush extends Block {
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable {
protected BlockBush(Block.Properties p_i48437_1_) {
super(p_i48437_1_);
}
@@ -26,6 +26,8 @@
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
BlockPos blockpos = p_196260_3_.func_177977_b();
+ if (p_196260_1_.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.
+ return p_196260_2_.func_180495_p(blockpos).canSustainPlant(p_196260_2_, blockpos, EnumFacing.UP, this);
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
}
@@ -44,4 +46,11 @@
public int func_200011_d(IBlockState p_200011_1_, IBlockReader p_200011_2_, BlockPos p_200011_3_) {
return 0;
}
+
+ @Override
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
}
@@ -1,63 +0,0 @@
--- a/net/minecraft/block/BlockCactus.java
+++ b/net/minecraft/block/BlockCactus.java
@@ -21,7 +21,7 @@
import net.minecraft.world.IWorldReaderBase;
import net.minecraft.world.World;
-public class BlockCactus extends Block {
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable {
public static final IntegerProperty field_176587_a = BlockStateProperties.field_208171_X;
protected static final VoxelShape field_196400_b = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D);
protected static final VoxelShape field_196401_c = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
@@ -32,6 +32,7 @@
}
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
p_196267_2_.func_175655_b(p_196267_3_, true);
} else {
@@ -44,6 +45,7 @@
if (i < 3) {
int j = p_196267_1_.func_177229_b(field_176587_a);
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) {
if (j == 15) {
p_196267_2_.func_175656_a(blockpos, this.func_176223_P());
IBlockState iblockstate = p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(0));
@@ -52,7 +54,8 @@
} else {
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4);
}
-
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
+ }
}
}
}
@@ -91,8 +94,8 @@
}
}
- Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c();
- return (block == Blocks.field_150434_aF || block == Blocks.field_150354_m || block == Blocks.field_196611_F) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d();
+ IBlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
+ return soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP, this) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d();
}
public void func_196262_a(IBlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
@@ -114,4 +117,14 @@
public boolean func_196266_a(IBlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return false;
}
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockReader world, BlockPos pos) {
+ return net.minecraftforge.common.EnumPlantType.Desert;
+ }
+
+ @Override
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
+ return func_176223_P();
+ }
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockChest.java
+++ b/net/minecraft/block/BlockChest.java
@@ -258,7 +258,7 @@
}
private boolean func_176456_n(IBlockReader 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_) {
@@ -1,20 +0,0 @@
--- a/net/minecraft/block/BlockChorusFlower.java
+++ b/net/minecraft/block/BlockChorusFlower.java
@@ -42,7 +42,7 @@
BlockPos blockpos = p_196267_3_.func_177984_a();
if (p_196267_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) {
int i = p_196267_1_.func_177229_b(field_185607_a);
- if (i < 5) {
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) {
boolean flag = false;
boolean flag1 = false;
IBlockState iblockstate = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
@@ -99,7 +99,7 @@
} else {
this.func_185605_c(p_196267_2_, p_196267_3_);
}
-
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
}
@@ -1,39 +0,0 @@
--- a/net/minecraft/block/BlockCocoa.java
+++ b/net/minecraft/block/BlockCocoa.java
@@ -34,10 +34,11 @@
}
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
- if (p_196267_2_.field_73012_v.nextInt(5) == 0) {
+ if (true) {
int i = p_196267_1_.func_177229_b(field_176501_a);
- if (i < 2) {
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_2_.field_73012_v.nextInt(5) == 0)) {
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
@@ -90,14 +91,20 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- int i = p_196255_1_.func_177229_b(field_176501_a);
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
+ }
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ super.getDrops(state, drops, world, pos, fortune);
+ int i = state.func_177229_b(field_176501_a);
int j = 1;
if (i >= 2) {
j = 3;
}
for(int k = 0; k < j; ++k) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_196130_bo));
+ drops.add(new ItemStack(Items.field_196130_bo));
}
}
@@ -1,56 +0,0 @@
--- a/net/minecraft/block/BlockCrops.java
+++ b/net/minecraft/block/BlockCrops.java
@@ -55,12 +55,14 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
if (p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
int i = this.func_185527_x(p_196267_1_);
if (i < this.func_185526_g()) {
float f = func_180672_a(this, p_196267_2_, p_196267_3_);
- if (p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0) {
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) {
p_196267_2_.func_180501_a(p_196267_3_, this.func_185528_e(i + 1), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
}
@@ -89,9 +91,9 @@
for(int j = -1; j <= 1; ++j) {
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.canSustainPlant(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 (iblockstate.func_177229_b(BlockFarmland.field_176531_a) > 0) {
+ if (iblockstate.isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) {
f1 = 3.0F;
}
}
@@ -135,15 +137,19 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, 0);
- if (!p_196255_2_.field_72995_K) {
- int i = this.func_185527_x(p_196255_1_);
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
+ }
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ {
+ int i = this.func_185527_x(state);
if (i >= this.func_185526_g()) {
- int j = 3 + p_196255_5_;
+ int j = 3 + fortune;
for(int k = 0; k < j; ++k) {
- if (p_196255_2_.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199772_f()));
+ if (world.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
+ drops.add(new ItemStack(this.func_199772_f()));
}
}
}
@@ -1,22 +0,0 @@
--- a/net/minecraft/block/BlockDeadBush.java
+++ b/net/minecraft/block/BlockDeadBush.java
@@ -14,7 +14,7 @@
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
-public class BlockDeadBush extends BlockBush {
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable {
protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected BlockDeadBush(Block.Properties p_i48418_1_) {
@@ -46,4 +46,10 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, flag ? Blocks.field_150350_a.func_176223_P() : p_180657_4_, p_180657_5_, p_180657_6_);
}
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_196555_aI));
+ }
}
@@ -1,10 +0,0 @@
--- a/net/minecraft/block/BlockDirtSnowySpreadable.java
+++ b/net/minecraft/block/BlockDirtSnowySpreadable.java
@@ -25,6 +25,7 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
if (!p_196267_2_.field_72995_K) {
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
if (!func_196383_a(p_196267_2_, p_196267_3_)) {
p_196267_2_.func_175656_a(p_196267_3_, Blocks.field_150346_d.func_176223_P());
} else {
@@ -1,19 +0,0 @@
--- a/net/minecraft/block/BlockDoublePlant.java
+++ b/net/minecraft/block/BlockDoublePlant.java
@@ -43,7 +43,7 @@
@Nullable
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
BlockPos blockpos = p_196258_1_.func_195995_a();
- return blockpos.func_177956_o() < 255 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
+ return blockpos.func_177956_o() < p_196258_1_.func_195991_k().func_72800_K() - 1 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
}
public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, IBlockState p_180633_3_, EntityLivingBase p_180633_4_, ItemStack p_180633_5_) {
@@ -51,6 +51,7 @@
}
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
+ if (p_196260_1_.func_177230_c() != this) return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_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_196260_1_.func_177229_b(field_176492_b) != DoubleBlockHalf.UPPER) {
return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_);
} else {
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockDropper.java
+++ b/net/minecraft/block/BlockDropper.java
@@ -37,7 +37,7 @@
p_176439_1_.func_175718_b(1001, p_176439_2_, 0);
} else {
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 = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
IInventory iinventory = TileEntityHopper.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(enumfacing));
ItemStack itemstack1;
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockEnderChest.java
+++ b/net/minecraft/block/BlockEnderChest.java
@@ -81,7 +81,7 @@
InventoryEnderChest inventoryenderchest = p_196250_4_.func_71005_bN();
TileEntity tileentity = p_196250_2_.func_175625_s(p_196250_3_);
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) {
- if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).func_185915_l()) {
+ if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).doesSideBlockChestOpening(p_196250_2_, p_196250_3_.func_177984_a(), EnumFacing.DOWN)) {
return true;
} else if (p_196250_2_.field_72995_K) {
return true;
@@ -1,21 +0,0 @@
--- a/net/minecraft/block/BlockFalling.java
+++ b/net/minecraft/block/BlockFalling.java
@@ -48,7 +48,9 @@
p_176503_1_.func_72838_d(entityfallingblock);
}
} else {
+ IBlockState state = func_176223_P();
if (p_176503_1_.func_180495_p(p_176503_2_).func_177230_c() == this) {
+ state = p_176503_1_.func_180495_p(p_176503_2_);
p_176503_1_.func_175698_g(p_176503_2_);
}
@@ -58,7 +60,7 @@
}
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,24 +0,0 @@
--- a/net/minecraft/block/BlockFarmland.java
+++ b/net/minecraft/block/BlockFarmland.java
@@ -79,7 +79,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 (!p_180658_1_.field_72995_K && net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) { // Forge: Move logic to Entity#canTrample
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -90,9 +90,9 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
}
- private static boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c();
- return block instanceof BlockCrops || block instanceof BlockStem || block instanceof BlockAttachedStem;
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
+ IBlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, EnumFacing.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
}
private static boolean func_176530_e(IWorldReaderBase p_176530_0_, BlockPos p_176530_1_) {
@@ -1,50 +0,0 @@
--- a/net/minecraft/block/BlockFence.java
+++ b/net/minecraft/block/BlockFence.java
@@ -64,15 +64,12 @@
IBlockReader iblockreader = p_196258_1_.func_195991_k();
BlockPos blockpos = p_196258_1_.func_195995_a();
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
- BlockPos blockpos1 = blockpos.func_177978_c();
- BlockPos blockpos2 = blockpos.func_177974_f();
- BlockPos blockpos3 = blockpos.func_177968_d();
- BlockPos blockpos4 = blockpos.func_177976_e();
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
- return super.func_196258_a(p_196258_1_).func_206870_a(field_196409_a, Boolean.valueOf(this.func_196416_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196416_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.WEST)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196416_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196416_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.EAST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
+ return super.func_196258_a(p_196258_1_)
+ .func_206870_a(field_196409_a, canFenceConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
+ .func_206870_a(field_196411_b, canFenceConnectTo(iblockreader, blockpos, EnumFacing.EAST))
+ .func_206870_a(field_196413_c, canFenceConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
+ .func_206870_a(field_196414_y, canFenceConnectTo(iblockreader, blockpos, EnumFacing.WEST))
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
}
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
@@ -80,7 +77,7 @@
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
}
- return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196416_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
+ return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canFenceConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
}
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
@@ -90,4 +87,16 @@
public BlockFaceShape func_193383_a(IBlockReader 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;
}
+
+ @Override
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
+ return func_196416_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
+ }
+
+ private boolean canFenceConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
+ BlockPos offset = pos.func_177972_a(facing);
+ IBlockState other = world.func_180495_p(offset);
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
+ }
}
@@ -1,26 +0,0 @@
--- a/net/minecraft/block/BlockFenceGate.java
+++ b/net/minecraft/block/BlockFenceGate.java
@@ -100,7 +100,7 @@
}
private boolean func_196380_i(IBlockState p_196380_1_) {
- return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg;
+ return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg || p_196380_1_.func_177230_c() instanceof BlockWall;
}
public boolean func_196250_a(IBlockState p_196250_1_, World p_196250_2_, BlockPos p_196250_3_, EntityPlayer p_196250_4_, EnumHand p_196250_5_, EnumFacing p_196250_6_, float p_196250_7_, float p_196250_8_, float p_196250_9_) {
@@ -145,4 +145,14 @@
return BlockFaceShape.UNDEFINED;
}
}
+
+ @Override
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
+ if (state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE) {
+ Block other = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
+ return other instanceof BlockFence || other instanceof BlockWall;
+ }
+ return false;
+ }
+
}
@@ -1,188 +0,0 @@
--- a/net/minecraft/block/BlockFire.java
+++ b/net/minecraft/block/BlockFire.java
@@ -64,13 +64,13 @@
public IBlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
IBlockState iblockstate = p_196448_1_.func_180495_p(p_196448_2_.func_177977_b());
- if (!iblockstate.func_185896_q() && !this.func_196446_i(iblockstate)) {
+ if (!iblockstate.func_185896_q() && !this.canCatchFire(p_196448_1_, p_196448_2_, EnumFacing.UP)) {
IBlockState iblockstate1 = this.func_176223_P();
for(EnumFacing enumfacing : EnumFacing.values()) {
BooleanProperty booleanproperty = field_196449_B.get(enumfacing);
if (booleanproperty != null) {
- iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.func_196446_i(p_196448_1_.func_180495_p(p_196448_2_.func_177972_a(enumfacing)))));
+ iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.canCatchFire(p_196448_1_, p_196448_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())));
}
}
@@ -98,12 +98,13 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) {
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
p_196267_2_.func_175698_g(p_196267_3_);
}
- Block block = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_177230_c();
- boolean flag = p_196267_2_.field_73011_w instanceof EndDimension && block == Blocks.field_150357_h || block == Blocks.field_150424_aL || block == Blocks.field_196814_hQ;
+ IBlockState other = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
+ boolean flag = other.isFireSource(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP);
int i = p_196267_1_.func_177229_b(field_176543_a);
if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_196267_2_.func_175698_g(p_196267_3_);
@@ -117,14 +118,14 @@
if (!flag) {
p_196267_2_.func_205220_G_().func_205360_a(p_196267_3_, this, this.func_149738_a(p_196267_2_) + p_196267_4_.nextInt(10));
if (!this.func_196447_a(p_196267_2_, p_196267_3_)) {
- if (!p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_185896_q() || i > 3) {
+ if (p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_193401_d(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID || i > 3) {
p_196267_2_.func_175698_g(p_196267_3_);
}
return;
}
- if (i == 15 && p_196267_4_.nextInt(4) == 0 && !this.func_196446_i(p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()))) {
+ if (i == 15 && p_196267_4_.nextInt(4) == 0 && !this.canCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP)) {
p_196267_2_.func_175698_g(p_196267_3_);
return;
}
@@ -132,12 +133,12 @@
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
int k = flag1 ? -50 : 0;
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i);
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i);
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i);
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i);
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i);
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i, EnumFacing.WEST);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i, EnumFacing.EAST);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i, EnumFacing.UP);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i, EnumFacing.DOWN);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i, EnumFacing.SOUTH);
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i, EnumFacing.NORTH);
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for(int l = -1; l <= 1; ++l) {
@@ -175,16 +176,18 @@
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
}
+ @Deprecated //Forge: Use IForgeBlockState.getFlammability
public int func_176532_c(Block p_176532_1_) {
return this.field_149848_b.getInt(p_176532_1_);
}
+ @Deprecated //Forge: Use IForgeBlockState.getFireSpreadSpeed
public int func_176534_d(Block p_176534_1_) {
return this.field_149849_a.getInt(p_176534_1_);
}
- 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());
+ 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_).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_);
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -204,7 +207,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(EnumFacing enumfacing : EnumFacing.values()) {
- if (this.func_196446_i(p_196447_1_.func_180495_p(p_196447_2_.func_177972_a(enumfacing)))) {
+ if (this.canCatchFire(p_196447_1_, p_196447_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())) {
return true;
}
}
@@ -219,7 +222,7 @@
int i = 0;
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)).getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
}
return i;
@@ -230,6 +233,7 @@
return false;
}
+ @Deprecated //Forge: Use canCatchFire with more context
public boolean func_196446_i(IBlockState p_196446_1_) {
return this.func_176534_d(p_196446_1_.func_177230_c()) > 0;
}
@@ -252,8 +256,8 @@
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() && !this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()))) {
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177976_e()))) {
+ if (p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_193401_d(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID && !this.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP)) {
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST)) {
for(int j = 0; j < 2; ++j) {
double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F;
double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -262,7 +266,7 @@
}
}
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177974_f()))) {
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST)) {
for(int k = 0; k < 2; ++k) {
double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -271,7 +275,7 @@
}
}
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177978_c()))) {
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH)) {
for(int l = 0; l < 2; ++l) {
double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -280,7 +284,7 @@
}
}
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177968_d()))) {
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH)) {
for(int i1 = 0; i1 < 2; ++i1) {
double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -289,7 +293,7 @@
}
}
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177984_a()))) {
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN)) {
for(int j1 = 0; j1 < 2; ++j1) {
double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
@@ -321,10 +325,23 @@
}
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_, p_180686_2_);
this.field_149848_b.put(p_180686_1_, p_180686_3_);
}
+ /**
+ * 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(IBlockReader world, BlockPos pos, EnumFacing face) {
+ return world.func_180495_p(pos).isFlammable(world, pos, face);
+ }
+
public static void func_149843_e() {
BlockFire blockfire = (BlockFire)Blocks.field_150480_ab;
blockfire.func_180686_a(Blocks.field_196662_n, 5, 20);
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockFlowerPot.java
+++ b/net/minecraft/block/BlockFlowerPot.java
@@ -22,7 +22,7 @@
import net.minecraft.world.World;
public class BlockFlowerPot extends Block {
- private static final Map<Block, Block> field_196451_b = Maps.newHashMap();
+ private static final Map<Block, Block> field_196451_b = Maps.newHashMap(); //TODO: Delegates
protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
private final Block field_196452_c;
@@ -1,25 +0,0 @@
--- a/net/minecraft/block/BlockIce.java
+++ b/net/minecraft/block/BlockIce.java
@@ -34,8 +34,10 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
p_180657_2_.func_71020_j(0.005F);
- if (this.func_149700_E() && 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_));
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
+ net.minecraft.util.NonNullList<ItemStack> items = net.minecraft.util.NonNullList.func_193580_a(ItemStack.field_190927_a, 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_);
+ items.stream().filter(e -> !e.func_190926_b()).forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
} else {
if (p_180657_1_.field_73011_w.func_177500_n()) {
p_180657_1_.func_175698_g(p_180657_3_);
@@ -43,7 +45,9 @@
}
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
+ harvesters.set(p_180657_2_);
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, 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()) {
p_180657_1_.func_175656_a(p_180657_3_, Blocks.field_150355_j.func_176223_P());
@@ -1,12 +0,0 @@
--- a/net/minecraft/block/BlockLadder.java
+++ b/net/minecraft/block/BlockLadder.java
@@ -151,4 +151,9 @@
return false;
}
}
+
+ @Override
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
+ return true;
+ }
}
@@ -1,83 +0,0 @@
--- a/net/minecraft/block/BlockLeaves.java
+++ b/net/minecraft/block/BlockLeaves.java
@@ -26,7 +26,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public class BlockLeaves extends Block {
+public class BlockLeaves extends Block implements net.minecraftforge.common.IShearable {
public static final IntegerProperty field_208494_a = BlockStateProperties.field_208514_aa;
public static final BooleanProperty field_208495_b = BlockStateProperties.field_208515_s;
protected static boolean field_196478_c;
@@ -122,28 +122,37 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- if (!p_196255_2_.field_72995_K) {
- int i = this.func_196472_i(p_196255_1_);
- if (p_196255_5_ > 0) {
- i -= 2 << p_196255_5_;
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
+ }
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World worldIn, BlockPos pos, int fortune) {
+ {
+ int i = this.func_196472_i(state);
+ if (fortune > 0) {
+ i -= 2 << fortune;
if (i < 10) {
i = 10;
}
}
- if (p_196255_2_.field_73012_v.nextInt(i) == 0) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_)));
+ if (worldIn.field_73012_v.nextInt(i) == 0) {
+ ItemStack drop = new ItemStack(this.func_199769_a(state, worldIn, pos, fortune));
+ if (!drop.func_190926_b())
+ drops.add(drop);
}
i = 200;
- if (p_196255_5_ > 0) {
- i -= 10 << p_196255_5_;
+ if (fortune > 0) {
+ i -= 10 << fortune;
if (i < 40) {
i = 40;
}
}
- this.func_196474_a(p_196255_2_, p_196255_3_, p_196255_1_, i);
+ captureDrops(true);
+ this.func_196474_a(worldIn, pos, state, i);
+ drops.addAll(captureDrops(false));
}
}
@@ -173,13 +182,7 @@
}
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
- if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ) {
- p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
- p_180657_2_.func_71020_j(0.005F);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(this));
- } else {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
- }
}
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
@@ -189,4 +192,10 @@
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
return func_208493_b(this.func_176223_P().func_206870_a(field_208495_b, Boolean.valueOf(true)), p_196258_1_.func_195991_k(), p_196258_1_.func_195995_a());
}
+
+ @Override
+ public java.util.List<ItemStack> onSheared(@javax.annotation.Nonnull ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(this));
+ }
}
@@ -1,27 +0,0 @@
--- a/net/minecraft/block/BlockMobSpawner.java
+++ b/net/minecraft/block/BlockMobSpawner.java
@@ -13,6 +13,8 @@
import net.minecraft.world.World;
public class BlockMobSpawner extends BlockContainer {
+ private static final java.util.Random RAND = new java.util.Random();
+
protected BlockMobSpawner(Block.Properties p_i48364_1_) {
super(p_i48364_1_);
}
@@ -27,10 +29,13 @@
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
- int i = 15 + p_196255_2_.field_73012_v.nextInt(15) + p_196255_2_.field_73012_v.nextInt(15);
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
}
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune) {
+ return 15 + RAND.nextInt(15) + RAND.nextInt(15);
+ }
+
public EnumBlockRenderType func_149645_b(IBlockState p_149645_1_) {
return EnumBlockRenderType.MODEL;
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockMushroom.java
+++ b/net/minecraft/block/BlockMushroom.java
@@ -64,7 +64,7 @@
IBlockState iblockstate = p_196260_2_.func_180495_p(blockpos);
Block block = iblockstate.func_177230_c();
if (block != Blocks.field_150391_bh && block != Blocks.field_196661_l) {
- return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && this.func_200014_a_(iblockstate, p_196260_2_, blockpos);
+ return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && iblockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.EnumFacing.UP, this);
} else {
return true;
}
@@ -1,36 +0,0 @@
--- a/net/minecraft/block/BlockNetherWart.java
+++ b/net/minecraft/block/BlockNetherWart.java
@@ -33,16 +33,22 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
int i = p_196267_1_.func_177229_b(field_176486_a);
- if (i < 3 && p_196267_4_.nextInt(10) == 0) {
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt(10) == 0)) {
p_196267_1_ = p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1));
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- if (!p_196255_2_.field_72995_K) {
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
+ }
+
+ @Override
+ public void getDrops(IBlockState p_196255_1_, net.minecraft.util.NonNullList<ItemStack> drops, World p_196255_2_, BlockPos p_196255_3_, int p_196255_5_) {
+ {
int i = 1;
if (p_196255_1_.func_177229_b(field_176486_a) >= 3) {
i = 2 + p_196255_2_.field_73012_v.nextInt(3);
@@ -52,7 +58,7 @@
}
for(int j = 0; j < i; ++j) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_151075_bm));
+ drops.add(new ItemStack(Items.field_151075_bm));
}
}
@@ -1,39 +0,0 @@
--- a/net/minecraft/block/BlockOre.java
+++ b/net/minecraft/block/BlockOre.java
@@ -49,23 +49,27 @@
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
- if (this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
+ }
+
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune) {
+ World world = reader instanceof World ? (World)reader : null;
+ if (world == null || this.func_199769_a(state, world, pos, fortune) != this) {
int i = 0;
if (this == Blocks.field_150365_q) {
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 0, 2);
+ i = MathHelper.func_76136_a(RANDOM, 0, 2);
} else if (this == Blocks.field_150482_ag) {
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
} else if (this == Blocks.field_150412_bA) {
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
} else if (this == Blocks.field_150369_x) {
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
} else if (this == Blocks.field_196766_fg) {
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
}
-
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
+ return i;
}
-
+ return 0;
}
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
@@ -1,50 +0,0 @@
--- a/net/minecraft/block/BlockPane.java
+++ b/net/minecraft/block/BlockPane.java
@@ -25,15 +25,12 @@
IBlockReader iblockreader = p_196258_1_.func_195991_k();
BlockPos blockpos = p_196258_1_.func_195995_a();
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
- BlockPos blockpos1 = blockpos.func_177978_c();
- BlockPos blockpos2 = blockpos.func_177968_d();
- BlockPos blockpos3 = blockpos.func_177976_e();
- BlockPos blockpos4 = blockpos.func_177974_f();
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
- return this.func_176223_P().func_206870_a(field_196409_a, Boolean.valueOf(this.func_196417_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196417_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196417_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.EAST)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196417_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.WEST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
+ return this.func_176223_P()
+ .func_206870_a(field_196409_a, canPaneConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
+ .func_206870_a(field_196413_c, canPaneConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
+ .func_206870_a(field_196414_y, canPaneConnectTo(iblockreader, blockpos, EnumFacing.WEST))
+ .func_206870_a(field_196411_b, canPaneConnectTo(iblockreader, blockpos, EnumFacing.EAST))
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
}
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
@@ -41,7 +38,7 @@
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
}
- return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196417_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
+ return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canPaneConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
}
public boolean func_149686_d(IBlockState p_149686_1_) {
@@ -87,4 +84,16 @@
public BlockFaceShape func_193383_a(IBlockReader 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;
}
+
+ @Override
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
+ return func_196417_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
+ }
+
+ private boolean canPaneConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
+ BlockPos offset = pos.func_177972_a(facing);
+ IBlockState other = world.func_180495_p(offset);
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
+ }
}
@@ -1,33 +0,0 @@
--- a/net/minecraft/block/BlockPistonBase.java
+++ b/net/minecraft/block/BlockPistonBase.java
@@ -244,7 +244,7 @@
return false;
}
- return !block.func_149716_u();
+ return !p_185646_0_.hasTileEntity();
} else {
return false;
}
@@ -280,7 +280,9 @@
for(int j = list2.size() - 1; j >= 0; --j) {
BlockPos blockpos2 = list2.get(j);
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos2);
- iblockstate.func_196949_c(p_176319_1_, blockpos2, 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_196941_a(p_176319_1_, blockpos2, chance, 0);
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
--k;
aiblockstate[k] = iblockstate;
@@ -333,6 +335,10 @@
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
}
+ public IBlockState rotate(IBlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) {
+ return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction);
+ }
+
public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176387_N)));
}
@@ -1,26 +0,0 @@
--- a/net/minecraft/block/BlockPistonMoving.java
+++ b/net/minecraft/block/BlockPistonMoving.java
@@ -86,14 +86,22 @@
}
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
- if (!p_196255_2_.field_72995_K) {
+ if (false && !p_196255_2_.field_72995_K) { //Forge: Noop this out
TileEntityPiston tileentitypiston = this.func_196342_a(p_196255_2_, p_196255_3_);
if (tileentitypiston != null) {
tileentitypiston.func_200230_i().func_196949_c(p_196255_2_, p_196255_3_, 0);
}
}
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, 1, p_196255_5_); // mimic vanilla behavior from above and ignore chance
}
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ TileEntityPiston te = this.func_196342_a(world, pos);
+ if (te != null)
+ te.func_200230_i().getDrops(drops, world, pos, fortune);
+ }
+
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
return VoxelShapes.func_197880_a();
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockPortal.java
+++ b/net/minecraft/block/BlockPortal.java
@@ -76,7 +76,7 @@
public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) {
BlockPortal.Size blockportal$size = this.func_201816_b(p_176548_1_, p_176548_2_);
- if (blockportal$size != null) {
+ if (blockportal$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size)) {
blockportal$size.func_150859_c();
return true;
} else {
@@ -1,25 +0,0 @@
--- a/net/minecraft/block/BlockPotato.java
+++ b/net/minecraft/block/BlockPotato.java
@@ -26,7 +26,7 @@
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
- if (!p_196255_2_.field_72995_K) {
+ if (false && !p_196255_2_.field_72995_K) { //Forge: Moved to getDrops
if (this.func_185525_y(p_196255_1_) && p_196255_2_.field_73012_v.nextInt(50) == 0) {
func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_151170_bI));
}
@@ -34,6 +34,13 @@
}
}
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ super.getDrops(state, drops, world, pos, fortune);
+ if (this.func_185525_y(state) && world.field_73012_v.nextInt(50) == 0)
+ drops.add(new ItemStack(Items.field_151170_bI));
+ }
+
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
return field_196396_a[p_196244_1_.func_177229_b(this.func_185524_e())];
}
@@ -1,122 +0,0 @@
--- a/net/minecraft/block/BlockRailBase.java
+++ b/net/minecraft/block/BlockRailBase.java
@@ -37,7 +37,7 @@
}
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
- RailShape railshape = p_196244_1_.func_177230_c() == this ? p_196244_1_.func_177229_b(this.func_176560_l()) : null;
+ RailShape railshape = p_196244_1_.func_177230_c() == this ? getRailDirection(p_196244_1_, p_196244_2_, p_196244_3_, null) : null;
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
}
@@ -50,7 +50,7 @@
}
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
- return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q();
+ return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
}
public void func_196259_b(IBlockState p_196259_1_, World p_196259_2_, BlockPos p_196259_3_, IBlockState p_196259_4_) {
@@ -67,19 +67,19 @@
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_) {
if (!p_189540_2_.field_72995_K) {
- RailShape railshape = p_189540_1_.func_177229_b(this.func_176560_l());
+ RailShape railshape = getRailDirection(p_189540_1_, p_189540_2_, p_189540_3_, null);
boolean flag = false;
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) {
+ if (p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID) {
flag = true;
}
- if (railshape == RailShape.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q()) {
+ if (railshape == RailShape.ASCENDING_EAST && p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_193401_d(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP) != BlockFaceShape.SOLID) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_WEST && p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_193401_d(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP) != BlockFaceShape.SOLID) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_NORTH && p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_193401_d(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP) != BlockFaceShape.SOLID) {
flag = true;
- } else if (railshape == RailShape.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q()) {
+ } else if (railshape == RailShape.ASCENDING_SOUTH && p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_193401_d(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP) != BlockFaceShape.SOLID) {
flag = true;
}
@@ -111,7 +111,7 @@
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
- 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);
}
@@ -123,5 +123,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(IBlockState 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(IBlockState 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(IBlockState state, IBlockReader world, BlockPos pos, @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(IBlockState state, World world, BlockPos pos, net.minecraft.entity.item.EntityMinecart 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(IBlockState state, World world, BlockPos pos, net.minecraft.entity.item.EntityMinecart cart) { }
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockRailDetector.java
+++ b/net/minecraft/block/BlockRailDetector.java
@@ -127,6 +127,8 @@
public int func_180641_l(IBlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
if (p_180641_1_.func_177229_b(field_176574_M)) {
+ List<EntityMinecart> carts = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecart.class, null);
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
List<EntityMinecartCommandBlock> list = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class, (Predicate<Entity>)null);
if (!list.isEmpty()) {
return list.get(0).func_145822_e().func_145760_g();
@@ -1,29 +0,0 @@
--- a/net/minecraft/block/BlockRailPowered.java
+++ b/net/minecraft/block/BlockRailPowered.java
@@ -15,10 +15,16 @@
public class BlockRailPowered extends BlockRailBase {
public static final EnumProperty<RailShape> field_176568_b = BlockStateProperties.field_208166_S;
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
+ private final boolean isActivator;
protected BlockRailPowered(Block.Properties p_i48349_1_) {
- super(true, p_i48349_1_);
+ this(p_i48349_1_, false);
+ }
+
+ protected BlockRailPowered(Block.Properties builder, boolean isActivator) {
+ super(true, builder);
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176568_b, RailShape.NORTH_SOUTH).func_206870_a(field_176569_M, Boolean.valueOf(false)));
+ this.isActivator = isActivator;
}
protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, IBlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
@@ -100,7 +106,7 @@
protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) {
IBlockState iblockstate = p_208071_1_.func_180495_p(p_208071_2_);
- if (iblockstate.func_177230_c() != this) {
+ if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator) {
return false;
} else {
RailShape railshape = iblockstate.func_177229_b(field_176568_b);
@@ -1,19 +0,0 @@
--- a/net/minecraft/block/BlockRedstoneComparator.java
+++ b/net/minecraft/block/BlockRedstoneComparator.java
@@ -156,4 +156,16 @@
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c);
}
+
+ @Override
+ public boolean getWeakChanges(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return true;
+ }
+
+ @Override
+ public void onNeighborChange(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, BlockPos neighbor) {
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World)world).func_201670_d()) {
+ func_189540_a(state, (World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor);
+ }
+ }
}
@@ -1,20 +0,0 @@
--- a/net/minecraft/block/BlockRedstoneDiode.java
+++ b/net/minecraft/block/BlockRedstoneDiode.java
@@ -35,7 +35,7 @@
}
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
- return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q();
+ return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q() || p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
}
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
@@ -172,6 +172,8 @@
protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, IBlockState p_176400_3_) {
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);
}
@@ -1,21 +0,0 @@
--- a/net/minecraft/block/BlockRedstoneOre.java
+++ b/net/minecraft/block/BlockRedstoneOre.java
@@ -72,11 +72,17 @@
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
- if (this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
+ if (false && this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
int i = 1 + p_196255_2_.field_73012_v.nextInt(5);
this.func_180637_b(p_196255_2_, p_196255_3_, i);
}
+ }
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune) {
+ if (!(world instanceof World) || func_199769_a(state, (World)world, pos, fortune) != this)
+ return 1 + RANDOM.nextInt(5);
+ return 0;
}
@OnlyIn(Dist.CLIENT)
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/BlockRedstoneTorch.java
+++ b/net/minecraft/block/BlockRedstoneTorch.java
@@ -24,7 +24,7 @@
public class BlockRedstoneTorch extends BlockTorch {
public static final BooleanProperty field_196528_a = BlockStateProperties.field_208190_q;
- private static final Map<IBlockReader, List<BlockRedstoneTorch.Toggle>> field_196529_b = Maps.newHashMap();
+ private static final Map<IBlockReader, List<BlockRedstoneTorch.Toggle>> field_196529_b = new java.util.WeakHashMap<IBlockReader, List<BlockRedstoneTorch.Toggle>>(); // FORGE - fix vanilla MC-101233
protected BlockRedstoneTorch(Block.Properties p_i48342_1_) {
super(p_i48342_1_);
@@ -1,71 +0,0 @@
--- a/net/minecraft/block/BlockRedstoneWire.java
+++ b/net/minecraft/block/BlockRedstoneWire.java
@@ -124,8 +124,8 @@
IBlockState iblockstate = p_208074_1_.func_180495_p(p_208074_2_.func_177972_a(p_208074_3_));
IBlockState iblockstate1 = p_208074_1_.func_180495_p(p_208074_2_.func_177984_a());
if (!iblockstate1.func_185915_l()) {
- boolean flag = p_208074_1_.func_180495_p(blockpos).func_185896_q() || p_208074_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
- if (flag && func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177984_a()))) {
+ boolean flag = iblockstate.func_193401_d(p_208074_1_, blockpos, EnumFacing.UP) == BlockFaceShape.SOLID || iblockstate.func_177230_c() == Blocks.field_150426_aN;
+ if (flag && canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177984_a()), p_208074_1_, blockpos.func_177984_a(), null)) {
if (iblockstate.func_185898_k()) {
return RedstoneSide.UP;
}
@@ -134,7 +134,7 @@
}
}
- return !func_176343_a(p_208074_1_.func_180495_p(blockpos), p_208074_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177977_b()))) ? RedstoneSide.NONE : RedstoneSide.SIDE;
+ return !canConnectTo(p_208074_1_.func_180495_p(blockpos), p_208074_1_, blockpos, p_208074_3_) && (iblockstate.func_185915_l() || !canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177977_b()), p_208074_1_, blockpos.func_177977_b(), null)) ? RedstoneSide.NONE : RedstoneSide.SIDE;
}
public boolean func_149686_d(IBlockState p_149686_1_) {
@@ -143,7 +143,7 @@
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
IBlockState iblockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
- return iblockstate.func_185896_q() || iblockstate.func_177230_c() == Blocks.field_150426_aN;
+ return iblockstate.func_185896_q() || iblockstate.func_177230_c() == Blocks.field_150426_aN || iblockstate.func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
}
private IBlockState func_176338_e(World p_176338_1_, BlockPos p_176338_2_, IBlockState p_176338_3_) {
@@ -338,26 +338,18 @@
IBlockState iblockstate = p_176339_1_.func_180495_p(blockpos);
boolean flag = iblockstate.func_185915_l();
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_185915_l();
- if (!flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a())) {
+ if (!flag1 && flag && canConnectTo(p_176339_1_.func_180495_p(blockpos.func_177984_a()), p_176339_1_, blockpos.func_177984_a(), null)) {
return true;
- } else if (func_176343_a(iblockstate, p_176339_3_)) {
+ } else if (canConnectTo(iblockstate, p_176339_1_, blockpos, p_176339_3_)) {
return true;
} else if (iblockstate.func_177230_c() == Blocks.field_196633_cV && iblockstate.func_177229_b(BlockRedstoneDiode.field_196348_c) && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_) {
return true;
} else {
- return !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b());
+ return !flag && canConnectTo(p_176339_1_.func_180495_p(blockpos.func_177977_b()), p_176339_1_, blockpos.func_177977_b(), null);
}
}
- protected static boolean func_176340_e(IBlockReader p_176340_0_, BlockPos p_176340_1_) {
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
- }
-
- protected static boolean func_176346_d(IBlockState p_176346_0_) {
- return func_176343_a(p_176346_0_, (EnumFacing)null);
- }
-
- protected static boolean func_176343_a(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_) {
+ protected boolean canConnectTo(IBlockState p_176343_0_, IBlockReader world, BlockPos pos, @Nullable EnumFacing p_176343_1_) {
Block block = p_176343_0_.func_177230_c();
if (block == Blocks.field_150488_af) {
return true;
@@ -367,7 +359,7 @@
} else if (Blocks.field_190976_dk == p_176343_0_.func_177230_c()) {
return p_176343_1_ == p_176343_0_.func_177229_b(BlockObserver.field_176387_N);
} else {
- return p_176343_0_.func_185897_m() && p_176343_1_ != null;
+ return p_176343_0_.canConnectRedstone(world, pos, p_176343_1_) && p_176343_1_ != null;
}
}
@@ -1,52 +0,0 @@
--- a/net/minecraft/block/BlockReed.java
+++ b/net/minecraft/block/BlockReed.java
@@ -18,7 +18,7 @@
import net.minecraft.world.IWorldReaderBase;
import net.minecraft.world.World;
-public class BlockReed extends Block {
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable {
public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X;
protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D);
@@ -40,12 +40,15 @@
if (i < 3) {
int j = p_196267_1_.func_177229_b(field_176355_a);
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, true)) {
if (j == 15) {
p_196267_2_.func_175656_a(p_196267_3_.func_177984_a(), this.func_176223_P());
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4);
} else {
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4);
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
+ }
}
}
@@ -56,6 +59,9 @@
}
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
+ IBlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
+ if (soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP, this)) return true;
+
Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c();
if (block == this) {
return true;
@@ -91,4 +97,14 @@
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockReader world, BlockPos pos) {
+ return net.minecraftforge.common.EnumPlantType.Beach;
+ }
+
+ @Override
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
+ return func_176223_P();
+ }
}
@@ -1,18 +0,0 @@
--- a/net/minecraft/block/BlockSapling.java
+++ b/net/minecraft/block/BlockSapling.java
@@ -29,6 +29,7 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
if (p_196267_2_.func_201696_r(p_196267_3_.func_177984_a()) >= 9 && p_196267_4_.nextInt(7) == 0) {
this.func_176478_d(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_);
}
@@ -39,6 +40,7 @@
if (p_176478_3_.func_177229_b(field_176479_b) == 0) {
p_176478_1_.func_180501_a(p_176478_2_, p_176478_3_.func_177231_a(field_176479_b), 4);
} else {
+ if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_176478_1_, p_176478_4_, p_176478_2_)) return;
this.field_196387_c.func_196935_a(p_176478_1_, p_176478_2_, p_176478_3_, p_176478_4_);
}
@@ -1,38 +0,0 @@
--- a/net/minecraft/block/BlockShearableDoublePlant.java
+++ b/net/minecraft/block/BlockShearableDoublePlant.java
@@ -11,7 +11,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
-public class BlockShearableDoublePlant extends BlockDoublePlant {
+public class BlockShearableDoublePlant extends BlockDoublePlant implements net.minecraftforge.common.IShearable {
public static final EnumProperty<DoubleBlockHalf> field_208063_b = BlockDoublePlant.field_176492_b;
private final Block field_196392_b;
@@ -26,9 +26,7 @@
}
protected void func_196391_a(IBlockState p_196391_1_, World p_196391_2_, BlockPos p_196391_3_, ItemStack p_196391_4_) {
- if (p_196391_4_.func_77973_b() == Items.field_151097_aZ) {
- func_180635_a(p_196391_2_, p_196391_3_, new ItemStack(this.field_196392_b, 2));
- } else {
+ {
super.func_196391_a(p_196391_1_, p_196391_2_, p_196391_3_, p_196391_4_);
}
@@ -37,4 +35,15 @@
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
return p_199769_1_.func_177229_b(field_208063_b) == DoubleBlockHalf.LOWER && this == Blocks.field_196804_gh && p_199769_2_.field_73012_v.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a;
}
+
+ @Override
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
+ return false;
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(this.field_196392_b, 2));
+ }
}
@@ -1,54 +0,0 @@
--- a/net/minecraft/block/BlockSnowLayer.java
+++ b/net/minecraft/block/BlockSnowLayer.java
@@ -84,30 +84,45 @@
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_) {
Integer integer = p_180657_4_.func_177229_b(field_176315_a);
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
+ net.minecraft.util.NonNullList<ItemStack> items = net.minecraft.util.NonNullList.func_191196_a();
+ int fortune = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
+ float chance = 1.0f;
+
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
if (integer == 8) {
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_196604_cC));
+ items.add(new ItemStack(Blocks.field_196604_cC));
} else {
for(int i = 0; i < integer; ++i) {
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
+ items.add(this.func_180643_i(p_180657_4_));
}
}
+ chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
} else {
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, integer));
+ getDrops(p_180657_4_, items, p_180657_1_, p_180657_3_, fortune);
+ chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, fortune, 1.0f, false, p_180657_2_);
}
+ for (ItemStack item : items) {
+ if (p_180657_1_.field_73012_v.nextFloat() <= chance)
+ func_180635_a(p_180657_1_, p_180657_3_, item);
+ }
+
p_180657_1_.func_175698_g(p_180657_3_);
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
p_180657_2_.func_71020_j(0.005F);
}
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
- return Items.field_190931_a;
+ return Items.field_151126_ay;
}
+ @Override
+ public int func_196264_a(IBlockState state, Random random) {
+ return state.func_177229_b(field_176315_a) + 1;
+ }
+
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
if (p_196267_2_.func_175642_b(EnumLightType.BLOCK, p_196267_3_) > 11) {
- p_196267_1_.func_196949_c(p_196267_2_, p_196267_3_, 0);
p_196267_2_.func_175698_g(p_196267_3_);
}
@@ -0,0 +1,26 @@
--- a/net/minecraft/block/BlockState.java
+++ b/net/minecraft/block/BlockState.java
@@ -51,7 +51,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public class BlockState extends StateHolder<Block, BlockState> implements IStateHolder<BlockState> {
+public class BlockState extends StateHolder<Block, BlockState> implements IStateHolder<BlockState>, net.minecraftforge.common.extensions.IForgeBlockState {
@Nullable
private BlockState.Cache field_215707_c;
private final int field_215708_d;
@@ -106,10 +106,14 @@
return this.field_215708_d;
}
+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */
+ @Deprecated
public boolean func_196958_f() {
return this.func_177230_c().func_196261_e(this);
}
+ /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation) */
+ @Deprecated
public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) {
return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_);
}
@@ -1,55 +0,0 @@
--- a/net/minecraft/block/BlockStem.java
+++ b/net/minecraft/block/BlockStem.java
@@ -39,22 +39,24 @@
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
if (p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
float f = BlockCrops.func_180672_a(this, p_196267_2_, p_196267_3_);
- if (p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0) {
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) {
int i = p_196267_1_.func_177229_b(field_176484_a);
if (i < 7) {
- p_196267_1_ = p_196267_1_.func_206870_a(field_176484_a, Integer.valueOf(i + 1));
- p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2);
+ p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176484_a, i + 1), 2);
} else {
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_196267_4_);
BlockPos blockpos = p_196267_3_.func_177972_a(enumfacing);
- Block block = p_196267_2_.func_180495_p(blockpos.func_177977_b()).func_177230_c();
- if (p_196267_2_.func_180495_p(blockpos).func_196958_f() && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_196660_k || block == Blocks.field_196661_l || block == Blocks.field_196658_i)) {
+ IBlockState soil = p_196267_2_.func_180495_p(blockpos.func_177977_b());
+ Block block = soil.func_177230_c();
+ if (p_196267_2_.func_180495_p(blockpos).isAir(p_196267_2_, blockpos) && (soil.canSustainPlant(p_196267_2_, blockpos.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_196660_k || block == Blocks.field_196661_l || block == Blocks.field_196658_i)) {
p_196267_2_.func_175656_a(blockpos, this.field_149877_a.func_176223_P());
p_196267_2_.func_175656_a(p_196267_3_, this.field_149877_a.func_196523_e().func_176223_P().func_206870_a(BlockHorizontal.field_185512_D, enumfacing));
}
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
}
}
@@ -62,14 +64,18 @@
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
- if (!p_196255_2_.field_72995_K) {
+ }
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ {
Item item = this.func_176481_j();
if (item != null) {
- int i = p_196255_1_.func_177229_b(field_176484_a);
+ int i = state.func_177229_b(field_176484_a);
for(int j = 0; j < 3; ++j) {
- if (p_196255_2_.field_73012_v.nextInt(15) <= i) {
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(item));
+ if (world.field_73012_v.nextInt(15) <= i) {
+ drops.add(new ItemStack(item));
}
}
@@ -1,39 +0,0 @@
--- a/net/minecraft/block/BlockTallGrass.java
+++ b/net/minecraft/block/BlockTallGrass.java
@@ -15,7 +15,7 @@
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
-public class BlockTallGrass extends BlockBush implements IGrowable {
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable {
protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected BlockTallGrass(Block.Properties p_i48310_1_) {
@@ -27,7 +27,7 @@
}
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
- return p_199769_2_.field_73012_v.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a;
+ return Items.field_190931_a;
}
public int func_196251_a(IBlockState p_196251_1_, int p_196251_2_, World p_196251_3_, BlockPos p_196251_4_, Random p_196251_5_) {
@@ -64,4 +64,18 @@
public Block.EnumOffsetType func_176218_Q() {
return Block.EnumOffsetType.XYZ;
}
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(this));
+ }
+
+ @Override
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
+ if (world.field_73012_v.nextInt(8) != 0) return;
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(world.field_73012_v, fortune);
+ if (!seed.func_190926_b())
+ drops.add(seed);
+ }
}
@@ -1,13 +0,0 @@
--- a/net/minecraft/block/BlockTorch.java
+++ b/net/minecraft/block/BlockTorch.java
@@ -37,9 +37,7 @@
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
IBlockState iblockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
- Block block = iblockstate.func_177230_c();
- boolean flag = block instanceof BlockFence || block instanceof BlockStainedGlass || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_196723_eg || iblockstate.func_185896_q();
- return flag && block != Blocks.field_185775_db;
+ return iblockstate.canPlaceTorchOnTop(p_196260_2_, p_196260_3_);
}
@OnlyIn(Dist.CLIENT)
@@ -1,17 +0,0 @@
--- a/net/minecraft/block/BlockTrapDoor.java
+++ b/net/minecraft/block/BlockTrapDoor.java
@@ -186,4 +186,14 @@
return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
}
+
+ @Override
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
+ if (state.func_177229_b(field_176283_b)) {
+ IBlockState down = world.func_180495_p(pos.func_177977_b());
+ if (down.func_177230_c() == net.minecraft.init.Blocks.field_150468_ap)
+ return down.func_177229_b(BlockLadder.field_176382_a) == state.func_177229_b(field_185512_D);
+ }
+ return false;
+ }
}
@@ -1,36 +0,0 @@
--- a/net/minecraft/block/BlockVine.java
+++ b/net/minecraft/block/BlockVine.java
@@ -29,7 +29,7 @@
import net.minecraft.world.IWorldReaderBase;
import net.minecraft.world.World;
-public class BlockVine extends Block {
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable {
public static final BooleanProperty field_176277_a = BlockSixWay.field_196496_z;
public static final BooleanProperty field_176273_b = BlockSixWay.field_196488_a;
public static final BooleanProperty field_176278_M = BlockSixWay.field_196490_b;
@@ -171,7 +171,7 @@
p_196267_2_.func_175698_g(p_196267_3_);
}
- } else if (p_196267_2_.field_73012_v.nextInt(4) == 0) {
+ } else if (p_196267_2_.field_73012_v.nextInt(4) == 0 && p_196267_2_.func_205050_e(p_196267_3_, 4)) { // Forge: check area to prevent loading unloaded chunks
EnumFacing enumfacing = EnumFacing.func_176741_a(p_196267_4_);
BlockPos blockpos = p_196267_3_.func_177984_a();
if (enumfacing.func_176740_k().func_176722_c() && !p_196267_1_.func_177229_b(func_176267_a(enumfacing))) {
@@ -365,4 +365,15 @@
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
+ return true;
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
+ return java.util.Arrays.asList(new ItemStack(this));
+ }
}
@@ -1,44 +0,0 @@
--- a/net/minecraft/block/BlockWall.java
+++ b/net/minecraft/block/BlockWall.java
@@ -51,6 +51,18 @@
return !func_194143_e(block) && p_196421_2_ == BlockFaceShape.SOLID || flag;
}
+ @Override
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
+ return func_196421_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
+ }
+
+ private boolean canWallConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
+ BlockPos off = pos.func_177972_a(facing);
+ IBlockState other = world.func_180495_p(off);
+ return other.canBeConnectedTo(world, off, facing.func_176734_d()) || func_196421_a(other, other.func_193401_d(world, off, facing.func_176734_d()));
+ }
+
public static boolean func_194143_e(Block p_194143_0_) {
return Block.func_193382_c(p_194143_0_) || p_194143_0_ == Blocks.field_180401_cv || p_194143_0_ == Blocks.field_150440_ba || p_194143_0_ == Blocks.field_150423_aK || p_194143_0_ == Blocks.field_196625_cS || p_194143_0_ == Blocks.field_196628_cT || p_194143_0_ == Blocks.field_185778_de || p_194143_0_ == Blocks.field_150335_W;
}
@@ -59,18 +71,10 @@
IWorldReaderBase iworldreaderbase = p_196258_1_.func_195991_k();
BlockPos blockpos = p_196258_1_.func_195995_a();
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
- BlockPos blockpos1 = blockpos.func_177978_c();
- BlockPos blockpos2 = blockpos.func_177974_f();
- BlockPos blockpos3 = blockpos.func_177968_d();
- BlockPos blockpos4 = blockpos.func_177976_e();
- IBlockState iblockstate = iworldreaderbase.func_180495_p(blockpos1);
- IBlockState iblockstate1 = iworldreaderbase.func_180495_p(blockpos2);
- IBlockState iblockstate2 = iworldreaderbase.func_180495_p(blockpos3);
- IBlockState iblockstate3 = iworldreaderbase.func_180495_p(blockpos4);
- boolean flag = this.func_196421_a(iblockstate, iblockstate.func_193401_d(iworldreaderbase, blockpos1, EnumFacing.SOUTH));
- boolean flag1 = this.func_196421_a(iblockstate1, iblockstate1.func_193401_d(iworldreaderbase, blockpos2, EnumFacing.WEST));
- boolean flag2 = this.func_196421_a(iblockstate2, iblockstate2.func_193401_d(iworldreaderbase, blockpos3, EnumFacing.NORTH));
- boolean flag3 = this.func_196421_a(iblockstate3, iblockstate3.func_193401_d(iworldreaderbase, blockpos4, EnumFacing.EAST));
+ boolean flag = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.NORTH);
+ boolean flag1 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.EAST);
+ boolean flag2 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.SOUTH);
+ boolean flag3 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.WEST);
boolean flag4 = (!flag || flag1 || !flag2 || flag3) && (flag || !flag1 || flag2 || !flag3);
return this.func_176223_P().func_206870_a(field_176256_a, Boolean.valueOf(flag4 || !iworldreaderbase.func_175623_d(blockpos.func_177984_a()))).func_206870_a(field_196409_a, Boolean.valueOf(flag)).func_206870_a(field_196411_b, Boolean.valueOf(flag1)).func_206870_a(field_196413_c, Boolean.valueOf(flag2)).func_206870_a(field_196414_y, Boolean.valueOf(flag3)).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
}
Loaded 100 of 2374 files, more files were not shown because too many files have changed in this diff. Show more