Compare commits

..
114 Commits
Author SHA1 Message Date
ichttt 863ab2ca18 Fix CME when removing ticket managers (#5861) 2019-09-03 14:22:38 -07:00
Ben Staddon 45da4f6910 Add checks for tile entities in now-unloaded chunks (#5724) 2019-08-28 19:25:57 -07:00
Bartosz Skrzypczak c2630d2a79 Fix client sometimes generating biomes, causing incorrect biome generation on integrated server (#5720) 2019-08-28 19:25:11 -07:00
Ben Staddon 05f4f5ec77 Fix invalid placeholder entity attributes (MC-150405) (#5718) 2019-08-28 19:22:56 -07:00
Ben Staddon a5d0a86760 Allow conditional loading of advancements (#5255) 2019-08-28 19:02:29 -07:00
Derik 7b4a01703b Fix lightning not triggering EntityJoinWorldEvent (#5290) 2019-08-28 18:58:43 -07:00
Ben Staddon 3b99c80636 Improve performance of persistent chunk checks (#5706) 2019-08-28 18:21:38 -07:00
LexManos 20efd7150a Fix copy paste derp 2019-08-28 18:19:45 -07:00
LexManos c56377e4ee Remove test publish group. 2019-08-28 17:44:19 -07:00
LexManos 3e98e16f39 Fix windows installer directory. 2019-08-28 17:24:52 -07:00
LexManos d41cb552a1 Use official launch4j plugin to potentially fix build. 2019-08-28 17:08:36 -07:00
LexManos ae2cb06d2c Move to Jenkinsfile and new Jenkins server. 2019-08-28 16:06:54 -07:00
Gabriel Harris-Rouquette 9de9193062 Fix error prone state lookup during rail neighbor updates. (#6028) 2019-08-15 10:42:21 -07:00
Unnoen f8d32a8525 Don't cache OBJ and B3D models. Throw model loading errors immediately. (#5758) 2019-08-02 14:16:20 -07:00
Ben Staddon dac053415b Improve performance of smooth vertex lighting (#5763) 2019-08-02 14:14:41 -07:00
Joseph C. Sible 7a52116665 Fix SidedInvWrapper hashCode when side is null (#5787) 2019-08-02 14:12:52 -07:00
Ben Staddon 9ba67cedf1 Fix concurrent modification when loading chunk tickets (#5876) 2019-08-02 13:43:12 -07:00
Cloudhunter 5aac0beba9 Fix link applying to whole component in chat if component starts with link (#5910) 2019-08-02 13:41:18 -07:00
Ben Staddon 7849aebab0 Protect against concurrent modification in World#setTileEntity (#5752) 2019-08-02 13:39:05 -07:00
Ben Staddon ea26df0174 Fix more potentially unclosed resources (#5760) 2019-08-02 13:33:43 -07:00
Ben Staddon 3a62514e60 Fix various unclosed I/O resources (#5766) 2019-08-02 13:32:08 -07:00
Ben Staddon 9a636e3c76 Fix vanilla handling of options file (MC-117449, MC-151173) (#5725) 2019-05-13 10:01:08 -07:00
clienthax fa35f30e86 Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712) 2019-05-08 17:46:04 -07:00
tterrag 633fd9bd2e Revert "Invalidate tile entities that are queued for removal (#5512)"
This reverts commit 75788f63ee.

This solution is invalid as TEs are free to modify the world tileEntities
list, usually indirectly via chunkloading, from inside invalidate().

This happens in vanilla, in TileEntityChest#invalidate, where it calls
checkForAdjacentChests(), which has the potential to load neighboring
chunks and cause a CME.

A more sophisticated solution is needed.
2019-04-13 09:54:03 -04:00
Ben Staddon 3c426a2e66 Fix some vertex format changes not being handled correctly (#5368) 2019-04-11 16:05:19 -04:00
Ben Staddon 25375f63cc Transform vertex normals as well as positions when generating quads (#5242) 2019-04-11 12:59:16 -04:00
Robert WC Seifert 45cadab7c5 Fix for SidedInvWrapper isItemValid using wrong slot (#5642) 2019-04-11 11:29:14 -04:00
Ben Staddon 75788f63ee Invalidate tile entities that are queued for removal (#5512) 2019-04-11 11:03:36 -04:00
lclc98 3e7b8809b6 Added Wool to OreDictionary (#5414) 2019-04-11 11:01:40 -04:00
CreativeMD 6162f438f1 Fixed boat not taking care of block-liquid hooks (#5086) 2019-04-11 10:18:26 -04:00
Ben Staddon 1752e57ea0 Add Forge dimension-changing hooks to spectator handling code (#5212) 2019-04-11 10:05:19 -04:00
ichttt e91ef7f56b Minor performace improvement when building chunks and rendering blocks (#5286) 2019-04-11 10:03:01 -04:00
Ben Staddon 24f7be2f37 Catch json parsing errors from constants/factories files (#5258) 2019-04-11 08:52:23 -04:00
Ben Staddon 208ed997d4 Allow custom DataSerializers to be registered safely (#5245) 2019-04-11 08:33:12 -04:00
cpw 1f12642a05 Try and make 1.13 mods more obviously wrong in 1.12..
Signed-off-by: cpw <[email protected]>
2019-04-06 13:54:54 -04:00
tterrag e7beed4875 Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace 2019-03-28 00:33:59 -04:00
Pokechu22 69a44e6414 Fail fast when null is used with setTag instead of crashing in writeEntry (#5257) 2019-03-22 12:53:07 -04:00
tterrag 3870951a37 Fix block placement not checking for player collision 2019-03-20 23:18:26 -04:00
Wyn Price af4fcd73a4 Added more Constants (#5323) 2019-03-15 15:38:52 -04:00
Thanh-Phuong 04a6b6c2d0 [1.12.2] Add a few events pertaining to villages (#5302) 2019-03-12 01:01:35 -04:00
Tyler Hancock 1b15c127a6 [1.12] Fix special spawn event not firing in many cases. (#5389) 2019-03-12 00:44:08 -04:00
Ben Staddon 8670abca57 Only prompt for missing registries on local worlds (#5348) 2019-03-12 00:34:29 -04:00
Christopher Krier f3d364397d Add EntityPlaceEvent (#5057) 2019-03-12 00:22:47 -04:00
Ben Staddon cc95c40b5b Generalise EnumRarity to an interface (#5182) 2019-03-12 00:02:57 -04:00
Ben Staddon e6fbf39591 Apply access-level changes to inner class attributes (#5468) 2019-02-14 22:46:35 -08:00
Ben Staddon 8cbac6af97 Fix small logic error in ItemTextureQuadConverter (#5463) 2019-02-13 17:03:37 -05:00
Ben Staddon 87cbf735a2 Better support for custom bows (#5209) 2019-02-13 15:58:43 -05:00
Ben Staddon bcbf184915 Improve tracking of used dimension IDs (#5249)
Closes #5378 Large dimension IDs bloat level.data
2019-02-13 15:28:58 -05:00
Phylogeny 965d872856 Fixed incorrect string representation of string list config property default values in their comments. 2019-02-13 15:26:53 -05:00
CovertJaguar 41a098e2f7 Remove FluidStack amount from hashcode calculation (#5272) 2019-02-06 15:35:18 -08:00
Ben Staddon 41d07e7aae Fix up torch placement logic to handle more vanilla special-casing (#5426) 2019-02-04 11:48:08 -08:00
LexManos d1adf00158 Written size does not include int bytes. 2019-02-01 00:46:29 -08:00
LexManos ed67b6fd31 Extend Region files to support >1MB per chunk.
If the 'sector count' is 255, ask the compressed data header for the proper length.
2019-02-01 00:34:45 -08:00
tterrag1098 d5ff207fab Add default impl to IConfigElement#getValidValuesDisplay 2019-01-19 16:40:49 -05:00
tterrag da7c299f7e Simplify custom item rendering by removing GL emissivity hacks 2019-01-10 06:09:06 -05:00
tterrag 204ebdc6dd Support diffuse lighting flag in item rendering 2019-01-04 13:48:36 -05:00
Ben Staddon be565d2ddc Add a hook to allow continuously using items through stack changes (#4834)
* Add a hook to allow continuously using items through stack changes

* Update licences
2019-01-03 23:22:24 -05:00
oOMitchOo 21f7c31f62 Added an additional constructor to every implementation of IFluidBlock. It is now possible to create a fluid block with a Fluid, Material and MapColor, so that the Material's MapColor isn't used for the blocks MapColor. (#5293) 2019-01-03 23:10:56 -05:00
Ben Staddon 4e11c95d0e Add redirects to PotionEffect to respect registry replacement (#5213) 2019-01-03 23:02:11 -05:00
AlexiyOrlov d1478ca529 Add an annotation for @Config elements which will automatically create a slider control (#5026) 2019-01-03 22:07:24 -05:00
Ben Staddon 359d4fe2d5 Fix small logic error in emissive item rendering code (#5320) 2019-01-03 21:11:34 -05:00
Phylogeny d3f27cf6fb Allow config GUI cycling button elements generated from enums to display toString return values, rather than actual values. (#5125) 2019-01-03 21:08:05 -05:00
Ben Staddon 3dd8c8ae6f Fix incorrect indexing in mipmap generation code (#5201) 2019-01-03 21:00:39 -05:00
Ben Staddon 54882f2564 Ensure slave maps are cleaned up when handling registry overrides (#5250) 2019-01-03 20:36:32 -05:00
Daniel Scalzi c5402d50fa Fix issue with --modListFile. (#5316) 2019-01-02 17:28:04 -08:00
LexManos a5f29570a3 Fix potential issues with the Minecraft FakePlayer lingering around after world unloads. 2018-12-07 22:03:32 -08:00
tterrag dd27209565 Fix potion remove event not always firing, add expiry event 2018-12-02 13:20:02 -05:00
tterrag f1d1e8853b Clean up CraftingHelper constants loading API 2018-12-02 03:05:53 -05:00
tterrag 5ef199f6d7 Fix crash from CraftingHelper due to FileSystem being closed early 2018-12-01 23:33:22 -05:00
mcenderdragon 2a5268c699 added PotionHooks, closes #3867, #4375 (#4614)
* solved merge confilct

* improved var names & removed tabs

* Added spaces around !=

* fixed typo
2018-12-01 20:13:13 -05:00
ichttt 32c24be6b4 Add a hook for farmland watering (#4891)
* Add a FarmlandWaterCheckEvent to allow mods to override when Farmland is watered or not

* revert 1.12.2 json

* Move the farmland patch to a ticket based instead of a event based system

* Minor changes

* Faster isValid checks, faster validation/invalidation if the state did not change, expand test mod to include a test for the validation system

* remove isValid boolean flag, we can express it with the tick counter

* Fix test mod resource warnings

* Remove tick timeout, add a javadoc note to invalidate on chunk unload, cleaned up test mod

* Allow mods to provide custom handling to determine if a pos is valid or not

* Make SimpleTicket more simple, make register public so custom tickets can be registered

* Fixes for review

* Add missing license headers

* Use a weak hash set

* Split up the map into smaller chunk based maps

* Add missing license headers

* Make MultiTicketManager more universal for custom implementations, cleanup imports
2018-12-01 20:08:04 -05:00
temp1011 5f56b7cd09 Add methods to allow loading json constants outside of _constants (#4975)
* add interface methods for loading json constants from an arbitary file

* use try-with-resources

* don't make modders create jsoncontext, clean up resource use

* very minor cleanup
2018-12-01 19:46:19 -05:00
ichttt 7f337cf230 Compute ASMDataTable submaps parallel, speeds up contructing mods (#5246)
* Compute submaps parallel, speeds up contructing mods by a lot

* Use stream API better
2018-12-01 19:38:46 -05:00
ichttt 7731e1cd75 Add logging for data manager key registration errors (#5129) 2018-12-01 16:28:02 -08:00
Ben Staddon f8879b1316 Improve support for custom block path types (#5203) 2018-12-01 16:27:20 -08:00
Luke Gilfoyle 3dfe47944d Fix missing comments in configs created with annotations (#5189) 2018-12-01 16:14:48 -08:00
Ben Staddon c11a712e2f Allow items to control the rate of repair from mending (#5102) 2018-12-01 16:08:15 -08:00
Ben Staddon 5771c8ffea Improve exception handling from server starting events (#5226) 2018-11-23 18:08:24 -08:00
Ben Staddon 9587f08ece Improve context provided by potion icon rendering hooks (#5111) 2018-11-23 16:36:29 -08:00
MrRiegel 73b6d10e5a Fix an ObjectHolderRef internal error message (#5214) 2018-11-23 16:03:44 -08:00
tterrag 90c244acb4 Implement rendering for item models with emissive quads (#5047) 2018-11-23 15:57:00 -08:00
Ben Staddon 3cf97f43fe Fix minor issue in getFilledPercentage for Fluid rendering (#5206) 2018-11-23 15:44:35 -08:00
Ben Staddon 0b47ccc015 Clean up logged mod states (#5227) 2018-11-23 15:42:11 -08:00
Paul Fulham 8d372f95f2 Fix inaccurate main thread name shown in client log (#5078) 2018-11-23 15:40:46 -08:00
Ben Staddon d16472d0ba Improve reflection helper methods (#4853) 2018-11-23 15:37:53 -08:00
Ben Staddon 896db6398f Fix Baked Item models with transformations (#5241) 2018-11-23 15:28:30 -08:00
Ben Staddon e406137b19 Prevent RecipeBook from crashing on empty modded ingredients (#5234) 2018-11-23 15:24:18 -08:00
Vincent Lee 16f4903285 Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) 2018-11-23 15:22:08 -08:00
Ben Staddon 84d322da34 Fix missing string parameters in some log messages (#5210) 2018-11-23 15:20:30 -08:00
Ben Staddon 3a64cb8985 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
2018-11-23 15:19:44 -08:00
TheIllusiveC4 2fef75c1de Fix the bed position given to the SleepingTimeCheck event (#5107) 2018-11-23 15:15:33 -08:00
Ben Staddon c040a8865f Fix some null returns from defaulted registries (#5235) 2018-11-15 13:52:45 -08:00
Yanbing Zhao 4931fc1907 Only remove synthetic lambda methods referenced in body of SideOnly methods (#5127) 2018-11-14 21:39:30 -08:00
LexManos 607da1bd9b Use HTTPS for files website. 2018-11-13 16:16:33 -08:00
Ben Staddon ebc4eaddac Fix patches from #5160 setting rotation as well as position (#5233) 2018-11-12 12:50:00 -08:00
LexManos 10dbbf9c19 A different approach to my changes in https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e to fix #5207 2018-11-12 12:47:27 -08:00
Ben Staddon f9c2f715fd Allow IModel to express itself as a vanilla parent (#5195)
* Fix errors caused by fancy missing model being non-vanilla parent

* Switch instanceof checks to a default IModel method

* Small code tweaks
2018-10-18 19:22:32 -04:00
gaudus 4e1f7138ee fixed visual bug with guislider 2018-10-18 19:21:42 -04:00
Ben Staddon 5ae5d81609 Make Forge blockstate variants correctly inherit AO setting from vanilla models (#5190)
* Make Forge blockstate variants correctly inherit AO setting

* Move variant format checks into variant, check for added properties

* Small code cleanup
2018-10-18 19:21:26 -04:00
Ben Staddon 947a004138 Make Forge-provided default transforms accessible to custom models 2018-10-18 19:21:02 -04:00
InsomniaKitten e4ca526d5b Add CreativeTabs#getLabelColor 2018-10-18 19:20:40 -04:00
XCompWiz 1ba084f131 Allow providing a BufferedImage for banner render generation (#5041)
* Adds an Event to allow providing a BufferedImage for the banner render generation (cached)
This allows mods to provide generated banner textures, since banners don't use an atlas.
Includes reference/test implementation.

* Missed some copyright; might as well absolut text match, I guess

* Remove unneeded patch change

* Fix event variable access convention

* Formatting fix

* Improve event handling registration

* Import cleanup

* Replace event approach with Supplier approach

* Better name for test mod (now that it's no longer an event); adds ENABLE flag

* Moves MC code into net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify patch

* Generalize naming
2018-10-11 19:25:25 -04:00
Tim 857573f10f Fix Mesa biome entry tags in the BiomeDictionary (#5177) 2018-10-07 12:37:23 -07:00
LexManos 76c138c400 Bump version number for RB. 2018-10-04 00:34:49 -07:00
Ben Staddon 55a7c6d64b Add a notification event for handling game rule changes (#5152) 2018-10-04 00:27:17 -07:00
Ben Staddon 0fb8844623 Patch PotionHelper to use registry delegates (#5142) 2018-10-04 00:25:58 -07:00
Ben Staddon 6337466735 Prevent some texture loading errors from crashing the game (#5121) 2018-10-04 00:24:51 -07:00
Ben Staddon 214275baba Change biome spawn list entries to use factory method where possible (#5075) 2018-10-04 00:24:01 -07:00
Ben Staddon 82262e462e Change universal bucket support to use fluid names instead of instances (#5031) 2018-10-04 00:20:44 -07:00
tterrag ee0d43bbde Fix NPE on clientside entities constructed with null world (#5170) 2018-09-28 12:32:19 -07:00
tterrag 93b704b459 Fix patches from #5160 running on the client and causing stutter 2018-09-27 21:42:06 -04:00
gegy1000 10036aa764 Class transformer optimizations (#5159)
* Filter packages for deobf transformation
* Only serialize transformed class with TerminalTransformer if bytecode changed
2018-09-27 14:27:21 -07:00
mezz fcd00bd4af Update github stale so issues can be Assigned 2018-09-26 21:22:54 -07:00
Gabriel Harris-Rouquette c20a5e8805 Fix MC-136995 - Chunk loading and unloading issue with entities placed in exact positions. (#5160)
Scatter gun patches to improve entity tracking and position tracking. 
Provided by Aikar through the Paper project, this commit of patches combines the following patches:

https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch
2018-09-26 11:08:30 -07:00
2622 changed files with 106909 additions and 77764 deletions

No files matched your search

-1
View File
@@ -13,4 +13,3 @@
*.pyd binary
*.cfg text eol=lf
*.py text eol=lf
*.jks binary
+4
View File
@@ -0,0 +1,4 @@
<!-- 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
@@ -1,13 +0,0 @@
---
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
@@ -1,26 +0,0 @@
---
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:**
+6 -18
View File
@@ -1,8 +1,7 @@
#eclipse
**/bin
**/.settings
**/.classpath
*.project
/bin
/.settings
/.classpath
#In case people make their workspace in the repo
/eclipse/
@@ -15,20 +14,11 @@
#gradle
/build
/.gradle
/mdk/.gradle
/mdk/build
#occupational hazards
/projects/mcp/
/projects/clean/
/projects/forge/
/projects/**/build/
/projects/**/out/
/projects/**/run/
/projects/**/*.launch
/projects/
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
/patches-/
@@ -36,9 +26,7 @@ src/generated/resources/.cache/
# FML changelog
changelog.txt
/patches_old/
/patches_old_bak/
*.py
*.7z
/logs/
gradle.properties
!/mdk/gradle.properties
-8
View File
@@ -28,11 +28,3 @@ script:
notifications:
email: false
# skip building travis on 1.13+ - it doesn't work there
branches:
except:
- 1.13-pre
- 1.13.x
- 1.14.x
- /^noci-.*$/
File renamed without changes.
+1 -1
View File
@@ -10,7 +10,7 @@ alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptian
of me taking over the project, who knows what Minecraft modding would be today.
Secondly, someone who has worked with me, and developed some of the core features
that allow modding to be as functional, and as simple as it is, cpw. For developing
that allow modding to he as functional, and as simple as it is, cpw. For developing
FML, which stabelized the client and server modding ecosystem. As well as the base
loading system that allows us to modify Minecraft's code as elegently as possible.
File renamed without changes.
Vendored
+10 -8
View File
@@ -39,11 +39,13 @@ pipeline {
)
}
}
stage('setup') {
stage('ciWriteBuildNumber') {
steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue ciWriteBuildNumber'
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
env.MYGROUP = sh(returnStdout: true, script: './gradlew properties -q | grep "group:" | awk \'{print $2}\'').trim()
env.MYARTIFACT = sh(returnStdout: true, script: './gradlew properties -q | grep "name:" | awk \'{print $2}\'').trim()
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
}
@@ -54,7 +56,7 @@ pipeline {
}
}
steps {
writeChangelog(currentBuild, 'build/changelog.txt')
writeChangelog(currentBuild, 'build/changelog_new.txt')
}
}
stage('publish') {
@@ -71,8 +73,8 @@ pipeline {
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
sh './gradlew ${GRADLE_ARGS} uploadArchives -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/${MYGROUP}.${MYARTIFACT}/${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
@@ -83,14 +85,14 @@ pipeline {
CROWDIN = credentials('forge-crowdin')
}
steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
sh './gradlew ${GRADLE_ARGS} uploadArchives -PcrowdinKey=${CROWDIN}'
}
}
}
post {
always {
script {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
//archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
+10
View File
@@ -0,0 +1,10 @@
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,40 @@
SoundSystem CodecIBXM Class License:
You are free to use this class for any purpose, commercial or otherwise.
You may modify this class or source code, and distribute it any way you
like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any
unmodified portion of it.
2) You may not copyright this class or a modified version of it and then
sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes
made before redistributing the modified source code, so other users know
it is not the original code.
4) You are not required to give me credit for this class in any derived
work, but if you do, you must also mention my website:
http://www.paulscode.com
5) I the author will not be responsible for any damages (physical,
financial, or otherwise) caused by the use if this class or any
portion of it.
6) I the author do not guarantee, warrant, or make any representations,
either expressed or implied, regarding the use of this class or any
portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the IBXM library available from
http://www.geocities.com/sunet2000/
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1 -1
View File
@@ -1,5 +1,5 @@
Minecraft Forge
Copyright (c) 2016-2019.
Copyright (c) 2016-2018.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
+8 -2
View File
@@ -3,8 +3,8 @@ parts herein are licensed under the terms of the LGPL 2.1 found
here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and
copied below.
Homepage: http://minecraftforge.net/
https://github.com/MinecraftForge/MinecraftForge
Homepage: http://MinecraftForge.net/
http://github.com/MinecraftForge/MinecraftForge
A note on authorship:
@@ -57,6 +57,12 @@ This software contains a partial repackaging of javaxdelta, a BSD licensed progr
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
authored by genman, heikok, pivot.
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
This software contains potions of Paulscodee IBXM library, a BSD liceensed library for
loading and playing IBXM formated auto. No modifications havee beeen made. The associated
licenses can be found along side this one, or at
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20IBXM%20Library.txt
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20SoundSystem%20CodecIBXM.txt
=========================================================================
+37
View File
@@ -0,0 +1,37 @@
# 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.
View File
File renamed without changes.
+422 -1254
View File
File diff suppressed because it is too large. Load diff
-127
View File
@@ -1,127 +0,0 @@
# FML
Entrypoint : ```FMLServiceProvider.onLoad```
- Verify environment
-- Check all libraries are present: ```accesstransformer```, ```coremod```, ```deobfuscator```
-- Check versions are suitable: ```modlauncher```, ```accesstransformer```, ```coremod```, ```deobfuscator```
- Find deobfuscated and patched MC
-- If not found, trigger job to generate that (loaded later at FMLLaunchProvider.launch)
Injected arguments:
- ```mods``` : CSV list of mod files to load
- ```modlist``` : JSON formatted list of mod files in a maven-like repository format
Entrypoint : ```FMLServiceProvider.initializer```
- Setup paths
-- ```mods``` folder
-- ```config``` folder
- FML config file read (JSON?)
- Trigger initial loading
Entrypoint : ```FMLLaunchProvider.launch```
- Launches the patched and deobfuscated game
- - If that wasn't found it'll be generated from the vanilla jar and patch/deobf files (see above)
- Possible we'll use an alternative launch for the development environment
(A goal is that we pre-generate this JAR during forge installation or modpack installation)
## Loading
- First we discover all mods
- - IModLocator instances present in system are found and queried to compile a master list of all mod artifacts of the three types
- LANGPROVIDERs are added to the supported language system : IModLanguageProvider
- The MODS from the list have their META-INF/mods.json file queried for mod instances to load
- - MODS are cross-referenced for their language being available
- - MODS are cross-referenced for their libraries being available
- - MODS are cross-referenced for their MOD dependencies being available
- - MODS with META-INF/coremods.json specification are loaded into the COREMOD system
- - MODS with META-INF/accesstransformer.json are loaded into the ACCESSTRANSFORMER system
- - MODS are enqueued to the background loading system
- FMLLaunchProvider will be triggered from the ModLauncher to start the game
## Game loading
- Events triggered from loadGame will launch various phases of modloading as before
-- Deprecation of old "FML" events in favour of Forge events
-- If a mod hasn't completed scanning there might be a pause waiting for it to complete before loading (testing indicates this should be a very rare occurrence and isn't worse than existing status quo where all scanning and loading is on-thread)
### ```IModLocator```
Finds mods from various sources of various types
manifest is queried for type: FMLModType
- MOD : this file will be scanned as a mod. This is default if nothing is present
- LIBRARY : this file will be added to the classpath and no further processing is done
- LANGPROVIDER : this file will be loaded as a language provider
#### ```ModsFolderLocator```
- scans for jar files from mods folder
-- able to load all types
-- loads in all environments
-- maybe able to do runtime name transformation for dev time?
Standard mechanism to find and load mods
#### ```ExplodedDirectoryLocator```
- loads a directory as a mod
-- only able to load mods
-- should only load in dev env
Intended as a mechanism to allow development of mods easily by pointing at a compiled output directory
#### ```ArgumentModsLocator``` : NYI
- loads mods from the arguments on the command line
-- able to load all types
-- loads in all environments
### ```IModLanguageProvider```
Provides mod and language provider services
- Provides a means to transform a Mod File (from the IModLocator) into a list of modcontainer objects based on mods.json
- Scanning work will be done in background threads
- Language providers can be provided as JARs via the modlocator for ease of distribution
#### ```FMLModLanguageProvider```
This is the standard Java @Mod implementation provider
- provided by default (always supported)
- All scanning for @Mod will be done in the background thread
#### ```ScalaModLanguageProvider```
This is the scala language provider. It'll be provided separately as a JAR mod download.
- API contract will need definition
Other languages? Kotlin? Alternative Scala versions? Javascript?
## Coremods
Coremods are now forcefully separated into _injection_ and _runtime_ phases.
### Injection
Injection is the act of intercepting the loading of a class and modifying the inbound class with alterations such as additions, replacements and deletions
Injections will be written using Javascript. Two functions are required: a function providing the list of injection sites, and the function to transform the injection site.
All injection sites will need to be pre-specified by the coremod in their metadata. Lookup services should be provided in the Javascript API.
Javascript API for common coremod injection tasks needs to be developed, to allow common best-practice tooling for these complex tasks.
Runtime coremod code (code that has been injected) is Java as usual.
## Background loading thread
Early in loading, a background thread is triggered which will perform scanning tasks for common resources, such as @Mod instances and other annotations. This thread will also be responsible for loading any cached resources, either those defined at build time or pre-computed from previous runs. It may also be tasked with writing those precomputed resources.
There will be a IPreLoaderJobProvider that will allow extension of the scope of these tasks
-68
View File
@@ -1,68 +0,0 @@
<img src="assets/Forge_logo.svg">
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.14.4-&query=$.promos["1.14.4-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.14.4-&query=$.promos["1.14.4-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos) [![Merch](https://img.shields.io/badge/Flocker-Merch-blueviolet.svg)](https://forgedev.flocker.tv/)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.14.x | Active |
| 1.12.x | Legacy |
* [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
-12
View File
@@ -1,12 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.
+2 -1
View File
@@ -1,5 +1,6 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
Vendored
+51 -59
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
##############################################################################
##
@@ -6,6 +6,47 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -20,49 +61,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -89,7 +90,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -113,7 +114,6 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,19 +154,11 @@ if $cygwin ; then
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
APP_ARGS=$(save "$@")
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Vendored
+10 -4
View File
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,9 +46,10 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -59,6 +60,11 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
+430
View File
@@ -0,0 +1,430 @@
Build 2838:
bs2609: Fix vanilla handling of options file (MC-117449, MC-151173) (#5725)
Build 2837:
clienthax: Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712)
Build 2836:
tterrag:
Revert "Invalidate tile entities that are queued for removal (#5512)"
This reverts commit 75788f63eea6c33ccef7e5cbcab27ad9ad2c2a04.
This solution is invalid as TEs are free to modify the world
tileEntities list, usually indirectly via chunkloading, from inside
invalidate().
This happens in vanilla, in TileEntityChest#invalidate, where it calls
checkForAdjacentChests(), which has the potential to load neighboring
chunks and cause a CME.
A more sophisticated solution is needed.
Build 2835:
bs2609: Fix some vertex format changes not being handled correctly (#5368)
Build 2834:
bs2609:
Transform vertex normals as well as positions when generating quads
(#5242)
Build 2833:
rseifert.phone: Fix for SidedInvWrapper isItemValid using wrong slot (#5642)
Build 2832:
bs2609: Invalidate tile entities that are queued for removal (#5512)
Build 2831:
lclc98: Added Wool to OreDictionary (#5414)
Build 2830:
CreativeMD: Fixed boat not taking care of block-liquid hooks (#5086)
Build 2829:
bs2609: Add Forge dimension-changing hooks to spectator handling code (#5212)
Build 2828:
ichttt:
Minor performace improvement when building chunks and rendering blocks
(#5286)
Build 2827:
bs2609: Catch json parsing errors from constants/factories files (#5258)
Build 2826:
bs2609: Allow custom DataSerializers to be registered safely (#5245)
Build 2825:
cpw:
Try and make 1.13 mods more obviously wrong in 1.12..
Signed-off-by: cpw <[email protected]>
Build 2824:
tterrag: Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace
Build 2823:
Pokechu022:
Fail fast when null is used with setTag instead of crashing in
writeEntry (#5257)
Build 2822:
tterrag: Fix block placement not checking for player collision
Build 2821:
wynprice999: Added more Constants (#5323)
Build 2820:
python0429: [1.12.2] Add a few events pertaining to villages (#5302)
Build 2819:
Tyler Hancock: [1.12] Fix special spawn event not firing in many cases. (#5389)
Build 2818:
bs2609: Only prompt for missing registries on local worlds (#5348)
Build 2817:
ckrier.3000: Add EntityPlaceEvent (#5057)
Build 2816:
bs2609: Generalise EnumRarity to an interface (#5182)
Build 2815:
bs2609: Apply access-level changes to inner class attributes (#5468)
Build 2814:
bs2609: Fix small logic error in ItemTextureQuadConverter (#5463)
Build 2813:
bs2609: Better support for custom bows (#5209)
Build 2812:
CovertJaguar: Remove FluidStack amount from hashcode calculation (#5272)
molecularphylo:
Fixed incorrect string representation of string list config property
default values in their comments.
bs2609:
Improve tracking of used dimension IDs (#5249)
Closes #5378 Large dimension IDs bloat level.data
Build 2811:
bs2609:
Fix up torch placement logic to handle more vanilla special-casing
(#5426)
Build 2810:
LexManos: Written size does not include int bytes.
Build 2809:
LexManos:
Extend Region files to support >1MB per chunk. If the 'sector count' is
255, ask the compressed data header for the proper length.
Build 2808:
tterrag1098: Add default impl to IConfigElement#getValidValuesDisplay
Build 2807:
tterrag: Simplify custom item rendering by removing GL emissivity hacks
Build 2806:
tterrag: Support diffuse lighting flag in item rendering
Build 2805:
bs2609:
Add a hook to allow continuously using items through stack changes
(#4834)
* Add a hook to allow continuously using items through stack changes
* Update licences
Build 2804:
oOMitchOo:
Added an additional constructor to every implementation of IFluidBlock.
It is now possible to create a fluid block with a Fluid, Material and
MapColor, so that the Material's MapColor isn't used for the blocks
MapColor. (#5293)
Build 2803:
bs2609: Add redirects to PotionEffect to respect registry replacement (#5213)
Build 2802:
alexiy.ov:
Add an annotation for @Config elements which will automatically create a
slider control (#5026)
Build 2801:
bs2609: Fix small logic error in emissive item rendering code (#5320)
Build 2800:
molecularphylo:
Allow config GUI cycling button elements generated from enums to display
toString return values, rather than actual values. (#5125)
Build 2799:
bs2609: Fix incorrect indexing in mipmap generation code (#5201)
Build 2798:
bs2609:
Ensure slave maps are cleaned up when handling registry overrides
(#5250)
Build 2797:
d_scalzi: Fix issue with --modListFile. (#5316)
Build 2796:
LexManos:
Fix potential issues with the Minecraft FakePlayer lingering around
after world unloads.
Build 2795:
tterrag: Fix potion remove event not always firing, add expiry event
Build 2794:
tterrag: Clean up CraftingHelper constants loading API
Build 2793:
tterrag: Fix crash from CraftingHelper due to FileSystem being closed early
Build 2792:
tterrag:
added PotionHooks, closes #3867, #4375 (#4614)
* solved merge confilct
* improved var names & removed tabs
* Added spaces around !=
* fixed typo
Build 2791:
tterrag:
Add a hook for farmland watering (#4891)
* Add a FarmlandWaterCheckEvent to allow mods to override when Farmland
is watered or not
* revert 1.12.2 json
* Move the farmland patch to a ticket based instead of a event based
system
* Minor changes
* Faster isValid checks, faster validation/invalidation if the state did
not change, expand test mod to include a test for the validation system
* remove isValid boolean flag, we can express it with the tick counter
* Fix test mod resource warnings
* Remove tick timeout, add a javadoc note to invalidate on chunk unload,
cleaned up test mod
* Allow mods to provide custom handling to determine if a pos is valid
or not
* Make SimpleTicket more simple, make register public so custom tickets
can be registered
* Fixes for review
* Add missing license headers
* Use a weak hash set
* Split up the map into smaller chunk based maps
* Add missing license headers
* Make MultiTicketManager more universal for custom implementations,
cleanup imports
Build 2790:
tterrag:
Add methods to allow loading json constants outside of _constants
(#4975)
* add interface methods for loading json constants from an arbitary file
* use try-with-resources
* don't make modders create jsoncontext, clean up resource use
* very minor cleanup
Build 2789:
tterrag:
Compute ASMDataTable submaps parallel, speeds up contructing mods
(#5246)
* Compute submaps parallel, speeds up contructing mods by a lot
* Use stream API better
Build 2788:
mezz: Add logging for data manager key registration errors (#5129)
Build 2787:
mezz: Improve support for custom block path types (#5203)
Build 2786:
mezz: Fix missing comments in configs created with annotations (#5189)
Build 2785:
mezz: Allow items to control the rate of repair from mending (#5102)
Build 2784:
mezz: Improve exception handling from server starting events (#5226)
Build 2783:
mezz: Improve context provided by potion icon rendering hooks (#5111)
Build 2782:
mezz: Fix an ObjectHolderRef internal error message (#5214)
Build 2781:
mezz: Implement rendering for item models with emissive quads (#5047)
Build 2780:
mezz: Clean up logged mod states (#5227)
mezz: Fix minor issue in getFilledPercentage for Fluid rendering (#5206)
Build 2779:
mezz: Improve reflection helper methods (#4853)
mezz: Fix inaccurate main thread name shown in client log (#5078)
Build 2778:
mezz: Fix Baked Item models with transformations (#5241)
Build 2777:
mezz:
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
mezz: Fix missing string parameters in some log messages (#5210)
mezz: Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217)
mezz: Prevent RecipeBook from crashing on empty modded ingredients (#5234)
Build 2776:
mezz: Fix the bed position given to the SleepingTimeCheck event (#5107)
Build 2775:
LexManos: Fix some null returns from defaulted registries (#5235)
Build 2774:
LexManos:
Only remove synthetic lambda methods referenced in body of SideOnly
methods (#5127)
Build 2773:
LexManos:
A different approach to my changes in
https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e
to fix #5207
LexManos: Fix patches from #5160 setting rotation as well as position (#5233)
LexManos: Use HTTPS for files website.
Build 2772:
tterrag: Make Forge-provided default transforms accessible to custom models
tterrag:
Make Forge blockstate variants correctly inherit AO setting from vanilla
models (#5190)
* Make Forge blockstate variants correctly inherit AO setting
* Move variant format checks into variant, check for added properties
* Small code cleanup
tterrag: fixed visual bug with guislider
tterrag:
Allow IModel to express itself as a vanilla parent (#5195)
* Fix errors caused by fancy missing model being non-vanilla parent
* Switch instanceof checks to a default IModel method
* Small code tweaks
Build 2771:
tterrag: Add CreativeTabs#getLabelColor
Build 2770:
tterrag:
Allow providing a BufferedImage for banner render generation (#5041)
* Adds an Event to allow providing a BufferedImage for the banner render
generation (cached)
textures, since banners don't use an atlas.
implementation.
* Missed some copyright; might as well absolut text match, I guess
* Remove unneeded patch change
* Fix event variable access convention
* Formatting fix
* Improve event handling registration
* Import cleanup
* Replace event approach with Supplier approach
* Better name for test mod (now that it's no longer an event); adds
ENABLE flag
* Moves MC code into
net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify
patch
* Generalize naming
Build 2769:
mezz: Fix Mesa biome entry tags in the BiomeDictionary (#5177)
Build 2768:
LexManos: Bump version number for RB.
Build 2767:
LexManos:
Change biome spawn list entries to use factory method where possible
(#5075)
LexManos: Prevent some texture loading errors from crashing the game (#5121)
LexManos: Patch PotionHelper to use registry delegates (#5142)
LexManos: Add a notification event for handling game rule changes (#5152)
Build 2766:
LexManos:
Change universal bucket support to use fluid names instead of instances
(#5031)
Build 2765:
LexManos: Fix NPE on clientside entities constructed with null world (#5170)
Build 2764:
tterrag: Fix patches from #5160 running on the client and causing stutter
Build 2763:
LexManos:
Class transformer optimizations (#5159)
* Filter packages for deobf transformation
* Only serialize transformed class with TerminalTransformer if bytecode
changed
Build 2762:
github: Update github stale so issues can be Assigned
Build 2761:
LexManos:
Fix MC-136995 - Chunk loading and unloading issue with entities placed
in exact positions. (#5160)
Scatter gun patches to improve entity tracking and position tracking.
Provided by Aikar through the Paper project, this commit of patches
combines the following patches:
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch
Build 2760:
LexManos: Fix --mods and --modListFile arguments not making it past LaunchWrapper.
Build 2759:
LexManos: Remove BlamingTransformer (#5115)
+21 -12
View File
@@ -19,26 +19,35 @@ 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: 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.
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
If you prefer to use IntelliJ:
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.
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
4. Refresh the Gradle Project in IDEA if required.
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)
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.
or the Forge Project Discord discord.gg/UvedJ9m
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.
Forge source installation
=========================
+52 -124
View File
@@ -1,149 +1,77 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
maven { url = "https://files.minecraftforge.net/maven" }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
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.
version = "1.0"
group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
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.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
version = "@VERSION@"
runDir = "run"
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
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
}
}
}
}
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "@MAPPINGS@"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
// 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
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
// the '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'
// 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 deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// For more info...
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact reobfArtifact
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
@@ -0,0 +1,4 @@
#Sun Jun 05 18:58:07 CEST 2011
version=1
eclipse.preferences.version=1
refresh.enabled=true
@@ -0,0 +1,7 @@
#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,
@@ -0,0 +1,3 @@
#Sun Jun 05 18:58:07 CEST 2011
eclipse.preferences.version=1
org.eclipse.epp.usagedata.gathering.enabled=false
@@ -0,0 +1,14 @@
#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
@@ -0,0 +1,4 @@
#Sun Jun 05 18:58:05 CEST 2011
spacesForTabs=true
eclipse.preferences.version=1
overviewRuler_migration=migrated_3.1
@@ -0,0 +1,9 @@
#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
@@ -0,0 +1,3 @@
#Sun Jun 05 18:50:08 CEST 2011
eclipse.preferences.version=1
showIntro=false
@@ -0,0 +1,13 @@
<?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>
@@ -0,0 +1,13 @@
<?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>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchHistory>
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
<mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Client&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Server&quot;/&gt;&#13;&#10;"/>
</mruHistory>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
<mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Client&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Server&quot;/&gt;&#13;&#10;"/>
</mruHistory>
<favorites/>
</launchGroup>
</launchHistory>
-3
View File
@@ -20,6 +20,3 @@ build
# other
eclipse
run
# Files from Forge MDK
forge*changelog.txt
-1
View File
@@ -1,4 +1,3 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
@@ -1,84 +1,31 @@
package com.example.examplemod;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;
import java.util.stream.Collectors;
// The value here should match an entry in the META-INF/mods.toml file
@Mod("examplemod")
@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
public class ExampleMod
{
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
public static final String MODID = "examplemod";
public static final String NAME = "Example Mod";
public static final String VERSION = "1.0";
public ExampleMod() {
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
// Register the enqueueIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
// Register the processIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
private static Logger logger;
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
private void setup(final FMLCommonSetupEvent event)
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
// some preinit code
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
logger = event.getModLog();
}
private void doClientStuff(final FMLClientSetupEvent event) {
// do something that can only be done on the client
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
}
private void enqueueIMC(final InterModEnqueueEvent event)
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code to dispatch IMC to another mod
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
private void processIMC(final InterModProcessEvent event)
{
// some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.getMessageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(FMLServerStartingEvent event) {
// do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
// Event bus for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
LOGGER.info("HELLO from Register Block");
}
// some example code
logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
}
}
-56
View File
@@ -1,56 +0,0 @@
# This is an example mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[28,)" #mandatory (28 is current forge version)
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="examplemod" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${file.jarVersion}" #mandatory
# A display name for the mod
displayName="Example Mod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
This is a long form description of the mod. You can write whatever you want here
Have some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional
# the modid of the dependency
modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[28,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.14.4]"
ordering="NONE"
side="BOTH"
+16
View File
@@ -0,0 +1,16 @@
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
+2 -2
View File
@@ -1,7 +1,7 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 4,
"_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods."
"pack_format": 3,
"_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
}
}
-66
View File
@@ -1,66 +0,0 @@
# The name of the mod loader type to load
modLoader="javafml"
# A version range to match for said mod loader
loaderVersion="[2.0,)"
# A URL to query for updates
updateJSONURL="http://myurl.me/"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/"
# Extra mod loader property
randomScalaProperty="fishy"
# Arbitrary key-value property pairs available to mods
[properties]
key="value"
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]]
# The modid of the mod
modId="inventorysorter"
# The version number of the mod
version="1.1"
# A display name for the mod
displayName="Inventory Sorter"
# The description text for the mod (multi line!)
description='''
This is my mod, there may be
others, but this one is mine
'''
# Override the default resourcelocation namespace with this instead
# Currently not implemented
namespace="invsorter"
# A random extra property for a mod loader
randomExtraProperty="somevalue"
# Arbitrary key-value pairs
[modproperties.inventorysorter]
key="value"
# A list of dependencies
[[dependencies.inventorysorter]]
# the modid of the dependency
modid="forge"
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true
# The version range of the dependency
versionRange="[14.23.2.0,)"
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.inventorysorter]]
modid="minecraft"
mandatory=true
versionRange="[1.12.2]"
ordering="NONE"
side="BOTH"
# Here's another mod in this jar
[[mods]]
# Note that other mod types may want to add additional key-value pairs in here
modId="inventorysortertoo"
# ${file.jarVersion} will read the Implementation-Version of the jar file
version="${file.jarVersion}"
displayName="Inventory Sorter as well"
description='''
This is also my mod, there may be
others, but this one is mine
'''
@@ -1,24 +0,0 @@
--- a/com/mojang/blaze3d/platform/GLX.java
+++ b/com/mojang/blaze3d/platform/GLX.java
@@ -115,6 +115,10 @@
p_212906_0_.put(1286, "Operation on incomplete framebuffer");
});
+ /* Stores the last values sent into glMultiTexCoord2f */
+ public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f;
+
public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) {
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938));
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936));
@@ -913,6 +917,10 @@
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
}
+ if (p_glMultiTexCoord2f_0_ == GL_TEXTURE1) {
+ lastBrightnessX = p_glMultiTexCoord2f_1_;
+ lastBrightnessY = p_glMultiTexCoord2f_2_;
+ }
}
public static void glBlendFuncSeparate(int p_glBlendFuncSeparate_0_, int p_glBlendFuncSeparate_1_, int p_glBlendFuncSeparate_2_, int p_glBlendFuncSeparate_3_) {
@@ -1,15 +1,10 @@
--- 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());
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementManager.java
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementManager.java
@@ -66,6 +66,7 @@
field_192784_c.func_192087_a();
Map<ResourceLocation, Advancement.Builder> map = this.func_192781_c();
this.func_192777_a(map);
+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map);
field_192784_c.func_192083_a(map);
for (Advancement advancement : field_192784_c.func_192088_b())
@@ -1,11 +1,11 @@
--- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java
@@ -43,7 +43,7 @@
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementRewards.java
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementRewards.java
@@ -49,7 +49,7 @@
public void func_192113_a(final EntityPlayerMP p_192113_1_)
{
p_192113_1_.func_71023_q(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186471_a();
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // Forge: add player & luck to LootContext
boolean flag = false;
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
p_192113_1_.func_195068_e(this.field_192115_b);
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
boolean flag = false;
for(ResourceLocation resourcelocation : this.field_192116_c) {
for (ResourceLocation resourcelocation : this.field_192116_c)
@@ -0,0 +1,13 @@
--- ../src-base/minecraft/net/minecraft/advancements/DisplayInfo.java
+++ ../src-work/minecraft/net/minecraft/advancements/DisplayInfo.java
@@ -132,7 +132,9 @@
{
Item item = JsonUtils.func_188180_i(p_193221_0_, "item");
int i = JsonUtils.func_151208_a(p_193221_0_, "data", 0);
- return new ItemStack(item, 1, i);
+ ItemStack ret = new ItemStack(item, 1, i);
+ ret.func_77982_d(net.minecraftforge.common.util.JsonUtils.readNBT(p_193221_0_, "nbt"));
+ return ret;
}
}
@@ -1,19 +1,21 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -187,6 +187,8 @@
}
--- ../src-base/minecraft/net/minecraft/advancements/PlayerAdvancements.java
+++ ../src-work/minecraft/net/minecraft/advancements/PlayerAdvancements.java
@@ -196,6 +196,9 @@
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
+ // Forge: don't grant advancements for fake players
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -199,6 +201,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_)
{
+ // Forge: don't grant advancements for fake players
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
+
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -214,6 +217,8 @@
{
this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[] {this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()}));
}
+
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
}
}
@@ -0,0 +1,16 @@
--- ../src-base/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
+++ ../src-work/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
@@ -104,6 +104,13 @@
if (p_192492_0_ != null && !p_192492_0_.isJsonNull())
{
JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item");
+ if (jsonobject.has("type"))
+ {
+ final ResourceLocation rl = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "type"));
+ final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> map = net.minecraftforge.advancements.critereon.ItemPredicates.getPredicates();
+ if (map.containsKey(rl)) return map.get(rl).apply(jsonobject);
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
+ }
MinMaxBounds minmaxbounds = MinMaxBounds.func_192515_a(jsonobject.get("count"));
MinMaxBounds minmaxbounds1 = MinMaxBounds.func_192515_a(jsonobject.get("durability"));
Integer integer = jsonobject.has("data") ? JsonUtils.func_151203_m(jsonobject, "data") : null;
@@ -1,38 +0,0 @@
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
@@ -25,6 +25,8 @@
import net.minecraft.util.registry.Registry;
public class ItemPredicate {
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> custom_predicates = new java.util.HashMap<>();
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates);
public static final ItemPredicate field_192495_a = new ItemPredicate();
@Nullable
private final Tag<Item> field_200018_b;
@@ -93,6 +95,11 @@
public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) {
if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) {
JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item");
+ if (jsonobject.has("type")) {
+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type"));
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
+ }
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
if (jsonobject.has("data")) {
@@ -181,6 +188,14 @@
}
}
+ public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) {
+ custom_predicates.put(name, deserializer);
+ }
+
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
+ return unmod_predicates;
+ }
+
public static class Builder {
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
@Nullable
@@ -1,96 +0,0 @@
--- a/net/minecraft/block/AbstractRailBlock.java
+++ b/net/minecraft/block/AbstractRailBlock.java
@@ -35,7 +35,7 @@
}
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
- RailShape railshape = p_220053_1_.func_177230_c() == this ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
+ RailShape railshape = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
}
@@ -57,7 +57,7 @@
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (!p_220069_2_.field_72995_K) {
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
boolean flag = false;
BlockPos blockpos = p_220069_3_.func_177977_b();
if (!func_220064_c(p_220069_2_, blockpos)) {
@@ -115,7 +115,7 @@
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) {
+ if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) {
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
}
@@ -127,5 +127,66 @@
}
}
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
public abstract IProperty<RailShape> func_176560_l();
+
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Return true if the rail can make corners.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make corners.
+ */
+ public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
+ {
+ return !this.field_196277_c;
+ }
+
+ /**
+ * Returns true if the rail can make up and down slopes.
+ * Used by placement logic.
+ * @param world The world.
+ * @param pos Block's position in world
+ * @return True if the rail can make slopes.
+ */
+ public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
+ return true;
+ }
+
+ /**
+ * Return the rail's direction.
+ * Can be used to make the cart think the rail is a different shape,
+ * for example when making diamond junctions or switches.
+ * The cart parameter will often be null unless it it called from EntityMinecart.
+ *
+ * @param world The world.
+ * @param pos Block's position in world
+ * @param state The BlockState
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
+ * @return The direction.
+ */
+ public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @javax.annotation.Nullable net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
+ return state.func_177229_b(func_176560_l());
+ }
+
+ /**
+ * Returns the max speed of the rail at the specified position.
+ * @param world The world.
+ * @param cart The cart on the rail, may be null.
+ * @param pos Block's position in world
+ * @return The max speed of the current rail.
+ */
+ public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
+ return 0.4f;
+ }
+
+ /**
+ * This function is called by any minecart that passes over this rail.
+ * It is called once per update tick that the minecart is on the rail.
+ * @param world The world.
+ * @param cart The cart on the rail.
+ * @param pos Block's position in world
+ */
+ public void onMinecartPass(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) { }
}
@@ -1,13 +0,0 @@
--- a/net/minecraft/block/BedBlock.java
+++ b/net/minecraft/block/BedBlock.java
@@ -85,7 +85,9 @@
}
}
- if (p_220051_2_.field_73011_w.func_76567_e() && p_220051_2_.func_180494_b(p_220051_3_) != Biomes.field_76778_j) {
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_220051_2_.field_73011_w.canSleepAt(p_220051_4_, p_220051_3_);
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
if (p_220051_1_.func_177229_b(field_176471_b)) {
p_220051_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
return true;
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,43 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBanner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java
@@ -90,16 +90,9 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_);
-
- if (itemstack.func_190926_b())
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
- else
- {
- func_180635_a(p_180653_1_, p_180653_2_, itemstack);
- }
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -126,6 +119,23 @@
return BlockFaceShape.UNDEFINED;
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntity te = world.func_175625_s(pos);
+
+ if (te instanceof TileEntityBanner)
+ {
+ TileEntityBanner tileentitybanner = (TileEntityBanner)te;
+ ItemStack itemstack = tileentitybanner.func_190615_l();
+ drops.add(itemstack);
+ }
+ else
+ {
+ drops.add(new ItemStack(Items.field_179564_cE, 1, 0));
+ }
+ }
+
public static class BlockBannerHanging extends BlockBanner
{
protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D);
@@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBed.java
@@ -84,8 +84,10 @@
}
}
- if (p_180639_1_.field_73011_w.func_76567_e() && p_180639_1_.func_180494_b(p_180639_2_) != Biomes.field_76778_j)
+ net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = p_180639_1_.field_73011_w.canSleepAt(p_180639_4_, p_180639_2_);
+ if (sleepResult != net.minecraft.world.WorldProvider.WorldSleepResult.BED_EXPLODES)
{
+ if (sleepResult == net.minecraft.world.WorldProvider.WorldSleepResult.DENY) return true;
if (((Boolean)p_180639_3_.func_177229_b(field_176471_b)).booleanValue())
{
EntityPlayer entityplayer = this.func_176470_e(p_180639_1_, p_180639_2_);
@@ -0,0 +1,70 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
@@ -17,7 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockBush extends Block
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
{
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
@@ -40,7 +40,8 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()));
+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected boolean func_185514_i(IBlockState p_185514_1_)
@@ -70,6 +71,11 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_180671_3_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+ {
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
+ }
return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
}
@@ -94,6 +100,36 @@
return false;
}
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_185773_cZ) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
+ return net.minecraftforge.common.EnumPlantType.Plains;
+ }
+
+ @Override
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
+
@SideOnly(Side.CLIENT)
public BlockRenderLayer func_180664_k()
{
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -98,7 +98,7 @@
if (p_181088_2_ == EnumFacing.UP)
{
- return block == Blocks.field_150438_bZ || !func_193384_b(block) && flag;
+ return iblockstate.func_185896_q() || !func_193384_b(block) && flag;
}
else
{
@@ -0,0 +1,67 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -20,7 +20,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockCactus extends Block
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D);
@@ -36,6 +36,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update
BlockPos blockpos = p_180650_2_.func_177984_a();
if (p_180650_1_.func_175623_d(blockpos))
@@ -51,6 +52,8 @@
{
int j = ((Integer)p_180650_3_.func_177229_b(field_176587_a)).intValue();
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, true))
+ {
if (j == 15)
{
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
@@ -62,6 +65,8 @@
{
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176587_a, Integer.valueOf(j + 1)), 4);
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
+ }
}
}
}
@@ -112,8 +117,8 @@
}
}
- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
+ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b());
+ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
}
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
@@ -137,6 +142,18 @@
return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue();
}
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return net.minecraftforge.common.EnumPlantType.Desert;
+ }
+
+ @Override
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return func_176223_P();
+ }
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176587_a});
@@ -0,0 +1,31 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -470,7 +470,7 @@
if (block == this)
{
- if (this.func_176457_m(p_189418_1_, blockpos))
+ if (!p_189418_3_ && this.func_176457_m(p_189418_1_, blockpos)) // Forge: fix MC-99321
{
return null;
}
@@ -538,7 +538,7 @@
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
{
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l();
+ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).doesSideBlockChestOpening(p_176456_1_, p_176456_2_.func_177984_a(), EnumFacing.DOWN);
}
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
@@ -608,4 +608,10 @@
BASIC,
TRAP;
}
+
+ /* ======================================== FORGE START =====================================*/
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ return !func_176454_e(world, pos) && super.rotateBlock(world, pos, axis);
+ }
}
@@ -0,0 +1,19 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChorusFlower.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChorusFlower.java
@@ -55,7 +55,7 @@
{
int i = ((Integer)p_180650_3_.func_177229_b(field_185607_a)).intValue();
- if (i < 5 && p_180650_4_.nextInt(1) == 0)
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, p_180650_4_.nextInt(1) == 0))
{
boolean flag = false;
boolean flag1 = false;
@@ -144,6 +144,7 @@
{
this.func_185605_c(p_180650_1_, p_180650_2_);
}
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -0,0 +1,44 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -44,13 +44,14 @@
{
this.func_176500_f(p_180650_1_, p_180650_2_, p_180650_3_);
}
- else if (p_180650_1_.field_73012_v.nextInt(5) == 0)
+ else
{
int i = ((Integer)p_180650_3_.func_177229_b(field_176501_a)).intValue();
- if (i < 2)
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(5) == 0))
{
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176501_a, Integer.valueOf(i + 1)), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -132,7 +133,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- int i = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ int i = ((Integer)state.func_177229_b(field_176501_a)).intValue();
int j = 1;
if (i >= 2)
@@ -142,7 +150,7 @@
for (int k = 0; k < j; ++k)
{
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
+ drops.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
}
}
@@ -0,0 +1,81 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -70,6 +70,7 @@
{
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9)
{
int i = this.func_185527_x(p_180650_3_);
@@ -78,9 +79,10 @@
{
float f = func_180672_a(this, p_180650_1_, p_180650_2_);
- if (p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0)
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0))
{
p_180650_1_.func_180501_a(p_180650_2_, this.func_185528_e(i + 1), 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
}
}
}
@@ -116,11 +118,11 @@
float f1 = 0.0F;
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
+ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
{
f1 = 1.0F;
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j)))
{
f1 = 3.0F;
}
@@ -161,7 +163,8 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected Item func_149866_i()
@@ -174,11 +177,32 @@
return Items.field_151015_O;
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, 0);
+ int age = func_185527_x(state);
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+
+ if (age >= func_185526_g())
+ {
+ int k = 3 + fortune;
+
+ for (int i = 0; i < 3 + fortune; ++i)
+ {
+ if (rand.nextInt(2 * func_185526_g()) <= age)
+ {
+ drops.add(new ItemStack(this.func_149866_i(), 1, 0));
+ }
+ }
+ }
+ }
+
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this.
{
int i = this.func_185527_x(p_180653_3_);
@@ -0,0 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
@@ -17,7 +17,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockDeadBush extends BlockBush
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
{
protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
@@ -68,4 +68,11 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I));
+ }
}
@@ -0,0 +1,28 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
@@ -203,7 +203,7 @@
flag1 = true;
}
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
+ if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP))
{
p_189540_2_.func_175698_g(p_189540_3_);
flag1 = true;
@@ -247,13 +247,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- if (p_176196_2_.func_177956_o() >= 255)
+ if (p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1)
{
return false;
}
else
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return (state.func_185896_q() || state.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
}
}
@@ -0,0 +1,81 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
@@ -24,7 +24,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockDoublePlant extends BlockBush implements IGrowable
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> field_176493_a = PropertyEnum.<BlockDoublePlant.EnumPlantType>func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> field_176492_b = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
@@ -87,6 +87,8 @@
Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c());
Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this);
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
+
if (block == this)
{
p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2);
@@ -95,17 +97,13 @@
if (block1 == this)
{
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
-
- if (!flag)
- {
- this.func_176226_b(p_176475_1_, blockpos1, p_176475_3_, 0);
- }
}
}
}
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
{
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
@@ -160,7 +158,6 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_)
{
- if (p_180657_1_.field_72995_K || p_180657_6_.func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
@@ -220,8 +217,6 @@
else
{
p_176489_4_.func_71029_a(StatList.func_188055_a(this));
- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a();
- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i));
return true;
}
}
@@ -290,6 +285,24 @@
return Block.EnumOffsetType.XZ;
}
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
+ return ret;
+ }
+
public static enum EnumBlockHalf implements IStringSerializable
{
UPPER,
@@ -0,0 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java
@@ -48,7 +48,7 @@
private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_)
{
- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
+ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -61,7 +61,7 @@
p_180683_1_.func_175698_g(p_180683_2_);
BlockPos blockpos;
- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}
@@ -95,7 +95,7 @@
{
BlockPos blockpos = p_180684_2_.func_177982_a(p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16), p_180684_1_.field_73012_v.nextInt(8) - p_180684_1_.field_73012_v.nextInt(8), p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16));
- if (p_180684_1_.func_180495_p(blockpos).func_177230_c().field_149764_J == Material.field_151579_a)
+ if (p_180684_1_.func_175623_d(blockpos))
{
if (p_180684_1_.field_72995_K)
{
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDropper.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDropper.java
@@ -43,7 +43,7 @@
{
ItemStack itemstack = tileentitydispenser.func_70301_a(i);
- if (!itemstack.func_190926_b())
+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, tileentitydispenser, i, itemstack))
{
EnumFacing enumfacing = (EnumFacing)p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
BlockPos blockpos = p_176439_2_.func_177972_a(enumfacing);
@@ -0,0 +1,60 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
@@ -26,6 +26,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
int j = 1;
@@ -67,7 +68,7 @@
}
}
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
{
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
@@ -118,7 +119,7 @@
{
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
{
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
return;
}
@@ -166,6 +167,7 @@
}
else
{
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
}
}
@@ -187,7 +189,7 @@
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
{
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
{
return p_176374_3_;
}
@@ -254,11 +256,12 @@
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
{
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
+ Material mat = p_176372_3_.func_185904_a();
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
{
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
}
else
{
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockEnchantmentTable.java
+++ ../src-work/minecraft/net/minecraft/block/BlockEnchantmentTable.java
@@ -64,7 +64,7 @@
{
BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j);
- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X)
+ if (net.minecraftforge.common.ForgeHooks.getEnchantPower(p_180655_2_, blockpos) > 0)
{
if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2)))
{
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockEnderChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockEnderChest.java
@@ -100,7 +100,7 @@
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
{
- if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).func_185915_l())
+ if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).doesSideBlockChestOpening(p_180639_1_, p_180639_2_.func_177984_a(), EnumFacing.DOWN))
{
return true;
}
@@ -0,0 +1,32 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
@@ -47,7 +47,7 @@
private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_)
{
- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0)
+ if ((p_176503_1_.func_175623_d(p_176503_2_.func_177977_b()) || func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b()))) && p_176503_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -62,17 +62,18 @@
}
else
{
+ IBlockState state = p_176503_1_.func_180495_p(p_176503_2_);
p_176503_1_.func_175698_g(p_176503_2_);
BlockPos blockpos;
- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_176503_2_.func_177977_b(); (p_176503_1_.func_175623_d(blockpos) || func_185759_i(p_176503_1_.func_180495_p(blockpos))) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}
if (blockpos.func_177956_o() > 0)
{
- p_176503_1_.func_175656_a(blockpos.func_177984_a(), this.func_176223_P());
+ p_176503_1_.func_175656_a(blockpos.func_177984_a(), state); //Forge: Fix loss of state information during world gen.
}
}
}
@@ -0,0 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -72,7 +72,7 @@
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
{
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof EntityLivingBase && (p_180658_3_ instanceof EntityPlayer || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.field_70130_N * p_180658_3_.field_70130_N * p_180658_3_.field_70131_O > 0.512F)
+ if (net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) // Forge: Move logic to Entity#canTrample
{
func_190970_b(p_180658_1_, p_180658_2_);
}
@@ -95,7 +95,7 @@
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
{
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
- return block instanceof BlockCrops || block instanceof BlockStem;
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
}
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
@@ -108,7 +108,7 @@
}
}
- return false;
+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_1_, p_176530_2_);
}
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_)
@@ -0,0 +1,38 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFence.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFence.java
@@ -165,7 +165,10 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return p_176221_1_.func_177226_a(field_176526_a, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176525_b, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))).func_177226_a(field_176527_M, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176528_N, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST)));
+ return p_176221_1_.func_177226_a(field_176526_a, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176525_b, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST))
+ .func_177226_a(field_176527_M, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176528_N, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST));
}
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
@@ -201,6 +204,23 @@
return new BlockStateContainer(this, new IProperty[] {field_176526_a, field_176525_b, field_176528_N, field_176527_M});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ return func_176524_e(world, pos.func_177972_a(facing), facing.func_176734_d());
+ }
+
+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ BlockPos other = pos.func_177972_a(facing);
+ Block block = world.func_180495_p(other).func_177230_c();
+ return block.canBeConnectedTo(world, other, facing.func_176734_d()) || func_176524_e(world, other, facing.func_176734_d());
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER;
@@ -0,0 +1,35 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFenceGate.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFenceGate.java
@@ -59,7 +59,7 @@
{
EnumFacing.Axis enumfacing$axis = ((EnumFacing)p_176221_1_.func_177229_b(field_185512_D)).func_176740_k();
- if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() == Blocks.field_150463_bK) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() == Blocks.field_150463_bK))
+ if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() instanceof BlockWall))
{
p_176221_1_ = p_176221_1_.func_177226_a(field_176467_M, Boolean.valueOf(true));
}
@@ -192,6 +192,23 @@
return new BlockStateContainer(this, new IProperty[] {field_185512_D, field_176466_a, field_176465_b, field_176467_M});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() instanceof BlockFenceGate &&
+ state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE)
+ {
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
+ return connector instanceof BlockFence || connector instanceof BlockWall;
+ }
+ return false;
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
if (p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN)
@@ -0,0 +1,218 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -39,7 +39,15 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P();
+ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
+ {
+ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))
+ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))
+ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))
+ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST))
+ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN));
+ }
+ return this.func_176223_P();
}
protected BlockFire()
@@ -92,6 +100,7 @@
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
{
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
}
@@ -126,19 +135,15 @@
{
if (p_180650_1_.func_82736_K().func_82766_b("doFireTick"))
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
if (!this.func_176196_c(p_180650_1_, p_180650_2_))
{
p_180650_1_.func_175698_g(p_180650_2_);
}
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
- boolean flag = block == Blocks.field_150424_aL || block == Blocks.field_189877_df;
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
- {
- flag = true;
- }
-
int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue();
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F)
@@ -159,7 +164,7 @@
{
if (!this.func_176533_e(p_180650_1_, p_180650_2_))
{
- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3)
+ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3)
{
p_180650_1_.func_175698_g(p_180650_2_);
}
@@ -167,7 +172,7 @@
return;
}
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
{
p_180650_1_.func_175698_g(p_180650_2_);
return;
@@ -182,12 +187,12 @@
j = -50;
}
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i, EnumFacing.WEST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i, EnumFacing.EAST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i, EnumFacing.UP);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i, EnumFacing.DOWN);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i, EnumFacing.SOUTH);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i, EnumFacing.NORTH);
for (int k = -1; k <= 1; ++k)
{
@@ -246,22 +251,30 @@
return false;
}
+ @Deprecated // Use Block.getFlammability
public int func_176532_c(Block p_176532_1_)
{
Integer integer = this.field_149848_b.get(p_176532_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use Block.getFireSpreadSpeed
public int func_176534_d(Block p_176534_1_)
{
Integer integer = this.field_149849_a.get(p_176534_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use tryCatchFire with face below
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
{
- int i = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
+ }
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
+ {
+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
+
if (p_176536_4_.nextInt(p_176536_3_) < i)
{
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -293,7 +306,7 @@
{
for (EnumFacing enumfacing : EnumFacing.values())
{
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
{
return true;
}
@@ -314,7 +327,7 @@
for (EnumFacing enumfacing : EnumFacing.values())
{
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
}
return i;
@@ -326,9 +339,10 @@
return false;
}
+ @Deprecated // Use canCatchFire with face sensitive version below
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
{
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -372,9 +386,9 @@
p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false);
}
- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b()))
+ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP))
{
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST))
{
for (int j = 0; j < 2; ++j)
{
@@ -385,7 +399,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST))
{
for (int k = 0; k < 2; ++k)
{
@@ -396,7 +410,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH))
{
for (int l = 0; l < 2; ++l)
{
@@ -407,7 +421,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH))
{
for (int i1 = 0; i1 < 2; ++i1)
{
@@ -418,7 +432,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN))
{
for (int j1 = 0; j1 < 2; ++j1)
{
@@ -462,6 +476,21 @@
return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R});
}
+ /*================================= Forge Start ======================================*/
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param pos Block position
+ * @param face The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
+ }
+ /*================================= Forge Start ======================================*/
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -0,0 +1,64 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -152,12 +152,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID);
}
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_)
{
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
+ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b());
+ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID)
{
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
p_189540_2_.func_175698_g(p_189540_3_);
@@ -166,13 +168,6 @@
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
-
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
- {
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- }
-
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
@@ -398,6 +393,30 @@
return BlockFaceShape.UNDEFINED;
}
+
+ /*============================FORGE START=====================================*/
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
+ if (te != null && te.func_145965_a() != null)
+ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
+ }
+ @Override
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool)
+ {
+ super.func_180657_a(world, player, pos, state, te, tool);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/
+
public static enum EnumFlowerType implements IStringSerializable
{
EMPTY("empty"),
@@ -0,0 +1,42 @@
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -38,7 +38,8 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
}
@@ -58,7 +59,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a());
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos);
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2)
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P());
}
@@ -96,18 +97,11 @@
{
if (j >= i / 16)
{
- if (p_176474_1_.func_180495_p(blockpos1).func_177230_c().field_149764_J == Material.field_151579_a)
+ if (p_176474_1_.func_175623_d(blockpos1))
{
if (p_176474_2_.nextInt(8) == 0)
{
- BlockFlower.EnumFlowerType blockflower$enumflowertype = p_176474_1_.func_180494_b(blockpos1).func_180623_a(p_176474_2_, blockpos1);
- BlockFlower blockflower = blockflower$enumflowertype.func_176964_a().func_180346_a();
- IBlockState iblockstate = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), blockflower$enumflowertype);
-
- if (blockflower.func_180671_f(p_176474_1_, blockpos1, iblockstate))
- {
- p_176474_1_.func_180501_a(blockpos1, iblockstate, 3);
- }
+ p_176474_1_.func_180494_b(blockpos1).plantFlower(p_176474_1_, p_176474_2_, blockpos1);
}
else
{
@@ -0,0 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
@@ -222,6 +222,20 @@
return new BlockStateContainer(this, new IProperty[] {field_176380_a});
}
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : (java.util.Set<IProperty<?>>)state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("variant"))
+ {
+ world.func_175656_a(pos, state.func_177231_a(prop));
+ return true;
+ }
+ }
+ return false;
+ }
+
public static enum EnumType implements IStringSerializable
{
NORTH_WEST(1, "north_west"),
@@ -0,0 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
@@ -41,9 +41,14 @@
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
p_180657_2_.func_71020_j(0.005F);
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
{
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
+ items.add(this.func_180643_i(p_180657_4_));
+
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
+ for (ItemStack is : items)
+ func_180635_a(p_180657_1_, p_180657_3_, is);
}
else
{
@@ -54,7 +59,9 @@
}
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
+ harvesters.set(p_180657_2_);
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
+ harvesters.set(null);
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a();
if (material.func_76230_c() || material.func_76224_d())
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -158,6 +158,8 @@
return new BlockStateContainer(this, new IProperty[] {field_176382_a});
}
+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -0,0 +1,139 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -17,7 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public abstract class BlockLeaves extends Block
+public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable
{
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
@@ -53,9 +53,9 @@
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -83,7 +83,8 @@
this.field_150128_a = new int[32768];
}
- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5)))
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks
+ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt
{
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
@@ -96,9 +97,9 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
Block block = iblockstate.func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
- if (iblockstate.func_185904_a() == Material.field_151584_j)
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2;
}
@@ -205,40 +206,7 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
- {
- int i = this.func_176232_d(p_180653_3_);
-
- if (p_180653_5_ > 0)
- {
- i -= 2 << p_180653_5_;
-
- if (i < 10)
- {
- i = 10;
- }
- }
-
- if (p_180653_1_.field_73012_v.nextInt(i) == 0)
- {
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
- }
-
- i = 200;
-
- if (p_180653_5_ > 0)
- {
- i -= 10 << p_180653_5_;
-
- if (i < 40)
- {
- i = 40;
- }
- }
-
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, i);
- }
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
@@ -274,6 +242,51 @@
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
+ {
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
+ }
+ }
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int chance = this.func_176232_d(state);
+
+ if (fortune > 0)
+ {
+ chance -= 2 << fortune;
+ if (chance < 10) chance = 10;
+ }
+
+ if (rand.nextInt(chance) == 0)
+ {
+ ItemStack drop = new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state));
+ if (!drop.func_190926_b())
+ drops.add(drop);
+ }
+
+ chance = 200;
+ if (fortune > 0)
+ {
+ chance -= 10 << fortune;
+ if (chance < 40) chance = 40;
+ }
+
+ this.captureDrops(true);
+ if (world instanceof World)
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
+ drops.addAll(this.captureDrops(false));
+ }
+
+
@SideOnly(Side.CLIENT)
public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_)
{
@@ -0,0 +1,59 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -284,14 +284,14 @@
if (integer.intValue() == 0)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
if (integer.intValue() <= 4)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
@@ -448,8 +448,39 @@
return (float)p_190972_2_.func_177956_o() + func_190973_f(p_190972_0_, p_190972_1_, p_190972_2_);
}
+ @Override
+ public float getBlockLiquidHeight(World world, BlockPos pos, IBlockState state, Material material)
+ {
+ return BlockLiquid.func_190973_f(state, world, pos);
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ @SideOnly (Side.CLIENT)
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
+ {
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks);
+
+ if (state.func_185904_a().func_76224_d())
+ {
+ float height = 0.0F;
+ if (state.func_177230_c() instanceof BlockLiquid)
+ {
+ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F;
+ }
+ float f1 = (float) (pos.func_177956_o() + 1) - height;
+ if (viewport.field_72448_b > (double)f1)
+ {
+ BlockPos upPos = pos.func_177984_a();
+ IBlockState upState = world.func_180495_p(upPos);
+ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
+ }
+ }
+
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
+ }
}
@@ -0,0 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -34,9 +34,9 @@
{
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -69,6 +69,9 @@
}
}
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
public static enum EnumAxis implements IStringSerializable
{
X("x"),
@@ -0,0 +1,19 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -40,10 +40,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- int i = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
}
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public boolean func_149662_c(IBlockState p_149662_1_)
{
return false;
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -89,7 +89,7 @@
}
else
{
- return p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate);
+ return p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
}
else
@@ -0,0 +1,21 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
@@ -39,7 +39,8 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
}
@@ -53,7 +54,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos);
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a());
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2)
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
}
@@ -0,0 +1,60 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -42,25 +42,28 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
int i = ((Integer)p_180650_3_.func_177229_b(field_176486_a)).intValue();
- if (i < 3 && p_180650_4_.nextInt(10) == 0)
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(10) == 0))
{
- p_180650_3_ = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
- p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_, 2);
+ IBlockState newState = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
+ p_180650_1_.func_180501_a(p_180650_2_, newState, 2);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, newState);
}
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
}
+ @SuppressWarnings("unused")
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ if (false && !p_180653_1_.field_72995_K)
{
int i = 1;
@@ -106,6 +109,23 @@
return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue();
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int count = 1;
+
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
+ {
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
+ }
+
+ for (int i = 0; i < count; i++)
+ {
+ drops.add(new ItemStack(Items.field_151075_bm));
+ }
+ }
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176486_a});
@@ -0,0 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
@@ -106,4 +106,10 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4));
+ }
}
@@ -0,0 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
@@ -63,7 +63,9 @@
if (tileentity instanceof TileEntityNote)
{
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
+ int old = tileentitynote.field_145879_a;
tileentitynote.func_145877_a();
+ if (old == tileentitynote.field_145879_a) return false;
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
p_180639_4_.func_71029_a(StatList.field_188087_U);
}
@@ -103,6 +105,10 @@
public boolean func_189539_a(IBlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_)
{
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_5_, p_189539_4_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
+ p_189539_4_ = e.getInstrument().ordinal();
+ p_189539_5_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_189539_5_ - 12) / 12.0D);
p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, this.func_185576_e(p_189539_4_), SoundCategory.RECORDS, 3.0F, f);
p_189539_2_.func_175688_a(EnumParticleTypes.NOTE, (double)p_189539_3_.func_177958_n() + 0.5D, (double)p_189539_3_.func_177956_o() + 1.2D, (double)p_189539_3_.func_177952_p() + 0.5D, (double)p_189539_5_ / 24.0D, 0.0D, 0.0D);
@@ -0,0 +1,15 @@
--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java
+++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java
@@ -145,4 +145,12 @@
{
return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7));
}
+
+ /* ======================================== FORGE START =====================================*/
+ @Override
+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
+ {
+ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos);
+ }
+ /* ========================================= FORGE END ======================================*/
}
@@ -0,0 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
@@ -101,11 +101,16 @@
if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ)
{
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a()));
}
else
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a()));
+ }
}
@@ -0,0 +1,50 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -78,34 +78,39 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ }
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
{
int i = 0;
if (this == Blocks.field_150365_q)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
+ i = MathHelper.func_76136_a(rand, 0, 2);
}
else if (this == Blocks.field_150482_ag)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150412_bA)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ i = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150369_x)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(rand, 2, 5);
}
else if (this == Blocks.field_150449_bY)
{
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ i = MathHelper.func_76136_a(rand, 2, 5);
}
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
+ return i;
}
+ return 0;
}
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
@@ -0,0 +1,39 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -112,7 +112,10 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()), p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()), p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()), p_176221_3_.func_177976_e(), EnumFacing.EAST))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()), p_176221_3_.func_177974_f(), EnumFacing.WEST)));
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -197,6 +200,24 @@
return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
}
+ /* ======================================== FORGE START ======================================== */
+
+ @Override
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
+ {
+ BlockPos offset = pos.func_177972_a(facing);
+ return func_193393_b(world, world.func_180495_p(offset), offset, facing.func_176734_d());
+ }
+
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
+ {
+ BlockPos other = pos.func_177972_a(dir);
+ IBlockState state = world.func_180495_p(other);
+ return state.func_177230_c().canBeConnectedTo(world, other, dir.func_176734_d()) || func_193393_b(world, state, other, dir.func_176734_d());
+ }
+
+ /* ======================================== FORGE END ======================================== */
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THIN : BlockFaceShape.CENTER_SMALL;
@@ -0,0 +1,45 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -241,7 +241,7 @@
}
}
- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
+ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_189539_2_, blockpos) && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
{
this.func_176319_a(p_189539_2_, p_189539_3_, enumfacing, false);
}
@@ -307,7 +307,7 @@
return false;
}
- return !block.func_149716_u();
+ return !block.hasTileEntity(p_185646_0_);
}
else
{
@@ -353,7 +353,9 @@
{
BlockPos blockpos1 = list2.get(j);
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1);
- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0);
+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f;
+ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0);
p_176319_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 4);
--k;
aiblockstate[k] = iblockstate;
@@ -434,6 +436,13 @@
return new BlockStateContainer(this, new IProperty[] {field_176387_N, field_176320_b});
}
+ /* ======================================== FORGE START =====================================*/
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return !state.func_177229_b(field_176320_b) && super.rotateBlock(world, pos, axis);
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
p_193383_2_ = this.func_176221_a(p_193383_2_, p_193383_1_, p_193383_3_);
@@ -0,0 +1,37 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
@@ -116,7 +116,7 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out
{
TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_);
@@ -126,6 +126,7 @@
iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0);
}
}
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, 1, p_180653_5_); // mimic vanilla behavior from above and ignore chance
}
@Nullable
@@ -210,6 +211,17 @@
return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b});
}
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos);
+ if (tileentitypiston != null)
+ {
+ IBlockState pushed = tileentitypiston.func_174927_b();
+ drops.addAll(pushed.func_177230_c().getDrops(world, pos, pushed, fortune)); // use the old method until it gets removed, for backward compatibility
+ }
+ }
+
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
@@ -0,0 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPortal.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPortal.java
@@ -111,7 +111,7 @@
{
BlockPortal.Size blockportal$size = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.X);
- if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0)
+ if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size))
{
blockportal$size.func_150859_c();
return true;
@@ -120,7 +120,7 @@
{
BlockPortal.Size blockportal$size1 = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.Z);
- if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0)
+ if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size1))
{
blockportal$size1.func_150859_c();
return true;
@@ -0,0 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
@@ -27,7 +27,7 @@
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops
{
if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0)
{
@@ -40,4 +40,12 @@
{
return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()];
}
+
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0)
+ drops.add(new ItemStack(Items.field_151170_bI));
+ }
}
Loaded 100 of 2622 files, more files were not shown because too many files have changed in this diff. Show more