Compare commits

...
131 Commits
Author SHA1 Message Date
LexManos 064ae6961b New 1.16.5 RB. 2021-07-21 18:25:45 -07:00
SizableShrimp 22d609ed6c ForgeGradle 5.1 and Gradle 7, which allows development on J16. Runtime still targets J8. (#7877) 2021-07-21 14:21:09 -07:00
LexManos 315bbb74ff Work around javac scoping issue. 2021-07-19 21:55:46 -07:00
LexManos 4e4d31b68c Fix LAN worlds where registry entries have been removed. 2021-07-19 21:15:26 -07:00
William Bradford Larcombe 1a17fa6129 Fix FakePlayers having null connection and add FakePlayer test mod (#7733) 2021-07-19 12:54:42 -07:00
AterAnimAvis ca9df21258 Use '{assets_root}' rather than task output path for userdev config (#7873)
Signed-off-by: AterAnimAvis <[email protected]>
2021-07-17 18:23:30 +02:00
Silk 93d7fa54fc Fix missing userdev config for datagen runs (#7871)
Signed-off-by: TheSilkMiner <[email protected]>
2021-07-17 13:14:38 +02:00
Bailey Hollingsworth f235d80d9f Adds a damage float in Lightning Entity and patches Entity to use it. (#7849) 2021-07-16 20:12:40 -07:00
Mike Garay be34dd89a9 Patch several mob classes to let them use modded versions of their ranged weapons (#7845) 2021-07-16 20:12:33 -07:00
AwesomeSyd239 6663f23e13 Add Fishing bobber projectile impact event (#7842) 2021-07-16 19:41:51 -07:00
OneLemonyBoi f9f7ef2580 Removes misapplied patch in Entity (#7841) 2021-07-16 19:38:56 -07:00
OneLemonyBoi 86352e9c19 Removes misleading Nullable annotation from canCreatureSpawn (#7840) 2021-07-16 19:38:06 -07:00
OneLemonyBoi 8c8b31435b Corrects the assigning of mob kills, Fixes MC-121048 (#7836) 2021-07-16 19:37:12 -07:00
OneLemonyBoi 16b3e2780e Updates MouseHelper to allow for Horizontal Scroll to be recognized as Vertical Scroll (#7834) 2021-07-16 19:31:14 -07:00
Take Weiland 1121f18413 Fix entities losing their scoreboard data when they are unloaded (#7826) 2021-07-16 19:24:29 -07:00
Take Weiland 96804fb4df [1.16] Allow blocks other than beds or respawn anchors to act as respawn points (#7824) 2021-07-16 19:23:36 -07:00
LexManos 03a6dbb405 Regen patches 2021-07-16 19:12:38 -07:00
Won-Ton 77e8c72589 Add AT entries for DimensionSettings to make them easier for mods to work with (#7817) 2021-07-16 18:03:56 -07:00
cech12 043e49a694 New hook to allow Trapdoors be climbable for custom ladders (#7816) 2021-07-16 18:01:27 -07:00
King Lemming 5169f1f6fe Convenience change for potion enumeration - does not change patch size in any meaningful way! (#7811) 2021-07-16 17:56:08 -07:00
Mike Garay 2bd83b26aa Adds knockback attribute to players and updated knockback calculation to PlayerEntity#attack (#7806) 2021-07-16 17:52:58 -07:00
Sekwah e6c1814122 Fix mod menu URL click bounds (#7804) 2021-07-16 17:51:11 -07:00
Daniel Houck 7f2892de7e Fix vanilla rotation/mirroring issues (#7803)
Patch minecraft to fix MC-227255 and MC-134110, which are block
rotation and mirroring issues.  I noticed this from problems with
Structurize, but this probably affects any other mods that allow
rotating or mirroring structures (as well as vanilla structure blocks).
2021-07-16 17:50:29 -07:00
PersonTheCat 439ba462d6 Synchronize ResourcePackList#addPackFinder (#7799) 2021-07-16 17:48:10 -07:00
mikewk 7c6ae3e61e Fixes tryFluidTransfer_Internal to respect the FluidStack drainable when draining fluidSource. (#7782) 2021-07-16 17:45:39 -07:00
Take Weiland f9b894ecbf Add IRecipeType parameter to burn time hooks (#7771) 2021-07-16 17:37:41 -07:00
Andy Dingley df53db351e Use MobGriefingEvent for PiglinEntity when determining whether Piglins want to pick up items. (#7762) 2021-07-16 17:35:24 -07:00
Andy Dingley 9aa04c8036 [1.16.x] Remove redundant mobgriefing check in SmallFireaballEntity. (#7761) 2021-07-16 17:33:59 -07:00
Queekusme 626496cec0 Changed AbstractFurnaceTileEntity's canBurn and burn functions to use IRecipe's 'assemble' instead of 'getResultItem' (#7756) 2021-07-16 17:33:02 -07:00
covers1624 022482a3bd Bypass chunk future chain when processing loads and getChunk called. (#7697) 2021-07-16 17:26:45 -07:00
DaemonUmbra dd228a9ac1 Removed sidedness from PacketBuffer methods. (#7236)
Affected methods:
* readLongArray (x2)
* readSectionPos
* readString (no-arg variant)
2021-07-16 17:25:11 -07:00
Silk a6d1646591 Add data generators for sounds.json (#6982) 2021-07-16 17:24:16 -07:00
Take Weiland 39f9f393db Add custom TextureAtlasSprite loaders (#7822)
Adds a system for mods to specify custom texture loaders which can be requested by the resource pack through a metadata section in the .mcmeta file. Due to technical reasons, png file is still required for MC to identify a texture as existing, even if the loader doesn't use it.
2021-07-16 01:55:43 +02:00
Commoble d35784eb14 Fix PlayerGameModeEventTest and ForgeWorldTypeTest so they don't crash the dedicated server when running forge_test_server in forgedev (#7869) 2021-07-15 16:40:07 -07:00
LexManos 31fb15c88d Add userdev to run config. 2021-07-13 18:15:54 -07:00
Take Weiland 29f175743b Add truncation to FMLStatusPing to work around protocol limits (#7818) 2021-06-16 19:23:20 -07:00
SizableShrimp 33499db93f Remove ModelResourceLocation patch for SAS entry (#7813) 2021-06-09 09:35:03 -07:00
Take Weiland 84381553a9 Fix jar file path detection if the path contains a "!" (#7790) 2021-06-08 13:26:01 -07:00
mrp-v2 2a7dde3d2e Add method to get the number of elements in a model builder (#7792) 2021-06-08 12:49:25 -07:00
Take Weiland aa4f24c915 Fix vanilla packet splitter remote detection and add advancement packet splitting (#7802) 2021-06-08 12:47:37 -07:00
Nightenom 1d87831773 Add option for linear filtering of text texture (#7645) 2021-06-08 21:33:31 +02:00
mrp-v2 65e99f9b58 Use empty model instead of missing model for non-existant layers in multilayer models (#7750)
Fixes issues when using multi-layer models as part of composite models
2021-06-08 21:07:33 +02:00
LexManos b98991dc70 Add debug logging to packet compression encoder.
Should make figuring out who is sending large packets easier.
Disable with -Pforge.disablePacketCompressionDebug=true
2021-06-03 10:29:49 -07:00
LexManos 435e65eb18 Removed signature line from mod list screen. #7500 2021-05-23 11:08:45 -07:00
Curle 8211a5048a Reinstate the MinecartCollisionHandler field to AbstractMinecartEntity (#7748) Closes #7506. 2021-05-17 13:51:23 -07:00
Curle 167f14f4a1 Fix PlayerEvent.BreakSpeed's pos being nullable. (#7747) Closes #7615. 2021-05-17 13:46:11 -07:00
Curle f332642409 Fix OBJ Loader data gen string (#7746) Closes #7616 2021-05-17 13:43:37 -07:00
noeppi_noeppi 77d41023b5 Add an event similar to PlayerEvent.NameFormat but for the name shown in the tab list. (#7740) 2021-05-17 13:17:01 -07:00
Curle da2594289c Fix filling buckets with fluids without bucket items consuming the fluid (#7745) Closes #7670 2021-05-17 13:10:27 -07:00
David Quintana 6f3da80b5a Work around crash while loading flatworld with modded structures. (#7764)
* Work around crash while loading flatworld with modded structures.

* Maybe fix issue with gradle daemon leaking memory and slowing down CI builds.
2021-05-14 00:11:46 +02:00
gigaherz 474b47ea51 Update Forge to Gradle 6.9 2021-05-12 23:33:33 +02:00
Trikzon b6ce4fb066 Add barrels and barrels/wooden block and item tag (#7676) 2021-04-30 10:53:19 -07:00
KnightMiner 1406f2bf1f Fix shears not properly breaking tripwire (MC-129055) (#7718) 2021-04-30 10:52:02 -07:00
JoJoModding 5125775992 Fix Line endings in tooltips not handled properly in multiplayer screen Closes #7738 (#7739) 2021-04-30 10:42:15 -07:00
Sydney 929c7b7a0b Fix cats, phantoms and pillagers saying they're at BlockPos.ZERO during LivingSpawnEvent.CheckSpawn (#7722) 2021-04-23 13:27:56 -07:00
mrp-v2 7bf02e7dcd [1.16] Add missing Multipart Blockstate Builder feature: Nested condition groups (#7677) 2021-04-22 22:55:18 -07:00
Dennis C 9d0d249eaf Pass BlockPos to BlockParticleData used for "fall impact" particle (#7705) 2021-04-22 22:53:58 -07:00
sciwhiz12 c4b1df1fc7 Check version ranges of optional dependencies when present (#7710)
If an optional dependency is present, but it does not conform to the version range,
it will now error out in the same fashion as missing required dependencies, instead
of a more cryptic error down the line due to a missing method/class/field/etc.

Implements and closes #7696
2021-04-22 22:52:24 -07:00
Take Weiland b3f253df61 Fix ClientVisualization crashing on systems without monitors (#7719) 2021-04-22 22:45:38 -07:00
atkarimarton dc099069fa Fix Furnace Minecarts going faster then vanilla (#7725) 2021-04-22 22:29:33 -07:00
AterAnimAvis e80c785563 Update for Forge's new maven (#7723) 2021-04-22 22:28:18 -07:00
cpw 1f9611204f A bloody quote FFS
Signed-off-by: cpw <[email protected]>
2021-04-18 11:35:05 -04:00
cpw 0120f6274d Update for new maven
Signed-off-by: cpw <[email protected]>
2021-04-18 11:28:54 -04:00
cpw c0e74bc8a8 Fix broken java9hacks for j16 handling..
Signed-off-by: cpw <[email protected]>
2021-04-02 14:27:25 -04:00
SizableShrimp 80feb0aeb2 Add generic EntityTeleportEvent (#7694) 2021-03-29 18:05:13 -07:00
covers1624 f47429717d Restore SS version, fixes findFieldInstanceChecks 2021-03-22 16:51:53 +10:30
Take Weiland 0239a736ec Fix sign textures being stitched onto every texture atlas (#7690) 2021-03-17 10:04:07 -07:00
LexManos 5c488c9007 Fix AT order, missed exec line and bump for RB. 2021-03-15 15:06:12 -07:00
Take Weiland 53c039680c Fix wrong eye height when entity size changes (esp. baby animals) (#7628) 2021-03-15 14:08:40 -07:00
Take Weiland 7379e8b9a4 Allow ITeleporter to override the vanilla teleport sound (#7682) 2021-03-15 14:02:20 -07:00
SizableShrimp 2a0d9e8dac Fix datapack exception related to EnumArgument with siblings (#7686)
Invalid enum constants are now properly thrown as a CommandSyntaxException
2021-03-15 13:20:08 -07:00
kaydogz aacba8e38e Add support for custom WoodTypes (#7623) 2021-03-15 12:28:45 -07:00
LexManos f4fd1c2f16 Use JGit instead of GrGit now that jcenter is going away.
Update missed mapped name in MDK.
2021-03-15 12:18:51 -07:00
gigaherz 813f3d630d Bump nashorn wrapper version. 2021-03-13 19:56:17 +01:00
gigaherz 76cea5a7da Fix yet another copypasta. 2021-03-13 19:56:17 +01:00
diesieben07 e33f794298 Fix incorrectly replaced SRG names 2021-03-13 19:56:14 +01:00
AterAnimAvis 72d05d17a9 Fix potential Deadlock when using custom Item entities. (#7532)
Be careful when adding Entities during Chunk Load (#7519)
2021-03-12 10:50:05 -08:00
gigaherz 19f9b309a6 Fix copypasta. 2021-03-12 02:54:10 +01:00
Curle 5b53616a47 Automatically fix some issues with configurations deemed invalid for simple reasons (#7671) 2021-03-11 16:11:05 -08:00
gigaherz 5f9e6f3b56 Add coremod that injects bouncer methods to work around name conflicts with official names.
Fixes a binary break.
2021-03-11 21:57:47 +01:00
gigaherz 0ad8e2c27f Bump SpecialSource 2021-03-11 19:29:20 +01:00
David Quintana 55f29764f8 Bulk update license year, and use replacement variable so that the current year is always used. 2021-03-10 23:41:00 +01:00
David Quintana a4f7087b92 Introduce a new feature that lets mods know if optional mods and optional network channels are present in the remote.
Allow connections from forge versions that don't have the vanilla splitter.
2021-03-10 23:40:59 +01:00
LexManos a95b968c13 Regenerate patches with relative headers. This should lower conflicts in future PRs.
Convert Forge to use Official mappings.
Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive.
It is clear that their intent is to allow us to use their names for developing mods like this.
See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
2021-03-09 14:21:48 -08:00
LexManos 802298d99d Update to FG4, and Gradle 6.8. 2021-03-09 13:27:46 -08:00
Take Weiland 5363dc5d99 Support splitting vanilla packets that are too large on forge<->forge connections (#7485)
Currently only for SUpdateRecipesPacket and STagsListPacket that blow up with huge datapacks
2021-03-04 12:14:52 -08:00
Sara Freimer 9602c22083 Fix a few places where the vanilla method was being called instead of the forge one (#7535)
Cleanup javadocs references slightly, fix a couple spots not using the proper forge hooks, and remove a couple unneeded patches
Update deprecation comment on isAir
2021-03-03 12:50:32 -08:00
FireController#1847 17500032ae Add Opacity to ForgeHooksClient#renderMainMenu (#7660) 2021-03-02 21:28:48 -08:00
Marc Hermans 65bc41281f Add support for caching of configuration values. (#7608) 2021-02-24 18:36:51 -08:00
Kovak ba15737fe3 Added entity attribute setup and creation events 2021-02-15 18:40:32 -08:00
KnightMiner 58f93263e2 Fix updateItemStackNBT not properly being called (#7646)
Re-added ItemStack delegate redirect transformer
2021-02-15 17:28:35 -08:00
Sara Freimer d97f28141c Fix a few FluidUtil issues that were causing DispenseFluidContainer to not function properly (#7422) 2021-02-15 17:08:05 -08:00
ichttt 0340664dbf Add a way to specify a custom background texture with namespaces in the Creative GUI. (#7404) 2021-02-15 16:46:23 -08:00
DaemonUmbra d2cfda3fb4 Fixed Configs not correcting when hot-loaded from changes on disk (#7427) 2021-02-15 16:39:59 -08:00
FledgeShiu 48225e1bea Reduce default logging markers in the MDK. Modders can re-enable these for better debugging. (#7432)
Modders PLEASE read your damn log, and fix the errors we point out. Spamming modpacks with stack traces is just lazy programming.
2021-02-15 16:39:02 -08:00
sciwhiz12 37ea725749 Deprecate Forge's setdimension command, vanilla execute command can do this now. (#7459) 2021-02-15 16:19:13 -08:00
LeBossMax2 733b812c7b Fix ItemTextureQuadConverter.convertTexture generating wrong quads, fixes #7620 (#7650) 2021-02-16 00:38:21 +01:00
Sangar 9ab29ea8fe Added MultipartBakedModel.getModelData(). (#7595)
This allows custom IBakedModel implementations to use the IModelData provided by their IBakedModel.getModelData() when used in the context of a multipart model.
2021-02-16 00:22:24 +01:00
Cyborgmas fe26b77e3b fix global cache not being a block render type (#7648) 2021-02-16 00:15:33 +01:00
Alex O'Neill b8eca88f75 Allow mods to use additional custom LootParameter when querying existing loot tables (#7515) 2021-02-15 14:52:00 -08:00
Sydney e039531497 Add ForgeHooks.canEntitySpawn to Cat, Phantom, and Patrol spawners. (#7569) 2021-02-15 13:40:03 -08:00
Max Becker 9017e24b40 Fix/Replace player visibility event (#7573) 2021-02-15 13:25:54 -08:00
AterAnimAvis 75570079ae Fix: Clear the last error from glfwInit to prevent vanilla from throwing an exception later in the chain when glfw errors. (#7587) 2021-02-15 13:16:09 -08:00
seymourimadeit e2167140db Fix MC-181464 persisting for modded shields (#7602) 2021-02-15 12:56:34 -08:00
malte0811 a89ce2d6f1 FIx race condition in LazyOptional (#7611) 2021-02-15 12:11:27 -08:00
Dennis C 007cd42ec6 [1.16.5] Fix shaders breaking almost every overlay that uses textures, fixes #7575 (#7624) 2021-02-14 19:11:46 -08:00
TelepathicGrunt d16a8d6d5d Disable syncing of Feature and Biome registries (#7639) 2021-02-14 19:05:11 -08:00
Drullkus 69321a363e Add IExtensibleEnum to GrassColorModifier (#7641) 2021-02-14 19:04:31 -08:00
Sydney 0e1ee4b1d2 Log stacktraces in NettyPacketEncoder. (#7654) 2021-02-14 18:36:09 -08:00
Dennis C cc1a9be2b4 Lower logging level for datafixer warning to debug (#7636) 2021-02-10 11:05:01 -08:00
Sara Freimer 1d7da4c595 Reintroduce forge's chunk manager to allow mods to force chunks with either a block position or entity (UUID) "owner" and have them properly persist between restarts (#7642) 2021-02-09 14:19:07 -08:00
Sara Freimer 1ac432c594 Fix two places where querying an object for the new "valid" capability from a capability invalidation listener could cause the object to return the old invalid capability. (#7643) 2021-02-09 13:28:02 -08:00
Cyborgmas 276871d5a3 Fix config spec in cases of enum class discrepancies (#7635) 2021-02-09 13:21:23 -08:00
Take Weiland 8460227ddf Fix onBlockAdded being called twice for ItemEntity placing non-TE blocks (#7607) 2021-02-09 13:02:08 -08:00
Jon f450d4025d Prevent NullPointerException when adding new loot pool. (#7605) 2021-02-09 12:59:48 -08:00
brandon3055 93a815957d Added generic multi part entity API (#7554) 2021-02-09 12:53:25 -08:00
Cyborgmas 84b7cdc1cd Fix IAngerable entities crashing when reading nbt on client (#7618) 2021-02-06 19:41:12 -08:00
Silk 83fee0b3d4 [1.16.x] Add loot table ID in Global Loot Modifiers (#7428) 2021-02-02 13:32:02 +01:00
Sara Freimer aeaebf5785 Add a block tag to allow mods to blacklist blocks endermen should not be able to place blocks on top of, similar to how vanilla hardcodes against them being able to place things on bedrock (#7548) 2021-01-29 18:02:08 -08:00
HellFirePvP d88e660cbb Fix translucent model parts of MultiLayerModels rendering as missing models due to differing rendertypes when rendering block model (#7579)
Signed-off-by: HellFirePvP <[email protected]>
2021-01-29 18:01:16 -08:00
Sara Freimer ab949c7cca Fix existing file tag provider support looking in the wrong folder for custom tag types (#7576) 2021-01-29 17:34:54 -08:00
Cyborgmas 7728dde36b Propery re-encode registries (#7629) 2021-01-28 13:07:11 -08:00
Cyborgmas 004ab59e6f Properly encode registries. (#7626) 2021-01-27 17:22:58 -08:00
Cyborgmas 7bfd2b8f34 Inject vanilla dimensions inside worlds missing them (#7599) 2021-01-27 16:00:28 -08:00
LexManos f169c99348 Introduce a new field_to_instanceof transformer to reduce some simple patches. 2021-01-26 16:32:13 -08:00
LexManos d3d3bdc769 Fix broken build. 2021-01-25 18:52:46 -08:00
Max Becker 0a0f3232ea Add modded biomes to overworld biome list (#7360) 2021-01-25 18:36:46 -08:00
LexManos 50d75a27e1 Fix dynamic registries not getting ids assigned correctly from old worlds in specific unordered value insertions. Closes #7586 2021-01-25 18:17:51 -08:00
KnightMiner 19f8d2a793 Optionally add a milk fluid to the vanilla bucket (#7294)
Fixes the previous broken code that was supposed to make mod registered milk returned by the vanilla bucket by allowing mods to enable a milk fluid.
2021-01-17 16:05:24 -05:00
LexManos 9ffa44f254 Introduce a new field_to_instanceof transformer to reduce some simple patches. 2021-01-14 02:52:52 -08:00
LexManos d8f41adf39 Update Coremods, ASM, and include standalone Nashorn to load on J15. 2021-01-12 13:22:13 -08:00
1434 changed files with 14728 additions and 6292 deletions

No files matched your search

-2
View File
@@ -39,8 +39,6 @@ changelog.txt
*.7z *.7z
/logs/ /logs/
gradle.properties
!/mdk/gradle.properties
/projects/forge/rejects/ /projects/forge/rejects/
# Srg2Source causes import bugs on these patches. If you intentionnally change these, remove the ignore. # Srg2Source causes import bugs on these patches. If you intentionnally change these, remove the ignore.
Vendored
+17 -6
View File
@@ -36,9 +36,11 @@ pipeline {
} }
stage('setup') { stage('setup') {
steps { steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup' withGradle {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
}
script { script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim() env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "^version:" | cut -d" " -f2').trim()
} }
} }
} }
@@ -59,15 +61,22 @@ pipeline {
} }
} }
environment { environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
CROWDIN = credentials('forge-crowdin') CROWDIN = credentials('forge-crowdin')
KEYSTORE = credentials('forge-jenkins-keystore-old') KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass') KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass') KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
} }
steps { 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}' withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}' withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
}
}
}
post {
success {
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:forge ${env.MYVERSION} latest")], propagate: false, wait: false
}
} }
} }
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 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
@@ -78,7 +87,9 @@ pipeline {
CROWDIN = credentials('forge-crowdin') CROWDIN = credentials('forge-crowdin')
} }
steps { steps {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}' withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
} }
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
Minecraft Forge Minecraft Forge
Copyright (c) 2016-2020. Copyright (c) 2016-${year}.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
+241 -177
View File
@@ -1,18 +1,11 @@
buildscript { buildscript {
repositories { repositories {
mavenLocal() mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' } maven { url = 'https://maven.minecraftforge.net/' }
jcenter() mavenCentral()
//mavenCentral() //TODO: Update Gradle to use HTTPS by default
maven {
name 'maven_central'
url 'https://repo.maven.apache.org/maven2/'
}
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.187' classpath 'net.minecraftforge.gradle:ForgeGradle:5.1.+'
classpath 'org.ow2.asm:asm:9.0'
classpath 'org.ow2.asm:asm-tree:9.0'
} }
} }
@@ -23,23 +16,21 @@ import java.util.Date
import java.util.LinkedHashMap import java.util.LinkedHashMap
import net.minecraftforge.forge.tasks.* import net.minecraftforge.forge.tasks.*
import static net.minecraftforge.forge.tasks.Util.* import static net.minecraftforge.forge.tasks.Util.*
import net.minecraftforge.gradle.common.task.DownloadMavenArtifact import net.minecraftforge.gradle.common.tasks.DownloadMavenArtifact
import net.minecraftforge.gradle.common.task.ExtractInheritance import net.minecraftforge.gradle.common.tasks.ExtractInheritance
import net.minecraftforge.gradle.common.task.SignJar import net.minecraftforge.gradle.common.tasks.SignJar
import net.minecraftforge.gradle.patcher.task.ApplyBinPatches import net.minecraftforge.gradle.patcher.tasks.ReobfuscateJar
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import net.minecraftforge.gradle.userdev.tasks.RenameJar
import org.apache.tools.ant.filters.ReplaceTokens import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.plugins.ide.eclipse.model.SourceFolder import org.gradle.plugins.ide.eclipse.model.SourceFolder
plugins { plugins {
id 'net.minecrell.licenser' version '0.4' id 'org.cadixdev.licenser' version '0.6.1'
id 'org.ajoberstar.grgit' version '3.1.1' id 'com.github.ben-manes.versions' version '0.36.0'
id 'com.github.ben-manes.versions' version '0.22.0' id 'net.minecraftforge.gradleutils' version '1.+'
id 'eclipse'
} }
apply plugin: 'eclipse'
Util.init() //Init all our extension methods! Util.init() //Init all our extension methods
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
@@ -52,10 +43,11 @@ ext {
keystore: project.properties.keystore keystore: project.properties.keystore
] ]
} }
MAPPING_CHANNEL = 'snapshot' MAPPING_CHANNEL = 'official'
MAPPING_VERSION = '20201028-1.16.3' MAPPING_VERSION = '1.16.5'
MC_VERSION = '1.16.5' MC_VERSION = '1.16.5'
MCP_VERSION = '20210115.111550' MCP_VERSION = '20210115.111550'
SPI_VERSION = '3.2.0'
} }
project(':mcp') { project(':mcp') {
@@ -64,7 +56,7 @@ project(':mcp') {
mavenLocal() mavenLocal()
} }
mcp { mcp {
config = MC_VERSION + '-' + MCP_VERSION config MC_VERSION + '-' + MCP_VERSION
pipeline = 'joined' pipeline = 'joined'
} }
} }
@@ -73,20 +65,18 @@ project(':clean') {
evaluationDependsOn(':mcp') evaluationDependsOn(':mcp')
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.patcher' apply plugin: 'net.minecraftforge.gradle.patcher'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
repositories { repositories {
mavenLocal() mavenLocal()
//mavenCentral() //TODO: Update Gradle to use HTTPS by default mavenCentral()
maven {
name 'maven_central'
url 'https://repo.maven.apache.org/maven2/'
}
} }
dependencies { dependencies {
implementation 'net.minecraftforge:forgespi:2.0.+' implementation 'net.minecraftforge:forgespi:' + SPI_VERSION
} }
patcher { patcher {
parent = project(':mcp') parent = project(':mcp')
mcVersion = MC_VERSION mcVersion = MC_VERSION
@@ -124,9 +114,9 @@ project(':forge') {
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.patcher' apply plugin: 'net.minecraftforge.gradle.patcher'
apply plugin: 'net.minecrell.licenser' apply plugin: 'org.cadixdev.licenser'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. java.toolchain.languageVersion = JavaLanguageVersion.of(8)
group = 'net.minecraftforge' group = 'net.minecraftforge'
sourceSets { sourceSets {
@@ -189,52 +179,34 @@ project(':forge') {
repositories { repositories {
mavenLocal() mavenLocal()
//mavenCentral() //TODO: Update Gradle to use HTTPS by default mavenCentral()
maven {
name 'maven_central'
url 'https://repo.maven.apache.org/maven2/'
}
} }
ext { ext {
SPEC_VERSION = '36.0' // This is overwritten by git tag, but here so dev time doesnt explode GIT_INFO = gradleutils.gitInfo
SPEC_VERSION = GIT_INFO.tag
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB> // The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
// ForgeMC is a unique identifier for every MC version we have supported. // ForgeMC is a unique identifier for every MC version we have supported.
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
MCP_ARTIFACT = project(':mcp').mcp.config MCP_ARTIFACT = project(':mcp').mcp.config.get()
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5' SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.10.0'
SPECIAL_SOURCE_MCP = 'net.md-5:SpecialSource:1.8.5'
VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json') VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar' BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar'
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.1.11' INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.2.6'
} }
def getVersion = { version = gradleutils.getMCTagOffsetBranchVersion(MC_VERSION)
//TAG-offset-hash
def raw = grgit.describe(longDescr: true, tags:true)
def desc = (raw == null ? '0.0-0-unknown' : grgit.describe(longDescr: true, tags:true)).split('-') as List
def hash = desc.remove(desc.size() - 1)
def offset = desc.remove(desc.size() - 1)
def tag = desc.join('-')
def branch = grgit.branch.current().name
if (branch in ['master', 'HEAD', MC_VERSION, MC_VERSION + '.0'])
branch = null
if (branch != null && branch.endsWith('.x') && MC_VERSION.startsWith(branch.substring(0, branch.length() - 2))) //1.13.x
branch = null
SPEC_VERSION = tag
return "${MC_VERSION}-${tag}.${offset}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
}
version = getVersion()
println('Forge Version: ' + version) println('Forge Version: ' + version)
patcher { patcher {
exc = file("$rootDir/src/main/resources/forge.exc") excs.from file("$rootDir/src/main/resources/forge.exc")
parent = project(':clean') parent = project(':clean')
patches = file("$rootDir/patches/minecraft") patches = file("$rootDir/patches/minecraft")
patchedSrc = file('src/main/java') patchedSrc = file('src/main/java')
srgPatches = true srgPatches = true
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg") accessTransformers.from file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
sideAnnotationStripper = file("$rootDir/src/main/resources/forge.sas") sideAnnotationStrippers.from file("$rootDir/src/main/resources/forge.sas")
runs { runs {
forge_client { forge_client {
@@ -246,21 +218,25 @@ project(':forge') {
environment 'target', 'fmldevclient' environment 'target', 'fmldevclient'
environment 'assetIndex', '{asset_index}' environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', downloadAssets.output environment 'assetDirectory', downloadAssets.output
environment 'nativesDirectory', extractNatives.output environment 'nativesDirectory', extractNatives.output.get().asFile
environment 'MC_VERSION', MC_VERSION environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString() environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
environment 'LAUNCHER_VERSION', SPEC_VERSION environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll' property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
property 'eventbus.checkTypesOnDispatch', 'true' property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev" ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main mods {
source sourceSets.userdev forge {
source sourceSets.main
source sourceSets.userdev
}
}
} }
forge_test_client { forge_test_client {
@@ -272,7 +248,8 @@ project(':forge') {
ideaModule "${rootProject.name}.${project.name}.userdev_test" ideaModule "${rootProject.name}.${project.name}.userdev_test"
mods { mods {
TestMods { sources sourceSets.test } forge { source sourceSets.main }
tests { sources sourceSets.test }
} }
} }
@@ -288,14 +265,15 @@ project(':forge') {
environment 'MCP_VERSION', MCP_VERSION environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString() environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
environment 'LAUNCHER_VERSION', SPEC_VERSION environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'eventbus.checkTypesOnDispatch', 'true' property 'eventbus.checkTypesOnDispatch', 'true'
ideaModule "${rootProject.name}.${project.name}.userdev" ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main mods {
source sourceSets.userdev forge { source sourceSets.main }
}
} }
forge_test_server { forge_test_server {
@@ -307,7 +285,8 @@ project(':forge') {
ideaModule "${rootProject.name}.${project.name}.userdev_test" ideaModule "${rootProject.name}.${project.name}.userdev_test"
mods { mods {
TestMods { sources sourceSets.test } forge { source sourceSets.main }
tests { sources sourceSets.test }
} }
} }
@@ -318,18 +297,21 @@ project(':forge') {
workingDirectory project.file('run') workingDirectory project.file('run')
environment 'target', 'fmldevdata' environment 'target', 'fmldevdata'
environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', downloadAssets.output
environment 'MC_VERSION', MC_VERSION environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString() environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
environment 'LAUNCHER_VERSION', SPEC_VERSION environment 'LAUNCHER_VERSION', SPEC_VERSION
ideaModule "${rootProject.name}.${project.name}.userdev" ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main mods {
source sourceSets.userdev forge { source sourceSets.main }
}
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/'), '--validate', args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/'), '--validate',
'--existing', sourceSets.main.resources.srcDirs[0] '--existing', sourceSets.main.resources.srcDirs[0]
@@ -365,8 +347,8 @@ project(':forge') {
MANIFESTS = [ MANIFESTS = [
'/': [ '/': [
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), 'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'GitCommit': grgit.head().abbreviatedId, 'GitCommit': GIT_INFO.abbreviatedId,
'Git-Branch': grgit.branch.current().getName() 'Git-Branch': GIT_INFO.branch
] as LinkedHashMap, ] as LinkedHashMap,
'net/minecraftforge/versions/forge/': [ 'net/minecraftforge/versions/forge/': [
'Specification-Title': 'Forge', 'Specification-Title': 'Forge',
@@ -419,54 +401,49 @@ project(':forge') {
] ]
} }
applyPatches {
canonicalizeAccess true
canonicalizeWhitespace true
maxFuzz 3
}
configurations { configurations {
installer { installer {
transitive = false //Don't pull all libraries, if we're missing something, add it to the installer list so the installer knows to download it. transitive = false //Don't pull all libraries, if we're missing something, add it to the installer list so the installer knows to download it.
} }
api.extendsFrom(installer) api.extendsFrom(installer)
fmllauncherImplementation.extendsFrom(installer) fmllauncherImplementation.extendsFrom(installer, implementation)
} }
dependencies { dependencies {
installer 'org.ow2.asm:asm:9.0' installer 'org.ow2.asm:asm:9.1'
installer 'org.ow2.asm:asm-commons:9.0' installer 'org.ow2.asm:asm-commons:9.1'
installer 'org.ow2.asm:asm-tree:9.0' installer 'org.ow2.asm:asm-tree:9.1'
installer 'org.ow2.asm:asm-util:9.0' installer 'org.ow2.asm:asm-util:9.1'
installer 'org.ow2.asm:asm-analysis:9.0' installer 'org.ow2.asm:asm-analysis:9.1'
installer 'cpw.mods:modlauncher:8.0.+' installer 'cpw.mods:modlauncher:8.0.9'
installer 'cpw.mods:grossjava9hacks:1.3.+' installer 'cpw.mods:grossjava9hacks:1.3.3'
installer 'net.minecraftforge:accesstransformers:3.0.+' installer 'net.minecraftforge:accesstransformers:3.0.1'
installer 'org.antlr:antlr4-runtime:4.9.1' //Dep of AccessTransformer installer 'org.antlr:antlr4-runtime:4.9.1' //Dep of AccessTransformer
installer 'net.minecraftforge:eventbus:4.0.+' installer 'net.minecraftforge:eventbus:4.0.+'
installer 'net.minecraftforge:forgespi:3.2.+' installer 'net.minecraftforge:forgespi:' + SPI_VERSION
installer 'net.minecraftforge:coremods:4.0.+' installer 'net.minecraftforge:coremods:4.0.+'
installer 'net.minecraftforge:unsafe:0.2.+' installer 'net.minecraftforge:unsafe:0.2.+'
installer 'com.electronwill.night-config:core:3.6.2' installer 'com.electronwill.night-config:core:3.6.3'
installer 'com.electronwill.night-config:toml:3.6.2' installer 'com.electronwill.night-config:toml:3.6.3'
installer 'org.jline:jline:3.12.+' installer 'org.jline:jline:3.12.+'
installer 'org.apache.maven:maven-artifact:3.6.0' installer 'org.apache.maven:maven-artifact:3.6.3'
installer 'net.jodah:typetools:0.8.+' installer 'net.jodah:typetools:0.8.3'
installer 'org.apache.logging.log4j:log4j-api:2.11.2' installer 'org.apache.logging.log4j:log4j-api:2.11.2'
installer 'org.apache.logging.log4j:log4j-core:2.11.2' installer 'org.apache.logging.log4j:log4j-core:2.11.2'
installer 'net.minecrell:terminalconsoleappender:1.2.+' installer 'net.minecrell:terminalconsoleappender:1.2.0'
installer 'net.sf.jopt-simple:jopt-simple:5.0.4' installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
installer 'org.spongepowered:mixin:0.8.2' installer 'org.spongepowered:mixin:0.8.2'
// This is org.openjdk.nashorn:nashorn-core:15.1.1 repackaged so it doesn't crash on JREs < 15. // This is org.openjdk.nashorn:nashorn-core:15.1.1 repackaged so it doesn't crash on JREs < 15.
// See: https://github.com/LexManos/NashornLegacyPackager // See: https://github.com/LexManos/NashornLegacyPackager
installer 'net.minecraftforge:nashorn-core-compat:15.1.1' installer 'net.minecraftforge:nashorn-core-compat:15.1.1.1'
fmllauncherImplementation 'com.google.guava:guava:21.0' fmllauncherImplementation 'com.google.guava:guava:21.0'
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0' fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2' fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-glfw:3.2.2' fmllauncherImplementation 'org.lwjgl:lwjgl-glfw:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-opengl:3.2.2' fmllauncherImplementation 'org.lwjgl:lwjgl-opengl:3.2.2'
fmllauncherImplementation 'org.lwjgl:lwjgl-stb:3.2.2' fmllauncherImplementation 'org.lwjgl:lwjgl-stb:3.2.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.+' testImplementation 'org.junit.vintage:junit-vintage-engine:5.+'
testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5 testImplementation 'org.opentest4j:opentest4j:1.2.0' // needed for junit 5
testImplementation 'org.hamcrest:hamcrest-all:1.3' // needs advanced matching for list order testImplementation 'org.hamcrest:hamcrest-all:1.3' // needs advanced matching for list order
} }
@@ -479,7 +456,7 @@ project(':forge') {
if (changelog.exists()) if (changelog.exists())
extraTxts += changelog extraTxts += changelog
task crowdin(type: CrowdinTask) { task crowdin(type: Crowdin) {
key = project.hasProperty('crowdinKey') ? project.crowdinKey : null key = project.hasProperty('crowdinKey') ? project.crowdinKey : null
//TODO: Merge our english.json? //TODO: Merge our english.json?
} }
@@ -488,65 +465,106 @@ project(':forge') {
['Client', 'Server', 'Joined'].each { side -> ['Client', 'Server', 'Joined'].each { side ->
def gen = tasks.getByName("gen${side}BinPatches") def gen = tasks.getByName("gen${side}BinPatches")
gen.tool = BINPATCH_TOOL gen.tool = BINPATCH_TOOL
task "apply${side}BinPatches"(type: ApplyBinPatches, dependsOn: gen) { task "apply${side}BinPatches"(type: net.minecraftforge.gradle.common.tasks.ApplyBinPatches, dependsOn: gen) {
clean = { gen.cleanJar } clean = gen.cleanJar
input = gen.output patch = gen.output
tool = BINPATCH_TOOL tool = BINPATCH_TOOL
} }
if (side != 'Joined') {
// Create SRG named Vanilla jars, using the SpecialSource we have in the installer def srgTask = tasks.getByName(patcher.notchObf ? 'createMcp2Obf' : 'createMcp2Srg')
task "create${side}SRG"(type: RenameJar, dependsOn: gen) { // Create SRG named Vanilla jars, using the SpecialSource we have in the installer
tool = SPECIAL_SOURCE + ':shaded' task "create${side}SRG"(type: net.minecraftforge.gradle.userdev.tasks.RenameJar, dependsOn: srgTask) {
args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}'] tool = SPECIAL_SOURCE_MCP + ':shaded'
mappings = { gen.srg } args = ['--stable', '--in-jar', '{input}', '--out-jar', '{output}', '--srg-in', '{mappings}']
input = { gen.cleanJar } mappings = srgTask.output
output = file("build/create${name}SRG/output.jar") input = gen.cleanJar
} output = file("build/create${name}SRG/output.jar")
} }
} }
task downloadLibraries(type: DownloadLibrariesTask, dependsOn: ':mcp:setupMCP') { task downloadLibraries(type: DownloadLibraries, dependsOn: ':mcp:setupMCP') {
input = VERSION_JSON input = VERSION_JSON
output = rootProject.file('build/libraries/') output = rootProject.file('build/libraries/')
} }
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) { task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
tool = INSTALLER_TOOLS + ':fatjar' tool = INSTALLER_TOOLS + ':fatjar'
input { genJoinedBinPatches.cleanJar } input = genJoinedBinPatches.cleanJar
doFirst { downloadLibraries.libraries.each{ addLibrary(it) } } libraries.addAll downloadLibraries.librariesOutput.map { rf -> Files.readAllLines(rf.asFile.toPath()).stream().map(File::new).collect(java.util.stream.Collectors.toList()) }
} }
task checkATs(type: CheckATs, dependsOn: extractInheritance) { task findFieldInstanceChecks(type: FieldCompareFinder, dependsOn: ['createJoinedSRG']) {
jar = tasks.getByName('createJoinedSRG').output
output = rootProject.file('src/main/resources/coremods/field_to_instanceof.json')
fields {
bows {
cls = 'net/minecraft/item/Items'
name = 'field_151031_f'
replacement = 'net/minecraft/item/BowItem'
}
crossbows {
cls = 'net/minecraft/item/Items'
name = 'field_222114_py'
replacement = 'net/minecraft/item/CrossbowItem'
}
filled_map {
cls = 'net/minecraft/item/Items'
name = 'field_151098_aY'
replacement = 'net/minecraft/item/FilledMapItem'
blacklist 'net/minecraft/client/gui/screen/inventory/CartographyTableScreen', 'func_230450_a_', '(Lcom/mojang/blaze3d/matrix/MatrixStack;FII)V'
blacklist 'net/minecraft/client/renderer/entity/ItemFrameRenderer', 'func_225623_a_', '(Lnet/minecraft/entity/item/ItemFrameEntity;FFLcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;I)V'
blacklist 'net/minecraft/item/crafting/MapCloningRecipe'
blacklist 'net/minecraft/item/crafting/MapExtendingRecipe'
}
fishing_rod {
cls = 'net/minecraft/item/Items'
name = 'field_151112_aM'
replacement = 'net/minecraft/item/FishingRodItem'
}
shears {
cls = 'net/minecraft/item/Items'
name = 'field_151097_aZ'
replacement = 'net/minecraft/item/ShearsItem'
}
}
}
task checkATs(type: CheckATs, dependsOn: [extractInheritance, createSrg2Mcp]) {
inheritance = extractInheritance.output inheritance = extractInheritance.output
ats = patcher.accessTransformers ats.from patcher.accessTransformers
mappings = createSrg2Mcp.output
} }
task checkSAS(type: CheckSAS, dependsOn: extractInheritance) { task checkSAS(type: CheckSAS, dependsOn: extractInheritance) {
inheritance = extractInheritance.output inheritance = extractInheritance.output
sass = patcher.sideAnnotationStrippers sass.from patcher.sideAnnotationStrippers
} }
task checkExcs(type: CheckExcs, dependsOn: jar) {
binary = jar.archivePath
excs = patcher.excs
}
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs]){}
task checkPatchesAndFix(type: CheckPatches) { task checkExcs(type: CheckExcs, dependsOn: jar) {
binary = jar.archiveFile
excs.from patcher.excs
}
task checkAll(dependsOn: [checkATs, checkSAS, checkExcs, findFieldInstanceChecks]){}
task checkPatchesAndFix(type: CheckPatches, dependsOn: genPatches) {
patchDir = file("$rootDir/patches") patchDir = file("$rootDir/patches")
autoFix = true autoFix = true
} }
task checkPatches(type: CheckPatches) { task checkPatches(type: CheckPatches, dependsOn: genPatches) {
patchDir = file("$rootDir/patches") patchDir = file("$rootDir/patches")
autoFix = false autoFix = false
} }
project(':forge').getTasks().getByName('genPatches').finalizedBy(checkPatches) genPatches {
finalizedBy checkPatches
autoHeader true
lineEnding = '\n'
}
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) { task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
inputs.file universalJar.archivePath inputs.file universalJar.archiveFile
inputs.file { launcherJar.archivePath } inputs.file { launcherJar.archiveFile }
ext { ext {
output = file('build/version.json') output = file('build/version.json')
vanilla = project(':mcp').file('build/mcp/downloadJson/version.json') vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
@@ -573,7 +591,18 @@ project(':forge') {
inheritsFrom: MC_VERSION, inheritsFrom: MC_VERSION,
logging: {}, logging: {},
arguments: [ arguments: [
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"] game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"],
// Support running with Java 8 and up, including 16
jvm: [
// Allow these JVM args to not crash Java 8
'-XX:+IgnoreUnrecognizedVMOptions',
// ModLauncher uses sun.security.util.ManifestEntryVerifier and needs access to it
'--add-exports=java.base/sun.security.util=ALL-UNNAMED',
// JDK bug, not fixed properly - https://bugs.openjdk.java.net/browse/JDK-8186019
'--add-exports=jdk.naming.dns/com.sun.jndi.dns=java.naming',
// ModLauncher reflects field 'jv' in java.util.jar.JarVerifier
'--add-opens=java.base/java.util.jar=ALL-UNNAMED'
]
], ],
libraries: [ libraries: [
[ [
@@ -583,8 +612,8 @@ project(':forge') {
artifact: [ artifact: [
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar", path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
sha1: launcherJar.archivePath.sha1(), sha1: launcherJar.archiveFile.get().asFile.sha1(),
size: launcherJar.archivePath.length() size: launcherJar.archiveFile.get().asFile.length()
] ]
] ]
] ]
@@ -603,7 +632,7 @@ project(':forge') {
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches/*, createClientSRG, createServerSRG*/]) { task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches/*, createClientSRG, createServerSRG*/]) {
ext { ext {
output = file('build/install_profile.json') output = file('build/install_profile.json')
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.2' JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.4'
} }
doFirst { doFirst {
ext.BIN_PATCHER = BINPATCH_TOOL.substring(0, BINPATCH_TOOL.length() - 1 - BINPATCH_TOOL.split(':')[3].length()) ext.BIN_PATCHER = BINPATCH_TOOL.substring(0, BINPATCH_TOOL.length() - 1 - BINPATCH_TOOL.split(':')[3].length())
@@ -625,8 +654,8 @@ project(':forge') {
artifact: [ artifact: [
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}-universal.jar", path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}-universal.jar",
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
sha1: universalJar.archivePath.sha1(), sha1: universalJar.archiveFile.get().asFile.sha1(),
size: universalJar.archivePath.length() size: universalJar.archiveFile.get().asFile.length()
] ]
] ]
] ]
@@ -657,16 +686,16 @@ project(':forge') {
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:slim]" server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:slim]"
], ],
MC_SLIM_SHA: [ MC_SLIM_SHA: [
client: "'${tasks.getByName('downloadClientSlim').output.sha1()}'", client: "'${tasks.getByName('downloadClientSlim').output.get().asFile.sha1()}'",
server: "'${tasks.getByName('downloadServerSlim').output.sha1()}'" server: "'${tasks.getByName('downloadServerSlim').output.get().asFile.sha1()}'"
], ],
MC_EXTRA: [ MC_EXTRA: [
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:extra]", client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:extra]",
server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:extra]" server: "[net.minecraft:server:${MC_VERSION}-${MCP_VERSION}:extra]"
], ],
MC_EXTRA_SHA: [ MC_EXTRA_SHA: [
client: "'${tasks.getByName('downloadClientExtra').output.sha1()}'", client: "'${tasks.getByName('downloadClientExtra').output.get().asFile.sha1()}'",
server: "'${tasks.getByName('downloadServerExtra').output.sha1()}'" server: "'${tasks.getByName('downloadServerExtra').output.get().asFile.sha1()}'"
], ],
MC_SRG: [ MC_SRG: [
client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:srg]", client: "[net.minecraft:client:${MC_VERSION}-${MCP_VERSION}:srg]",
@@ -681,8 +710,8 @@ project(':forge') {
server: "[${project.group}:${project.name}:${project.version}:server]" server: "[${project.group}:${project.name}:${project.version}:server]"
], ],
PATCHED_SHA: [ PATCHED_SHA: [
client: "'${applyClientBinPatches.output.sha1()}'", client: "'${applyClientBinPatches.output.get().asFile.sha1()}'",
server: "'${applyServerBinPatches.output.sha1()}'" server: "'${applyServerBinPatches.output.get().asFile.sha1()}'"
], ],
MCP_VERSION: [ MCP_VERSION: [
client: "'${MCP_VERSION}'", client: "'${MCP_VERSION}'",
@@ -713,8 +742,8 @@ project(':forge') {
'{MC_EXTRA}': '{MC_EXTRA_SHA}' '{MC_EXTRA}': '{MC_EXTRA_SHA}'
] ]
], [ ], [
jar: SPECIAL_SOURCE, jar: SPECIAL_SOURCE_MCP,
classpath: getClasspath(project, libs, SPECIAL_SOURCE), classpath: getClasspath(project, libs, SPECIAL_SOURCE_MCP),
args: [ args: [
//'--stable', Java 9 Is borked, https://bugs.openjdk.java.net/browse/JDK-8184940 TODO: find a fix. //'--stable', Java 9 Is borked, https://bugs.openjdk.java.net/browse/JDK-8184940 TODO: find a fix.
'--in-jar', '{MC_SLIM}', '--in-jar', '{MC_SLIM}',
@@ -761,7 +790,7 @@ project(':forge') {
from extraTxts from extraTxts
// add crowdin locales // add crowdin locales
from { crowdin.output.exists() ? zipTree(crowdin.output) : null} from { crowdin.output.present && crowdin.output.get().asFile.exists() ? zipTree(crowdin.output) : null}
dependsOn crowdin dependsOn crowdin
duplicatesStrategy = 'exclude' duplicatesStrategy = 'exclude'
@@ -809,14 +838,14 @@ project(':forge') {
} }
task downloadInstaller(type: DownloadMavenArtifact) { task downloadInstaller(type: DownloadMavenArtifact) {
artifact = 'net.minecraftforge:installer:2.0.+:shrunk' artifact = 'net.minecraftforge:installer:2.1.+:shrunk'
changing = true changing = true
} }
task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) { task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) {
classifier = 'installer' archiveClassifier = 'installer'
extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension archiveExtension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
destinationDir = file('build/libs') destinationDirectory = file('build/libs')
from(extraTxts) from(extraTxts)
from(rootProject.file('/installer_logo.png')) { from(rootProject.file('/installer_logo.png')) {
rename{'big_logo.png'} rename{'big_logo.png'}
@@ -837,8 +866,10 @@ project(':forge') {
} }
from(installerJson.output) from(installerJson.output)
from(launcherJson.output) from(launcherJson.output)
from(zipTree(downloadInstaller.output)) { if (downloadInstaller.output.present) {
duplicatesStrategy = 'exclude' from(zipTree(downloadInstaller.output)) {
duplicatesStrategy = 'exclude'
}
} }
} }
@@ -852,8 +883,8 @@ project(':forge') {
storePass = jarsigner.storepass storePass = jarsigner.storepass
keyPass = jarsigner.keypass keyPass = jarsigner.keypass
keyStore = jarsigner.keystore keyStore = jarsigner.keystore
inputFile = t.archivePath inputFile = t.archiveFile
outputFile = t.archivePath outputFile = t.archiveFile
doFirst { doFirst {
project.logger.lifecycle('Signing: ' + inputFile) project.logger.lifecycle('Signing: ' + inputFile)
} }
@@ -862,10 +893,10 @@ project(':forge') {
} }
task makeMdk(type: Zip) { task makeMdk(type: Zip) {
baseName = project.name archiveBaseName = project.name
classifier = 'mdk' archiveClassifier = 'mdk'
version = project.version archiveVersion = project.version
destinationDir = file('build/libs') destinationDirectory = file('build/libs')
from rootProject.file('gradlew') from rootProject.file('gradlew')
from rootProject.file('gradlew.bat') from rootProject.file('gradlew.bat')
@@ -896,13 +927,19 @@ project(':forge') {
userdevConfig { userdevConfig {
def artifacts = getArtifacts(project, project.configurations.installer, true) def artifacts = getArtifacts(project, project.configurations.installer, true)
artifacts.each { key, lib -> artifacts.each { key, lib ->
addLibrary(lib.name) libraries.add(lib.name)
} }
addLibrary("${project.group}:${project.name}:${project.version}:launcher") libraries.add("${project.group}:${project.name}:${project.version}:launcher")
runs { runs {
client { client {
main 'net.minecraftforge.userdev.LaunchTesting' main 'net.minecraftforge.userdev.LaunchTesting'
// Support mod devs running on Java 8 and up, including 16
jvmArgs '-XX:+IgnoreUnrecognizedVMOptions'
jvmArgs '--add-exports=java.base/sun.security.util=ALL-UNNAMED'
jvmArgs '--add-exports=jdk.naming.dns/com.sun.jndi.dns=java.naming'
jvmArgs '--add-opens=java.base/java.util.jar=ALL-UNNAMED'
environment 'target', 'fmluserdevclient' environment 'target', 'fmluserdevclient'
environment 'assetIndex', '{asset_index}' environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', '{assets_root}' environment 'assetDirectory', '{assets_root}'
@@ -919,6 +956,12 @@ project(':forge') {
server { server {
main 'net.minecraftforge.userdev.LaunchTesting' main 'net.minecraftforge.userdev.LaunchTesting'
// Support mod devs running on Java 8 and up, including 16
jvmArgs '-XX:+IgnoreUnrecognizedVMOptions'
jvmArgs '--add-exports=java.base/sun.security.util=ALL-UNNAMED'
jvmArgs '--add-exports=jdk.naming.dns/com.sun.jndi.dns=java.naming'
jvmArgs '--add-opens=java.base/java.util.jar=ALL-UNNAMED'
environment 'target', 'fmluserdevserver' environment 'target', 'fmluserdevserver'
environment 'MC_VERSION', "${MC_VERSION}" environment 'MC_VERSION', "${MC_VERSION}"
@@ -932,7 +975,15 @@ project(':forge') {
data { data {
main 'net.minecraftforge.userdev.LaunchTesting' main 'net.minecraftforge.userdev.LaunchTesting'
// Support mod devs running on Java 8 and up, including 16
jvmArgs '-XX:+IgnoreUnrecognizedVMOptions'
jvmArgs '--add-exports=java.base/sun.security.util=ALL-UNNAMED'
jvmArgs '--add-exports=jdk.naming.dns/com.sun.jndi.dns=java.naming'
jvmArgs '--add-opens=java.base/java.util.jar=ALL-UNNAMED'
environment 'target', 'fmluserdevdata' environment 'target', 'fmluserdevdata'
environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', '{assets_root}'
environment 'MC_VERSION', "${MC_VERSION}" environment 'MC_VERSION', "${MC_VERSION}"
environment 'FORGE_GROUP', "${project.group}" environment 'FORGE_GROUP', "${project.group}"
@@ -947,6 +998,10 @@ project(':forge') {
license { license {
header = file("$rootDir/LICENSE-header.txt") header = file("$rootDir/LICENSE-header.txt")
ext {
year = new Date().format("yyyy")
}
include 'net/minecraftforge/' include 'net/minecraftforge/'
exclude 'net/minecraftforge/server/terminalconsole/' exclude 'net/minecraftforge/server/terminalconsole/'
exclude 'net/minecraftforge/api/' // exclude API here because it's validated in the SPI build exclude 'net/minecraftforge/api/' // exclude API here because it's validated in the SPI build
@@ -958,10 +1013,10 @@ project(':forge') {
tasks { tasks {
main { main {
files = files("$rootDir/src/main/java") files.from files("$rootDir/src/main/java")
} }
test { test {
files = files("$rootDir/src/test/java") files.from files("$rootDir/src/test/java")
} }
} }
} }
@@ -972,15 +1027,20 @@ project(':forge') {
classifier 'userdev-temp' classifier 'userdev-temp'
} }
task userdevExtrasReobf(type:TaskReobfuscateJar) { reobfJar {
tool = SPECIAL_SOURCE + ':shaded'
}
task userdevExtrasReobf(type: ReobfuscateJar) {
dependsOn userdevExtras, createMcp2Srg dependsOn userdevExtras, createMcp2Srg
input = tasks.userdevExtras.archivePath input = tasks.userdevExtras.archiveFile
classpath = project.configurations.compile classpath.from project.configurations.userdevCompileClasspath
srg = tasks.createMcp2Srg.output srg = tasks.createMcp2Srg.output
tool = SPECIAL_SOURCE + ':shaded'
} }
userdevJar { userdevJar {
dependsOn userdevExtrasReobf dependsOn tasks.userdevExtrasReobf
from (zipTree(tasks.userdevExtrasReobf.output)) { from (zipTree(tasks.userdevExtrasReobf.output)) {
into '/inject/' into '/inject/'
} }
@@ -990,21 +1050,22 @@ project(':forge') {
} }
extractRangeMap { extractRangeMap {
addDependencies jar.archivePath dependencies.from jar.archiveFile
addSources sourceSets.userdev.java.srcDirs sources.from sourceSets.userdev.java.srcDirs
} }
applyRangeMap { applyRangeMap {
setSources sourceSets.userdev.java.srcDirs sources.from sourceSets.userdev.java.srcDirs
} }
tasks.eclipse.dependsOn('genEclipseRuns') tasks.eclipse.dependsOn('genEclipseRuns')
if (project.hasProperty('UPDATE_MAPPINGS')) { if (project.hasProperty('UPDATE_MAPPINGS')) {
extractRangeMap { extractRangeMap {
sources sourceSets.test.java.srcDirs sources.from sourceSets.test.java.srcDirs
addDependencies compileTestJava.classpath
} }
applyRangeMap { applyRangeMap {
sources sourceSets.test.java.srcDirs sources.from sourceSets.test.java.srcDirs
} }
sourceSets.test.java.srcDirs.each { extractMappedNew.addTarget it } sourceSets.test.java.srcDirs.each { extractMappedNew.addTarget it }
} }
@@ -1053,12 +1114,15 @@ project(':forge') {
} }
repositories { repositories {
maven { maven {
if (project.hasProperty('forgeMavenPassword')) { if (System.env.MAVEN_USER) {
credentials { url "https://maven.minecraftforge.net/releases/"
username project.properties.forgeMavenUser authentication {
password project.properties.forgeMavenPassword basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?: 'not'
password = System.env.MAVEN_PASSWORD ?: 'set'
} }
url 'https://files.minecraftforge.net/maven/manage/upload'
} else { } else {
url 'file://' + rootProject.file('repo').getAbsolutePath() url 'file://' + rootProject.file('repo').getAbsolutePath()
} }
+5 -6
View File
@@ -1,10 +1,9 @@
repositories { repositories {
//mavenCentral() //TODO: Update Gradle to use HTTPS by default maven { url = 'https://maven.minecraftforge.net/' }
maven { mavenCentral()
name 'maven_central'
url 'https://repo.maven.apache.org/maven2/'
}
} }
dependencies { dependencies {
implementation 'org.ow2.asm:asm:7.2' implementation 'org.ow2.asm:asm:9.1'
implementation 'org.ow2.asm:asm-tree:9.1'
implementation 'net.minecraftforge:srgutils:0.4.+'
} }
@@ -0,0 +1,64 @@
package net.minecraftforge.forge.tasks
import groovy.json.JsonBuilder
import org.gradle.api.DefaultTask
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.ClassReader
import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.FieldNode
import org.objectweb.asm.tree.MethodNode
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
abstract class BytecodeFinder extends DefaultTask {
@InputFile abstract RegularFileProperty getJar()
@OutputFile abstract RegularFileProperty getOutput()
BytecodeFinder() {
output.convention(project.layout.buildDirectory.dir(name).map { it.file("output.json") })
}
@TaskAction
protected void exec() {
Util.init()
def outputFile = output.get().asFile
if (outputFile.exists())
outputFile.delete()
pre()
jar.get().asFile.withInputStream { i ->
new ZipInputStream(i).withCloseable { zin ->
ZipEntry zein
while ((zein = zin.nextEntry) != null) {
if (zein.name.endsWith('.class')) {
def node = new ClassNode(Opcodes.ASM9)
new ClassReader(zin).accept(node, 0)
process(node)
}
}
}
}
post()
outputFile.text = new JsonBuilder(getData()).toPrettyString()
}
protected process(ClassNode node) {
if (node.fields != null) node.fields.each { process(node, it) }
if (node.methods != null) node.methods.each { process(node, it) }
}
protected pre() {}
protected process(ClassNode parent, FieldNode node) {}
protected process(ClassNode parent, MethodNode node) {}
protected post() {}
protected abstract Object getData()
}
@@ -1,20 +1,23 @@
package net.minecraftforge.forge.tasks package net.minecraftforge.forge.tasks
import java.util.ArrayList import net.minecraftforge.srgutils.IMappingFile
import java.util.TreeMap
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
public class CheckATs extends DefaultTask { abstract class CheckATs extends DefaultTask {
@InputFile File inheritance @InputFile abstract RegularFileProperty getInheritance()
@InputFiles File[] ats @InputFiles abstract ConfigurableFileCollection getAts()
@InputFile @Optional abstract RegularFileProperty getMappings()
@TaskAction @TaskAction
protected void exec() { protected void exec() {
def mappings = mappings.map { IMappingFile.load(it.asFile) }.getOrNull()
Util.init() Util.init()
def parse = { line -> def parse = { line ->
def idx = line.indexOf('#') def idx = line.indexOf('#')
@@ -41,7 +44,7 @@ public class CheckATs extends DefaultTask {
default: return -1 default: return -1
} }
} }
def json = inheritance.json() def json = inheritance.get().asFile.json()
ats.each { f -> ats.each { f ->
TreeMap lines = [:] TreeMap lines = [:]
@@ -51,12 +54,12 @@ public class CheckATs extends DefaultTask {
if (line.startsWith('#group ')) { if (line.startsWith('#group ')) {
def (modifier, cls, desc, comment, key) = parse.call(line.substring(7)) def (modifier, cls, desc, comment, key) = parse.call(line.substring(7))
if (!desc.equals('*') && !desc.equals('*()') && !desc.equals('<init>')) if (desc != '*' && desc != '*()' && desc != '<init>')
throw new IllegalStateException('Invalid group: ' + line) throw new IllegalStateException('Invalid group: ' + line)
group = [modifier: modifier, cls: cls, desc: desc, comment: comment, group = [modifier: modifier, cls: cls, desc: desc, comment: comment,
'existing': [] as Set, existing: [] as Set,
'children': [] as TreeSet, children: [] as TreeSet,
group: true group: true
] ]
if (lines.containsKey(key)) if (lines.containsKey(key))
@@ -93,7 +96,7 @@ public class CheckATs extends DefaultTask {
if (jcls == null) { if (jcls == null) {
lines.remove(key) lines.remove(key)
println('Invalid Group: ' + key) println('Invalid Group: ' + key)
} else if ('*'.equals(entry['desc'])) { } else if ('*' == entry['desc']) {
if (!jcls.containsKey('fields')) { if (!jcls.containsKey('fields')) {
lines.remove(key) lines.remove(key)
println('Invalid Group, Class has no fields: ' + key) println('Invalid Group, Class has no fields: ' + key)
@@ -114,13 +117,13 @@ public class CheckATs extends DefaultTask {
} }
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) } entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
} }
} else if ('*()'.equals(entry['desc'])) { } else if ('*()' == entry['desc']) {
if (!jcls.containsKey('methods')) { if (!jcls.containsKey('methods')) {
lines.remove(key) lines.remove(key)
println('Invalid Group, Class has no methods: ' + key) println('Invalid Group, Class has no methods: ' + key)
} else { } else {
jcls['methods'].each{ mtd, value -> jcls['methods'].each{ mtd, value ->
if (mtd.startsWith('<clinit>')) if (mtd.startsWith('<clinit>') || mtd.startsWith('lambda$'))
return return
key = cls + ' ' + mtd.replace(' ', '') key = cls + ' ' + mtd.replace(' ', '')
if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) { if (accessLevel.call(value['access']) < accessStr.call(entry['modifier'])) {
@@ -137,7 +140,7 @@ public class CheckATs extends DefaultTask {
} }
entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) } entry['existing'].stream().findAll{ !entry['children'].contains(it) }.each{ println('Removed: ' + it) }
} }
} else if ('<init>'.equals(entry['desc'])) { //Make all public non-abstract subclasses } else if ('<init>' == entry['desc']) { //Make all public non-abstract subclasses
json.each{ tcls,value -> json.each{ tcls,value ->
if (!value.containsKey('methods') || ((value['access'] & Opcodes.ACC_ABSTRACT) != 0)) if (!value.containsKey('methods') || ((value['access'] & Opcodes.ACC_ABSTRACT) != 0))
return return
@@ -182,7 +185,7 @@ public class CheckATs extends DefaultTask {
lines.remove(key) lines.remove(key)
println('Invalid: ' + key) println('Invalid: ' + key)
} else if (entry['desc'] == '') { } else if (entry['desc'] == '') {
if (accessLevel.call(jcls['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) { if (accessLevel.call(jcls['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key) lines.remove(key)
println('Invalid Narrowing: ' + key) println('Invalid Narrowing: ' + key)
} }
@@ -192,7 +195,7 @@ public class CheckATs extends DefaultTask {
println('Invalid: ' + key) println('Invalid: ' + key)
} else { } else {
def value = jcls['fields'][entry['desc']] def value = jcls['fields'][entry['desc']]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) { if (accessLevel.call(value['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key) lines.remove(key)
println('Invalid Narrowing: ' + key) println('Invalid Narrowing: ' + key)
println(entry.comment) println(entry.comment)
@@ -205,7 +208,7 @@ public class CheckATs extends DefaultTask {
println('Invalid: ' + key) println('Invalid: ' + key)
} else { } else {
def value = jcls['methods'][jdesc] def value = jcls['methods'][jdesc]
if (accessLevel.call(value['access']) >= accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) { if (accessLevel.call(value['access']) > accessStr.call(entry['modifier']) && (entry.comment == null || !entry.comment.startsWith('#force '))) {
lines.remove(key) lines.remove(key)
println('Invalid Narrowing: ' + key) println('Invalid Narrowing: ' + key)
} }
@@ -216,12 +219,44 @@ public class CheckATs extends DefaultTask {
def data = [] def data = []
def remapComment = { entry ->
if (!mappings || !entry || !entry.desc) return null
def comment = entry.comment?.substring(1)?.trim()
def jsonCls = json.get(entry.cls.replaceAll('\\.', '/'))
def mappingsClass = mappings?.getClass(jsonCls.name)
if (!mappingsClass) return entry.comment
def idx = entry.desc.indexOf('(')
def mappedName = idx == -1
? mappingsClass.remapField(entry.desc)
: mappingsClass.remapMethod(entry.desc.substring(0, idx), entry.desc.substring(idx))
if (!mappedName) return entry.comment
if (mappedName == '<init>')
mappedName = 'constructor'
if (comment?.startsWith(mappedName))
return '# ' + comment
if (comment && comment.indexOf(' ') != -1) {
def split = comment.split(" - ").toList()
if (split[0].indexOf(' ') != -1)
// The first string is more than one word, so append before it
return "# ${mappedName} - ${comment}"
split.remove(0)
return "# ${mappedName} - ${String.join(' - ', split)}"
}
return '# ' + mappedName
}
lines.each { key,value -> lines.each { key,value ->
if (!value.group) { if (!value.group) {
data.add(value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment)) def comment = remapComment.call(value)
data.add(value.modifier + ' ' + key + (comment ? ' ' + comment : ''))
} else { } else {
data.add('#group ' + value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment)) data.add('#group ' + value.modifier + ' ' + key + (value.comment == null ? '' : ' ' + value.comment))
value.children.each{ data.add(value.modifier + ' ' + it) } value.children.each {
def line = value.modifier + ' ' + it
def (modifier, cls, desc, comment) = parse.call(line)
comment = remapComment.call([modifier: modifier, cls: cls, desc: desc, comment: comment])
data.add(line + (comment ? ' ' + comment : ''))
}
data.add('#endgroup') data.add('#endgroup')
} }
} }
@@ -1,33 +1,27 @@
package net.minecraftforge.forge.tasks package net.minecraftforge.forge.tasks
import java.util.ArrayList
import java.util.TreeMap
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.*
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
import java.util.zip.ZipEntry import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream import java.util.zip.ZipInputStream
public class CheckExcs extends DefaultTask { abstract class CheckExcs extends DefaultTask {
@InputFile File binary @InputFile abstract RegularFileProperty getBinary()
@InputFiles File[] excs @InputFiles abstract ConfigurableFileCollection getExcs()
@TaskAction @TaskAction
protected void exec() { protected void exec() {
Util.init() Util.init()
def known = [] def known = []
binary.withInputStream { i -> binary.get().asFile.withInputStream { i ->
new ZipInputStream(i).withCloseable { zin -> new ZipInputStream(i).withCloseable { zin ->
def visitor = new ClassVisitor(Opcodes.ASM7) { def visitor = new ClassVisitor(Opcodes.ASM9) {
private String cls private String cls
@Override @Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
@@ -68,8 +62,7 @@ public class CheckExcs extends DefaultTask {
def (key, value) = line.split('=', 2) def (key, value) = line.split('=', 2)
if (!known.contains(key)) { if (!known.contains(key)) {
println(key) println('Unknown: ' + line)
println('Invalid: ' + line)
return return
} }
@@ -1,6 +1,7 @@
package net.minecraftforge.forge.tasks package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.tasks.Input import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
@@ -9,8 +10,8 @@ import java.nio.file.Files
import java.nio.file.Paths import java.nio.file.Paths
import java.util.regex.Pattern import java.util.regex.Pattern
public class CheckPatches extends DefaultTask { abstract class CheckPatches extends DefaultTask {
@InputDirectory File patchDir @InputDirectory abstract DirectoryProperty getPatchDir()
@Input boolean autoFix = false @Input boolean autoFix = false
@TaskAction @TaskAction
@@ -21,7 +22,7 @@ public class CheckPatches extends DefaultTask {
] ]
def verified = true; def verified = true;
project.fileTree(patchDir).each { patch -> patchDir.get().asFileTree.each { patch ->
def patchPath = project.rootDir.toPath().relativize(patch.toPath()) def patchPath = project.rootDir.toPath().relativize(patch.toPath())
verified &= verifyPatch(patch, autoFix, patchPath.toString(), hasS2SArtifact.contains(patchPath)) verified &= verifyPatch(patch, autoFix, patchPath.toString(), hasS2SArtifact.contains(patchPath))
} }
@@ -31,7 +32,7 @@ public class CheckPatches extends DefaultTask {
} }
def verifyPatch(patch, fix, patchPath, hasS2SArtifact) { def verifyPatch(patch, fix, patchPath, hasS2SArtifact) {
def hunk_start_pattern = Pattern.compile('^@@ -[0-9,]* \\+[0-9,]* @@$') def hunk_start_pattern = Pattern.compile('^@@ -[0-9,]* \\+[0-9,_]* @@$')
def white_space_pattern = Pattern.compile('^[+\\-]\\s*$') def white_space_pattern = Pattern.compile('^[+\\-]\\s*$')
def import_pattern = Pattern.compile('^[+\\-]\\s*import.*') def import_pattern = Pattern.compile('^[+\\-]\\s*import.*')
def field_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$') def field_pattern = Pattern.compile('^[+\\-][\\s]*((public|protected|private)[\\s]*)?(static[\\s]*)?(final)?([^=;]*)(=.*)?;\\s*$')
@@ -1,22 +1,20 @@
package net.minecraftforge.forge.tasks package net.minecraftforge.forge.tasks
import java.util.ArrayList
import java.util.TreeMap
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
import org.objectweb.asm.Opcodes
public class CheckSAS extends DefaultTask { abstract class CheckSAS extends DefaultTask {
@InputFile File inheritance @InputFile abstract RegularFileProperty getInheritance()
@InputFiles File[] sass @InputFiles abstract ConfigurableFileCollection getSass()
@TaskAction @TaskAction
protected void exec() { protected void exec() {
Util.init() Util.init()
def json = inheritance.json() def json = inheritance.get().asFile.json()
sass.each { f -> sass.each { f ->
def lines = [] def lines = []
@@ -0,0 +1,31 @@
package net.minecraftforge.forge.tasks
import java.util.function.BiConsumer
public class ClosureHelper {
BiConsumer<String, Closure> callback
public ClosureHelper(Closure cl, BiConsumer<String, Closure> callback) {
this.callback = callback
apply(this, cl)
}
def methodMissing(String name, Object args) {
if (!args.class.isArray()) return
Object[] aargs = (Object[])args
if (aargs.length == 1 && aargs[0] instanceof Closure) {
this.callback.accept(name, (Closure)aargs[0])
} else {
throw new IllegalArgumentException('Unknown method: "' + name + '" with arguments ' + args + ' for ' + this)
}
}
static <T> T apply(T obj, Closure cl) {
cl.delegate = obj
cl.resolveStrategy = Closure.DELEGATE_FIRST
cl()
return obj
}
}
@@ -1,47 +1,55 @@
package net.minecraftforge.forge.tasks package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.Optional import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import java.util.zip.ZipEntry import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream import java.util.zip.ZipOutputStream
import java.net.URL
public class CrowdinTask extends DefaultTask { abstract class Crowdin extends DefaultTask {
@Input String id = 'minecraft-forge' @Input abstract Property<String> getId()
@Input @Optional String key @Input @Optional abstract Property<String> getKey()
@Input boolean json = true @Input boolean json = true
@OutputFile output = project.file("build/${name}/output.zip") @OutputFile abstract RegularFileProperty getOutput()
@OutputFile export = project.file("build/${name}/export.json") @OutputFile abstract RegularFileProperty getExport()
CrowdinTask() { Crowdin() {
outputs.upToDateWhen{ false } outputs.upToDateWhen{ false }
id.convention('minecraft-forge')
output.convention(project.layout.buildDirectory.dir(name).map {it.file("output.zip") })
export.convention(project.layout.buildDirectory.dir(name).map {it.file("export.json") })
} }
@TaskAction @TaskAction
def run() { def run() {
if (output.exists()) File outputFile = output.get().asFile
output.delete() File exportFile = export.get().asFile
if (outputFile.exists())
outputFile.delete()
if (key == null) if (!key.isPresent())
return return
String key = this.key.get()
String id = this.id.get()
// Force an export // Force an export
new URL("https://api.crowdin.com/api/project/${id}/export?key=${key}").withInputStream { i -> new URL("https://api.crowdin.com/api/project/${id}/export?key=${key}").withInputStream { i ->
export.withOutputStream { it << i } exportFile.withOutputStream { it << i }
} }
if (!export.text.contains('success')) { if (!exportFile.text.contains('success')) {
throw new RuntimeException("Crowdin export failed, see ${export} for more info") throw new RuntimeException("Crowdin export failed, see ${exportFile} for more info")
} }
new URL("https://api.crowdin.com/api/project/${id}/download/all.zip?key=${key}").withInputStream { i -> new URL("https://api.crowdin.com/api/project/${id}/download/all.zip?key=${key}").withInputStream { i ->
new ZipInputStream(i).withCloseable { zin -> new ZipInputStream(i).withCloseable { zin ->
output.withOutputStream { out -> outputFile.withOutputStream { out ->
new ZipOutputStream(out).withCloseable { zout -> new ZipOutputStream(out).withCloseable { zout ->
ZipEntry zein ZipEntry zein
while ((zein = zin.nextEntry) != null) { while ((zein = zin.nextEntry) != null) {
@@ -0,0 +1,51 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import java.nio.file.Files
abstract class DownloadLibraries extends DefaultTask {
@InputFile abstract RegularFileProperty getInput()
@OutputDirectory abstract DirectoryProperty getOutput()
@OutputFile abstract RegularFileProperty getLibrariesOutput()
DownloadLibraries() {
output.convention(project.layout.buildDirectory.dir(name))
librariesOutput.convention(project.layout.buildDirectory.dir(name).map(d -> d.file('libraries.txt')))
}
@TaskAction
def run() {
Util.init()
File outputDir = output.get().asFile
def libraries = new ArrayList()
def json = input.get().asFile.json().libraries.each { lib ->
//TODO: Thread?
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = new File(outputDir, art.path)
libraries.add(target.absolutePath)
if (!target.exists() || !art.sha1.equals(target.sha1())) {
project.logger.lifecycle("Downloading ${art.url}")
if (!target.parentFile.exists()) {
target.parentFile.mkdirs()
}
new URL(art.url).withInputStream { i ->
target.withOutputStream { it << i }
}
if (!art.sha1.equals(target.sha1())) {
throw new IllegalStateException("Failed to download ${art.url} to ${target.canonicalPath} SHA Mismatch")
}
}
}
}
Files.write(librariesOutput.get().asFile.toPath(), libraries)
}
}
@@ -1,43 +0,0 @@
package net.minecraftforge.forge.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.OutputDirectory
import java.io.File
import java.util.HashSet
import java.util.Set
import java.net.URL
public class DownloadLibrariesTask extends DefaultTask {
@InputFile File input
@OutputDirectory File output = project.file("build/${name}/")
Set<File> libraries = new HashSet<>()
@TaskAction
def run() {
Util.init()
def json = input.json().libraries.each { lib ->
//TODO: Thread?
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = new File(output, art.path)
libraries.add(target)
if (!target.exists() || !art.sha1.equals(target.sha1())) {
project.logger.lifecycle("Downloading ${art.url}")
if (!target.parentFile.exists()) {
target.parentFile.mkdirs()
}
new URL(art.url).withInputStream { i ->
target.withOutputStream { it << i }
}
if (!art.sha1.equals(target.sha1())) {
throw new IllegalStateException("Failed to download ${art.url} to ${target.canonicalPath} SHA Mismatch")
}
}
}
}
}
}
@@ -0,0 +1,100 @@
package net.minecraftforge.forge.tasks
import groovy.transform.EqualsAndHashCode
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.Optional
import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.MethodNode
import static org.objectweb.asm.Opcodes.*
abstract class FieldCompareFinder extends BytecodeFinder {
@Nested
Map<String, Search> fields = [:] as HashMap
@Internal
Map<Search, String> fieldsReverse = [:] as HashMap
@Internal
Map<String, Set<ObjectTarget>> targets = [:] as TreeMap
@Override
protected pre() {
//fields.each{ k,v -> logger.lifecycle("Fields: " + k + ' ' + v) }
}
@Override
protected process(ClassNode parent, MethodNode node) {
def last = null
def parentInstance = new ObjectTarget(owner: parent.name, name: '', desc: '')
for (int x = 0; x < node.instructions.size(); x++) {
def current = node.instructions.get(x)
if (current.opcode == IF_ACMPEQ || current.opcode == IF_ACMPNE) {
if (last != null && (last.opcode == GETSTATIC || last.opcode == GETFIELD)) {
def target = new Search(cls: last.owner, name: last.name)
def wanted = fieldsReverse.get(target)
def original = fields.get(wanted)
def instance = new ObjectTarget(owner: parent.name, name: node.name, desc: node.desc)
if (wanted != null && (original.blacklist == null || (!original.blacklist.contains(instance) && !original.blacklist.contains(parentInstance)))) {
targets.computeIfAbsent(wanted, { k -> new TreeSet() }).add(instance)
}
}
}
last = current
}
}
@Internal
@Override
protected Object getData() {
def ret = [:] as HashMap
targets.forEach{ k, v ->
def e = fields.get(k)
ret[k] = [
cls: e.cls,
name: e.name,
replacement: e.replacement,
targets: v
]
}
return ret
}
@EqualsAndHashCode(excludes = ['replacement', 'blacklist'])
public static class Search {
@Input
String cls
@Input
String name
@Input
String replacement
@Nested
@Optional
Set<ObjectTarget> blacklist
@Override
String toString() {
return cls + '.' + name
}
def blacklist(def owner, def name, def desc) {
if (blacklist == null)
blacklist = new HashSet()
blacklist.add(new ObjectTarget(owner: owner, name: name, desc: desc))
}
def blacklist(def owner) {
blacklist(owner, '', '')
}
}
def fields(Closure cl) {
new ClosureHelper(cl, {name, ccl ->
def search = ClosureHelper.apply(new Search(), ccl)
this.fields.put(name, search)
this.fieldsReverse.put(search, name)
})
}
}
@@ -0,0 +1,32 @@
package net.minecraftforge.forge.tasks
import groovy.transform.EqualsAndHashCode
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.Optional
@EqualsAndHashCode
public class ObjectTarget implements Comparable<ObjectTarget> {
@Input
String owner
@Input
String name
@Input
@Optional
String desc
@Override
String toString() {
if (desc == null)
return owner + '.' + name
return owner + '.' + name + desc
}
@Override
int compareTo(ObjectTarget o) {
return toString().compareTo(o.toString())
}
}
@@ -2,10 +2,8 @@ package net.minecraftforge.forge.tasks
import groovy.json.JsonSlurper import groovy.json.JsonSlurper
import java.io.File
import java.security.MessageDigest import java.security.MessageDigest
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date
public class Util { public class Util {
static void init() { static void init() {
@@ -24,6 +22,18 @@ public class Util {
def result = format.format(delegate) def result = format.format(delegate)
return result[0..21] + ':' + result[22..-1] return result[0..21] + ':' + result[22..-1]
} }
String.metaClass.rsplit = { String del, int limit = -1 ->
def lst = new ArrayList()
def x = 0, idx
def tmp = delegate
while ((idx = tmp.lastIndexOf(del)) != -1 && (limit == -1 || x++ < limit)) {
lst.add(0, tmp.substring(idx + del.length(), tmp.length()))
tmp = tmp.substring(0, idx)
}
lst.add(0, tmp)
return lst
}
} }
public static String[] getClasspath(project, libs, artifact) { public static String[] getClasspath(project, libs, artifact) {
@@ -56,7 +66,7 @@ public class Util {
def path = "${folder}${filename}" def path = "${folder}${filename}"
def url = "https://libraries.minecraft.net/${path}" def url = "https://libraries.minecraft.net/${path}"
if (!checkExists(url)) { if (!checkExists(url)) {
url = "https://files.minecraftforge.net/maven/${path}" url = "https://maven.minecraftforge.net/${path}"
} }
//TODO remove when Mojang launcher is updated //TODO remove when Mojang launcher is updated
if (!classifiers && art.classifier != null) { if (!classifiers && art.classifier != null) {
+2 -2
View File
@@ -2,8 +2,8 @@
MinecraftForge 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.16.3-&query=$.promos["1.16.3-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net) [![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.16.5-&query=$.promos["1.16.5-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.16.3-&query=$.promos["1.16.3-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo= [![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.16.5-&query=$.promos["1.16.5-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) )](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)
Forge is a free, open-source modding API all of your favourite mods use! Forge is a free, open-source modding API all of your favourite mods use!
+4
View File
@@ -0,0 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Vendored
+33 -20
View File
@@ -1,5 +1,21 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
############################################################################## ##############################################################################
## ##
## Gradle start up script for UN*X ## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` 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. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS="" DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
@@ -66,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
@@ -138,19 +156,19 @@ if $cygwin ; then
else else
eval `echo args$i`="\"$arg\"" eval `echo args$i`="\"$arg\""
fi fi
i=$((i+1)) i=`expr $i + 1`
done done
case $i in case $i in
(0) set -- ;; 0) set -- ;;
(1) set -- "$args0" ;; 1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;; 2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;; 3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
@@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules # 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" 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" "$@"
Vendored
+24 -19
View File
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @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 DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -45,28 +64,14 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
+22 -29
View File
@@ -1,53 +1,46 @@
-------------------------------------------
Source installation information for modders Source installation information for modders
------------------------------------------- -------------------------------------------
This code follows the Minecraft Forge installation methodology. It will apply This code follows the Minecraft Forge installation methodology. It will apply
some small patches to the vanilla MCP source code, giving you and it access some small patches to the vanilla MCP source code, giving you and it access
to some of the data and functions you need to build a successful mod. to some of the data and functions you need to build a successful mod.
Note also that the patches are built against "unrenamed" MCP source code (aka Note also that the patches are built against "un-renamed" MCP source code (aka
srgnames) - this means that you will not be able to read them directly against SRG Names) - this means that you will not be able to read them directly against
normal code. normal code.
Source pack installation information: Setup Process:
Standalone source installation
============================== ==============================
See the Forge Documentation online for more detailed instructions:
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 1: Open your command-line and browse to the folder where you extracted the zip file.
Step 2: You're left with a choice. Step 2: You're left with a choice.
If you prefer to use Eclipse: If you prefer to use Eclipse:
1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux) 1. Run the following command: `gradlew genEclipseRuns` (`./gradlew genEclipseRuns` if you are on Mac/Linux)
2. Open Eclipse, Import > Existing Gradle Project > Select Folder 2. Open Eclipse, Import > Existing Gradle Project > Select Folder
or run "gradlew eclipse" to generate the project. 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.
If you prefer to use IntelliJ: If you prefer to use IntelliJ:
1. Open IDEA, and import project. 1. Open IDEA, and import project.
2. Select your build.gradle file and have it import. 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) 3. Run the following command: `gradlew genIntellijRuns` (`./gradlew genIntellijRuns` if you are on Mac/Linux)
4. Refresh the Gradle Project in IDEA if required. 4. Refresh the Gradle Project in IDEA if required.
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again. 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 process again.
Should it still not work, Mapping Names:
Refer to #ForgeGradle on EsperNet for more information about the gradle environment. =============================
or the Forge Project Discord discord.gg/UvedJ9m By default, the MDK is configured to use the official mapping names from Mojang for methods and fields
in the Minecraft codebase. These names are covered by a specific license. All modders should be aware of this
license, if you do not agree with it you can change your mapping names to other crowdsourced names in your
build.gradle. For the latest license text, refer to the mapping file itself, or the reference copy here:
https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
Forge source installation Additional Resources:
========================= =========================
MinecraftForge ships with this code and installs it as part of the forge Community Documentation: http://mcforge.readthedocs.io/en/latest/gettingstarted/
installation process, no further action is required on your part. LexManos' Install Video: https://www.youtube.com/watch?v=8VEdtQLuLO0
Forge Forum: https://forums.minecraftforge.net/
LexManos' Install Video Forge Discord: https://discord.gg/UvedJ9m
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be
For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
+33 -10
View File
@@ -1,11 +1,10 @@
buildscript { buildscript {
repositories { repositories {
maven { url = 'https://files.minecraftforge.net/maven' } maven { url = 'https://maven.minecraftforge.net' }
jcenter()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
} }
} }
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'net.minecraftforge.gradle'
@@ -17,13 +16,19 @@ version = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'modid' archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft { minecraft {
// The mappings can be changed at any time, and must be in the following format. // The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly. // Channel: Version:
// stable_# Stables are built at the discretion of the MCP team. // snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
//
// You must be aware of the Mojang license when using the 'official' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Use non-default mappings at your own risk. they may not always work. // Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace. // Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@' mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
@@ -38,9 +43,15 @@ minecraft {
workingDirectory project.file('run') workingDirectory project.file('run')
// Recommended logging data for a userdev environment // Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console // Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
mods { mods {
@@ -54,9 +65,15 @@ minecraft {
workingDirectory project.file('run') workingDirectory project.file('run')
// Recommended logging data for a userdev environment // Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console // Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
mods { mods {
@@ -70,9 +87,15 @@ minecraft {
workingDirectory project.file('run') workingDirectory project.file('run')
// Recommended logging data for a userdev environment // Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console // Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
@@ -148,4 +171,4 @@ publishing {
url "file:///${project.projectDir}/mcmodsrepo" url "file:///${project.projectDir}/mcmodsrepo"
} }
} }
} }
@@ -48,7 +48,7 @@ public class ExampleMod
private void doClientStuff(final FMLClientSetupEvent event) { private void doClientStuff(final FMLClientSetupEvent event) {
// do something that can only be done on the client // do something that can only be done on the client
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings); LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().options);
} }
private void enqueueIMC(final InterModEnqueueEvent event) private void enqueueIMC(final InterModEnqueueEvent event)
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java --- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java +++ b/com/mojang/blaze3d/platform/GlStateManager.java
@@ -572,10 +572,17 @@ @@ -572,10 +_,17 @@
GL13.glClientActiveTexture(p_227747_0_); GL13.glClientActiveTexture(p_227747_0_);
} }
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/IVertexBuilder.java --- a/com/mojang/blaze3d/vertex/IVertexBuilder.java
+++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java +++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java
@@ -18,7 +18,7 @@ @@ -18,7 +_,7 @@
import org.lwjgl.system.MemoryStack; import org.lwjgl.system.MemoryStack;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
Logger field_227884_f_ = LogManager.getLogger(); Logger field_227884_f_ = LogManager.getLogger();
IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_); IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_);
@@ -96,11 +96,12 @@ @@ -96,11 +_,12 @@
f5 = p_227890_3_[k] * p_227890_6_; f5 = p_227890_3_[k] * p_227890_6_;
} }
@@ -1,6 +1,6 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java --- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java +++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
@@ -63,6 +63,15 @@ @@ -63,6 +_,15 @@
})); }));
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/Advancement.java --- a/net/minecraft/advancements/Advancement.java
+++ b/net/minecraft/advancements/Advancement.java +++ b/net/minecraft/advancements/Advancement.java
@@ -309,6 +309,7 @@ @@ -309,6 +_,7 @@
} }
public static Advancement.Builder func_241043_a_(JsonObject p_241043_0_, ConditionArrayParser p_241043_1_) { public static Advancement.Builder func_241043_a_(JsonObject p_241043_0_, ConditionArrayParser p_241043_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/AdvancementList.java --- a/net/minecraft/advancements/AdvancementList.java
+++ b/net/minecraft/advancements/AdvancementList.java +++ b/net/minecraft/advancements/AdvancementList.java
@@ -96,6 +96,7 @@ @@ -96,6 +_,7 @@
} }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/AdvancementManager.java --- a/net/minecraft/advancements/AdvancementManager.java
+++ b/net/minecraft/advancements/AdvancementManager.java +++ b/net/minecraft/advancements/AdvancementManager.java
@@ -36,6 +36,10 @@ @@ -36,6 +_,10 @@
try { try {
JsonObject jsonobject = JSONUtils.func_151210_l(p_240923_3_, "advancement"); JsonObject jsonobject = JSONUtils.func_151210_l(p_240923_3_, "advancement");
Advancement.Builder advancement$builder = Advancement.Builder.func_241043_a_(jsonobject, new ConditionArrayParser(p_240923_2_, this.field_240922_d_)); Advancement.Builder advancement$builder = Advancement.Builder.func_241043_a_(jsonobject, new ConditionArrayParser(p_240923_2_, this.field_240922_d_));
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/AdvancementRewards.java --- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java +++ b/net/minecraft/advancements/AdvancementRewards.java
@@ -39,7 +39,7 @@ @@ -39,7 +_,7 @@
public void func_192113_a(ServerPlayerEntity p_192113_1_) { public void func_192113_a(ServerPlayerEntity p_192113_1_) {
p_192113_1_.func_195068_e(this.field_192115_b); p_192113_1_.func_195068_e(this.field_192115_b);
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java --- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java +++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -159,6 +159,10 @@ @@ -159,6 +_,10 @@
} }
this.func_240920_c_(p_240921_1_); this.func_240920_c_(p_240921_1_);
@@ -11,7 +11,7 @@
this.func_192752_d(); this.func_192752_d();
this.func_240919_b_(p_240921_1_); this.func_240919_b_(p_240921_1_);
} }
@@ -192,6 +196,8 @@ @@ -192,6 +_,8 @@
} }
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) { public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
@@ -20,7 +20,7 @@
boolean flag = false; boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_); AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a(); boolean flag1 = advancementprogress.func_192105_a();
@@ -204,6 +210,7 @@ @@ -204,6 +_,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)) { 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_240917_e_.func_232641_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()), ChatType.SYSTEM, Util.field_240973_b_); this.field_240917_e_.func_232641_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()), ChatType.SYSTEM, Util.field_240973_b_);
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/criterion/ItemPredicate.java --- a/net/minecraft/advancements/criterion/ItemPredicate.java
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java +++ b/net/minecraft/advancements/criterion/ItemPredicate.java
@@ -26,6 +26,8 @@ @@ -26,6 +_,8 @@
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
public class ItemPredicate { public class ItemPredicate {
@@ -9,7 +9,7 @@
public static final ItemPredicate field_192495_a = new ItemPredicate(); public static final ItemPredicate field_192495_a = new ItemPredicate();
@Nullable @Nullable
private final ITag<Item> field_200018_b; private final ITag<Item> field_200018_b;
@@ -105,6 +107,11 @@ @@ -105,6 +_,11 @@
public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) { public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) {
if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) { if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) {
JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item"); JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item");
@@ -21,18 +21,18 @@
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count")); MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability")); MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
if (jsonobject.has("data")) { if (jsonobject.has("data")) {
@@ -204,6 +211,14 @@ @@ -202,6 +_,14 @@
} else {
return new ItemPredicate[0];
} }
} + }
+
+ public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) { + public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) {
+ custom_predicates.put(name, deserializer); + custom_predicates.put(name, deserializer);
+ } + }
+ +
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() { + public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
+ return unmod_predicates; + return unmod_predicates;
+ } }
+
public static class Builder { public static class Builder {
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
private final List<EnchantmentPredicate> field_226657_b_ = Lists.newArrayList();
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractBlock.java --- a/net/minecraft/block/AbstractBlock.java
+++ b/net/minecraft/block/AbstractBlock.java +++ b/net/minecraft/block/AbstractBlock.java
@@ -60,7 +60,8 @@ @@ -60,7 +_,8 @@
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -10,7 +10,7 @@
protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
protected final Material field_149764_J; protected final Material field_149764_J;
protected final boolean field_235688_at_; protected final boolean field_235688_at_;
@@ -87,6 +88,8 @@ @@ -87,6 +_,8 @@
this.field_226887_g_ = p_i241196_1_.field_226894_k_; this.field_226887_g_ = p_i241196_1_.field_226894_k_;
this.field_208621_p = p_i241196_1_.field_208772_j; this.field_208621_p = p_i241196_1_.field_208772_j;
this.field_235684_aB_ = p_i241196_1_; this.field_235684_aB_ = p_i241196_1_;
@@ -19,7 +19,7 @@
} }
@Deprecated @Deprecated
@@ -129,7 +132,7 @@ @@ -129,7 +_,7 @@
@Deprecated @Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) { 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_) {
@@ -28,7 +28,7 @@
p_196243_2_.func_175713_t(p_196243_3_); p_196243_2_.func_175713_t(p_196243_3_);
} }
@@ -191,7 +194,7 @@ @@ -191,7 +_,7 @@
@Deprecated @Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) { public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
@@ -37,7 +37,7 @@
} }
@Deprecated @Deprecated
@@ -294,8 +297,8 @@ @@ -294,8 +_,8 @@
if (f == -1.0F) { if (f == -1.0F) {
return 0.0F; return 0.0F;
} else { } else {
@@ -48,7 +48,7 @@
} }
} }
@@ -321,14 +324,14 @@ @@ -321,14 +_,14 @@
return 0; return 0;
} }
@@ -65,7 +65,7 @@
} }
return this.field_220085_g; return this.field_220085_g;
@@ -346,6 +349,14 @@ @@ -346,6 +_,14 @@
return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P()); return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P());
} }
@@ -80,11 +80,17 @@
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> { public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
private final int field_215708_d; private final int field_215708_d;
private final boolean field_215709_e; private final boolean field_215709_e;
@@ -428,14 +439,18 @@ @@ -424,18 +_,24 @@
return this.field_215709_e;
}
+ /** @deprecated use {@link BlockState#getLightValue(IBlockReader, BlockPos)} */
+ @Deprecated
public int func_185906_d() {
return this.field_215708_d; return this.field_215708_d;
} }
+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */ + /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos)} until 1.17, at which point this method will be undreprecated. See https://github.com/MinecraftForge/MinecraftForge/issues/7409 for more details */
+ @Deprecated + @Deprecated
public boolean func_196958_f() { public boolean func_196958_f() {
- return this.field_235702_f_; - return this.field_235702_f_;
@@ -95,12 +101,12 @@
return this.field_235704_h_; return this.field_235704_h_;
} }
+ /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation) */ + /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation)} */
+ @Deprecated + @Deprecated
public BlockState func_185907_a(Rotation p_185907_1_) { public BlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_); return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
} }
@@ -802,6 +817,9 @@ @@ -802,8 +_,11 @@
private ResourceLocation field_222381_j; private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true; private boolean field_226895_m_ = true;
private boolean field_235813_o_; private boolean field_235813_o_;
@@ -108,9 +114,12 @@
+ private net.minecraftforge.common.ToolType harvestTool; + private net.minecraftforge.common.ToolType harvestTool;
+ private java.util.function.Supplier<ResourceLocation> lootTableSupplier; + private java.util.function.Supplier<ResourceLocation> lootTableSupplier;
private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> { private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> {
return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14; - return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14;
+ return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.getLightValue(p_235832_1_, p_235832_2_) < 14;
}; };
@@ -863,6 +881,8 @@ private AbstractBlock.IPositionPredicate field_235815_q_ = (p_235853_0_, p_235853_1_, p_235853_2_) -> {
return p_235853_0_.func_185904_a().func_76218_k() && p_235853_0_.func_235785_r_(p_235853_1_, p_235853_2_);
@@ -863,6 +_,8 @@
abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_; abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_;
abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_; abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_;
abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_; abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_;
@@ -119,7 +128,7 @@
return abstractblock$properties; return abstractblock$properties;
} }
@@ -877,6 +897,24 @@ @@ -877,6 +_,24 @@
return this; return this;
} }
@@ -144,7 +153,7 @@
public AbstractBlock.Properties func_200941_a(float p_200941_1_) { public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_; this.field_200961_i = p_200941_1_;
return this; return this;
@@ -932,11 +970,17 @@ @@ -932,9 +_,15 @@
return this; return this;
} }
@@ -153,13 +162,11 @@
- this.field_222381_j = p_222379_1_.func_220068_i(); - this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i(); + this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this; return this;
} + }
+
+ public AbstractBlock.Properties lootFrom(java.util.function.Supplier<? extends Block> blockIn) { + public AbstractBlock.Properties lootFrom(java.util.function.Supplier<? extends Block> blockIn) {
+ this.lootTableSupplier = () -> blockIn.get().func_220068_i(); + this.lootTableSupplier = () -> blockIn.get().func_220068_i();
+ return this; + return this;
+ } }
+
public AbstractBlock.Properties func_235859_g_() { public AbstractBlock.Properties func_235859_g_() {
this.field_235813_o_ = true;
return this;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractFireBlock.java --- a/net/minecraft/block/AbstractFireBlock.java
+++ b/net/minecraft/block/AbstractFireBlock.java +++ b/net/minecraft/block/AbstractFireBlock.java
@@ -124,6 +124,7 @@ @@ -124,6 +_,7 @@
if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) { if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) {
if (func_242649_a(p_220082_2_)) { if (func_242649_a(p_220082_2_)) {
Optional<PortalSize> optional = PortalSize.func_242964_a(p_220082_2_, p_220082_3_, Direction.Axis.X); Optional<PortalSize> optional = PortalSize.func_242964_a(p_220082_2_, p_220082_3_, Direction.Axis.X);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractRailBlock.java --- a/net/minecraft/block/AbstractRailBlock.java
+++ b/net/minecraft/block/AbstractRailBlock.java +++ b/net/minecraft/block/AbstractRailBlock.java
@@ -13,7 +13,7 @@ @@ -13,7 +_,7 @@
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -9,7 +9,7 @@
protected static final VoxelShape field_185590_a = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D); protected static final VoxelShape field_185590_a = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
protected static final VoxelShape field_190959_b = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D); protected static final VoxelShape field_190959_b = Block.func_208617_a(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
private final boolean field_196277_c; private final boolean field_196277_c;
@@ -37,6 +37,7 @@ @@ -37,6 +_,7 @@
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) { 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_203425_a(this) ? p_220053_1_.func_177229_b(this.func_176560_l()) : null; RailShape railshape = p_220053_1_.func_203425_a(this) ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
@@ -17,7 +17,7 @@
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a; return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
} }
@@ -61,7 +62,7 @@ @@ -61,7 +_,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_) { 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 && p_220069_2_.func_180495_p(p_220069_3_).func_203425_a(this)) { if (!p_220069_2_.field_72995_K && p_220069_2_.func_180495_p(p_220069_3_).func_203425_a(this)) {
@@ -26,7 +26,7 @@
if (func_235328_a_(p_220069_3_, p_220069_2_, railshape)) { if (func_235328_a_(p_220069_3_, p_220069_2_, railshape)) {
func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_); func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_);
p_220069_2_.func_217377_a(p_220069_3_, p_220069_6_); p_220069_2_.func_217377_a(p_220069_3_, p_220069_6_);
@@ -110,7 +111,7 @@ @@ -110,7 +_,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_) { 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_) { if (!p_196243_5_) {
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_); super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
@@ -35,7 +35,7 @@
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this); p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
} }
@@ -129,5 +130,20 @@ @@ -129,5 +_,20 @@
return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH); return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH);
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/AbstractTopPlantBlock.java --- a/net/minecraft/block/AbstractTopPlantBlock.java
+++ b/net/minecraft/block/AbstractTopPlantBlock.java +++ b/net/minecraft/block/AbstractTopPlantBlock.java
@@ -32,10 +32,11 @@ @@ -32,10 +_,11 @@
} }
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/BambooBlock.java --- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java +++ b/net/minecraft/block/BambooBlock.java
@@ -100,10 +100,11 @@ @@ -100,10 +_,11 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
if (p_225542_1_.func_177229_b(field_220266_f) == 0) { if (p_225542_1_.func_177229_b(field_220266_f) == 0) {
@@ -1,6 +1,16 @@
--- a/net/minecraft/block/BeehiveBlock.java --- a/net/minecraft/block/BeehiveBlock.java
+++ b/net/minecraft/block/BeehiveBlock.java +++ b/net/minecraft/block/BeehiveBlock.java
@@ -85,6 +85,7 @@ @@ -65,6 +_,9 @@
public int func_180641_l(BlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
return p_180641_1_.func_177229_b(field_226873_c_);
}
+ // Forge: Fixed MC-227255 Beehives and bee nests do not rotate/mirror correctly in structure blocks
+ @Override public BlockState func_185499_a(BlockState blockState, net.minecraft.util.Rotation rotation) { return (BlockState)blockState.func_206870_a(field_226872_b_, rotation.func_185831_a(blockState.func_177229_b(field_226872_b_))); }
+ @Override public BlockState func_185471_a(BlockState blockState, net.minecraft.util.Mirror mirror) { return blockState.func_185907_a(mirror.func_185800_a(blockState.func_177229_b(field_226872_b_))); }
public void func_180657_a(World p_180657_1_, PlayerEntity p_180657_2_, BlockPos p_180657_3_, BlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
@@ -85,6 +_,7 @@
List<BeeEntity> list = p_226881_1_.func_217357_a(BeeEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D)); List<BeeEntity> list = p_226881_1_.func_217357_a(BeeEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
if (!list.isEmpty()) { if (!list.isEmpty()) {
List<PlayerEntity> list1 = p_226881_1_.func_217357_a(PlayerEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D)); List<PlayerEntity> list1 = p_226881_1_.func_217357_a(PlayerEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
@@ -8,12 +18,3 @@
int i = list1.size(); int i = list1.size();
for(BeeEntity beeentity : list) { for(BeeEntity beeentity : list) {
@@ -105,7 +106,7 @@
int i = p_225533_1_.func_177229_b(field_226873_c_);
boolean flag = false;
if (i >= 5) {
- if (itemstack.func_77973_b() == Items.field_151097_aZ) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ShearsItem) {
p_225533_2_.func_184148_a(p_225533_4_, p_225533_4_.func_226277_ct_(), p_225533_4_.func_226278_cu_(), p_225533_4_.func_226281_cx_(), SoundEvents.field_226133_ah_, SoundCategory.NEUTRAL, 1.0F, 1.0F);
func_226878_a_(p_225533_2_, p_225533_3_);
itemstack.func_222118_a(1, p_225533_4_, (p_226874_1_) -> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Block.java --- a/net/minecraft/block/Block.java
+++ b/net/minecraft/block/Block.java +++ b/net/minecraft/block/Block.java
@@ -54,9 +54,10 @@ @@ -54,9 +_,10 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@@ -13,7 +13,7 @@
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() { private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
public Boolean load(VoxelShape p_load_1_) { public Boolean load(VoxelShape p_load_1_) {
return !VoxelShapes.func_197879_c(VoxelShapes.func_197868_b(), p_load_1_, IBooleanFunction.field_223236_g_); return !VoxelShapes.func_197879_c(VoxelShapes.func_197868_b(), p_load_1_, IBooleanFunction.field_223236_g_);
@@ -151,6 +152,8 @@ @@ -151,6 +_,8 @@
super(p_i48440_1_); super(p_i48440_1_);
StateContainer.Builder<Block, BlockState> builder = new StateContainer.Builder<>(this); StateContainer.Builder<Block, BlockState> builder = new StateContainer.Builder<>(this);
this.func_206840_a(builder); this.func_206840_a(builder);
@@ -22,7 +22,7 @@
this.field_176227_L = builder.func_235882_a_(Block::func_176223_P, BlockState::new); this.field_176227_L = builder.func_235882_a_(Block::func_176223_P, BlockState::new);
this.func_180632_j(this.field_176227_L.func_177621_b()); this.func_180632_j(this.field_176227_L.func_177621_b());
} }
@@ -261,7 +264,7 @@ @@ -261,7 +_,7 @@
} }
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) { public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
@@ -31,7 +31,7 @@
float f = 0.5F; float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -273,7 +276,7 @@ @@ -273,7 +_,7 @@
} }
public void func_180637_b(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) { public void func_180637_b(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
@@ -40,7 +40,7 @@
while(p_180637_3_ > 0) { while(p_180637_3_ > 0) {
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_); int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
p_180637_3_ -= i; p_180637_3_ -= i;
@@ -283,6 +286,7 @@ @@ -283,6 +_,7 @@
} }
@@ -48,7 +48,7 @@
public float func_149638_a() { public float func_149638_a() {
return this.field_235689_au_; return this.field_235689_au_;
} }
@@ -332,6 +336,7 @@ @@ -332,6 +_,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D)); p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
} }
@@ -56,7 +56,7 @@
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) { public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
return new ItemStack(this); return new ItemStack(this);
} }
@@ -363,6 +368,7 @@ @@ -363,6 +_,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) { public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
} }
@@ -64,7 +64,7 @@
public boolean func_149659_a(Explosion p_149659_1_) { public boolean func_149659_a(Explosion p_149659_1_) {
return true; return true;
} }
@@ -382,6 +388,7 @@ @@ -382,6 +_,7 @@
return this.field_196275_y; return this.field_196275_y;
} }
@@ -72,7 +72,7 @@
public SoundType func_220072_p(BlockState p_220072_1_) { public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H; return this.field_149762_H;
} }
@@ -391,7 +398,7 @@ @@ -391,7 +_,7 @@
this.field_220086_i = Item.func_150898_a(this); this.field_220086_i = Item.func_150898_a(this);
} }
@@ -81,7 +81,7 @@
} }
public boolean func_208619_r() { public boolean func_208619_r() {
@@ -399,7 +406,7 @@ @@ -399,7 +_,7 @@
} }
public String toString() { public String toString() {
@@ -90,21 +90,17 @@
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@@ -410,6 +417,83 @@ @@ -409,6 +_,78 @@
protected Block func_230328_p_() {
return this; return this;
} }
+
+ /* ======================================== FORGE START =====================================*/ + /* ======================================== FORGE START =====================================*/
+ protected Random RANDOM = new Random(); + protected Random RANDOM = new Random();
+ private net.minecraftforge.common.ToolType harvestTool; + private net.minecraftforge.common.ToolType harvestTool;
+ private int harvestLevel; + private int harvestLevel;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::func_199896_a); + private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::func_199896_a);
+ +
+ @Override
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
+ return this.field_149765_K;
+ }
+
+ @Nullable + @Nullable
+ @Override + @Override
+ public net.minecraftforge.common.ToolType getHarvestTool(BlockState state) { + public net.minecraftforge.common.ToolType getHarvestTool(BlockState state) {
@@ -170,7 +166,6 @@
+ }); + });
+ } + }
+ /* ========================================= FORGE END ======================================*/ + /* ========================================= FORGE END ======================================*/
+
public static final class RenderSideCacheKey { public static final class RenderSideCacheKey {
private final BlockState field_212164_a; private final BlockState field_212164_a;
private final BlockState field_212165_b;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/BlockState.java --- a/net/minecraft/block/BlockState.java
+++ b/net/minecraft/block/BlockState.java +++ b/net/minecraft/block/BlockState.java
@@ -6,7 +6,7 @@ @@ -6,7 +_,7 @@
import net.minecraft.state.Property; import net.minecraft.state.Property;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Blocks.java --- a/net/minecraft/block/Blocks.java
+++ b/net/minecraft/block/Blocks.java +++ b/net/minecraft/block/Blocks.java
@@ -25,6 +25,7 @@ @@ -25,6 +_,7 @@
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraft.world.gen.feature.Features; import net.minecraft.world.gen.feature.Features;
@@ -8,7 +8,7 @@
public class Blocks { public class Blocks {
public static final Block field_150350_a = func_222382_a("air", new AirBlock(AbstractBlock.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e().func_235859_g_())); public static final Block field_150350_a = func_222382_a("air", new AirBlock(AbstractBlock.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e().func_235859_g_()));
public static final Block field_150348_b = func_222382_a("stone", new Block(AbstractBlock.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_235861_h_().func_200948_a(1.5F, 6.0F))); public static final Block field_150348_b = func_222382_a("stone", new Block(AbstractBlock.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_235861_h_().func_200948_a(1.5F, 6.0F)));
@@ -119,7 +120,7 @@ @@ -119,7 +_,7 @@
public static final Block field_196601_az = func_222382_a("green_bed", func_235422_a_(DyeColor.GREEN)); public static final Block field_196601_az = func_222382_a("green_bed", func_235422_a_(DyeColor.GREEN));
public static final Block field_196550_aA = func_222382_a("red_bed", func_235422_a_(DyeColor.RED)); public static final Block field_196550_aA = func_222382_a("red_bed", func_235422_a_(DyeColor.RED));
public static final Block field_196551_aB = func_222382_a("black_bed", func_235422_a_(DyeColor.BLACK)); public static final Block field_196551_aB = func_222382_a("black_bed", func_235422_a_(DyeColor.BLACK));
@@ -17,10 +17,11 @@
public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
public static final Block field_150320_F = func_222382_a("sticky_piston", func_235432_a_(true)); public static final Block field_150320_F = func_222382_a("sticky_piston", func_235432_a_(true));
public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(AbstractBlock.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_235861_h_().func_200943_b(4.0F))); public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(AbstractBlock.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_235861_h_().func_200943_b(4.0F)));
@@ -937,15 +938,4 @@ @@ -936,16 +_,5 @@
public static void func_235419_a_() { public static void func_235419_a_() {
Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c); Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c);
} - }
- -
- static { - static {
- for(Block block : Registry.field_212618_g) { - for(Block block : Registry.field_212618_g) {
@@ -31,5 +32,5 @@
- block.func_220068_i(); - block.func_220068_i();
- } - }
- -
- } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/BushBlock.java --- a/net/minecraft/block/BushBlock.java
+++ b/net/minecraft/block/BushBlock.java +++ b/net/minecraft/block/BushBlock.java
@@ -7,7 +7,7 @@ @@ -7,7 +_,7 @@
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
@@ -9,7 +9,7 @@
public BushBlock(AbstractBlock.Properties p_i48437_1_) { public BushBlock(AbstractBlock.Properties p_i48437_1_) {
super(p_i48437_1_); super(p_i48437_1_);
} }
@@ -22,6 +22,8 @@ @@ -22,6 +_,8 @@
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
BlockPos blockpos = p_196260_3_.func_177977_b(); BlockPos blockpos = p_196260_3_.func_177977_b();
@@ -18,15 +18,16 @@
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos); return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
} }
@@ -32,4 +34,11 @@ @@ -31,5 +_,12 @@
public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return p_196266_4_ == PathType.AIR && !this.field_235688_at_ ? true : super.func_196266_a(p_196266_1_, p_196266_2_, p_196266_3_, p_196266_4_); return p_196266_4_ == PathType.AIR && !this.field_235688_at_ ? true : super.func_196266_a(p_196266_1_, p_196266_2_, p_196266_3_, p_196266_4_);
} + }
+ +
+ @Override + @Override
+ public BlockState getPlant(IBlockReader world, BlockPos pos) { + public BlockState getPlant(IBlockReader world, BlockPos pos) {
+ BlockState state = world.func_180495_p(pos); + BlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P(); + if (state.func_177230_c() != this) return func_176223_P();
+ return state; + return state;
+ } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CactusBlock.java --- a/net/minecraft/block/CactusBlock.java
+++ b/net/minecraft/block/CactusBlock.java +++ b/net/minecraft/block/CactusBlock.java
@@ -19,7 +19,7 @@ @@ -19,7 +_,7 @@
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -9,7 +9,7 @@
public static final IntegerProperty field_176587_a = BlockStateProperties.field_208171_X; public static final IntegerProperty field_176587_a = BlockStateProperties.field_208171_X;
protected static final VoxelShape field_196400_b = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D); protected static final VoxelShape field_196400_b = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D);
protected static final VoxelShape field_196401_c = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); protected static final VoxelShape field_196401_c = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
@@ -30,6 +30,7 @@ @@ -30,6 +_,7 @@
} }
public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) {
@@ -17,7 +17,7 @@
if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) { if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) {
p_225534_2_.func_175655_b(p_225534_3_, true); p_225534_2_.func_175655_b(p_225534_3_, true);
} }
@@ -45,6 +46,7 @@ @@ -45,6 +_,7 @@
if (i < 3) { if (i < 3) {
int j = p_225542_1_.func_177229_b(field_176587_a); int j = p_225542_1_.func_177229_b(field_176587_a);
@@ -25,7 +25,7 @@
if (j == 15) { if (j == 15) {
p_225542_2_.func_175656_a(blockpos, this.func_176223_P()); p_225542_2_.func_175656_a(blockpos, this.func_176223_P());
BlockState blockstate = p_225542_1_.func_206870_a(field_176587_a, Integer.valueOf(0)); BlockState blockstate = p_225542_1_.func_206870_a(field_176587_a, Integer.valueOf(0));
@@ -53,7 +55,8 @@ @@ -53,7 +_,8 @@
} else { } else {
p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4); p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4);
} }
@@ -35,7 +35,7 @@
} }
} }
} }
@@ -84,7 +87,7 @@ @@ -84,7 +_,7 @@
} }
BlockState blockstate1 = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); BlockState blockstate1 = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
@@ -44,10 +44,11 @@
} }
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
@@ -98,4 +101,14 @@ @@ -97,5 +_,15 @@
public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return false; return false;
} + }
+ +
+ @Override + @Override
+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) { + public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) {
@@ -57,5 +58,5 @@
+ @Override + @Override
+ public BlockState getPlant(IBlockReader world, BlockPos pos) { + public BlockState getPlant(IBlockReader world, BlockPos pos) {
+ return func_176223_P(); + return func_176223_P();
+ } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CampfireBlock.java --- a/net/minecraft/block/CampfireBlock.java
+++ b/net/minecraft/block/CampfireBlock.java +++ b/net/minecraft/block/CampfireBlock.java
@@ -181,7 +181,7 @@ @@ -181,7 +_,7 @@
public void func_220066_a(World p_220066_1_, BlockState p_220066_2_, BlockRayTraceResult p_220066_3_, ProjectileEntity p_220066_4_) { public void func_220066_a(World p_220066_1_, BlockState p_220066_2_, BlockRayTraceResult p_220066_3_, ProjectileEntity p_220066_4_) {
if (!p_220066_1_.field_72995_K && p_220066_4_.func_70027_ad()) { if (!p_220066_1_.field_72995_K && p_220066_4_.func_70027_ad()) {
Entity entity = p_220066_4_.func_234616_v_(); Entity entity = p_220066_4_.func_234616_v_();
@@ -9,7 +9,7 @@
if (flag && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) { if (flag && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) {
BlockPos blockpos = p_220066_3_.func_216350_a(); BlockPos blockpos = p_220066_3_.func_216350_a();
p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11); p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11);
@@ -208,7 +208,7 @@ @@ -208,7 +_,7 @@
return true; return true;
} }
@@ -0,0 +1,12 @@
--- a/net/minecraft/block/ChestBlock.java
+++ b/net/minecraft/block/ChestBlock.java
@@ -325,7 +_,8 @@
}
public BlockState func_185471_a(BlockState p_185471_1_, Mirror p_185471_2_) {
- return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176459_a)));
+ BlockState rotated = p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176459_a)));
+ return p_185471_2_ == Mirror.NONE ? rotated : rotated.func_206870_a(field_196314_b, rotated.func_177229_b(field_196314_b).func_208081_a()); // Forge: Fixed MC-134110 Structure mirroring breaking apart double chests
}
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/ChorusFlowerBlock.java --- a/net/minecraft/block/ChorusFlowerBlock.java
+++ b/net/minecraft/block/ChorusFlowerBlock.java +++ b/net/minecraft/block/ChorusFlowerBlock.java
@@ -40,7 +40,7 @@ @@ -40,7 +_,7 @@
BlockPos blockpos = p_225542_3_.func_177984_a(); BlockPos blockpos = p_225542_3_.func_177984_a();
if (p_225542_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) { if (p_225542_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) {
int i = p_225542_1_.func_177229_b(field_185607_a); int i = p_225542_1_.func_177229_b(field_185607_a);
@@ -9,7 +9,7 @@
boolean flag = false; boolean flag = false;
boolean flag1 = false; boolean flag1 = false;
BlockState blockstate = p_225542_2_.func_180495_p(p_225542_3_.func_177977_b()); BlockState blockstate = p_225542_2_.func_180495_p(p_225542_3_.func_177977_b());
@@ -65,7 +65,7 @@ @@ -65,7 +_,7 @@
if (j < 2 || j <= p_225542_4_.nextInt(flag1 ? 5 : 4)) { if (j < 2 || j <= p_225542_4_.nextInt(flag1 ? 5 : 4)) {
flag = true; flag = true;
} }
@@ -18,7 +18,7 @@
flag = true; flag = true;
} }
@@ -97,7 +97,7 @@ @@ -97,7 +_,7 @@
} else { } else {
this.func_185605_c(p_225542_2_, p_225542_3_); this.func_185605_c(p_225542_2_, p_225542_3_);
} }
@@ -27,7 +27,7 @@
} }
} }
} }
@@ -133,7 +133,7 @@ @@ -133,7 +_,7 @@
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
if (blockstate.func_177230_c() != this.field_196405_b && !blockstate.func_203425_a(Blocks.field_150377_bs)) { if (blockstate.func_177230_c() != this.field_196405_b && !blockstate.func_203425_a(Blocks.field_150377_bs)) {
@@ -36,7 +36,7 @@
return false; return false;
} else { } else {
boolean flag = false; boolean flag = false;
@@ -146,7 +146,7 @@ @@ -146,7 +_,7 @@
} }
flag = true; flag = true;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CocoaBlock.java --- a/net/minecraft/block/CocoaBlock.java
+++ b/net/minecraft/block/CocoaBlock.java +++ b/net/minecraft/block/CocoaBlock.java
@@ -35,10 +35,11 @@ @@ -35,10 +_,11 @@
} }
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/ComparatorBlock.java --- a/net/minecraft/block/ComparatorBlock.java
+++ b/net/minecraft/block/ComparatorBlock.java +++ b/net/minecraft/block/ComparatorBlock.java
@@ -154,4 +154,16 @@ @@ -154,4 +_,16 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) { protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c); p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c);
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CropsBlock.java --- a/net/minecraft/block/CropsBlock.java
+++ b/net/minecraft/block/CropsBlock.java +++ b/net/minecraft/block/CropsBlock.java
@@ -61,12 +61,14 @@ @@ -61,12 +_,14 @@
} }
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -16,7 +16,7 @@
} }
} }
} }
@@ -95,9 +97,9 @@ @@ -95,9 +_,9 @@
for(int j = -1; j <= 1; ++j) { for(int j = -1; j <= 1; ++j) {
float f1 = 0.0F; float f1 = 0.0F;
BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
@@ -28,7 +28,7 @@
f1 = 3.0F; f1 = 3.0F;
} }
} }
@@ -133,7 +135,7 @@ @@ -133,7 +_,7 @@
} }
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DeadBushBlock.java --- a/net/minecraft/block/DeadBushBlock.java
+++ b/net/minecraft/block/DeadBushBlock.java +++ b/net/minecraft/block/DeadBushBlock.java
@@ -5,7 +5,7 @@ @@ -5,7 +_,7 @@
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DetectorRailBlock.java --- a/net/minecraft/block/DetectorRailBlock.java
+++ b/net/minecraft/block/DetectorRailBlock.java +++ b/net/minecraft/block/DetectorRailBlock.java
@@ -131,6 +131,8 @@ @@ -131,6 +_,8 @@
} }
List<AbstractMinecartEntity> list1 = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, EntityPredicates.field_96566_b); List<AbstractMinecartEntity> list1 = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, EntityPredicates.field_96566_b);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DoublePlantBlock.java --- a/net/minecraft/block/DoublePlantBlock.java
+++ b/net/minecraft/block/DoublePlantBlock.java +++ b/net/minecraft/block/DoublePlantBlock.java
@@ -51,6 +51,7 @@ @@ -51,6 +_,7 @@
return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_); return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_);
} else { } else {
BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/DropperBlock.java --- a/net/minecraft/block/DropperBlock.java
+++ b/net/minecraft/block/DropperBlock.java +++ b/net/minecraft/block/DropperBlock.java
@@ -37,7 +37,7 @@ @@ -37,7 +_,7 @@
p_176439_1_.func_217379_c(1001, p_176439_2_, 0); p_176439_1_.func_217379_c(1001, p_176439_2_, 0);
} else { } else {
ItemStack itemstack = dispensertileentity.func_70301_a(i); ItemStack itemstack = dispensertileentity.func_70301_a(i);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/EnchantingTableBlock.java --- a/net/minecraft/block/EnchantingTableBlock.java
+++ b/net/minecraft/block/EnchantingTableBlock.java +++ b/net/minecraft/block/EnchantingTableBlock.java
@@ -54,7 +54,7 @@ @@ -54,7 +_,7 @@
if (p_180655_4_.nextInt(16) == 0) { if (p_180655_4_.nextInt(16) == 0) {
for(int k = 0; k <= 1; ++k) { for(int k = 0; k <= 1; ++k) {
BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j); BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FallingBlock.java --- a/net/minecraft/block/FallingBlock.java
+++ b/net/minecraft/block/FallingBlock.java +++ b/net/minecraft/block/FallingBlock.java
@@ -30,7 +30,7 @@ @@ -30,7 +_,7 @@
} }
public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) {
@@ -9,7 +9,7 @@
FallingBlockEntity fallingblockentity = new FallingBlockEntity(p_225534_2_, (double)p_225534_3_.func_177958_n() + 0.5D, (double)p_225534_3_.func_177956_o(), (double)p_225534_3_.func_177952_p() + 0.5D, p_225534_2_.func_180495_p(p_225534_3_)); FallingBlockEntity fallingblockentity = new FallingBlockEntity(p_225534_2_, (double)p_225534_3_.func_177958_n() + 0.5D, (double)p_225534_3_.func_177956_o(), (double)p_225534_3_.func_177952_p() + 0.5D, p_225534_2_.func_180495_p(p_225534_3_));
this.func_149829_a(fallingblockentity); this.func_149829_a(fallingblockentity);
p_225534_2_.func_217376_c(fallingblockentity); p_225534_2_.func_217376_c(fallingblockentity);
@@ -59,7 +59,7 @@ @@ -59,7 +_,7 @@
public void func_180655_c(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) { public void func_180655_c(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
if (p_180655_4_.nextInt(16) == 0) { if (p_180655_4_.nextInt(16) == 0) {
BlockPos blockpos = p_180655_3_.func_177977_b(); BlockPos blockpos = p_180655_3_.func_177977_b();
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FarmlandBlock.java --- a/net/minecraft/block/FarmlandBlock.java
+++ b/net/minecraft/block/FarmlandBlock.java +++ b/net/minecraft/block/FarmlandBlock.java
@@ -77,7 +77,7 @@ @@ -77,7 +_,7 @@
} }
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) { public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) {
@@ -9,7 +9,7 @@
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_); func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
} }
@@ -88,9 +88,10 @@ @@ -88,9 +_,10 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_)); p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
} }
@@ -23,7 +23,7 @@
} }
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) { private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -100,7 +101,7 @@ @@ -100,7 +_,7 @@
} }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FireBlock.java --- a/net/minecraft/block/FireBlock.java
+++ b/net/minecraft/block/FireBlock.java +++ b/net/minecraft/block/FireBlock.java
@@ -92,13 +92,13 @@ @@ -92,13 +_,13 @@
protected BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) { protected BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
BlockPos blockpos = p_196448_2_.func_177977_b(); BlockPos blockpos = p_196448_2_.func_177977_b();
BlockState blockstate = p_196448_1_.func_180495_p(blockpos); BlockState blockstate = p_196448_1_.func_180495_p(blockpos);
@@ -16,7 +16,7 @@
} }
} }
@@ -121,7 +121,7 @@ @@ -121,7 +_,7 @@
} }
BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b()); BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b());
@@ -25,7 +25,7 @@
int i = p_225534_1_.func_177229_b(field_176543_a); int i = p_225534_1_.func_177229_b(field_176543_a);
if (!flag && p_225534_2_.func_72896_J() && this.func_176537_d(p_225534_2_, p_225534_3_) && p_225534_4_.nextFloat() < 0.2F + (float)i * 0.03F) { if (!flag && p_225534_2_.func_72896_J() && this.func_176537_d(p_225534_2_, p_225534_3_) && p_225534_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_225534_2_.func_217377_a(p_225534_3_, false); p_225534_2_.func_217377_a(p_225534_3_, false);
@@ -142,7 +142,7 @@ @@ -142,7 +_,7 @@
return; return;
} }
@@ -34,7 +34,7 @@
p_225534_2_.func_217377_a(p_225534_3_, false); p_225534_2_.func_217377_a(p_225534_3_, false);
return; return;
} }
@@ -150,12 +150,12 @@ @@ -150,12 +_,12 @@
boolean flag1 = p_225534_2_.func_180502_D(p_225534_3_); boolean flag1 = p_225534_2_.func_180502_D(p_225534_3_);
int k = flag1 ? -50 : 0; int k = flag1 ? -50 : 0;
@@ -53,7 +53,7 @@
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(); BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
for(int l = -1; l <= 1; ++l) { for(int l = -1; l <= 1; ++l) {
@@ -193,16 +193,18 @@ @@ -193,16 +_,18 @@
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d()); return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
} }
@@ -74,7 +74,7 @@
if (p_176536_4_.nextInt(p_176536_3_) < i) { if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_); BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) { if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -212,11 +214,7 @@ @@ -212,11 +_,7 @@
p_176536_1_.func_217377_a(p_176536_2_, false); p_176536_1_.func_217377_a(p_176536_2_, false);
} }
@@ -87,7 +87,7 @@
} }
} }
@@ -228,7 +226,7 @@ @@ -228,7 +_,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) { private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) { for(Direction direction : Direction.values()) {
@@ -96,7 +96,7 @@
return true; return true;
} }
} }
@@ -244,13 +242,14 @@ @@ -244,13 +_,14 @@
for(Direction direction : Direction.values()) { for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction)); BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -112,15 +112,15 @@
protected boolean func_196446_i(BlockState p_196446_1_) { protected boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0; return this.func_220275_r(p_196446_1_) > 0;
} }
@@ -269,10 +268,23 @@ @@ -269,8 +_,21 @@
} }
private void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { private 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."); + if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
this.field_149849_a.put(p_180686_1_, p_180686_2_); this.field_149849_a.put(p_180686_1_, p_180686_2_);
this.field_149848_b.put(p_180686_1_, p_180686_3_); this.field_149848_b.put(p_180686_1_, p_180686_3_);
} + }
+
+ /** + /**
+ * Side sensitive version that calls the block function. + * Side sensitive version that calls the block function.
+ * + *
@@ -131,8 +131,6 @@
+ */ + */
+ public boolean canCatchFire(IBlockReader world, BlockPos pos, Direction face) { + public boolean canCatchFire(IBlockReader world, BlockPos pos, Direction face) {
+ return world.func_180495_p(pos).isFlammable(world, pos, face); + return world.func_180495_p(pos).isFlammable(world, pos, face);
+ } }
+
public static void func_149843_e() { public static void func_149843_e() {
FireBlock fireblock = (FireBlock)Blocks.field_150480_ab;
fireblock.func_180686_a(Blocks.field_196662_n, 5, 20);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FlowerPotBlock.java --- a/net/minecraft/block/FlowerPotBlock.java
+++ b/net/minecraft/block/FlowerPotBlock.java +++ b/net/minecraft/block/FlowerPotBlock.java
@@ -24,12 +24,35 @@ @@ -24,10 +_,33 @@
protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D); protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
private final Block field_196452_c; private final Block field_196452_c;
@@ -13,8 +13,8 @@
+ if (Blocks.field_150457_bL != null) { + if (Blocks.field_150457_bL != null) {
+ ((FlowerPotBlock)Blocks.field_150457_bL).addPlant(p_i48395_1_.getRegistryName(), () -> this); + ((FlowerPotBlock)Blocks.field_150457_bL).addPlant(p_i48395_1_.getRegistryName(), () -> this);
+ } + }
} + }
+
+ /** + /**
+ * For mod use, eliminates the need to extend this class, and prevents modded + * For mod use, eliminates the need to extend this class, and prevents modded
+ * flower pots from altering vanilla behavior. + * flower pots from altering vanilla behavior.
@@ -34,12 +34,10 @@
+ this.fullPots = java.util.Collections.emptyMap(); + this.fullPots = java.util.Collections.emptyMap();
+ this.emptyPot = emptyPot; + this.emptyPot = emptyPot;
+ } + }
+ }
+
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
return field_196450_a;
} }
@@ -41,7 +64,7 @@
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
@@ -41,7 +_,7 @@
public ActionResultType func_225533_a_(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) { public ActionResultType func_225533_a_(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) {
ItemStack itemstack = p_225533_4_.func_184586_b(p_225533_5_); ItemStack itemstack = p_225533_4_.func_184586_b(p_225533_5_);
Item item = itemstack.func_77973_b(); Item item = itemstack.func_77973_b();
@@ -48,7 +46,7 @@
boolean flag = block == Blocks.field_150350_a; boolean flag = block == Blocks.field_150350_a;
boolean flag1 = this.field_196452_c == Blocks.field_150350_a; boolean flag1 = this.field_196452_c == Blocks.field_150350_a;
if (flag != flag1) { if (flag != flag1) {
@@ -59,7 +82,7 @@ @@ -59,7 +_,7 @@
p_225533_4_.func_71019_a(itemstack1, false); p_225533_4_.func_71019_a(itemstack1, false);
} }
@@ -57,7 +55,7 @@
} }
return ActionResultType.func_233537_a_(p_225533_2_.field_72995_K); return ActionResultType.func_233537_a_(p_225533_2_.field_72995_K);
@@ -77,10 +100,27 @@ @@ -77,10 +_,27 @@
} }
public Block func_220276_d() { public Block func_220276_d() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FlowingFluidBlock.java --- a/net/minecraft/block/FlowingFluidBlock.java
+++ b/net/minecraft/block/FlowingFluidBlock.java +++ b/net/minecraft/block/FlowingFluidBlock.java
@@ -29,10 +29,11 @@ @@ -29,10 +_,11 @@
public class FlowingFluidBlock extends Block implements IBucketPickupHandler { public class FlowingFluidBlock extends Block implements IBucketPickupHandler {
public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag; public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag;
@@ -13,14 +13,14 @@
public FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) { public FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) {
super(p_i49014_2_); super(p_i49014_2_);
this.field_204517_c = p_i49014_1_; this.field_204517_c = p_i49014_1_;
@@ -45,8 +46,21 @@ @@ -45,6 +_,19 @@
this.field_212565_c.add(p_i49014_1_.func_207207_a(8, true)); this.field_212565_c.add(p_i49014_1_.func_207207_a(8, true));
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0))); this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0)));
+ fluidStateCacheInitialized = true; + fluidStateCacheInitialized = true;
+ supplier = p_i49014_1_.delegate; + supplier = p_i49014_1_.delegate;
} + }
+
+ /** + /**
+ * @param supplier A fluid supplier such as {@link net.minecraftforge.fml.RegistryObject<Fluid>} + * @param supplier A fluid supplier such as {@link net.minecraftforge.fml.RegistryObject<Fluid>}
+ */ + */
@@ -30,12 +30,10 @@
+ this.field_212565_c = Lists.newArrayList(); + this.field_212565_c = Lists.newArrayList();
+ this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0))); + this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0)));
+ this.supplier = supplier; + this.supplier = supplier;
+ }
+
public VoxelShape func_220071_b(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, ISelectionContext p_220071_4_) {
return p_220071_4_.func_216378_a(field_235510_c_, p_220071_3_, true) && p_220071_1_.func_177229_b(field_176367_b) == 0 && p_220071_4_.func_230426_a_(p_220071_2_.func_204610_c(p_220071_3_.func_177984_a()), this.field_204517_c) ? field_235510_c_ : VoxelShapes.func_197880_a();
} }
@@ -69,6 +83,7 @@
public VoxelShape func_220071_b(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, ISelectionContext p_220071_4_) {
@@ -69,6 +_,7 @@
public FluidState func_204507_t(BlockState p_204507_1_) { public FluidState func_204507_t(BlockState p_204507_1_) {
int i = p_204507_1_.func_177229_b(field_176367_b); int i = p_204507_1_.func_177229_b(field_176367_b);
@@ -43,7 +41,7 @@
return this.field_212565_c.get(Math.min(i, 8)); return this.field_212565_c.get(Math.min(i, 8));
} }
@@ -120,13 +135,13 @@ @@ -120,13 +_,13 @@
BlockPos blockpos = p_204515_2_.func_177972_a(direction); BlockPos blockpos = p_204515_2_.func_177972_a(direction);
if (p_204515_1_.func_204610_c(blockpos).func_206884_a(FluidTags.field_206959_a)) { if (p_204515_1_.func_204610_c(blockpos).func_206884_a(FluidTags.field_206959_a)) {
Block block = p_204515_1_.func_204610_c(p_204515_2_).func_206889_d() ? Blocks.field_150343_Z : Blocks.field_150347_e; Block block = p_204515_1_.func_204610_c(p_204515_2_).func_206889_d() ? Blocks.field_150343_Z : Blocks.field_150347_e;
@@ -59,10 +57,12 @@
this.func_180688_d(p_204515_1_, p_204515_2_); this.func_180688_d(p_204515_1_, p_204515_2_);
return false; return false;
} }
@@ -153,4 +168,23 @@ @@ -151,6 +_,25 @@
return this.field_204517_c;
} else {
return Fluids.field_204541_a; return Fluids.field_204541_a;
} + }
} + }
+ +
+ // Forge start + // Forge start
+ private final java.util.function.Supplier<? extends Fluid> supplier; + private final java.util.function.Supplier<? extends Fluid> supplier;
@@ -80,6 +80,6 @@
+ +
+ this.field_212565_c.add(getFluid().func_207207_a(8, true)); + this.field_212565_c.add(getFluid().func_207207_a(8, true));
+ fluidStateCacheInitialized = true; + fluidStateCacheInitialized = true;
+ } }
+ } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/ITileEntityProvider.java --- a/net/minecraft/block/ITileEntityProvider.java
+++ b/net/minecraft/block/ITileEntityProvider.java +++ b/net/minecraft/block/ITileEntityProvider.java
@@ -4,6 +4,7 @@ @@ -4,6 +_,7 @@
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
@@ -1,14 +0,0 @@
--- a/net/minecraft/block/LadderBlock.java
+++ b/net/minecraft/block/LadderBlock.java
@@ -93,6 +93,11 @@
return null;
}
+ @Override
+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
+ return true;
+ }
+
public BlockState func_185499_a(BlockState p_185499_1_, Rotation p_185499_2_) {
return p_185499_1_.func_206870_a(field_176382_a, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176382_a)));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/LeavesBlock.java --- a/net/minecraft/block/LeavesBlock.java
+++ b/net/minecraft/block/LeavesBlock.java +++ b/net/minecraft/block/LeavesBlock.java
@@ -19,7 +19,7 @@ @@ -19,7 +_,7 @@
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/MushroomBlock.java --- a/net/minecraft/block/MushroomBlock.java
+++ b/net/minecraft/block/MushroomBlock.java +++ b/net/minecraft/block/MushroomBlock.java
@@ -64,7 +64,7 @@ @@ -64,7 +_,7 @@
if (blockstate.func_235714_a_(BlockTags.field_242171_aD)) { if (blockstate.func_235714_a_(BlockTags.field_242171_aD)) {
return true; return true;
} else { } else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/NetherWartBlock.java --- a/net/minecraft/block/NetherWartBlock.java
+++ b/net/minecraft/block/NetherWartBlock.java +++ b/net/minecraft/block/NetherWartBlock.java
@@ -35,9 +35,10 @@ @@ -35,9 +_,10 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
int i = p_225542_1_.func_177229_b(field_176486_a); int i = p_225542_1_.func_177229_b(field_176486_a);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/NoteBlock.java --- a/net/minecraft/block/NoteBlock.java
+++ b/net/minecraft/block/NoteBlock.java +++ b/net/minecraft/block/NoteBlock.java
@@ -50,7 +50,7 @@ @@ -50,7 +_,7 @@
} }
private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) { private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) {
@@ -9,7 +9,7 @@
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0); p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
} }
@@ -60,7 +60,9 @@ @@ -60,7 +_,9 @@
if (p_225533_2_.field_72995_K) { if (p_225533_2_.field_72995_K) {
return ActionResultType.SUCCESS; return ActionResultType.SUCCESS;
} else { } else {
@@ -20,7 +20,7 @@
p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3); p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3);
this.func_196482_a(p_225533_2_, p_225533_3_); this.func_196482_a(p_225533_2_, p_225533_3_);
p_225533_4_.func_195066_a(Stats.field_188087_U); p_225533_4_.func_195066_a(Stats.field_188087_U);
@@ -76,6 +78,9 @@ @@ -76,6 +_,9 @@
} }
public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) { public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/OreBlock.java --- a/net/minecraft/block/OreBlock.java
+++ b/net/minecraft/block/OreBlock.java +++ b/net/minecraft/block/OreBlock.java
@@ -31,12 +31,10 @@ @@ -31,12 +_,10 @@
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/PistonBlock.java --- a/net/minecraft/block/PistonBlock.java
+++ b/net/minecraft/block/PistonBlock.java +++ b/net/minecraft/block/PistonBlock.java
@@ -158,6 +158,7 @@ @@ -158,6 +_,7 @@
} }
if (p_189539_4_ == 0) { if (p_189539_4_ == 0) {
@@ -8,7 +8,7 @@
if (!this.func_176319_a(p_189539_2_, p_189539_3_, direction, true)) { if (!this.func_176319_a(p_189539_2_, p_189539_3_, direction, true)) {
return false; return false;
} }
@@ -165,6 +166,7 @@ @@ -165,6 +_,7 @@
p_189539_2_.func_180501_a(p_189539_3_, p_189539_1_.func_206870_a(field_176320_b, Boolean.valueOf(true)), 67); p_189539_2_.func_180501_a(p_189539_3_, p_189539_1_.func_206870_a(field_176320_b, Boolean.valueOf(true)), 67);
p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187715_dR, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.25F + 0.6F); p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187715_dR, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.25F + 0.6F);
} else if (p_189539_4_ == 1 || p_189539_4_ == 2) { } else if (p_189539_4_ == 1 || p_189539_4_ == 2) {
@@ -16,7 +16,7 @@
TileEntity tileentity1 = p_189539_2_.func_175625_s(p_189539_3_.func_177972_a(direction)); TileEntity tileentity1 = p_189539_2_.func_175625_s(p_189539_3_.func_177972_a(direction));
if (tileentity1 instanceof PistonTileEntity) { if (tileentity1 instanceof PistonTileEntity) {
((PistonTileEntity)tileentity1).func_145866_f(); ((PistonTileEntity)tileentity1).func_145866_f();
@@ -204,6 +206,7 @@ @@ -204,6 +_,7 @@
p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187712_dQ, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.15F + 0.6F); p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187712_dQ, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.15F + 0.6F);
} }
@@ -24,7 +24,7 @@
return true; return true;
} }
@@ -234,7 +237,7 @@ @@ -234,7 +_,7 @@
return false; return false;
} }
@@ -33,7 +33,7 @@
} }
} else { } else {
return false; return false;
@@ -273,7 +276,7 @@ @@ -273,7 +_,7 @@
for(int k = list2.size() - 1; k >= 0; --k) { for(int k = list2.size() - 1; k >= 0; --k) {
BlockPos blockpos2 = list2.get(k); BlockPos blockpos2 = list2.get(k);
BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2); BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2);
@@ -42,14 +42,14 @@
func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity); func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity);
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18); p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
ablockstate[j++] = blockstate1; ablockstate[j++] = blockstate1;
@@ -337,6 +340,10 @@ @@ -335,6 +_,10 @@
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
}
+ public BlockState rotate(BlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) { public BlockState func_185499_a(BlockState p_185499_1_, Rotation p_185499_2_) {
+ return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction); return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
+ } + }
+ +
public BlockState func_185471_a(BlockState p_185471_1_, Mirror p_185471_2_) { + public BlockState rotate(BlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) {
return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176387_N))); + return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction);
} }
public BlockState func_185471_a(BlockState p_185471_1_, Mirror p_185471_2_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/PistonBlockStructureHelper.java --- a/net/minecraft/block/PistonBlockStructureHelper.java
+++ b/net/minecraft/block/PistonBlockStructureHelper.java +++ b/net/minecraft/block/PistonBlockStructureHelper.java
@@ -48,7 +48,7 @@ @@ -48,7 +_,7 @@
} else { } else {
for(int i = 0; i < this.field_177258_e.size(); ++i) { for(int i = 0; i < this.field_177258_e.size(); ++i) {
BlockPos blockpos = this.field_177258_e.get(i); BlockPos blockpos = this.field_177258_e.get(i);
@@ -9,7 +9,7 @@
return false; return false;
} }
} }
@@ -57,24 +57,9 @@ @@ -57,24 +_,9 @@
} }
} }
@@ -35,7 +35,7 @@
return true; return true;
} else if (!PistonBlock.func_185646_a(blockstate, this.field_177261_a, p_177251_1_, this.field_177257_d, false, p_177251_2_)) { } else if (!PistonBlock.func_185646_a(blockstate, this.field_177261_a, p_177251_1_, this.field_177257_d, false, p_177251_2_)) {
return true; return true;
@@ -87,12 +72,12 @@ @@ -87,12 +_,12 @@
if (i + this.field_177258_e.size() > 12) { if (i + this.field_177258_e.size() > 12) {
return false; return false;
} else { } else {
@@ -52,7 +52,7 @@
break; break;
} }
@@ -119,7 +104,7 @@ @@ -119,7 +_,7 @@
for(int k = 0; k <= j + l; ++k) { for(int k = 0; k <= j + l; ++k) {
BlockPos blockpos2 = this.field_177258_e.get(k); BlockPos blockpos2 = this.field_177258_e.get(k);
@@ -61,7 +61,7 @@
return false; return false;
} }
} }
@@ -128,7 +113,7 @@ @@ -128,7 +_,7 @@
} }
blockstate = this.field_177261_a.func_180495_p(blockpos1); blockstate = this.field_177261_a.func_180495_p(blockpos1);
@@ -70,7 +70,7 @@
return true; return true;
} }
@@ -173,7 +158,7 @@ @@ -173,7 +_,7 @@
if (direction.func_176740_k() != this.field_177257_d.func_176740_k()) { if (direction.func_176740_k() != this.field_177257_d.func_176740_k()) {
BlockPos blockpos = p_177250_1_.func_177972_a(direction); BlockPos blockpos = p_177250_1_.func_177972_a(direction);
BlockState blockstate1 = this.field_177261_a.func_180495_p(blockpos); BlockState blockstate1 = this.field_177261_a.func_180495_p(blockpos);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/PortalSize.java --- a/net/minecraft/block/PortalSize.java
+++ b/net/minecraft/block/PortalSize.java +++ b/net/minecraft/block/PortalSize.java
@@ -16,7 +16,7 @@ @@ -16,7 +_,7 @@
public class PortalSize { public class PortalSize {
private static final AbstractBlock.IPositionPredicate field_242962_a = (p_242966_0_, p_242966_1_, p_242966_2_) -> { private static final AbstractBlock.IPositionPredicate field_242962_a = (p_242966_0_, p_242966_1_, p_242966_2_) -> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/PoweredRailBlock.java --- a/net/minecraft/block/PoweredRailBlock.java
+++ b/net/minecraft/block/PoweredRailBlock.java +++ b/net/minecraft/block/PoweredRailBlock.java
@@ -14,10 +14,16 @@ @@ -14,10 +_,16 @@
public class PoweredRailBlock extends AbstractRailBlock { public class PoweredRailBlock extends AbstractRailBlock {
public static final EnumProperty<RailShape> field_176568_b = BlockStateProperties.field_208166_S; public static final EnumProperty<RailShape> field_176568_b = BlockStateProperties.field_208166_S;
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u; public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
@@ -18,7 +18,7 @@
} }
protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, BlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) { protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, BlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
@@ -99,13 +105,13 @@ @@ -99,13 +_,13 @@
protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) { protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) {
BlockState blockstate = p_208071_1_.func_180495_p(p_208071_2_); BlockState blockstate = p_208071_1_.func_180495_p(p_208071_2_);
@@ -35,7 +35,7 @@
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1); return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else { } else {
return false; return false;
@@ -156,6 +162,9 @@ @@ -156,6 +_,9 @@
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST); return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST);
case NORTH_EAST: case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST); return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST);
@@ -45,12 +45,13 @@
} }
case COUNTERCLOCKWISE_90: case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) { switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) {
@@ -255,4 +264,8 @@ @@ -254,5 +_,9 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) { protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176568_b, field_176569_M); p_206840_1_.func_206894_a(field_176568_b, field_176569_M);
} + }
+ +
+ public boolean isActivatorRail() { + public boolean isActivatorRail() {
+ return isActivator; + return isActivator;
+ } }
} }
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/PumpkinBlock.java
+++ b/net/minecraft/block/PumpkinBlock.java
@@ -20,7 +20,7 @@
public ActionResultType func_225533_a_(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) {
ItemStack itemstack = p_225533_4_.func_184586_b(p_225533_5_);
- if (itemstack.func_77973_b() == Items.field_151097_aZ) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ShearsItem) {
if (!p_225533_2_.field_72995_K) {
Direction direction = p_225533_6_.func_216354_b();
Direction direction1 = direction.func_176740_k() == Direction.Axis.Y ? p_225533_4_.func_174811_aO().func_176734_d() : direction;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/RailBlock.java --- a/net/minecraft/block/RailBlock.java
+++ b/net/minecraft/block/RailBlock.java +++ b/net/minecraft/block/RailBlock.java
@@ -49,6 +49,9 @@ @@ -49,6 +_,9 @@
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST); return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST);
case NORTH_EAST: case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST); return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/RailState.java --- a/net/minecraft/block/RailState.java
+++ b/net/minecraft/block/RailState.java +++ b/net/minecraft/block/RailState.java
@@ -15,14 +15,16 @@ @@ -15,14 +_,16 @@
private BlockState field_196923_d; private BlockState field_196923_d;
private final boolean field_208513_e; private final boolean field_208513_e;
private final List<BlockPos> field_196924_e = Lists.newArrayList(); private final List<BlockPos> field_196924_e = Lists.newArrayList();
@@ -19,7 +19,7 @@
this.func_208509_a(railshape); this.func_208509_a(railshape);
} }
@@ -178,7 +180,7 @@ @@ -178,7 +_,7 @@
} }
} }
@@ -28,7 +28,7 @@
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) { if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
railshape = RailShape.ASCENDING_NORTH; railshape = RailShape.ASCENDING_NORTH;
} }
@@ -188,7 +190,7 @@ @@ -188,7 +_,7 @@
} }
} }
@@ -37,7 +37,7 @@
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) { if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
railshape = RailShape.ASCENDING_EAST; railshape = RailShape.ASCENDING_EAST;
} }
@@ -304,7 +306,7 @@ @@ -304,7 +_,7 @@
} }
} }
@@ -46,7 +46,7 @@
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) { if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
railshape = RailShape.ASCENDING_NORTH; railshape = RailShape.ASCENDING_NORTH;
} }
@@ -314,7 +316,7 @@ @@ -314,7 +_,7 @@
} }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/RedstoneDiodeBlock.java --- a/net/minecraft/block/RedstoneDiodeBlock.java
+++ b/net/minecraft/block/RedstoneDiodeBlock.java +++ b/net/minecraft/block/RedstoneDiodeBlock.java
@@ -65,7 +65,7 @@ @@ -65,7 +_,7 @@
if (p_220069_1_.func_196955_c(p_220069_2_, p_220069_3_)) { if (p_220069_1_.func_196955_c(p_220069_2_, p_220069_3_)) {
this.func_176398_g(p_220069_2_, p_220069_3_, p_220069_1_); this.func_176398_g(p_220069_2_, p_220069_3_, p_220069_1_);
} else { } else {
@@ -9,7 +9,7 @@
func_220059_a(p_220069_1_, p_220069_2_, p_220069_3_, tileentity); func_220059_a(p_220069_1_, p_220069_2_, p_220069_3_, tileentity);
p_220069_2_.func_217377_a(p_220069_3_, false); p_220069_2_.func_217377_a(p_220069_3_, false);
@@ -163,6 +163,8 @@ @@ -163,6 +_,8 @@
protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, BlockState p_176400_3_) { protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, BlockState p_176400_3_) {
Direction direction = p_176400_3_.func_177229_b(field_185512_D); Direction direction = p_176400_3_.func_177229_b(field_185512_D);
BlockPos blockpos = p_176400_2_.func_177972_a(direction.func_176734_d()); BlockPos blockpos = p_176400_2_.func_177972_a(direction.func_176734_d());
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/RedstoneOreBlock.java --- a/net/minecraft/block/RedstoneOreBlock.java
+++ b/net/minecraft/block/RedstoneOreBlock.java +++ b/net/minecraft/block/RedstoneOreBlock.java
@@ -71,11 +71,11 @@ @@ -71,11 +_,11 @@
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/RedstoneWireBlock.java --- a/net/minecraft/block/RedstoneWireBlock.java
+++ b/net/minecraft/block/RedstoneWireBlock.java +++ b/net/minecraft/block/RedstoneWireBlock.java
@@ -184,7 +184,7 @@ @@ -184,7 +_,7 @@
BlockState blockstate = p_235545_1_.func_180495_p(blockpos); BlockState blockstate = p_235545_1_.func_180495_p(blockpos);
if (p_235545_4_) { if (p_235545_4_) {
boolean flag = this.func_235552_b_(p_235545_1_, blockpos, blockstate); boolean flag = this.func_235552_b_(p_235545_1_, blockpos, blockstate);
@@ -9,7 +9,7 @@
if (blockstate.func_224755_d(p_235545_1_, blockpos, p_235545_3_.func_176734_d())) { if (blockstate.func_224755_d(p_235545_1_, blockpos, p_235545_3_.func_176734_d())) {
return RedstoneSide.UP; return RedstoneSide.UP;
} }
@@ -193,7 +193,7 @@ @@ -193,7 +_,7 @@
} }
} }
@@ -18,7 +18,7 @@
} }
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
@@ -335,11 +335,7 @@ @@ -335,11 +_,7 @@
} }
} }
@@ -31,7 +31,7 @@
if (p_176343_0_.func_203425_a(Blocks.field_150488_af)) { if (p_176343_0_.func_203425_a(Blocks.field_150488_af)) {
return true; return true;
} else if (p_176343_0_.func_203425_a(Blocks.field_196633_cV)) { } else if (p_176343_0_.func_203425_a(Blocks.field_196633_cV)) {
@@ -348,7 +344,7 @@ @@ -348,7 +_,7 @@
} else if (p_176343_0_.func_203425_a(Blocks.field_190976_dk)) { } else if (p_176343_0_.func_203425_a(Blocks.field_190976_dk)) {
return p_176343_1_ == p_176343_0_.func_177229_b(ObserverBlock.field_176387_N); return p_176343_1_ == p_176343_0_.func_177229_b(ObserverBlock.field_176387_N);
} else { } else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SaplingBlock.java --- a/net/minecraft/block/SaplingBlock.java
+++ b/net/minecraft/block/SaplingBlock.java +++ b/net/minecraft/block/SaplingBlock.java
@@ -29,6 +29,7 @@ @@ -29,6 +_,7 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
if (p_225542_2_.func_201696_r(p_225542_3_.func_177984_a()) >= 9 && p_225542_4_.nextInt(7) == 0) { if (p_225542_2_.func_201696_r(p_225542_3_.func_177984_a()) >= 9 && p_225542_4_.nextInt(7) == 0) {
@@ -8,7 +8,7 @@
this.func_226942_a_(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_); this.func_226942_a_(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_);
} }
@@ -38,6 +39,7 @@ @@ -38,6 +_,7 @@
if (p_226942_3_.func_177229_b(field_176479_b) == 0) { if (p_226942_3_.func_177229_b(field_176479_b) == 0) {
p_226942_1_.func_180501_a(p_226942_2_, p_226942_3_.func_235896_a_(field_176479_b), 4); p_226942_1_.func_180501_a(p_226942_2_, p_226942_3_.func_235896_a_(field_176479_b), 4);
} else { } else {
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/ScaffoldingBlock.java
+++ b/net/minecraft/block/ScaffoldingBlock.java
@@ -138,6 +138,8 @@
return i;
}
+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
+
static {
VoxelShape voxelshape = Block.func_208617_a(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D);
VoxelShape voxelshape1 = Block.func_208617_a(0.0D, 0.0D, 0.0D, 2.0D, 16.0D, 2.0D);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SeaGrassBlock.java --- a/net/minecraft/block/SeaGrassBlock.java
+++ b/net/minecraft/block/SeaGrassBlock.java +++ b/net/minecraft/block/SeaGrassBlock.java
@@ -17,7 +17,7 @@ @@ -17,7 +_,7 @@
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SoundType.java --- a/net/minecraft/block/SoundType.java
+++ b/net/minecraft/block/SoundType.java +++ b/net/minecraft/block/SoundType.java
@@ -59,6 +59,7 @@ @@ -59,6 +_,7 @@
private final SoundEvent field_185865_r; private final SoundEvent field_185865_r;
private final SoundEvent field_185866_s; private final SoundEvent field_185866_s;
@@ -1,18 +1,16 @@
--- a/net/minecraft/block/SpawnerBlock.java --- a/net/minecraft/block/SpawnerBlock.java
+++ b/net/minecraft/block/SpawnerBlock.java +++ b/net/minecraft/block/SpawnerBlock.java
@@ -18,10 +18,13 @@ @@ -18,8 +_,11 @@
public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
- int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15); - int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15);
- this.func_180637_b(p_220062_2_, p_220062_3_, i); - this.func_180637_b(p_220062_2_, p_220062_3_, i);
} + }
+
+ @Override + @Override
+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) { + public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) {
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); + return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public BlockRenderType func_149645_b(BlockState p_149645_1_) {
return BlockRenderType.MODEL;
} }
public BlockRenderType func_149645_b(BlockState p_149645_1_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SpongeBlock.java --- a/net/minecraft/block/SpongeBlock.java
+++ b/net/minecraft/block/SpongeBlock.java +++ b/net/minecraft/block/SpongeBlock.java
@@ -64,7 +64,7 @@ @@ -64,7 +_,7 @@
queue.add(new Tuple<>(blockpos1, j + 1)); queue.add(new Tuple<>(blockpos1, j + 1));
} }
} else if (material == Material.field_203243_f || material == Material.field_204868_h) { } else if (material == Material.field_203243_f || material == Material.field_204868_h) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SpreadableSnowyDirtBlock.java --- a/net/minecraft/block/SpreadableSnowyDirtBlock.java
+++ b/net/minecraft/block/SpreadableSnowyDirtBlock.java +++ b/net/minecraft/block/SpreadableSnowyDirtBlock.java
@@ -33,6 +33,7 @@ @@ -33,6 +_,7 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
if (!func_220257_b(p_225542_1_, p_225542_2_, p_225542_3_)) { if (!func_220257_b(p_225542_1_, p_225542_2_, p_225542_3_)) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/StairsBlock.java --- a/net/minecraft/block/StairsBlock.java
+++ b/net/minecraft/block/StairsBlock.java +++ b/net/minecraft/block/StairsBlock.java
@@ -83,13 +83,23 @@ @@ -83,11 +_,21 @@
return voxelshape; return voxelshape;
} }
@@ -11,20 +11,18 @@
this.field_150149_b = p_i48321_1_.func_177230_c(); this.field_150149_b = p_i48321_1_.func_177230_c();
this.field_150151_M = p_i48321_1_; this.field_150151_M = p_i48321_1_;
+ this.stateSupplier = () -> p_i48321_1_; + this.stateSupplier = () -> p_i48321_1_;
} + }
+
+ public StairsBlock(java.util.function.Supplier<BlockState> state, AbstractBlock.Properties properties) { + public StairsBlock(java.util.function.Supplier<BlockState> state, AbstractBlock.Properties properties) {
+ super(properties); + super(properties);
+ this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false))); + this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176309_a, Direction.NORTH).func_206870_a(field_176308_b, Half.BOTTOM).func_206870_a(field_176310_M, StairsShape.STRAIGHT).func_206870_a(field_204513_t, Boolean.valueOf(false)));
+ this.field_150149_b = Blocks.field_150350_a; // These are unused, fields are redirected + this.field_150149_b = Blocks.field_150350_a; // These are unused, fields are redirected
+ this.field_150151_M = Blocks.field_150350_a.func_176223_P(); + this.field_150151_M = Blocks.field_150350_a.func_176223_P();
+ this.stateSupplier = state; + this.stateSupplier = state;
+ }
+
public boolean func_220074_n(BlockState p_220074_1_) {
return true;
} }
@@ -265,4 +275,14 @@
public boolean func_220074_n(BlockState p_220074_1_) {
@@ -265,4 +_,14 @@
public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
return false; return false;
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/StemBlock.java --- a/net/minecraft/block/StemBlock.java
+++ b/net/minecraft/block/StemBlock.java +++ b/net/minecraft/block/StemBlock.java
@@ -37,22 +37,24 @@ @@ -37,22 +_,24 @@
} }
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -29,14 +29,15 @@
} }
} }
@@ -97,4 +99,10 @@ @@ -96,5 +_,11 @@
public StemGrownBlock func_208486_d() { public StemGrownBlock func_208486_d() {
return this.field_149877_a; return this.field_149877_a;
} + }
+ +
+ //FORGE START + //FORGE START
+ @Override + @Override
+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) { + public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) {
+ return net.minecraftforge.common.PlantType.CROP; + return net.minecraftforge.common.PlantType.CROP;
+ } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SugarCaneBlock.java --- a/net/minecraft/block/SugarCaneBlock.java
+++ b/net/minecraft/block/SugarCaneBlock.java +++ b/net/minecraft/block/SugarCaneBlock.java
@@ -15,7 +15,7 @@ @@ -15,7 +_,7 @@
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -9,7 +9,7 @@
public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X; public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X;
protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D); protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D);
@@ -43,12 +43,14 @@ @@ -43,12 +_,14 @@
if (i < 3) { if (i < 3) {
int j = p_225542_1_.func_177229_b(field_176355_a); int j = p_225542_1_.func_177229_b(field_176355_a);
@@ -24,7 +24,7 @@
} }
} }
@@ -63,6 +65,8 @@ @@ -63,6 +_,8 @@
} }
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
@@ -33,10 +33,11 @@
BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
if (blockstate.func_177230_c() == this) { if (blockstate.func_177230_c() == this) {
return true; return true;
@@ -86,4 +90,14 @@ @@ -85,5 +_,15 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) { protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176355_a); p_206840_1_.func_206894_a(field_176355_a);
} + }
+ +
+ @Override + @Override
+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) { + public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) {
@@ -46,5 +47,5 @@
+ @Override + @Override
+ public BlockState getPlant(IBlockReader world, BlockPos pos) { + public BlockState getPlant(IBlockReader world, BlockPos pos) {
+ return func_176223_P(); + return func_176223_P();
+ } }
} }
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/SweetBerryBushBlock.java --- a/net/minecraft/block/SweetBerryBushBlock.java
+++ b/net/minecraft/block/SweetBerryBushBlock.java +++ b/net/minecraft/block/SweetBerryBushBlock.java
@@ -52,8 +52,9 @@ @@ -52,8 +_,9 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
int i = p_225542_1_.func_177229_b(field_220125_a); int i = p_225542_1_.func_177229_b(field_220125_a);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/TNTBlock.java --- a/net/minecraft/block/TNTBlock.java
+++ b/net/minecraft/block/TNTBlock.java +++ b/net/minecraft/block/TNTBlock.java
@@ -29,10 +29,14 @@ @@ -29,10 +_,14 @@
this.func_180632_j(this.func_176223_P().func_206870_a(field_212569_a, Boolean.valueOf(false))); this.func_180632_j(this.func_176223_P().func_206870_a(field_212569_a, Boolean.valueOf(false)));
} }
@@ -16,7 +16,7 @@
p_220082_2_.func_217377_a(p_220082_3_, false); p_220082_2_.func_217377_a(p_220082_3_, false);
} }
@@ -41,7 +45,7 @@ @@ -41,7 +_,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_) { public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
if (p_220069_2_.func_175640_z(p_220069_3_)) { if (p_220069_2_.func_175640_z(p_220069_3_)) {
@@ -25,7 +25,7 @@
p_220069_2_.func_217377_a(p_220069_3_, false); p_220069_2_.func_217377_a(p_220069_3_, false);
} }
@@ -49,7 +53,7 @@ @@ -49,7 +_,7 @@
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) { public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) {
if (!p_176208_1_.func_201670_d() && !p_176208_4_.func_184812_l_() && p_176208_3_.func_177229_b(field_212569_a)) { if (!p_176208_1_.func_201670_d() && !p_176208_4_.func_184812_l_() && p_176208_3_.func_177229_b(field_212569_a)) {
@@ -34,7 +34,7 @@
} }
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_); super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
@@ -63,10 +67,12 @@ @@ -63,10 +_,12 @@
} }
} }
@@ -47,7 +47,7 @@
private static void func_196535_a(World p_196535_0_, BlockPos p_196535_1_, @Nullable LivingEntity p_196535_2_) { private static void func_196535_a(World p_196535_0_, BlockPos p_196535_1_, @Nullable LivingEntity p_196535_2_) {
if (!p_196535_0_.field_72995_K) { if (!p_196535_0_.field_72995_K) {
TNTEntity tntentity = new TNTEntity(p_196535_0_, (double)p_196535_1_.func_177958_n() + 0.5D, (double)p_196535_1_.func_177956_o(), (double)p_196535_1_.func_177952_p() + 0.5D, p_196535_2_); TNTEntity tntentity = new TNTEntity(p_196535_0_, (double)p_196535_1_.func_177958_n() + 0.5D, (double)p_196535_1_.func_177956_o(), (double)p_196535_1_.func_177952_p() + 0.5D, p_196535_2_);
@@ -81,7 +87,7 @@ @@ -81,7 +_,7 @@
if (item != Items.field_151033_d && item != Items.field_151059_bz) { if (item != Items.field_151033_d && item != Items.field_151059_bz) {
return super.func_225533_a_(p_225533_1_, p_225533_2_, p_225533_3_, p_225533_4_, p_225533_5_, p_225533_6_); return super.func_225533_a_(p_225533_1_, p_225533_2_, p_225533_3_, p_225533_4_, p_225533_5_, p_225533_6_);
} else { } else {
@@ -56,7 +56,7 @@
p_225533_2_.func_180501_a(p_225533_3_, Blocks.field_150350_a.func_176223_P(), 11); p_225533_2_.func_180501_a(p_225533_3_, Blocks.field_150350_a.func_176223_P(), 11);
if (!p_225533_4_.func_184812_l_()) { if (!p_225533_4_.func_184812_l_()) {
if (item == Items.field_151033_d) { if (item == Items.field_151033_d) {
@@ -102,7 +108,7 @@ @@ -102,7 +_,7 @@
Entity entity = p_220066_4_.func_234616_v_(); Entity entity = p_220066_4_.func_234616_v_();
if (p_220066_4_.func_70027_ad()) { if (p_220066_4_.func_70027_ad()) {
BlockPos blockpos = p_220066_3_.func_216350_a(); BlockPos blockpos = p_220066_3_.func_216350_a();
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/TallGrassBlock.java --- a/net/minecraft/block/TallGrassBlock.java
+++ b/net/minecraft/block/TallGrassBlock.java +++ b/net/minecraft/block/TallGrassBlock.java
@@ -8,7 +8,7 @@ @@ -8,7 +_,7 @@
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/TrapDoorBlock.java --- a/net/minecraft/block/TrapDoorBlock.java
+++ b/net/minecraft/block/TrapDoorBlock.java +++ b/net/minecraft/block/TrapDoorBlock.java
@@ -147,4 +147,17 @@ @@ -147,4 +_,17 @@
return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
} }
@@ -9,9 +9,9 @@
+ @Override + @Override
+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { + public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
+ if (state.func_177229_b(field_176283_b)) { + if (state.func_177229_b(field_176283_b)) {
+ BlockState down = world.func_180495_p(pos.func_177977_b()); + BlockPos downPos = pos.func_177977_b();
+ if (down.func_177230_c() == net.minecraft.block.Blocks.field_150468_ap) + BlockState down = world.func_180495_p(downPos);
+ return down.func_177229_b(LadderBlock.field_176382_a) == state.func_177229_b(field_185512_D); + return down.func_177230_c().makesOpenTrapdoorAboveClimbable(down, world, downPos, state);
+ } + }
+ return false; + return false;
+ } + }
@@ -1,11 +0,0 @@
--- a/net/minecraft/block/TripWireBlock.java
+++ b/net/minecraft/block/TripWireBlock.java
@@ -67,7 +67,7 @@
}
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) {
- if (!p_176208_1_.field_72995_K && !p_176208_4_.func_184614_ca().func_190926_b() && p_176208_4_.func_184614_ca().func_77973_b() == Items.field_151097_aZ) {
+ if (!p_176208_1_.field_72995_K && !p_176208_4_.func_184614_ca().func_190926_b() && p_176208_4_.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ShearsItem) {
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_.func_206870_a(field_176295_N, Boolean.valueOf(true)), 4);
}
@@ -0,0 +1,12 @@
--- a/net/minecraft/block/TripWireHookBlock.java
+++ b/net/minecraft/block/TripWireHookBlock.java
@@ -150,8 +_,8 @@
BlockPos blockpos2 = p_176260_2_.func_177967_a(direction, k);
BlockState blockstate2 = ablockstate[k];
if (blockstate2 != null) {
+ if (!p_176260_1_.func_180495_p(blockpos2).func_196958_f()) { // FORGE: fix MC-129055
p_176260_1_.func_180501_a(blockpos2, blockstate2.func_206870_a(field_176265_M, Boolean.valueOf(flag2)), 3);
- if (!p_176260_1_.func_180495_p(blockpos2).func_196958_f()) {
}
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/TurtleEggBlock.java --- a/net/minecraft/block/TurtleEggBlock.java
+++ b/net/minecraft/block/TurtleEggBlock.java +++ b/net/minecraft/block/TurtleEggBlock.java
@@ -149,7 +149,7 @@ @@ -149,7 +_,7 @@
if (!(p_212570_2_ instanceof LivingEntity)) { if (!(p_212570_2_ instanceof LivingEntity)) {
return false; return false;
} else { } else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/VineBlock.java --- a/net/minecraft/block/VineBlock.java
+++ b/net/minecraft/block/VineBlock.java +++ b/net/minecraft/block/VineBlock.java
@@ -22,7 +22,7 @@ @@ -22,7 +_,7 @@
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -9,7 +9,7 @@
public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z; public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z;
public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a; public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a;
public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b; public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b;
@@ -152,14 +152,14 @@ @@ -152,14 +_,14 @@
} }
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
@@ -26,7 +26,7 @@
Direction direction3 = direction.func_176746_e(); Direction direction3 = direction.func_176746_e();
Direction direction4 = direction.func_176735_f(); Direction direction4 = direction.func_176735_f();
boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3)); boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3));
@@ -216,8 +216,9 @@ @@ -216,8 +_,9 @@
if (p_225542_3_.func_177956_o() > 0) { if (p_225542_3_.func_177956_o() > 0) {
BlockPos blockpos1 = p_225542_3_.func_177977_b(); BlockPos blockpos1 = p_225542_3_.func_177977_b();
BlockState blockstate = p_225542_2_.func_180495_p(blockpos1); BlockState blockstate = p_225542_2_.func_180495_p(blockpos1);
@@ -38,11 +38,3 @@
BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_); BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_);
if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) { if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) {
p_225542_2_.func_180501_a(blockpos1, blockstate2, 2); p_225542_2_.func_180501_a(blockpos1, blockstate2, 2);
@@ -322,4 +323,7 @@
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
return field_196546_A.get(p_176267_0_);
}
+
+ @Override
+ public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/WebBlock.java --- a/net/minecraft/block/WebBlock.java
+++ b/net/minecraft/block/WebBlock.java +++ b/net/minecraft/block/WebBlock.java
@@ -5,7 +5,7 @@ @@ -5,7 +_,7 @@
import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -0,0 +1,14 @@
--- a/net/minecraft/block/WoodType.java
+++ b/net/minecraft/block/WoodType.java
@@ -32,4 +_,11 @@
public String func_227048_b_() {
return this.field_227045_h_;
}
+
+ /**
+ * Use this to create a new {@link WoodType}. Make sure to register its rendering by enqueuing Atlases.addWoodType(...) during client setup..
+ */
+ public static WoodType create(String name) {
+ return new WoodType(name);
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/ClientBrandRetriever.java --- a/net/minecraft/client/ClientBrandRetriever.java
+++ b/net/minecraft/client/ClientBrandRetriever.java +++ b/net/minecraft/client/ClientBrandRetriever.java
@@ -6,6 +6,6 @@ @@ -6,6 +_,6 @@
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class ClientBrandRetriever { public class ClientBrandRetriever {
public static String getClientModName() { public static String getClientModName() {
Loaded 100 of 1434 files, more files were not shown because too many files have changed in this diff. Show more