Compare commits

...
230 Commits
Author SHA1 Message Date
RainWarrior ab39b7e4e0 Removed leftover debug messages 2015-01-30 03:14:12 +03:00
LexManos a420927007 Merge pull request #1666 from TechStack/1.8
Fixes issue #1552 Where the flowIntoBlock method was not setting the Block to the fluid and causing crashes
2015-01-29 16:29:30 -06:00
LexManos 7581ead65f Merge pull request #1664 from Lunatrius/fix-debug
Fixed debug text rendering one line to low.
2015-01-29 16:19:20 -06:00
TechStack 146b08a8cd Closes #1552
Set the destination block the to the fluid.
In the previous code the destination block was still Air and would would
cause a crash because air doesn't have a property for LEVEL
2015-01-29 17:11:22 -05:00
RainWarrior 67121d9ebc Merge pull request #1521 from RainWarrior/model-system
Model loader registry
2015-01-29 13:25:47 +03:00
RainWarrior 6eba0ebb93 Added model loader registry
Entry point: ModelLoaderRegistry
loader interface: ICustomModelLoader
custom model: IModel

ModelLoader is responsible for splicing into vanilla model system.
(you probably don't need to use it directly)

Interop with vanilla models isn't great yet
(vanilla models can't refer to custom ones as parents), will improve in
the future.

Includes loader for B3D models, with animation support
(net.minecraftforge.client.model.b3d).
Blender export plugin with compatible coordinate system:
https://github.com/RainWarrior/B3DExport

OBJ loader is being written, will be included at some point in the
future. For now you can convert OBJ to B3D via blender, or wait.
2015-01-29 11:33:52 +03:00
Lunatrius 39eb036b0e Don't skip the first line when rendering (debug) text. 2015-01-28 21:41:39 +01:00
Lex Manos 8b6ef01ecc Updated FML:
MinecraftForge/FML@a55e412453 Save the mod list of players in their NetworkDispatcher (Make it accessable for mods)
MinecraftForge/FML@69d479d46a Fixed getEffectiveSide() for Netty Server threads
MinecraftForge/FML@0f9a33cf14 Exclude only log4j2 queue from class loader
2015-01-19 11:38:05 -08:00
LexManos c4b0fea9ee Merge pull request #1647 from Parker8283/fluid-icons
Re-enabled Icon setting for Fluids
2015-01-16 15:22:09 -08:00
LexManos 698b1558cd Merge pull request #1645 from Lunatrius/chat-npe-fix
Fixed NPE when canceling ClientChatRecievedEvent. Fixes #1644
2015-01-16 15:18:02 -08:00
Parker Young bfcce919b9 Re-enabled Icon setting for Fluids 2015-01-16 17:30:00 -05:00
Lunatrius 4380ca026e Fixed NPE when canceling ClientChatRecievedEvent. Fixes #1644 2015-01-16 23:09:45 +01:00
Lex Manos f6a378e136 Silently eat exceptions when getting a TE's rendering bounding box, this 'fixes' Bukkit servers screwing up world data and causing clients to crash. 2015-01-14 19:02:50 -08:00
RainWarrior dcabad2bd1 Merge pull request #1602 from Chicken-Bones/1.8
Allow blocks to render in multiple layers
2015-01-10 13:35:29 +03:00
Lex Manos 64bf7bb3be Fix value passed for Item.getModel useRemaining argument. Closes #1623 2015-01-08 23:37:06 -08:00
Lex Manos fb88b021c5 Made Chunk.fillBlock respect TileEntity.shouldRefresh. 2015-01-08 23:22:45 -08:00
Lex Manos d899f8fb84 Call World.init from DimensionManager.initDimension Closes #1551 2015-01-08 23:02:25 -08:00
Lex Manos 5328701219 Fix potential NPE when loading a single player world where you were saved in a unloaded dimension. Closes #1575 2015-01-08 21:42:13 -08:00
LexManos bca990cc93 Merge pull request #1609 from lumien231/1.8
Fixes #1603: Moving the start of the update thread to the pre init of the forge mod container
2014-12-28 14:28:51 -08:00
Lumien 9d34bbece7 Fixes #1603: Moving the start of the update thread to the pre init of the forge mod container 2014-12-28 22:49:31 +01:00
Chicken-Bones 0cbc685d3c Allow blocks to render in multiple layers 2014-12-26 15:45:00 +10:00
Lex Manos 0923c2c2b8 Fix recipies for stone variants. 2014-12-25 01:39:22 -08:00
LexManos 30e44e19e9 Merge pull request #1592 from palechip/1.8
Fix Scoreboard rendering for the sidebar.
2014-12-24 16:06:17 -08:00
Lex Manos 51271dcc3a Fix MC-30864 (sending web links in chat) 2014-12-23 15:04:41 -08:00
Lex Manos 7ddc5469b4 Fix crafting of non-oak fences/gates. 2014-12-23 14:14:40 -08:00
Lex Manos 3c936e88f2 Added chests to the ore dictionary. 2014-12-23 13:17:44 -08:00
Lex Manos 53275ff0ac Removed exclusion of white stained glass recipes in ore dictionary. 2014-12-23 12:15:40 -08:00
palechip f6dc40c07d Fix Scoreboard rendering for the sidebar. 2014-12-22 14:34:35 +01:00
Lex Manos 959eaf0218 Fix BlockSnapshots not firing correctly due to patch mixup in 1.8 update. Closes #1591 2014-12-21 18:55:46 -08:00
LexManos 005e0c8451 Merge pull request #1586 from Lunatrius/fix-chat-1.8
[1.8] Fixed messages not being added to the chat history
2014-12-18 14:13:33 -08:00
Lunatrius 7916a21682 Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. 2014-12-18 20:46:24 +01:00
Lex Manos ae1321b8c8 MinecraftForge/FML@5a4d362293 Finish removing marker in mapping entry names. FMLMissingMappingsEvent/FMLModIdMappingEvent should fire with correct names now. 2014-12-18 08:11:36 -08:00
Lex Manos 4aaabdd0e0 Fix incorrect logic in world change clumping. 2014-12-18 08:11:30 -08:00
Lex Manos 9d95952dc1 Remove our changes to Stitcher slot allocation. 2014-12-13 18:07:31 -08:00
Lex Manos fd859812eb MinecraftForge/FML@e3785c2893 Ensure that EntitySpawn and OpenGUI packets are handled in the world thread. Also log all errors that are thrown in FutureTasks. 2014-12-13 18:07:13 -08:00
Lex Manos d8cb28911c Fix userdev for new BlockState change. 2014-12-12 14:42:49 -08:00
LexManos ca2d49b4cd Merge pull request #1518 from RainWarrior/model-event
Added model bake event, ISmartBlock/itemModel, Block.getExtendedState, IExtendedState and IUnlistedProperty
2014-12-12 12:44:05 -08:00
Lex Manos 0b41756125 Untie ItemModelMesher from using Item Ids internally by implementing our own simple mechanics using Trove. 2014-12-12 11:47:27 -08:00
Lex Manos ecd4a259ec Fix EnumHelper for new ArmorTexture argument. 2014-12-11 16:41:27 -08:00
Lex Manos bf66e45699 Fix texture stitcher not using all avalible spaces. 2014-12-11 16:40:48 -08:00
Lex Manos a6c6a79916 Fixed log spam when breaking DoublePlants. Closes #1555 2014-12-10 05:44:07 -08:00
Lex Manos 7c79a4226f Fix missed patch causing Dispensed Armor to go into the wrong slot. Closes #1560 2014-12-10 05:36:15 -08:00
Lex Manos 66018bd168 Make daylight sensor recipe use ore dictionary wooden slabs Closes #1565 2014-12-10 05:18:42 -08:00
Lex Manos 924db0ff03 Fixed NPE thrown when brewing event is fired and not all slots are filled. Closes #1564 2014-12-10 05:12:36 -08:00
Lex Manos 08960ffb7b Unbind Shaped/Shapeless Ore Recipies from Array list to normal List. 2014-12-08 05:03:43 -08:00
Lex Manos f9955efb08 Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. 2014-12-07 05:48:26 -08:00
Lex Manos fd3f948e4c Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. 2014-12-07 05:20:50 -08:00
Lex Manos 309fe700cd Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. 2014-12-07 04:30:10 -08:00
Lex Manos 4cc11b220a Add quartz_ore tool init, more mojang special casing -.- 2014-12-07 03:41:53 -08:00
Lex Manos 27524a02ae Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. 2014-12-07 03:30:10 -08:00
Lex Manos 44b21681e2 Add LivingHealEvent called from EntityLivingBase.heal() 2014-12-07 02:34:28 -08:00
Lex Manos f2b1622355 Added CreateSpawnPosition event. 2014-12-07 01:52:29 -08:00
Lex Manos 0c11a1544f Cleanup deprecated code, and TODOs in OreDictionary. Down-typed things from ArrayList to List. Asking for the ores with a null stack will now throw an Exception. 2014-12-07 01:50:26 -08:00
Lex Manos cf81ad7b15 Add "sand" to the OreDictionary 2014-12-07 00:44:29 -08:00
Lex Manos b417594e71 Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. 2014-12-07 00:39:09 -08:00
Lex Manos 42938a1e7f Added Explosion Start and Detonate events to control explosion. 2014-12-07 00:28:41 -08:00
RainWarrior 134fbaa1ff Added model bake event (allows mods to insert custom baked models, much like TextureStitchEvent allows to load custom textures), ISmartBlock/ItemModel (ability form models to react to block/item states), Block.getExtendedState, support for unlisted properties in block states. Includes example implementation of http://imgur.com/a/FyyJX 2014-12-04 14:16:30 +03:00
Lex Manos 1fc1570663 Only call blockBreak when block itself changes, not just meta. Fixes bottles poping out of brewing stands. 2014-12-02 21:40:50 -08:00
Lex Manos 07db77401d Fix finding of spawn location for mobs. Closes #1546 2014-12-02 21:37:15 -08:00
Lex Manos c683bce659 Remove debug patch I left in. 2014-12-01 19:17:11 -08:00
Lex Manos 59df94bd90 Updated FML:
MinecraftForge/FML@9c8ca4a4e3 Unlink banner block and item id. Mojang should of matched these up but they didn't -.-
MinecraftForge/FML@84a101f344 Update Dev mcp mappings to 11-30 snapshot.
2014-12-01 19:11:17 -08:00
Lex Manos 4caf09cd33 Fix stickey pistons not retracting properly. 2014-12-01 14:53:30 -08:00
Lex Manos 6ff24351d3 Fixed blocks not breaking properly when instantly destroied. 2014-11-30 23:55:28 -08:00
Lex Manos 9f4ef7b38a Fixed vanilla issue where exceptions in World tasks would not be logged. 2014-11-30 23:55:04 -08:00
Lex Manos 7cc7056c57 Fix NPE with BlockSnapshots that caused items with TileEntities to be used up in creative mode. 2014-11-30 23:54:17 -08:00
Lex Manos 2a02804379 Fixed vanilla bug where top part of double plants would flicker a tifferent texture before dissapearing. 2014-11-30 23:50:56 -08:00
Lex Manos c539d5389a Fix BlockPane's connection detection. 2014-11-30 08:36:24 -08:00
Lex Manos b4779be2f6 Fixed snow layers not being able to stack more then twice. Closes #1534 2014-11-29 23:04:22 -08:00
Lex Manos cbcdbf56bb Fixed Entities not being able to climb ladders, Closes #1535 2014-11-29 23:03:55 -08:00
Lex Manos d6d4735a70 Fixed Entity extended properties init order. Closes #1532 2014-11-29 23:03:26 -08:00
Lex Manos 6bb769268f Fix interacting with entities. 2014-11-28 12:04:09 -08:00
Lex Manos 5de6cf571c Updated FML:
MinecraftForge/FML@36644e9771 Finalize modded handshakes in the World tick thread. Prevents potential CMEs when login event takes to long to fire.
2014-11-28 11:20:06 -08:00
Lex Manos f35a53bad5 Fix not being able to place blocks in liquids, and related issues. 2014-11-28 11:19:30 -08:00
Lex Manos 10efdbc085 Fix debug screen not showing grey background. Closes #1529 2014-11-28 11:18:59 -08:00
Lex Manos dcefcc9047 Fix destroy particles not being added. Closes #1528 2014-11-28 08:31:14 -08:00
Lex Manos d48f4d0a94 Update RecipeSorter for new 1.8 recipies. 2014-11-28 08:20:10 -08:00
Lex Manos aa07fa4443 Fix potential NPE in Block.isToolEffective 2014-11-28 08:19:40 -08:00
Lex Manos d879b2c70d Fix wrong state being passed to Block.getDrops 2014-11-28 07:43:50 -08:00
Lex Manos 17e5480b6e Fix Entityies not taking damage correctly. Closes #1511 2014-11-28 07:43:10 -08:00
Lex Manos a059a9a7fb Fix inverted logic preventing blocks from breaking. 2014-11-28 07:10:37 -08:00
Lex Manos 8dc71d5ffa Fixed crash with caomparators due to wrong position. Closes #1512 2014-11-28 06:51:55 -08:00
Lex Manos b9c2968c0e Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 2014-11-28 06:09:33 -08:00
Lex Manos 0edeb1e04b Fix acedential inversion causing some tress to not have leaves. Closes #1522 2014-11-28 06:02:41 -08:00
Lex Manos dce17105ea Fix fog colors, Closes #1524 2014-11-28 06:01:03 -08:00
Lex Manos 277fc4ea7d Fix local variable conflict in Forge patch and latest MCP mappings. 2014-11-26 01:12:11 -08:00
Lex Manos 53659fca06 Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 00:00:54 -08:00
LexManos 0e91787efb Merge pull request #1492 from XCompWiz/clientrain
Fixes client-side fake rain
2014-11-10 16:03:29 -08:00
XCompWiz a5358eb916 Fixes client-side fake rain
Changes the updateWeather function in WorldServer to only send the
weather info to players in the correct dimension, rather than all
players on the server. This is what causes the client-side rain, as the
client believes that it has started raining locally, rather than in
another dimension.
2014-11-11 01:39:26 +02:00
LexManos 5b82e18afc Merge pull request #1376 from founderio/patch-1
Modify WavefrontObject to allow '.' in group object names
2014-11-04 18:29:12 -08:00
Lex Manos 47305ff691 Player sensitive version of Block.getPickBlock Closes #1348 2014-11-04 18:27:02 -08:00
Lex Manos ef0e0d7393 Fix slots being black due to vanilla blending leakage Forge fixes. Closes #1325 & #1242 2014-11-04 18:07:42 -08:00
LexManos a8cce392ab Merge pull request #1005 from luacs1998/patch-1
Create CONTRIBUTING.md
2014-10-22 02:38:09 -07:00
LexManos bcaf8b7e79 Merge pull request #1450 from Adubbz/master
Fixed desert list initialization. Fixes #1447
2014-10-17 15:56:00 -07:00
Lex Manos 31e330090a Bump version for new RB. 2014-10-16 20:49:33 -07:00
Lex Manos 2af2795288 Fix logic error in Blodd's Snapshot capture that caused blocks to not be updated to the client. Closes #1451 2014-10-16 20:49:00 -07:00
LexManos 5aa313cf00 Merge pull request #1461 from Azanor/master
Fix for biome weights under 10
2014-10-16 06:24:48 -07:00
Azanor 46dfaa6d0c Fix for biome weights under 10
This solves the problem where custom mod biomes with weights under 10
not being generated in the world.

Cleaned up the code and made the patch smaller
2014-10-16 12:28:10 +02:00
LexManos 6283e9327e Merge pull request #1368 from matthewprenger/patch-1
Added username cache
2014-10-15 17:16:13 -07:00
matthewprenger 9c2f0ddfad Add username cache for determining a player's last known username 2014-10-15 16:14:36 -05:00
LexManos 619ceefa49 Merge pull request #1457 from AbrarSyed/master
implemented crowdin support
2014-10-15 01:27:44 -07:00
AbrarSyed 8af641a86d implemented crowdin support 2014-10-15 01:07:15 -05:00
Lex Manos ae4f979318 Compleetly disable stencil bits unless told not to by using the -Dforge.forceDisplayStencil=true flag. Should solve the 'menu in bottom corner' issue with Intel Integrated graphics cards. 2014-10-12 22:11:40 -07:00
LexManos 3aef547046 Merge pull request #1418 from Parker8283/wakeupevent
Added PlayerWakeUpEvent
2014-10-11 11:34:50 -07:00
Parker ff36d4f1d3 Added PlayerWakeUpEvent 2014-10-11 14:13:25 -04:00
Adubbz de5daadf11 Fixed desert list initialization. Fixes #1447 2014-10-10 21:22:47 +11:00
LexManos 38275c8232 Merge pull request #1364 from Adubbz/master
Fixed biome weights not working with non multiples of 10
2014-10-08 17:58:26 -07:00
Lex Manos b0190bb50d Fix vanilla lighting issue and blending issues in achievements gui. Closes #1445 2014-10-08 17:54:20 -07:00
Lex Manos 3c51b1a8c8 MinecraftForge/FML@d00feb58c7 Remove debug code that was causing console spam in Forge. 2014-10-06 15:30:58 -07:00
Lex Manos 676ecab52e Disable by default the Display Stencil bits. Keep FBO bits. Acording to Mumfery and ChickenBones, it should not be nessasary and should solve the 1/4 main menu issue. Use -Dforge.forceDisplayStencil=true to enable old behavior. 2014-10-06 15:12:12 -07:00
LexManos 6da8a19094 Merge pull request #1219 from Lunatrius/master
Prevent client only commands from bleeding through to the server.
2014-10-06 14:50:47 -07:00
LexManos 9879143b96 Merge pull request #1367 from bloodmc/blockplace
Added PlaceEvent and MultiPlaceEvent which fires before placing a block.
2014-10-02 13:32:02 -07:00
bloodshot 37f91681d9 Added PlaceEvent and MultiPlaceEvent which fires before placing a block.
Before calling "ItemStack.tryPlaceItemInWorld", a recording flag is turned on for
setBlock to capture a blocksnapshot for each block that attempts to be placed.

If 1 block is captured, a "BlockEvent.PlaceEvent" is fired to notify mods.
If 2 or more blocks are captured, a "BlockEvent.PlaceEvent" is fired first with the first block
captured followed by a "BlockEvent.MultiPlaceEvent" with all captured blocks. This extra event
is required for items that have the ability to place 2 or more blocks such as a BlockBed.

If either event is cancelled, the recorded block snapshot(s), item stacksize, and item meta will
revert back to the captured snapshot(s).
If the events are not cancelled, a notification will be sent to clients and block physics will be updated.

What this means for mods is Forge will be able to capture all player block placement automatically and fire
a PlaceEvent and/or MultiPlaceEvent.
If for whatever reason your mod does not use the standard placement methods then you will need to fire the
appropriate placement events in order to notify mods/servers.

This commit also includes a new utility class called BlockSnapshot which is serializable. This new class is used in conjunction with
both PlaceEvent and MultiPlaceEvent in order to record a snapshot of block space before it is altered. This
allows us to restore the block(s) if an event is cancelled. The class also provides the ability to restore a snapshot
to any location using the restoreToLocation method. This should be helpful to many mods that are looking to be able
to capture block data then restore it to back to any location required.
2014-10-02 11:33:25 -04:00
Lunatrius 7cff6f4c80 Prevent client only commands from bleeding through to the server. 2014-09-17 01:48:44 +02:00
cpw 9ccf454b88 Merge branch 'new' 2014-09-14 18:20:53 -04:00
cpw 97f715bf6d MinecraftForge/FML@63b64482e6 Add jsr305 dev-time dependancy for Nullable/Nonnull annotations. Unneeded at runtime.
MinecraftForge/FML@5365f5ea3e Add IEventExceptionHandler for EventBus to allow special handeling exceptions that are fired while running an event. Events now track what 'phase' they are in during the execution process. Each EventPriority is a 'phase'. An exception is thrown if the event attempts to set its phase to a previous one.
2014-09-14 18:20:06 -04:00
LexManos 647e476c8f Merge pull request #1402 from nekosune/new
Fixed Clientside GameProfile UUID being null on offline mode
2014-09-09 17:06:35 -07:00
nekosune f9c68bba81 Fixed Clientside GameProfile UUID being null on offline mode 2014-09-10 00:24:36 +01:00
LexManos e2ae05ccb6 Merge pull request #1395 from lawremi/rendergasfix
Fix rendering height of non-liquid fluids
2014-09-09 13:28:54 -07:00
Michael Lawrence 71cb9dfe52 check for IFluidBlock (in addition to Material.liquid) when
determining render height so that non-liquids (gases) render correctly
2014-09-08 05:51:34 -07:00
cpw 69700d2227 MinecraftForge/FML@7ab69aff2e Clean up import
MinecraftForge/FML@c5a90bd456 Is vanilla possible with this mod load, side tests.
MinecraftForge/FML@cad11f3165 Allow injecting alternative container types. This is the core support code for allowing sponge plugins!
2014-09-08 08:52:45 +12:00
LexManos a7ce64dfbc Merge pull request #1390 from diesieben07/beacon-items
Added Item#isBeaconpayment
2014-09-06 15:55:13 -07:00
diesieben07 126d7e3ebe Added Item#isBeaconpayment 2014-09-06 23:39:38 +02:00
Oliver Kahrmann da39ed066c Modify WavefrontObject to allow '.' in group object names
Blender names objects with .001 ir .002 when separating vertices or duplicating objects and the importer would crash on them. This fixes the regex to allow dots in the name.
2014-09-01 22:43:53 +02:00
cpw d9865fed66 MinecraftForge/FML@dc02d56195 Fix derp with ModType annotation. mods should load again now.. 2014-09-01 16:05:51 -04:00
cpw de521cf531 MinecraftForge/FML@4ce3e73bfe Add overloaded version of SimpleNetworkWrapper#registerMessage that takes the MessageHandler instance directly, allowing to specify the same handler for multiple messages.
MinecraftForge/FML@cbe2ccbda4 Add in ModType to the jar manifest. If it's present, and doesn't have value "FML" it will be skipped from the modloading cycle. This should let liteloader mods have a .jar extension.
MinecraftForge/FML@37cf0174fc OK, lets make that a csv list. It'll let you be liteloader and fml in one jar file!
MinecraftForge/FML@0475b15eb1 Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch.
MinecraftForge/FML@abeac06a2e Two new features. ModLists can have a "parent" mod list. Circularity will result in a crash, so be careful. Mods specified in a child will override ones from a parent (using the maven group:name:classifier triple to identify - ignoring the version component)
MinecraftForge/FML@7fcfedcfef Canonicalized file paths in modListFile handling with the minecraftDirectory.
MinecraftForge/FML@633fce19d4 Make Keyevent also fire for key releases
MinecraftForge/FML@57ba2339b6 Merge branch 'keyup-event' of github.com:diesieben07/FML
MinecraftForge/FML@1ff048062c Merge branch 'simple-netw-improve' of github.com:diesieben07/FML
2014-08-31 21:59:47 -04:00
cpw 24989689b3 GIANT FML UPDATE! Bump forge revision number, and fix patches for ItemStack changes. More to come on this branch I expect.
MinecraftForge/FML@7c5cf21904 Implement STDOUT/STDERR redirection.
MinecraftForge/FML@bc78e31cb7 added support for \n in tooltip strings added \n test tooltip localization fixed int/double conversion error in slider entry added test slider scenario that highlighted conversion error
MinecraftForge/FML@a2908e5c59 Clean up a bunch of compiler warnings.
MinecraftForge/FML@7f67523d87 Update realms to 1.3.2
MinecraftForge/FML@73f23c24b8 Merge branch 'std-redir' of github.com:Emberwalker/FML
MinecraftForge/FML@1c6b25df74 If an IO exception comes from the datawatcher, spew it all over the console don't discard it silently. Should stop pixelmon blaming forge for their mistakes.
MinecraftForge/FML@e77da9eb2f And fix the read side too, incase someone is trying to bitbang and failing.
MinecraftForge/FML@305d8950c9 Make LogContext optional. This can be useful for debugging mod issues, but Apache's implementation in log4j2 is responsible for a very significant % of the overall runtime. Quite frankly this is shockingly bad performance from what is supposed to be a high performance logging framework. Anyway, until we can figure out if we can fix it, we're turning it off by default.
MinecraftForge/FML@bdfca1c8ed Make more noise when people screw up mod downloading and put .jar.zip in their mod folders.
MinecraftForge/FML@2108494112 Add a custom version range factory method. Should hush skyboy's complaints. Closes #486
MinecraftForge/FML@7c1e6aaa40 Add a delegate to every item and block. this should help with renaming fun stuffs. Also, fix all the tabs from my previous commits. *sigh*
MinecraftForge/FML@61fcb4df06 Tweak Itemstack patch to always delegate to the method call. Set the field, so it's in sync.
MinecraftForge/FML@eb8c5ab146 Fix nested directory for language resources. Closes MinecraftForge#1264
MinecraftForge/FML@7c05e5f70d Default collections, so that we don't crash if useDependencyInfo is true. Closes #485
MinecraftForge/FML@9729fe2332 Kill net.minecraft.src warning. It hasn't served a purpose in a long time now. Closes #313
MinecraftForge/FML@21e875ef22 AllowPlayerLogins only after the server has completed the core init tasks. Closes #372
MinecraftForge/FML@46cfeade80 Add a constructor to CustomModLoadingDisplayException. Closes #387
MinecraftForge/FML@a6eab2683a Update README.txt
MinecraftForge/FML@f75838461c Last part is the itemstack transformer. Itemstacks should now only be loosely coupled with the items within.
MinecraftForge/FML@51f24e9e6d First draft of add alias. It is probably not properly persistent atm.
MinecraftForge/FML@2a4c642470 Finally fix stupid NPE error caused by FML trying to parse the super of Object in IDEA envs.
MinecraftForge/FML@c1b1417ee1 FML now supports passing a json formatted modlist as an argument, as well as a comma separated argument list. These facilitate modpacks mostly, by meaning you don't need to duplicate mods. The modlist is arranged in the maven style, with mods referenced maven-like.
MinecraftForge/FML@3d42cda2a2 Build.Gradle Patch
MinecraftForge/FML@20c7add845 Merge pull request #484 from bspkrs/master
MinecraftForge/FML@26ed4b992e Clear button list on FML fatal error screens. The hidden cancel button should not be there. Closes #497
MinecraftForge/FML@ebe4f5c5e2 Merge pull request #494 from AntonBoch1244/patch-1
MinecraftForge/FML@ad0da05f5c Fix the ItemStack transformer to find the method and field so it works with srg and mcp naming.
MinecraftForge/FML@65d380181a Extend timeout for client to 5 seconds. Should fix Forge #1322
MinecraftForge/FML@45486a0b6d Fix almost invisible NPE in TerminalTransformer when loading a non-existant class
MinecraftForge/FML@13da3efce0 Allow a clean way to exit the game without big ugly warnings, but with logging information available if needed. Closes #496
MinecraftForge/FML@fda305edfe Some more tidying up of the exit handling
MinecraftForge/FML@b087f60c33 More cleanup of exit handling, also add a couple more noise classes to the list of things ignored.
MinecraftForge/FML@d6358a466b Cleanup override warnings
MinecraftForge/FML@af7a58b9e5 Update to legacylauncher 1.10 and asm 5.0.3
MinecraftForge/FML@e6d00440a6 ItemStack swapping
MinecraftForge/FML@8597e45a0e Fix NPE from a boolean
MinecraftForge/FML@b9b9daa8a9 Fix ups from feedback.
MinecraftForge/FML@d89165021f Mark the promise a success in the outbound handler.
MinecraftForge/FML@2e5ccf7988 Update for launchwrapper 1.11. Fixes java 6 compatibility.
MinecraftForge/FML@641250d853 Fix java 8u20. Closes #501 and a bunch of other bugs too.
MinecraftForge/FML@292be72639 Allow client handshake to be reset by server to support BungeeCord.
MinecraftForge/FML@092873fbe5 Merge branch 'bungeecord' of github.com:bloodmc/FML
MinecraftForge/FML@134f2f8e88 Fix bug with entityspawn - if the entity doesn't extend livingbase, it fails to write a headyaw byte, and everything will be derped for that packet.
MinecraftForge/FML@4852de81e0 Wrap the server description box a little bit shorter. Stops the overlapping. Closes #489
2014-08-30 00:16:46 -04:00
Adubbz 0d93bec5e7 Fixed biome weights not working with non multiples of 10 2014-08-30 10:35:05 +10:00
LexManos fa7ff7c6e7 Merge pull request #1300 from zlyfire/patch-1
Update README.txt
2014-08-20 13:01:53 -07:00
LexManos 1dadcb12be Merge pull request #1330 from bonii-xx/master
Write the correct default value for StringList comments in the config
2014-08-15 13:56:15 -07:00
Bernhard Bonigl 53294b843b Write the correct default value for StringList comments in the config 2014-08-15 15:57:44 +02:00
Lex Manos ba69a1a6fd Fix AIOOB in BiomeDictionary. Closes #1326 2014-08-14 20:33:23 -07:00
cpw 6fafbf3b09 Attempt to properly resolve this daft metadata and TE nonsense. This might be mod impacting, if you maintain a reference to a TE via neighbour update calls - you
might see two TEs for a single setblock where previously you saw one. This is a phantom TE being created by badly written neighbour triggers - I'm looking at you
redstone.

Anyway, with luck, this'll close a slew of bugs across Forge, IC2, MFR, TE, RC. Yeah, fun times. Thanks to LexManos, skyboy and KingLemming for helping figure this
issue out. Quite frankly, from now on, issues with phantom TEs will be mods behaving badly. Modders will need to adapt.
2014-08-13 00:00:29 -04:00
LexManos 016e303379 Fix invalid math in GuiContainerCreative. 2014-08-12 17:32:53 -07:00
LexManos 5d01fa55b1 Merge pull request #1316 from GUIpsp/master
Add ItemStack sensitive version of getItemEnchantability
2014-08-12 11:43:59 -07:00
SackCastellon 2519822b25 Add ItemStack sensitive version of getItemEnchantability 2014-08-12 16:48:01 +01:00
Lex Manos 6f693206de Add ability for creative tabs that have search bars to customize the text box's width, and prevent the default set of enchanted books from being displayed in those tabs. Closes #1303 Closes #1301 2014-08-11 19:18:38 -07:00
LexManos 948f7145d1 Merge pull request #1187 from Abastro/skylight
Skylight Hooks for Minecraft Forge
2014-08-11 16:00:11 -07:00
Abastro f590ce8641 Skylight Hooks for Minecraft Forge
Mainly for solar/lunar eclipse.
2014-08-11 15:42:07 +09:00
LexManos 261ba628df Merge pull request #1217 from Glassmaker/patch-1
Adds getLocalizedName and getUnlocalizedName to FluidStack
2014-08-10 01:42:24 -07:00
zlyfire ce8882e89c Update README.txt
Add in reference to running setupDecompWorkspace to get decompiled classes
2014-08-06 16:29:34 -04:00
LexManos 98285e4df6 Merge pull request #1297 from ShetiPhian/patch-1
Legacy Liquid Load Fix
2014-08-05 19:47:58 -07:00
ShetiPhian 22609b1d54 Legacy Liquid Load Fix
nbt.getString("FluidName") no longer returns null, it returns an empty string.

This patch allows legacy liquids to be resolved once again.
2014-08-05 21:08:53 -04:00
Lex Manos 5131aed7bd Fix metadata for every permutation -.- Closes #1294 2014-08-05 15:18:02 -07:00
Lex Manos d2682ab969 Fix patch screwup in Skyboy's Fishing PR -.- 2014-08-05 15:17:10 -07:00
LexManos 4600b015d9 Merge pull request #1296 from Vazkii/patch-3
Fixed items with more than 2 render passes rendering wrong in first person
2014-08-05 13:15:59 -07:00
Lizbeth Rika 63140bcf7f Fixed items with more than 2 render passes rendering weird in first person 2014-08-05 21:10:28 +01:00
LexManos ec0691538f Merge pull request #1292 from DemoXinMC/master
New PlayerRepairEvent and AnvilUpdateEvent
2014-08-04 14:34:10 -07:00
DemoXin 68fd0049fb * Added AT for ContainerRepair.stackSizeToBeUsedInRepair (Now public)
* Added ability to AnvilUpdateEvent to alter stackSizeToBeUsedInRepair (vanilla behavior is now reproducable)
* Added AnvilRepairEvent, fired when the player removes an ItemStack from the output slot of ContainerRepair, and allows the chance to damage the anvil to be altered.
2014-08-04 16:54:35 -04:00
KingLemming 7cd820d855 Merge pull request #1288 from skyboy/master
Add EntityFishHook AT
2014-08-03 22:06:26 -04:00
skyboy 5f8d501ed6 Add EntityFishHook AT 2014-08-03 19:52:59 -04:00
LexManos 224987aa83 Merge pull request #1128 from skyboy/patch-fishingapi
Add API for fishing results, I'm tired of this, If shit breaks, Blame Skyboy and King_Lemming.
2014-08-03 16:28:32 -07:00
LexManos dae471e7d7 Merge pull request #1272 from rwtema/master
Fixed ItemFluidContainer always draining the maximum amount, regardless ...
2014-08-03 15:47:58 -07:00
Lex Manos cd2982f9b1 Closes #1280 2014-08-02 11:32:34 -07:00
Lex Manos 10192959f9 Fixed bug that allowed duplication of Fluids with redstone dust. Closes #1279 2014-08-01 18:37:54 -07:00
rwtema eeb701cb16 Fixed ItemFluidContainer always draining the maximum amount, regardless of the amount remaining. 2014-07-31 20:52:52 +01:00
LexManos bc8374d71c Merge pull request #1263 from Zarathul/master
Added drainFluidContainer() and getContainerCapacity() helper methods to FluidContainerRegistry.
2014-07-30 13:11:58 -07:00
zarathul 7a1de8c13d - Added drainFluidContainer() and getContainerCapacity() helper methods. 2014-07-30 13:23:52 +02:00
LexManos 7170a8c4c6 Merge pull request #1254 from Adubbz/master
Added a RenderFogEvent
2014-07-28 13:29:49 -07:00
Adubbz 2affeae979 Added an event for fog rendering 2014-07-28 17:01:38 +10:00
skyboy cc169c3ea1 Update FishingHooks 2014-07-25 06:42:17 -04:00
cpw a22bcf7e72 MinecraftForge/FML@3231db9376 Sorta revert 908491d5e7ac26becdac938f38cc90d6b9d73ce1 but merge assets into the map, rather than force overwriting. Fixes skyboy's comment. 2014-07-24 21:41:59 -04:00
cpw bbcc515063 Revert old light amortization patch. It seems to be breaking chunk sending pretty badly when more
than a couple of people are online. Tests indicate it is not useful anymore.
2014-07-24 21:40:30 -04:00
skyboy 906dcb999d Add FishingHooks 2014-07-24 04:12:45 -04:00
Lex Manos 9febf999c0 Updated FML:
MinecraftForge/FML@53887ac59c Hacky interm solution to #1207 to buy me time to re-write FML's network protocol.
2014-07-18 12:29:03 -07:00
Lex Manos c69958e34b Made skulls respect Block.isReplaceable when placing, also prevented them from deleting blocks when placed at certain angels. Closes #1233 2014-07-16 18:37:49 -07:00
Lex Manos b2dddf545b Fixed NPE that happens sometimes when exiting the game witout fully loading a world {main a dev-time thing} 2014-07-16 18:36:12 -07:00
Lex Manos 5f20829165 Updated FML:
MinecraftForge/FML@9d40b76197 Don't scan ObjectHolders if there was an error already, derpitude will ensure.
MinecraftForge/FML@76538c1781 Add a terminal transformer and tweaker.
MinecraftForge/FML@aec9228845 Add ExitVisitor to the TerminalTransformer that finds and intercepts any calls to Runtime.exit or System.exit.
MinecraftForge/FML@908491d5e7 Move LaunguageRegistry call above normal asset loading to allow resource packs to override mod's language systems.
MinecraftForge/FML@d13295e281 Fix FMLAT manifest AccessTransformers, class loader fun!
2014-07-16 16:52:18 -07:00
LexManos 20cac56bfb Merge pull request #1235 from darkhax/master
Changed exception message for duplicate enchantment ids
2014-07-16 10:10:28 -07:00
Darkhax 08826ed84b Changed exception message for duplicate enchantment ids to contain the
class path for both enchantments along with the enchantmnet id that has
been duplicated.
2014-07-16 07:08:57 -06:00
LexManos 06701348d6 Merge pull request #1232 from bspkrs/patch-3
Fixed missing assignment of constructor arg (thanks @Lunatrius)
2014-07-15 12:26:00 -07:00
bspkrs e35755c3e3 Fixed missing assignment of constructor arg (thanks @Lunatrius)
I must have edited this out when I was cleaning up my formatting commit spam.
2014-07-15 09:47:01 -04:00
LexManos e2fe13bd17 Merge pull request #1226 from williewillus/xporb
Fix experience orbs spawning at 32x coordinates clientside
2014-07-14 14:56:52 -07:00
Vincent Lee a35457ecb7 Fix comment derp (+1 squashed commits)
Squashed commits:

[52c40bc] Fix experience orbs spawning at 32x coordinates clientside

Add // FORGE comment

Add // FORGE comment to clarify the purpose of the change
2014-07-14 16:43:16 -05:00
LexManos 79cda09594 Merge pull request #1225 from williewillus/master
Fix chat opacity
2014-07-14 13:11:09 -07:00
Vincent Lee 5c0217d316 Fix chat opacity
Add // FORGE comment

As per convention, add // FORGE comment to clarify the purpose of the change
2014-07-13 23:44:47 -05:00
Lex Manos 52ec4f7c57 Updated FML:
MinecraftForge/FML@ab52901b8b Force preferIPv4Stack to true early in the load chain to combat netty loopback issues.
MinecraftForge/FML@11893fbbb7 Add system property to skip doing world backups when game registry changes. This is SEVERLY ill-advised, if you do this DO NOT ask for any support.
MinecraftForge/FML@fdb6b34b8f Update authlib and realms to latest json data.
MinecraftForge/FML@b3a74882b4 added slider controls for numerics. default control is textbox, but slider can be used as a custom list entry class. fixed constructor javadocs in GuiConfig
MinecraftForge/FML@7c6d1f7568 Merge pull request #468 from bspkrs/master
MinecraftForge/FML@692d955c1a Update tweaker login to use authlib.
MinecraftForge/FML@c2119eb1c1 Update realms library to 1.3.1, and implement network latch when connecting to Realms. Tested and working.
2014-07-11 18:17:50 -07:00
Glassmaker ff2696dff8 Adds getLocalizedName and getUnlocalizedName to FluidStack 2014-07-10 15:25:53 +03:00
cpw 27d5dc0a25 Add a system property for the stencil, in case config is not available.. 2014-07-09 10:59:33 -04:00
LexManos 01d0e6a481 Merge pull request #1213 from TheCountryGamer/master
RenderBlockOverlayEvent patch
2014-07-08 13:17:30 -07:00
TheCountryGamer 7adaef9aed RenderBlockOverlayEvent patch
Fixes skewed XYZ parameters
2014-07-08 15:49:32 -04:00
Lex Manos 195542c5fb Fixed Enchantment.addToBookList Closes #1160 2014-07-07 21:54:32 -07:00
Lex Manos af9229d3bc Add ability for modders to designate custom biome types. And remove note about automatically registering. Closes #1167 2014-07-07 21:29:37 -07:00
LexManos ba6c2c88ed Merge pull request #1194 from diesieben07/potion-icon
Added hook for potion inventory icons
2014-07-07 19:56:52 -07:00
LexManos 7d24c2259b Merge pull request #1199 from Adubbz/master
Enhanced the Biome Dictionary
2014-07-07 19:50:56 -07:00
LexManos a6b7ba06c6 Merge pull request #1163 from TheCountryGamer/master
Added RenderBlockOverlayEvent
2014-07-07 19:50:04 -07:00
Lex Manos f6471c3c08 Added World to ChunkProviderEvent.ReplaceBiomeBlocks, and exposed metadata to End and Nether generation events. Close #1201 2014-07-07 19:47:50 -07:00
Adubbz 8d2ebdf25f Enhanced the Biome Dictionary with tags based on temperature, vegetation, moisture, trees and others 2014-07-08 12:09:44 +10:00
Lex Manos 86ccfb1d68 Made EmeraldOre respect isReplaceableOreGen. Closes #1157 2014-07-07 18:55:24 -07:00
TheCountryGamer 7e7870026e Added RenderBlockOverlayEvent.java
Adds a Forge event which controls whether an overlay is rendered.
Overlays include: First-person fire, Block (when inside a block)
	and water when a player is inside a water block.

Patched for easier manipulation of event

Fixed for Lex

To be squashed

Removed Contructor

Added block XYZ parameters

TODO, the second block overlay event’s XYZ might not be correct
2014-07-07 21:49:51 -04:00
LexManos 53ce6f69e7 Merge pull request #1200 from tterrag1098/master
Add AchievementEvent
2014-07-07 18:37:53 -07:00
LexManos 81a791bac7 STENCIL buffer and DEPTH buffer, attempt a fix for GL errors. 2014-07-06 22:19:13 -07:00
LexManos 7c016d9ee8 Merge pull request #1210 from Ghosrec35/master
Added Javadoc comments for Forge Event documentation.
2014-07-06 17:16:46 -07:00
Lex Manos 5d82316059 MinecraftForge/FML@ac994e178a Scala people test your shit. 2014-07-06 17:14:25 -07:00
Lex Manos d35098ab9e Remove the BLEND enable in rendering damage bars. And exclicitly fix blend states in some GUI elements. 2014-07-06 16:25:14 -07:00
Alex c410a2d9fc Added Javadoc comments for Forge Event documentation. 2014-07-06 18:41:11 -04:00
cpw 0705670f1d MinecraftForge/FML@3ee86d0f3e updated gradle wrapper to gradle 2.0
MinecraftForge/FML@627ae73ea6 Merge pull request #464 from AbrarSyed/upgradle
MinecraftForge/FML@ee38c1b3f4 Fix unneeded cast causing crash in new Config GUI system.
MinecraftForge/FML@eb92c35a2f updated run configs for GradleStart/Server classes
MinecraftForge/FML@70dcf80410 Merge pull request #465 from AbrarSyed/upgradle
MinecraftForge/FML@0ebdbe77a2 Updated Scala to latest stable
MinecraftForge/FML@ddba18e6e3 Merge branch 'patch-1' of github.com:Soaryn/FML into scalaupdate
MinecraftForge/FML@220a37660b Update realms to 1.2.9
MinecraftForge/FML@abd7d0969b Merge branch 'scalaupdate'
2014-07-06 15:18:59 -04:00
LexManos d889765b10 Merge pull request #1159 from ganymedes01/master
Added FluidStack sensitive version for Fluid's localised name
2014-07-06 12:06:58 -07:00
tterrag1098 a3c268b577 Add AchievementEvent
Allows modders to react to players receiving achievements, and cancel
them.

Fix indentation

More shortening

Down to one line...

Remove newline
2014-07-02 20:18:53 -04:00
LexManos a59c5fbd8c Merge pull request #1197 from MrIbby/patch-1
Add RenderItemInFrameEvent
2014-07-01 12:34:41 -07:00
Gerard Bruwn aca429f17b Add RenderItemInFrameEvent 2014-07-01 09:58:44 -07:00
Lex Manos 6db5d2ed26 Fixed issue where Fire's 'fizz' would not play for the person who extinguished the fire. 2014-06-30 11:08:18 -07:00
LexManos 7525d209b6 Merge pull request #1195 from iChun/patch-1
Fixed inverted params in FogDensity use
2014-06-29 22:47:53 -07:00
iChun 78f68847d2 Fixed inverted params in FogDensity use 2014-06-30 10:56:03 +08:00
Lex Manos 63d3fd2e84 Add config option to specify the default spawn fuzz factor for the overworld. Closes #1190 2014-06-29 18:56:22 -07:00
Lex Manos 219f5adf61 Add config option to disable attempting to creat screen with Stencil Bits. 2014-06-29 18:42:48 -07:00
diesieben07 9662b5a657 Added hook for custom PotionEffect rendering in the inventory 2014-06-30 02:06:39 +02:00
Lex Manos 086d02896f Fix creative inventory tabs not blending base don items rendered. Closes #1179 2014-06-29 16:14:57 -07:00
LexManos 8586de3222 Merge pull request #1191 from bloodmc/chunkasync
Fixed wrong method call in ChunkIOProvider.
2014-06-29 14:56:03 -07:00
bloodshot 2bfda259fa Fixed wrong method call in ChunkIOProvider.
When a chunk fails to load async, we fallback to the original sync method.
In this case, it was calling the async method twice which ended up causing
a stackoverflow.
2014-06-29 14:27:37 -04:00
cpw 5217f6f8bb MinecraftForge/FML@db219fb287 API is now able to "provide" and "own" itself. Useful for libraries without a Mod in them. To go along with this, you can now require an API, with a version, in your mod dependency string 2014-06-26 22:18:41 -04:00
cpw 3b648d826f Merge pull request #1183 from bspkrs/master
fixed dupe quotes issue with category names that require quotes when save is called more than once
2014-06-26 16:34:12 -04:00
bspkrs f8be9a237c fixed compounding quotes issue with category names that require quotes when save is called more than once 2014-06-26 16:31:27 -04:00
cpw ebf0e7617a Update to MC 1.7.10, bump to 10.13.0
MinecraftForge/FML@bc420dcb0b Fix Eclipse launching attribute
MinecraftForge/FML@1e0134a1ca Merge pull request #455 from rumickon/feature
MinecraftForge/FML@1c5db211af Update for release 1.7.10
MinecraftForge/FML@79a0c5e559 Merge branch 'mc179'
2014-06-26 15:07:51 -04:00
cpw f1c7a2c134 Merge branch 'prerelease' 2014-06-26 14:57:33 -04:00
cpw 32e577d5bf Fix API incompatibilities. Should mean mods will work with new config changes. 2014-06-26 14:45:43 -04:00
LexManos 2d7f22ade8 Merge pull request #1180 from luacs1998/patch-2
Update mc version string
2014-06-25 18:49:10 -07:00
luacs1998 23c6d0ef55 Update mc version string
Or was I not supposed to?
2014-06-26 09:03:22 +08:00
cpw af23e296f2 Fix mcp release number 2014-06-25 20:19:38 -04:00
cpw fcd13f5e71 Merge branch 'master' into prerelease 2014-06-25 20:18:42 -04:00
cpw ced81b5c93 Clean patch cruft. 2014-06-25 20:09:42 -04:00
cpw c7f9d5a529 Fix new method with Side.CLIENT when it shouldn't have it. Closes a bunch of reports of problems. 2014-06-25 18:59:14 -04:00
cpw cbc873bc8b MinecraftForge/FML@701d98eafa Added config GUI system
MinecraftForge/FML@50164db5c1 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui
MinecraftForge/FML@7eb36a1481 Merge branch 'bspkrsgui'
MinecraftForge/FML@96a7e14a45 Merge branch 'master' into mc179
MinecraftForge/FML@f45f18b1d7 Fix accessing guava from transformers
MinecraftForge/FML@8f7adced47 Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are available at mojang, so we can update the json.
2014-06-25 18:31:02 -04:00
cpw c8b3719810 MinecraftForge/FML@5d6dc5dce3 Fix up other exit points. Should stop process hangs for clean exits.
MinecraftForge/FML@8a240ec3c7 Merge branch 'master' into mc179
MinecraftForge/FML@0cd5ef6bb7 Fix NPE when no FMLAT is defined
2014-06-25 09:15:37 -04:00
cpw 0bbee11b3c MinecraftForge/FML@e152984538 Add support for mod access transformers without a coremod requirement. Use the "FMLAT" manifest attribute, with a space separate list of files that live in the 'META-INF' directory. They should conform to standard AT formatting. 2014-06-24 22:05:38 -04:00
cpw 729d8fb721 MinecraftForge/FML@06ab104c9a Force the descriptors to the right type for the field they're referencing. Fixes the sand issue 2014-06-24 18:35:48 -04:00
Lex Manos 7ba54ffd48 Fix flower pots not droping the items that are inside them. 2014-06-23 22:06:52 -07:00
Lex Manos 256d865db6 Update to 1.7.10-pre4. 2014-06-23 21:55:16 -07:00
ganymedes01 85497cbf6e Added FluidStack sensitive version for Fluid's localised name
Would be helpful for determining names for more complex FluidStacks (with tag compounds for example)
2014-06-18 15:26:14 +01:00
luacs1998 7f1b938cae Update CONTRIBUTING.md
Add link to wiki page on contributing
2014-03-19 23:33:36 +08:00
luacs1998 132d53583d Create CONTRIBUTING.md
Simple file (which github will show for those making PRs) containing guidelines for making PRs.
Feel free to comment if you want/need anything added. I can pull the same thing to FML too if you'd like, Lex.
2014-03-19 23:26:02 +08:00
470 changed files with 16732 additions and 14103 deletions

No files matched your search

+4
View File
@@ -21,3 +21,7 @@
/patches-/
# FML changelog
changelog.txt
/patches_old/
/patches_old_bak/
*.py
*.7z
+10
View File
@@ -0,0 +1,10 @@
Contributing to Forge
=====================
1) Keep patches to Minecraft classes minimal. If you need a lot of things done, you may either add to relevant forge classes or make a new class.
2) An example mod must be provided for all PRs adding events/hooks to Forge. Whether it's a full mod using your proposed hooks, or just a pastebin containing a simple example, an example mod is required. Please also explain in detail what your new hook does.
3) Follow Forge coding guidelines (braces on newlines, spaces instead of tabs, etc)
For more information, refer to [the wiki](https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge)
+5
View File
@@ -15,6 +15,11 @@ MacOS/Linux: ./gradlew setupDevWorkspace
If you wish to use the Eclipse IDE, run gradle eclipse instead of gradle setupDevWorkspace, or install the Gradle plugin for Eclipse and import the Forge source folder as a Gradle project.
To get the decompiled classes:
If you have Gradle: gradle setupDecompWorkspace
If you DO NOT have Gradle installed:
Windows: ./gradlew.bat setupDecompWorkspace
MacOS/Linux: ./gradlew setupDecompWorkspace
For Contributors: (Note: This assumes you have Gradle installed. If you don't, use ./gradlew(.bat) instead of gradle.
+10 -4
View File
@@ -34,11 +34,12 @@ repositories {
}
minecraft {
version = '1.7.2'
mcpVersion = '9.03'
version = '1.8'
mcpVersion = '9.10'
mappings = 'snapshot_nodoc_20141130'
fmlDir = projectDir.getAbsolutePath() + "/fml";
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
mainClass = 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'net.minecraftforge.fml.common.launcher.FMLTweaker'
installerVersion = "1.4"
}
@@ -49,6 +50,11 @@ jenkins {
job = 'minecraftforge'
}
// crowdin stuff
if (project.hasProperty("crowdinKey"))
tasks.getLocalizations.apiKey = project.crowdinKey
launch4j {
jreMinVersion = '1.6.0'
}
Binary file not shown.
+1 -1
Submodule fml updated: 7eb36a1481...d4ded9d6e2.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,9 @@
--- ../src-base/minecraft/net/minecraft/block/BlockAir.java
+++ ../src-work/minecraft/net/minecraft/block/BlockAir.java
@@ -36,4 +36,6 @@
}
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
+
+ public boolean func_176200_f(World worldIn, BlockPos pos){ return true; }
}
@@ -1,73 +1,54 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
@@ -6,8 +6,13 @@
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
+import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+import static net.minecraftforge.common.EnumPlantType.*;
@@ -12,7 +12,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockBush extends Block
+public class BlockBush extends Block implements IPlantable
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
{
private static final String __OBFID = "CL_00000208";
@@ -27,7 +32,7 @@
@@ -32,7 +32,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_));
+ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected boolean func_149854_a(Block p_149854_1_)
@@ -57,7 +62,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
@@ -85,4 +85,33 @@
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
}
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
@@ -79,4 +84,37 @@
{
return 1;
return EnumWorldBlockLayer.CUTOUT;
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ if (this == Blocks.field_150464_aj) return Crop;
+ if (this == Blocks.field_150459_bM) return Crop;
+ if (this == Blocks.field_150469_bN) return Crop;
+ if (this == Blocks.field_150394_bc) return Crop;
+ if (this == Blocks.field_150393_bb) return Crop;
+ if (this == Blocks.field_150330_I) return Desert;
+ if (this == Blocks.field_150392_bi) return Water;
+ if (this == Blocks.field_150337_Q) return Cave;
+ if (this == Blocks.field_150338_P) return Cave;
+ if (this == Blocks.field_150388_bm) return Nether;
+ if (this == Blocks.field_150345_g) return Plains;
+ if (this == Blocks.field_150329_H) return Plains;
+ if (this == Blocks.field_150398_cm) return Plains;
+ if (this == Blocks.field_150328_O) return Plains;
+ if (this == Blocks.field_150327_N) return Plains;
+ return Plains;
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
+ return net.minecraftforge.common.EnumPlantType.Plains;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.func_72805_g(x, y, z);
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
}
@@ -1,100 +1,55 @@
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -14,6 +14,9 @@
@@ -18,6 +18,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import static net.minecraft.util.EnumFacing.*;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public abstract class BlockButton extends Block
{
private final boolean field_150047_a;
@@ -49,12 +52,19 @@
@@ -57,7 +58,7 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST)) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST));
- return p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
+ return p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -69,7 +70,7 @@
{
EnumFacing enumfacing = aenumfacing[j];
- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r())
+ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true))
{
return true;
}
@@ -80,7 +81,7 @@
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH));
- return p_180642_1_.func_180495_p(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())).func_177230_c().func_149721_r() ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
+ return p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_, true) ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -63,19 +73,21 @@
int k1 = j1 & 8;
j1 &= 7;
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
@@ -89,7 +90,7 @@
{
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176585_a);
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_);
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
{
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);
@@ -338,6 +339,8 @@
return new BlockState(this, new IProperty[] {field_176585_a, field_176584_b});
}
+ @Override public net.minecraft.item.Item func_180660_a(IBlockState state, Random rnd, int fortune){ return null; }
+
+ if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
static final class SwitchEnumFacing
{
j1 = 4;
}
- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
j1 = 3;
}
- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
j1 = 2;
}
- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
j1 = 1;
}
@@ -89,7 +101,11 @@
private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_)
{
- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1)));
+ if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1;
+ if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2;
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3;
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ + 1, NORTH)) return 4;
+ return 1;
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -99,22 +115,22 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
{
flag = true;
}
static final int[] field_180420_a = new int[EnumFacing.values().length];
@@ -1,49 +1,37 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -11,9 +11,13 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
@@ -19,7 +19,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockCactus extends Block
+public class BlockCactus extends Block implements IPlantable
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
{
@SideOnly(Side.CLIENT)
private IIcon field_150041_a;
@@ -125,7 +129,7 @@
else
{
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
+ return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
private static final String __OBFID = "CL_00000210";
@@ -115,7 +115,7 @@
}
Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
+ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this);
}
@@ -141,4 +145,22 @@
this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top");
this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom");
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
@@ -143,4 +143,16 @@
{
return new BlockState(this, new IProperty[] {field_176587_a});
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return EnumPlantType.Desert;
+ return net.minecraftforge.common.EnumPlantType.Desert;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return -1;
+ return func_176223_P();
+ }
}
@@ -1,44 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -23,6 +23,8 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -531,7 +531,7 @@
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockChest extends BlockContainer
{
private final Random field_149955_b = new Random();
@@ -407,7 +409,7 @@
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r())
+ else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN))
{
return null;
}
@@ -415,19 +417,19 @@
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
{
return null;
}
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
{
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r();
+ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false);
}
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
@@ -1,46 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -2,6 +2,7 @@
@@ -137,7 +137,14 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -160,6 +161,13 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- int j = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int p_149690_5_, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> dropped = super.getDrops(world, x, y, z, p_149690_5_, fortune);
int j1 = func_149987_c(p_149690_5_);
+ java.util.List<ItemStack> dropped = super.getDrops(world, pos, state, fortune);
+ int j = ((Integer)state.func_177229_b(field_176501_a)).intValue();
byte b0 = 1;
@@ -170,8 +178,9 @@
if (j >= 2)
@@ -147,8 +154,9 @@
for (int k1 = 0; k1 < b0; ++k1)
for (int k = 0; k < b0; ++k)
{
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3));
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
}
+ return dropped;
}
@SideOnly(Side.CLIENT)
@@ -216,4 +225,10 @@
++j1;
p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2);
}
+
+ @Override
+ public Item func_149650_a(int par1, Random par2Random, int par3)
+ {
+ return null;
+ }
}
@@ -1,79 +1,68 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -12,6 +13,7 @@
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockCrops extends BlockBush implements IGrowable
{
@@ -89,11 +91,11 @@
{
@@ -82,11 +82,11 @@
float f1 = 0.0F;
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos1.func_177982_a(i, 0, j));
- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak)
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos1.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
{
f1 = 1.0F;
- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0)
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos1.func_177982_a(i, 0, j)))
{
f1 = 3.0F;
}
@@ -145,22 +147,6 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -143,24 +143,6 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
-
- if (!p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- if (p_149690_5_ >= 7)
- {
- int j1 = 3 + p_149690_7_;
- int j = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
-
- for (int k1 = 0; k1 < j1; ++k1)
- if (j >= 7)
- {
- int k = 3 + p_180653_5_;
-
- for (int l = 0; l < k; ++l)
- {
- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_)
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
- {
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
- }
- }
- }
- }
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@@ -204,4 +190,23 @@
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -203,4 +185,26 @@
{
this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
return new BlockState(this, new IProperty[] {field_176488_a});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+
+ if (metadata >= 7)
+ if (age >= 7)
+ {
+ int k = 3 + fortune;
+
+ for (int i = 0; i < 3 + fortune; ++i)
+ {
+ if (world.field_73012_v.nextInt(15) <= metadata)
+ if (rand.nextInt(15) <= age)
+ {
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
+ }
+ }
+ }
+
+ return ret;
+ }
}
@@ -1,45 +1,33 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
@@ -1,5 +1,7 @@
package net.minecraft.block;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -8,9 +10,11 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
+import net.minecraft.world.IBlockAccess;
@@ -13,7 +13,7 @@
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
-public class BlockDeadBush extends BlockBush
+public class BlockDeadBush extends BlockBush implements IShearable
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
{
private static final String __OBFID = "CL_00000224";
@@ -33,14 +37,15 @@
@@ -41,14 +41,15 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150330_I, 1, p_149636_6_));
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0));
- }
- else
- {
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; }
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return new ArrayList<ItemStack>(Arrays.asList(new ItemStack(Blocks.field_150330_I, 1, world.func_72805_g(x, y, z))));
+ return new java.util.ArrayList<ItemStack>(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)));
+ }
}
@@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
@@ -249,7 +249,7 @@
@@ -149,7 +149,7 @@
{
if (this.field_149764_J == Material.field_151573_f)
{
@@ -9,12 +9,12 @@
}
else
{
@@ -367,7 +367,7 @@
@@ -267,7 +267,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
+ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
}
public int func_149656_h()
@@ -1,52 +1,80 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -18,8 +19,9 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
@@ -24,7 +24,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockDoublePlant extends BlockBush implements IGrowable
+public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"};
@SideOnly(Side.CLIENT)
@@ -81,6 +83,7 @@
public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
@@ -89,6 +89,8 @@
Object object = flag ? this : p_176475_1_.func_180495_p(blockpos1).func_177230_c();
Object object1 = flag ? p_176475_1_.func_180495_p(blockpos2).func_177230_c() : this;
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
+
if (object == this)
{
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
@@ -97,17 +99,13 @@
if (object1 == this)
{
p_176475_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 3);
-
- if (!flag)
- {
- this.func_176226_b(p_176475_1_, blockpos2, p_176475_3_, 0);
- }
}
}
}
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_);
return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
{
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
@@ -157,7 +155,6 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
@@ -296,6 +293,32 @@
return Block.EnumOffsetType.XZ;
}
@@ -262,4 +265,22 @@
int l = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
this.func_149642_a(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, l));
}
+
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
+ {
+ int metadata = world.func_72805_g(x, y, z);
+ int type = func_149890_d(metadata);
+ return func_149887_c(metadata) && (type == 3 || type == 4);
+ IBlockState state = world.func_180495_p(pos);
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
+ }
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ int type = func_149890_d(world.func_72805_g(x, y, z));
+ if (type == 3 || type == 2)
+ ret.add(new ItemStack(Blocks.field_150329_H, 2, type == 3 ? 2 : 1));
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
+ return ret;
+ }
}
+ @Override
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this)
+ world.func_175698_g(pos.func_177984_a());
+ return world.func_175698_g(pos);
+ }
+
static enum EnumBlockHalf implements IStringSerializable
{
UPPER,
@@ -1,19 +1,10 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
@@ -84,7 +84,7 @@
{
Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_);
@@ -85,6 +85,7 @@
- if (block.field_149764_J == Material.field_151579_a)
+ if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_))
{
return true;
}
@@ -94,6 +94,7 @@
}
else
{
+ //TODO: King, take a look here when doing liquids!
Material material = block.field_149764_J;
return material == Material.field_151586_h ? true : material == Material.field_151587_i;
}
public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_)
{
+ if (p_180685_0_.func_175623_d(p_180685_1_)) return true;
Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c();
Material material = block.field_149764_J;
return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i;
@@ -1,20 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -12,6 +12,8 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import net.minecraftforge.common.IPlantable;
+import net.minecraftforge.common.util.ForgeDirection;
@@ -89,7 +89,7 @@
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
{
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
- return block instanceof BlockCrops || block instanceof BlockStem;
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
}
public class BlockFarmland extends Block
{
@@ -94,7 +96,7 @@
{
Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1);
- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM)
+ if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block))
{
return true;
}
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
@@ -1,309 +1,211 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -2,7 +2,10 @@
@@ -42,18 +42,24 @@
int j = p_176221_3_.func_177956_o();
int k = p_176221_3_.func_177952_p();
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.IdentityHashMap;
+import java.util.Map.Entry;
import java.util.Random;
+import com.google.common.collect.Maps;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -12,11 +15,15 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldProviderEnd;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockFire extends Block
{
- private int[] field_149849_a = new int[256];
- private int[] field_149848_b = new int[256];
+ @Deprecated
+ private int[] field_149849_a = new int[4096];
+ @Deprecated
+ private int[] field_149848_b = new int[4096];
@SideOnly(Side.CLIENT)
private IIcon[] field_149850_M;
private static final String __OBFID = "CL_00000245";
@@ -54,10 +61,10 @@
Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20);
}
+ @Deprecated // Use setFireInfo
public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_)
{
- this.field_149849_a[p_149842_1_] = p_149842_2_;
- this.field_149848_b[p_149842_1_] = p_149842_3_;
+ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_);
}
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
@@ -94,13 +101,8 @@
{
if (p_149674_1_.func_82736_K().func_82766_b("doFireTick"))
- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()))
+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
{
- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL;
+ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP);
boolean flag = (i + j + k & 1) == 1;
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
int l = 0;
- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h)
- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))
+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN))
{
l = flag ? 1 : 2;
}
- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag));
+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)))
+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST )))
+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)))
+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST )))
+ .func_177226_a(field_176542_R, Integer.valueOf(l))
+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1))
+ .func_177226_a(field_176544_M, Boolean.valueOf(flag));
}
else
{
@@ -109,6 +115,7 @@
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
{
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
}
@@ -148,13 +155,8 @@
}
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
- boolean flag = block == Blocks.field_150424_aL;
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
- {
- flag = true;
- }
-
if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_))
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_))
{
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
@@ -128,7 +130,7 @@
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
}
}
- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0)
+ else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0)
{
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
}
@@ -142,12 +144,12 @@
b0 = -50;
p_180650_1_.func_175698_g(p_180650_2_);
@@ -183,7 +185,7 @@
return;
}
- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l);
+ this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST );
+ this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH);
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH);
for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1)
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
{
@@ -201,10 +203,16 @@
p_180650_1_.func_175698_g(p_180650_2_);
return;
@@ -198,12 +200,12 @@
b0 = -50;
}
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i, EnumFacing.WEST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i, EnumFacing.EAST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i, EnumFacing.UP);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i, EnumFacing.DOWN);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i, EnumFacing.SOUTH);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i, EnumFacing.NORTH);
for (int j = -1; j <= 1; ++j)
{
@@ -262,22 +264,30 @@
return false;
}
+ @Deprecated
private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_)
+ @Deprecated // Use Block.getFlammability
public int func_176532_c(Block p_176532_1_)
{
- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))];
+ this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP);
Integer integer = (Integer)this.field_149848_b.get(p_176532_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use Block.getFlammability
public int func_176534_d(Block p_176534_1_)
{
Integer integer = (Integer)this.field_149849_a.get(p_176534_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use tryCatchFire with face below
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
{
- int k = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
+ }
+ private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face)
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
+ {
+ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face);
+ int k = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
+
if (p_149841_6_.nextInt(p_149841_5_) < j1)
if (p_176536_4_.nextInt(p_176536_3_) < k)
{
boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W;
@@ -234,7 +242,12 @@
private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_)
{
- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1)))));
+ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH);
}
private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_)
@@ -247,12 +260,13 @@
}
else
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -314,7 +324,7 @@
{
- int l = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, b0);
- l = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l);
+ int l = b0;
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH);
return l;
}
}
@@ -262,15 +276,16 @@
EnumFacing enumfacing = aenumfacing[j];
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
{
return true;
}
@@ -338,7 +348,7 @@
for (int k = 0; k < j; ++k)
{
EnumFacing enumfacing = aenumfacing[k];
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
}
return i;
@@ -350,9 +360,10 @@
return false;
}
+ @Deprecated
public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_)
+ @Deprecated // Use canCatchFire with face sensitive version below
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
{
- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0;
+ return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
}
+ @Deprecated
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_)
{
- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))];
- return i1 > p_149846_5_ ? i1 : p_149846_5_;
+ return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -396,9 +407,9 @@
double d1;
double d2;
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -314,9 +329,9 @@
float f1;
float f2;
- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_))
+ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP))
- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b()))
+ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP))
{
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -327,7 +342,7 @@
@@ -409,7 +420,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -338,7 +353,7 @@
@@ -420,7 +431,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -349,7 +364,7 @@
@@ -431,7 +442,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -360,7 +375,7 @@
@@ -442,7 +453,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -405,4 +420,101 @@
@@ -490,4 +501,19 @@
{
return MapColor.field_151656_f;
return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M});
}
+
+ /*================================= Forge Start ======================================*/
+ private static class FireInfo
+ {
+ private int encouragement = 0;
+ private int flammibility = 0;
+ }
+ private IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
+
+ public void setFireInfo(Block block, int encouragement, int flammibility)
+ {
+ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
+ int id = Block.func_149682_b(block);
+ this.field_149849_a[id] = encouragement;
+ this.field_149848_b[id] = flammibility;
+
+ FireInfo info = getInfo(block, true);
+ info.encouragement = encouragement;
+ info.flammibility = flammibility;
+ }
+
+ private FireInfo getInfo(Block block, boolean garentee)
+ {
+ FireInfo ret = blockInfo.get(block);
+ if (ret == null && garentee)
+ {
+ ret = new FireInfo();
+ blockInfo.put(block, ret);
+ }
+ return ret;
+ }
+
+ public void rebuildFireInfo()
+ {
+ for (int x = 0; x < 4096; x++)
+ {
+ //If we care.. we could detect changes in here and make sure we keep them, however
+ //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them.
+ field_149849_a[x] = 0;
+ field_149848_b[x] = 0;
+ }
+
+ for (Entry<Block, FireInfo> e : blockInfo.entrySet())
+ {
+ int id = Block.func_149682_b(e.getKey());
+ if (id >= 0 && id < 4096)
+ {
+ field_149849_a[id] = e.getValue().encouragement;
+ field_149848_b[id] = e.getValue().flammibility;
+ }
+ }
+ }
+
+ public int getFlammability(Block block)
+ {
+ int id = Block.func_149682_b(block);
+ return id >= 0 && id < 4096 ? field_149848_b[id] : 0;
+ }
+
+ public int getEncouragement(Block block)
+ {
+ int id = Block.func_149682_b(block);
+ return id >= 0 && id < 4096 ? field_149849_a[id] : 0;
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param pos Block position
+ * @param face The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face)
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face);
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param oldChance The previous maximum chance.
+ * @param face The side the fire is coming from
+ * @return The chance of the block catching fire, or oldChance if it is higher
+ */
+ public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face)
+ {
+ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
+ return (newChance > oldChance ? newChance : oldChance);
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
+ }
+ /*================================= Forge Start ======================================*/
}
@@ -1,38 +1,48 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -2,6 +2,7 @@
@@ -162,13 +162,6 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -139,12 +140,6 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
-
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
- {
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- }
-
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
@@ -242,4 +237,14 @@
return new TileEntityFlowerPot(Item.func_150898_a((Block)object), b0);
@@ -388,6 +381,31 @@
return EnumWorldBlockLayer.CUTOUT;
}
+
+ /*============================FORGE START=====================================*/
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ TileEntityFlowerPot te = this.func_149929_e(world, x, y, z);
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
+ if (te != null && te.func_145965_a() != null)
+ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
+ return ret;
+ }
}
+ @Override
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
+ {
+ super.func_180657_a(world, player, pos, state, te);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/
+
public static enum EnumFlowerType implements IStringSerializable
{
EMPTY("empty"),
@@ -1,37 +1,41 @@
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -43,7 +43,7 @@
@@ -59,7 +59,7 @@
{
if (!p_149674_1_.field_72995_K)
if (!p_180650_1_.field_72995_K)
{
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
}
@@ -56,7 +56,7 @@
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
@@ -73,7 +73,7 @@
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
{
p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c);
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos1, Blocks.field_150349_c.func_176223_P());
}
@@ -120,18 +120,11 @@
continue;
}
@@ -184,15 +184,7 @@
}
- else if (p_176474_1_.func_180495_p(blockpos2).func_177230_c().field_149764_J == Material.field_151579_a)
+ else if (p_176474_1_.func_175623_d(blockpos2))
{
if (p_176474_2_.nextInt(8) == 0)
{
- BlockFlower.EnumFlowerType enumflowertype = p_176474_1_.func_180494_b(blockpos2).func_180623_a(p_176474_2_, blockpos2);
- BlockFlower blockflower = enumflowertype.func_176964_a().func_180346_a();
- IBlockState iblockstate1 = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), enumflowertype);
-
- if (blockflower.func_180671_f(p_176474_1_, blockpos2, iblockstate1))
- {
- p_176474_1_.func_180501_a(blockpos2, iblockstate1, 3);
- }
+ p_176474_1_.func_180494_b(blockpos2).plantFlower(p_176474_1_, p_176474_2_, blockpos2);
}
else
{
- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1);
- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s);
- BlockFlower blockflower = BlockFlower.func_149857_e(s);
-
- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1))
- {
- int i2 = BlockFlower.func_149856_f(s);
- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3);
- }
+ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
}
}
@@ -1,50 +1,35 @@
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
@@ -2,6 +2,7 @@
@@ -40,14 +40,17 @@
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
p_180657_2_.func_71020_j(0.025F);
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -13,6 +14,7 @@
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.event.ForgeEventFactory;
public class BlockIce extends BlockBreakable
{
@@ -43,14 +45,16 @@
p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
p_149636_2_.func_71020_j(0.025F);
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_))
+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_))
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_))
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_))
{
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.func_149644_j(p_149636_6_);
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
ItemStack itemstack = this.func_180643_i(p_180657_4_);
- if (itemstack != null)
- {
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack);
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
- }
+ if (itemstack != null) items.add(itemstack);
+
+ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_);
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_);
+
+ for (ItemStack is : items)
+ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is);
+ func_180635_a(p_180657_1_, p_180657_3_, is);
}
else
{
@@ -61,7 +65,9 @@
@@ -58,7 +61,9 @@
}
int i1 = EnchantmentHelper.func_77517_e(p_149636_2_);
+ harvesters.set(p_149636_2_);
this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1);
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
+ harvesters.set(p_180657_2_);
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
+ harvesters.set(null);
Material material = p_149636_1_.func_147439_a(p_149636_3_, p_149636_4_ - 1, p_149636_5_).func_149688_o();
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o();
if (material.func_76230_c() || material.func_76224_d())
@@ -1,93 +1,32 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -5,10 +5,14 @@
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -80,7 +80,10 @@
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockLadder extends Block
{
private static final String __OBFID = "CL_00000262";
@@ -79,29 +83,32 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r()));
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true);
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
@@ -124,7 +127,7 @@
protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_)
{
int j1 = p_149660_9_;
- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
{
j1 = 2;
}
- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
j1 = 3;
}
- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
j1 = 4;
}
- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
j1 = 5;
}
@@ -114,22 +121,22 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_);
boolean flag = false;
- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r())
+ if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
{
flag = true;
}
- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r())
+ if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
{
flag = true;
}
- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r())
+ if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
{
flag = true;
}
- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r())
+ if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
{
flag = true;
}
@@ -147,4 +154,10 @@
{
return 1;
- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r();
+ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true);
}
@SideOnly(Side.CLIENT)
@@ -155,6 +158,8 @@
return new BlockState(this, new IProperty[] {field_176382_a});
}
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
+
+ @Override
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
+ {
+ return true;
+ }
}
static final class SwitchEnumFacing
{
static final int[] field_180190_a = new int[EnumFacing.values().length];
@@ -1,151 +1,108 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -15,8 +16,9 @@
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
@@ -18,7 +18,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public abstract class BlockLeaves extends BlockLeavesBase
+public abstract class BlockLeaves extends BlockLeavesBase implements IShearable
+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable
{
int[] field_150128_a;
@SideOnly(Side.CLIENT)
@@ -82,10 +84,10 @@
{
for (int l1 = -b0; l1 <= b0; ++l1)
{
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
@@ -76,9 +76,9 @@
BlockPos blockpos1 = p_180663_2_.func_177982_a(i1, j1, k1);
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
{
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
}
}
}
@@ -127,9 +129,9 @@
@@ -119,11 +119,12 @@
{
for (i2 = -b0; i2 <= b0; ++i2)
{
Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2);
- Block block = p_180650_1_.func_180495_p(new BlockPos(j + k1, k + l1, l + i2)).func_177230_c();
+ BlockPos tmp = new BlockPos(j + k1, k + l1, l + i2);
+ Block block = p_180650_1_.func_180495_p(tmp).func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
+ if (!block.canSustainLeaves(p_180650_1_, tmp))
{
- if (block.func_149688_o() == Material.field_151584_j)
+ if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
+ if (block.isLeaves(p_180650_1_, tmp))
{
this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
this.field_150128_a[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2;
}
@@ -236,40 +238,7 @@
@@ -230,40 +231,7 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- int j1 = this.func_150123_b(p_149690_5_);
- int j = this.func_176232_d(p_180653_3_);
-
- if (p_149690_7_ > 0)
- if (p_180653_5_ > 0)
- {
- j1 -= 2 << p_149690_7_;
- j -= 2 << p_180653_5_;
-
- if (j1 < 10)
- if (j < 10)
- {
- j1 = 10;
- j = 10;
- }
- }
-
- if (p_149690_1_.field_73012_v.nextInt(j1) == 0)
- if (p_180653_1_.field_73012_v.nextInt(j) == 0)
- {
- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_);
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_)));
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
- }
-
- j1 = 200;
- j = 200;
-
- if (p_149690_7_ > 0)
- if (p_180653_5_ > 0)
- {
- j1 -= 10 << p_149690_7_;
- j -= 10 << p_180653_5_;
-
- if (j1 < 40)
- if (j < 40)
- {
- j1 = 40;
- j = 40;
- }
- }
-
- this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, j1);
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, j);
- }
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {}
@@ -281,13 +250,7 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3));
- }
- else
- {
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
}
}
@@ -318,4 +281,67 @@
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) {}
@@ -298,4 +266,48 @@
}
public abstract String[] func_150125_e();
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public void beginLeavesDecay(World world, BlockPos pos)
+ {
+ return true;
+ }
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3));
+ return ret;
+ }
+
+ @Override
+ public void beginLeavesDecay(World world, int x, int y, int z)
+ {
+
+ int i2 = world.func_72805_g(x, y, z);
+
+ if ((i2 & 8) == 0)
+ IBlockState state = world.func_180495_p(pos);
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_72921_c(x, y, z, i2 | 8, 4);
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
+ }
+ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4);
+ }
+
+ @Override
+ public boolean isLeaves(IBlockAccess world, int x, int y, int z)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ return true;
+ }
+
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ int chance = this.func_150123_b(metadata);
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int chance = this.func_176232_d(state);
+
+ if (fortune > 0)
+ {
@@ -153,8 +110,8 @@
+ if (chance < 10) chance = 10;
+ }
+
+ if (world.field_73012_v.nextInt(chance) == 0)
+ ret.add(new ItemStack(this.func_149650_a(metadata, world.field_73012_v, fortune), 1, this.func_149692_a(metadata)));
+ if (rand.nextInt(chance) == 0)
+ ret.add(new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state)));
+
+ chance = 200;
+ if (fortune > 0)
@@ -164,8 +121,10 @@
+ }
+
+ this.captureDrops(true);
+ this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang
+ if (world instanceof World)
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
+ ret.addAll(this.captureDrops(false));
+ return ret;
+ }
+
}
@@ -1,128 +1,67 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
@@ -10,6 +10,9 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -47,24 +47,24 @@
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : this.func_176358_d(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()));
+ return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return this.func_176358_d(p_176196_1_, p_176196_2_.func_177976_e()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177974_f()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177978_c()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177968_d()) ? true : (World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) ? true : this.func_176358_d(p_176196_1_, p_176196_2_.func_177984_a())))));
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177984_a(), EnumFacing.DOWN );
}
- protected boolean func_176358_d(World p_176358_1_, BlockPos p_176358_2_)
- {
- return p_176358_1_.func_180495_p(p_176358_2_).func_177230_c().func_149721_r();
- }
-
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
{
IBlockState iblockstate = this.func_176223_P().func_177226_a(field_176359_b, Boolean.valueOf(false));
- if (this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())))
+ if (p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_))
{
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(p_180642_3_, p_180642_8_.func_174811_aO()));
}
@@ -87,7 +87,7 @@
enumfacing1 = (EnumFacing)iterator.next();
}
- while (enumfacing1 == p_180642_3_ || !this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(enumfacing1.func_176734_d())));
+ while (enumfacing1 == p_180642_3_ || !p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1));
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(enumfacing1, p_180642_8_.func_174811_aO()));
}
@@ -116,7 +116,8 @@
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
{
- if (this.func_176356_e(p_176204_1_, p_176204_2_) && !this.func_176358_d(p_176204_1_, p_176204_2_.func_177972_a(((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c().func_176734_d())))
+ EnumFacing dir = ((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c();
+ if (this.func_176356_e(p_176204_1_, p_176204_2_) && !p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(dir.func_176734_d()), dir))
{
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);
@@ -235,6 +236,12 @@
return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b});
}
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockLever extends Block
{
private static final String __OBFID = "CL_00000264";
@@ -42,12 +45,23 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
+ private boolean canAttach(World world, BlockPos pos, EnumFacing side)
+ {
+ return world.isSideSolid(pos, side);
+ }
+
public static enum EnumOrientation implements IStringSerializable
{
- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()))));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) ||
+ (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) ||
+ (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r()))));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ - 1, p_149742_4_, UP ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN );
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -56,32 +70,32 @@
int j1 = p_149660_9_ & 7;
byte b0 = -1;
- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN))
{
b0 = 0;
}
- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_))
+ if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP))
{
b0 = 5;
}
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
{
b0 = 4;
}
- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
b0 = 3;
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
b0 = 2;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
b0 = 1;
}
@@ -147,42 +161,42 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
{
flag = true;
}
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5)
{
flag = true;
}
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7)
{
flag = true;
}
DOWN_X(0, "down_x", EnumFacing.DOWN),
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -67,7 +67,7 @@
{
for (int l1 = -1; l1 <= 1; ++l1)
{
- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H;
+ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier();
l += (i2 & 16711680) >> 16;
i1 += (i2 & 65280) >> 8;
j1 += i2 & 255;
@@ -1,45 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -7,6 +7,7 @@
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -38,9 +38,9 @@
BlockPos blockpos1 = (BlockPos)iterator.next();
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
public abstract class BlockLog extends BlockRotatedPillar
@@ -53,14 +54,10 @@
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
{
for (int l1 = -b0; l1 <= b0; ++l1)
{
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
{
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
-
- if ((i2 & 8) == 0)
- {
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
- }
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
}
}
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
}
@@ -79,4 +76,16 @@
{
return this.field_150166_b[p_150161_1_ % this.field_150166_b.length];
}
}
@@ -51,6 +51,9 @@
return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k()));
}
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isWood(IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
}
public static enum EnumAxis implements IStringSerializable
{
X("x"),
@@ -1,26 +1,17 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -7,6 +7,7 @@
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityMobSpawner;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockMobSpawner extends BlockContainer
@@ -36,10 +37,15 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -39,10 +39,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15);
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- int j = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
}
+ private Random rand = new Random();
+ @Override
+ public int getExpDrop(IBlockAccess world, int metadata, int fortune)
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 15 + rand.nextInt(15) + rand.nextInt(15);
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public boolean func_149662_c()
@@ -1,19 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -4,6 +4,7 @@
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockMushroom extends BlockBush implements IGrowable
{
@@ -85,7 +86,7 @@
if (p_149718_3_ >= 0 && p_149718_3_ < 256)
@@ -76,7 +76,7 @@
if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256)
{
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block);
+ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
IBlockState iblockstate1 = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
- return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate1.func_177230_c()));
+ return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate1.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
}
else
{
@@ -1,20 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
@@ -37,7 +37,7 @@
@@ -39,7 +39,7 @@
{
if (!p_149674_1_.field_72995_K)
if (!p_180650_1_.field_72995_K)
{
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
}
@@ -50,7 +50,7 @@
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
@@ -53,7 +53,7 @@
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
{
p_149674_1_.func_147449_b(i1, j1, k1, this);
}
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos1, this.func_176223_P());
}
@@ -1,58 +1,42 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -2,6 +2,7 @@
@@ -36,7 +36,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -11,6 +12,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockNetherWart extends BlockBush
{
@@ -33,7 +35,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
@@ -60,9 +62,12 @@
return 6;
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
@@ -52,9 +52,11 @@
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
}
+ @SuppressWarnings("unused")
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_149690_1_.field_72995_K)
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+
+ if (false && !p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ if (false && !p_180653_1_.field_72995_K)
{
int j1 = 1;
int j = 1;
@@ -109,4 +114,23 @@
this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i);
}
@@ -105,4 +107,24 @@
{
return new BlockState(this, new IProperty[] {field_176486_a});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int count = 1;
+
+ if (metadata >= 3)
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
+ {
+ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0);
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
+ }
+
+ for (int i = 0; i < count; i++)
@@ -0,0 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
@@ -105,14 +105,15 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4));
- }
- else
- {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
+ @Override
+ public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4)));
+ }
}
@@ -1,24 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
@@ -45,7 +45,9 @@
if (tileentitynote != null)
@@ -58,7 +58,9 @@
if (tileentity instanceof TileEntityNote)
{
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
+ int old = tileentitynote.field_145879_a;
tileentitynote.func_145877_a();
+ if (old == tileentitynote.field_145879_a) return false;
tileentitynote.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
}
@@ -73,6 +75,11 @@
@@ -96,6 +98,10 @@
public boolean func_149696_a(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_)
public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_)
{
+ int meta = p_149696_1_.func_72805_g(p_149696_2_, p_149696_3_, p_149696_4_);
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, meta, p_149696_6_, p_149696_5_);
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
+ p_149696_5_ = e.instrument.ordinal();
+ p_149696_6_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D);
String s = "harp";
+ p_180648_4_ = e.instrument.ordinal();
+ p_180648_5_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D);
p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f);
p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]);
@@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
@@ -155,4 +155,11 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
+ @Override
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a())));
+ }
}
@@ -1,58 +1,59 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -7,6 +7,7 @@
import net.minecraft.init.Items;
@@ -10,6 +10,7 @@
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockOre extends Block
@@ -51,34 +52,40 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -54,34 +55,40 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ }
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
+ private Random rand = new Random();
+ @Override
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
+ {
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
+ IBlockState state = world.func_180495_p(pos);
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
{
int j1 = 0;
int j = 0;
if (this == Blocks.field_150365_q)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2);
+ j1 = MathHelper.func_76136_a(rand, 0, 2);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
+ j = MathHelper.func_76136_a(rand, 0, 2);
}
else if (this == Blocks.field_150482_ag)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ j = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150412_bA)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ j = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150369_x)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ j = MathHelper.func_76136_a(rand, 2, 5);
}
else if (this == Blocks.field_150449_bY)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ j = MathHelper.func_76136_a(rand, 2, 5);
}
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
+ return j1;
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
+ return j;
}
+ return 0;
}
public int func_149692_a(int p_149692_1_)
public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_)
@@ -1,52 +1,41 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -15,6 +15,8 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
@@ -39,7 +39,10 @@
public class BlockPane extends Block
{
@@ -62,10 +64,10 @@
public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1));
- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1));
- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_));
- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_));
+ boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST );
+ boolean flag3 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_, EAST );
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c()))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c()))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c()))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c())));
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -65,10 +68,10 @@
public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_)
{
- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c());
- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c());
- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c());
- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c());
+ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST);
+ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST);
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
{
@@ -117,10 +119,10 @@
float f1 = 0.5625F;
float f2 = 0.4375F;
float f3 = 0.5625F;
- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1));
- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1));
- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_));
- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_));
+ boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST );
+ boolean flag3 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_, EAST );
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
{
@@ -186,4 +188,10 @@
this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M);
this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a);
@@ -187,4 +190,11 @@
{
return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
}
+
+ public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir)
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
+ {
+ return func_150098_a(world.func_147439_a(x, y, z)) ||
+ world.isSideSolid(x, y, z, dir.getOpposite(), false);
+ BlockPos off = pos.func_177972_a(dir);
+ Block block = world.func_180495_p(off).func_177230_c();
+ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d());
+ }
}
@@ -1,65 +1,31 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -11,6 +11,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
+import net.minecraft.server.management.PlayerManager;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityPiston;
import net.minecraft.util.AxisAlignedBB;
@@ -360,7 +361,8 @@
return false;
}
- return !(p_150080_0_ instanceof ITileEntityProvider);
+ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_)));
+
}
}
@@ -375,14 +377,14 @@
{
if (l1 < 13)
{
- if (j1 <= 0 || j1 >= 255)
+ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K())
{
return false;
}
Block block = p_150077_0_.func_147439_a(i1, j1, k1);
- if (block.func_149688_o() != Material.field_151579_a)
+ if (!block.isAir(p_150077_0_, i1, j1, k1))
{
if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true))
{
@@ -420,14 +422,14 @@
{
if (l1 < 13)
{
- if (j1 <= 0 || j1 >= 255)
+ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K())
{
return false;
}
Block block = p_150079_1_.func_147439_a(i1, j1, k1);
- if (block.func_149688_o() != Material.field_151579_a)
+ if (!block.isAir(p_150079_1_, i1, j1, k1))
{
if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true))
{
@@ -448,7 +450,9 @@
continue;
@@ -200,7 +200,7 @@
}
- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 0);
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
+ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0);
p_150079_1_.func_147468_f(i1, j1, k1);
}
- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
+ if (!flag1 && !block.isAir(p_180648_1_, blockpos1) && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
{
this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false);
}
@@ -344,7 +344,7 @@
return false;
}
- return !(p_180696_0_ instanceof ITileEntityProvider);
+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_)));
}
else
{
@@ -384,7 +384,9 @@
{
blockpos1 = (BlockPos)list1.get(j);
Block block = p_176319_1_.func_180495_p(blockpos1).func_177230_c();
- block.func_176226_b(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), 0);
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
+ block.func_180653_a(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), chance, 0);
p_176319_1_.func_175698_g(blockpos1);
--i;
ablock[i] = block;
@@ -1,47 +1,37 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
@@ -2,11 +2,13 @@
@@ -110,16 +110,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityPiston;
import net.minecraft.util.AxisAlignedBB;
@@ -90,15 +92,7 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- if (!p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- TileEntityPiston tileentitypiston = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_);
-
- if (tileentitypiston != null)
- {
- tileentitypiston.func_145861_a().func_149697_b(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, tileentitypiston.func_145832_p(), 0);
- IBlockState iblockstate1 = tileentitypiston.func_174927_b();
- iblockstate1.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate1, 0);
- }
- }
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -231,4 +225,13 @@
public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_)
@@ -283,4 +274,16 @@
{
this.field_149761_L = p_149651_1_.func_94245_a("piston_top_normal");
return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntityPiston te = this.func_149963_e(world, x, y, z);
+ if (te != null)
+ return te.func_145861_a().getDrops(world, x, y, z, te.func_145832_p(), 0);
+ return new ArrayList<ItemStack>();
+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos);
+ if (tileentitypiston != null)
+ {
+ IBlockState pushed = tileentitypiston.func_174927_b();
+ return pushed.func_177230_c().getDrops(world, pos, pushed, fortune);
+ }
+ return new java.util.ArrayList();
+ }
}
@@ -1,32 +1,25 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
@@ -1,5 +1,6 @@
package net.minecraft.block;
+import java.util.ArrayList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -46,14 +47,15 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -24,13 +24,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+ }
- if (!p_149690_1_.field_72995_K)
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (!p_180653_1_.field_72995_K)
- {
- if (p_149690_5_ >= 7 && p_149690_1_.field_73012_v.nextInt(50) == 0)
- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0)
- {
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151170_bI));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI));
- }
- }
}
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ if (metadata >= 7 && world.field_73012_v.nextInt(50) == 0)
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random();
+ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0)
+ ret.add(new ItemStack(Items.field_151170_bI));
+ return ret;
}
@SideOnly(Side.CLIENT)
+ }
}
@@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
@@ -113,7 +113,7 @@
@@ -109,7 +109,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
}
public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
@@ -1,109 +1,51 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -5,6 +5,7 @@
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
@@ -25,7 +26,7 @@
public static final boolean func_150051_a(Block p_150051_0_)
@@ -33,7 +33,7 @@
public static boolean func_176563_d(IBlockState p_176563_0_)
{
- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc;
+ return p_150051_0_ instanceof BlockRailBase;
Block block = p_176563_0_.func_177230_c();
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
+ return block instanceof BlockRailBase;
}
protected BlockRailBase(boolean p_i45389_1_)
@@ -78,7 +79,7 @@
public int func_149645_b()
{
- return 9;
+ return renderType;
}
public int func_149745_a(Random p_149745_1_)
@@ -193,6 +194,111 @@
}
@@ -174,7 +174,56 @@
}
public abstract IProperty func_176560_l();
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Return true if the rail can make corners.
+ * Used by placement logic.
+ * @param world The world.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return True if the rail can make corners.
+ */
+ public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z)
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
+ {
+ return !func_150050_e();
+ return !this.field_150053_a;
+ }
+
+ /**
+ * Returns true if the rail can make up and down slopes.
+ * Used by placement logic.
+ * @param world The world.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return True if the rail can make slopes.
+ */
+ public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z)
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
+
+ /**
+ * Return the rail's metadata (without the power bit if the rail uses one).
+ * Can be used to make the cart think the rail something other than it is,
+ * for example when making diamond junctions or switches.
+ * The cart parameter will often be null unless it it called from EntityMinecart.
+ *
+ * Valid rail metadata is defined as follows:
+ * 0x0: flat track going North-South
+ * 0x1: flat track going West-East
+ * 0x2: track ascending to the East
+ * 0x3: track ascending to the West
+ * 0x4: track ascending to the North
+ * 0x5: track ascending to the South
+ * 0x6: WestNorth corner (connecting East and South)
+ * 0x7: EastNorth corner (connecting West and South)
+ * 0x8: EastSouth corner (connecting West and North)
+ * 0x9: WestSouth corner (connecting East and North)
+ *
+ * @param world The world.
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
+ * @param y The rail X coordinate.
+ * @param x The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @return The metadata.
+ */
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
+ {
+ int meta = world.func_72805_g(x, y, z);
+ if(func_150050_e())
+ {
+ meta = meta & 7;
+ }
+ return meta;
+ }
+
+ /**
+ * Returns the max speed of the rail at the specified position.
+ * @param world The world.
+ * @param cart The cart on the rail, may be null.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return The max speed of the current rail.
+ */
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ return 0.4f;
+ }
@@ -113,96 +55,68 @@
+ * It is called once per update tick that the minecart is on the rail.
+ * @param world The world.
+ * @param cart The cart on the rail.
+ * @param y The rail X coordinate.
+ * @param x The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ */
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ }
+
+ /**
+ * Forge: Moved render type to a field and a setter.
+ * This allows for a mod to change the render type
+ * for vanilla rails, and any mod rails that extend
+ * this class.
+ */
+ private int renderType = 9;
+
+ public void setRenderType(int value)
+ {
+ renderType = value;
+ }
+
+ /* ======================================== FORGE END =====================================*/
+
public class Rail
public static enum EnumRailDirection implements IStringSerializable
{
private World field_150660_b;
@@ -202,6 +308,7 @@
NORTH_SOUTH(0, "north_south"),
@@ -251,6 +300,7 @@
private final boolean field_150656_f;
private List field_150657_g = new ArrayList();
private final List field_150657_g = Lists.newArrayList();
private static final String __OBFID = "CL_00000196";
+ private final boolean canMakeSlopes;
public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_)
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
{
@@ -209,19 +316,10 @@
this.field_150661_c = p_i45388_3_;
this.field_150658_d = p_i45388_4_;
this.field_150659_e = p_i45388_5_;
- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_);
-
- if (((BlockRailBase)block).field_150053_a)
- {
- this.field_150656_f = true;
- l &= -9;
- }
- else
- {
- this.field_150656_f = false;
- }
-
+ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
this.func_150648_a(l);
@@ -259,7 +309,8 @@
this.field_180366_e = p_i45739_4_;
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
- this.field_150656_f = this.field_180365_d.field_150053_a;
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
this.func_180360_a(enumraildirection);
}
@@ -412,7 +510,7 @@
@@ -448,7 +499,7 @@
}
}
- if (b0 == 0)
+ if (b0 == 0 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -425,7 +523,7 @@
@@ -461,7 +512,7 @@
}
}
- if (b0 == 1)
+ if (b0 == 1 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -570,7 +668,7 @@
@@ -604,7 +655,7 @@
}
}
- if (b0 == 0)
+ if (b0 == 0 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -583,7 +681,7 @@
@@ -617,7 +668,7 @@
}
}
- if (b0 == 1)
+ if (b0 == 1 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -1,22 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
@@ -228,4 +228,19 @@
{
return new TileEntityComparator();
@@ -295,6 +295,21 @@
return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
}
+ @Override
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
+ {
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World)
+ {
+ func_176204_a((World)world, pos, world.func_180495_p(pos), world.func_180495_p(neighbor).func_177230_c());
+ }
+ }
+
+ @Override
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ)
+ {
+ if (y == tileY && world instanceof World)
+ {
+ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ));
+ }
+ }
+
+ @Override
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z)
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
}
+
public static enum Mode implements IStringSerializable
{
COMPARE("compare"),
@@ -1,29 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
@@ -10,6 +10,7 @@
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockRedstoneOre extends Block
@@ -88,12 +89,17 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -92,12 +92,16 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
+ private Random rand = new Random();
+ @Override // World, meta, fortune
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ @Override
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this))
{
- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5);
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
+ return 1 + rand.nextInt(5);
- int j = 1 + p_180653_1_.field_73012_v.nextInt(5);
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
+ return 1 + RANDOM.nextInt(5);
}
+ return 0;
}
@@ -1,11 +1,59 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -405,7 +405,7 @@
}
else if (!Blocks.field_150413_aR.func_149907_e(block))
@@ -60,10 +60,10 @@
BlockPos blockpos1 = p_176341_2_.func_177972_a(p_176341_3_);
Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c();
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos1), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177977_b()))))
+ if (!canRestoneConnect(p_176341_1_, blockpos1, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos1.func_177977_b(), null)))
{
- return block.func_149744_f() && p_150174_4_ != -1;
+ return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c();
- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos1.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
}
else
{
@@ -393,35 +393,25 @@
Block block = iblockstate.func_177230_c();
boolean flag = block.func_149721_r();
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r();
- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos1.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos1.func_177977_b())));
+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos1.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos1, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos1.func_177977_b(), null)));
}
- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
{
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
- }
+ IBlockState state = world.func_180495_p(pos);
- protected static boolean func_176346_d(IBlockState p_176346_0_)
- {
- return func_176343_a(p_176346_0_, (EnumFacing)null);
- }
-
- protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_)
- {
- Block block = p_176343_0_.func_177230_c();
-
- if (block == Blocks.field_150488_af)
+ if (state.func_177230_c() == Blocks.field_150488_af)
{
return true;
}
- else if (Blocks.field_150413_aR.func_149907_e(block))
+ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c()))
{
- EnumFacing enumfacing1 = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
- return enumfacing1 == p_176343_1_ || enumfacing1.func_176734_d() == p_176343_1_;
+ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N);
+ return direction == side || direction.func_176734_d() == side;
}
else
{
- return block.func_149744_f() && p_176343_1_ != null;
+ return state.func_177230_c().canConnectRedstone(world, pos, side);
}
}
@@ -1,47 +1,35 @@
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
@@ -11,7 +11,11 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -19,7 +19,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockReed extends Block
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+
+public class BlockReed extends Block implements IPlantable
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
private static final String __OBFID = "CL_00000300";
@@ -57,7 +61,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -67,6 +67,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h))));
+ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this);
}
Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
+ if (block.canSustainPlant(p_176196_1_, p_176196_2_, EnumFacing.UP, this)) return true;
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -120,4 +124,22 @@
if (block == this)
{
@@ -172,4 +173,15 @@
{
return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_);
return new BlockState(this, new IProperty[] {field_176355_a});
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
+ {
+ return EnumPlantType.Beach;
+ return net.minecraftforge.common.EnumPlantType.Beach;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.func_72805_g(x, y, z);
+ return this.func_176223_P();
+ }
}
@@ -1,10 +1,10 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
@@ -71,6 +71,7 @@
@@ -66,6 +66,7 @@
public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_)
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
{
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return;
int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7;
Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
int i1 = 0;
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return;
Object object = p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
int i = 0;
int j = 0;
@@ -1,62 +1,55 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -108,8 +109,6 @@
return p_149692_1_;
@@ -122,8 +122,6 @@
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_);
}
- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}
- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
-
public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
{
if (p_149681_6_.field_71075_bZ.field_75098_d)
@@ -118,29 +117,38 @@
p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4);
if (p_176208_4_.field_71075_bZ.field_75098_d)
@@ -131,13 +129,18 @@
p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true));
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4);
}
+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0);
+ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0);
+
super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
}
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- if (!p_149749_1_.field_72995_K)
+ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- if (!p_180663_1_.field_72995_K)
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
{
if ((p_149749_6_ & 8) == 0)
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
{
ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_));
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_);
+ if (tileentityskull == null) return ret;
+
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_145907_c() != null && tileentityskull.func_145907_c().length() > 0)
@@ -146,7 +149,7 @@
if (tileentity instanceof TileEntitySkull)
{
itemstack.func_77982_d(new NBTTagCompound());
itemstack.func_77978_p().func_74778_a("SkullOwner", tileentityskull.func_145907_c());
}
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_));
+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack);
+ ret.add(itemstack);
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
{
@@ -156,12 +159,11 @@
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
}
- func_180635_a(p_180663_1_, p_180663_2_, itemstack);
+ ret.add(itemstack);
}
}
-
- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
+ return ret;
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -1,35 +1,34 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
@@ -73,7 +73,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -80,7 +80,7 @@
{
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
Block block = iblockstate.func_177230_c();
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -85,7 +85,6 @@
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
@@ -92,7 +92,6 @@
{
if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_))
if (!this.func_176196_c(p_176314_1_, p_176314_2_))
{
- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0);
p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_);
- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0);
p_176314_1_.func_175698_g(p_176314_2_);
return false;
}
@@ -97,10 +96,8 @@
@@ -104,9 +103,8 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- int i1 = p_149636_6_ & 7;
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0));
+ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_);
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0));
+ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
p_180657_1_.func_175698_g(p_180657_3_);
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@@ -110,14 +107,13 @@
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -116,14 +114,13 @@
public int func_149745_a(Random p_149745_1_)
{
@@ -37,46 +36,18 @@
+ return 1;
}
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11)
if (p_180650_1_.func_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11)
{
- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0);
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0);
p_180650_1_.func_175698_g(p_180650_2_);
}
}
@@ -127,4 +123,34 @@
@@ -153,4 +150,6 @@
{
return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
return new BlockState(this, new IProperty[] {field_176315_a});
}
+
+ /**
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
+ * version in 1.1.
+ *
+ * @param meta Blocks Metadata
+ * @param fortune Current item fortune level
+ * @param random Random number generator
+ * @return The number of items to drop
+ */
+ public int quantityDropped(int meta, int fortune, Random random)
+ {
+ return (meta & 7) + 1;
+ }
+
+ /**
+ * Determines if a new block can be replace the space occupied by this one,
+ * Used in the player's placement code to make the block act like water, and lava.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y position
+ * @param z Z position
+ * @return True if the block is replaceable by another block
+ */
+ public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
+ {
+ int meta = world.func_72805_g(x, y, z);
+ return meta >= 7 ? false : field_149764_J.func_76222_j();
+ }
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; }
}
@@ -1,79 +1,45 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
@@ -2,6 +2,7 @@
@@ -108,7 +108,7 @@
p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_));
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -14,6 +15,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockStem extends BlockBush implements IGrowable
{
@@ -101,7 +103,7 @@
Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1);
- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
+ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
{
p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a);
p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P());
}
@@ -144,11 +146,11 @@
Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1);
float f1 = 0.0F;
- if (block8 == Blocks.field_150458_ak)
+ if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this))
{
f1 = 1.0F;
- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0)
+ if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1))
{
f1 = 3.0F;
}
@@ -211,11 +213,12 @@
return l < 7 ? -1 : (p_149873_1_.func_147439_a(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.func_147439_a(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1))));
}
+ @SuppressWarnings("unused")
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -162,24 +162,29 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- if (!p_149690_1_.field_72995_K)
+ if (false && !p_149690_1_.field_72995_K)
{
Item item = null;
@@ -282,4 +285,23 @@
{
this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
}
+
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+
+ Item item = null;
+ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item;
+ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item;
+
+ for (int i = 0; item != null && i < 3; i++)
+ {
+ if (world.field_73012_v.nextInt(15) <= meta)
+ ret.add(new ItemStack(item));
+ }
+
+ return ret;
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
}
- if (!p_180653_1_.field_72995_K)
+ @Override
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
{
Item item = this.func_176481_j();
if (item != null)
{
- int j = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue();
+ int j = ((Integer)state.func_177229_b(field_176484_a)).intValue();
for (int k = 0; k < 3; ++k)
{
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
+ if (RANDOM.nextInt(15) <= j)
{
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item));
+ ret.add(new ItemStack(item));
}
}
}
}
+ return ret;
}
protected Item func_176481_j()
@@ -1,83 +1,66 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -17,8 +18,10 @@
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.IShearable;
@@ -23,7 +23,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockTallGrass extends BlockBush implements IGrowable
+public class BlockTallGrass extends BlockBush implements IGrowable, IShearable
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"};
@SideOnly(Side.CLIENT)
@@ -53,7 +56,7 @@
public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class);
private static final String __OBFID = "CL_00000321";
@@ -44,7 +44,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
@SideOnly(Side.CLIENT)
@@ -71,7 +74,7 @@
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
@@ -74,7 +74,7 @@
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
{
- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
+ return null;
}
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
@@ -81,13 +84,7 @@
@@ -84,13 +84,7 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_));
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a()));
- }
- else
- {
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
@@ -143,4 +140,28 @@
Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2);
@@ -210,4 +204,22 @@
}
}
}
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (world.field_73012_v.nextInt(8) != 0) return ret;
+ ItemStack seed = ForgeHooks.getGrassSeed(world);
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ ret.add(new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a()));
+ return ret;
+ }
+ @Override
+ public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ if (RANDOM.nextInt(8) != 0) return ret;
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM);
+ if (seed != null) ret.add(seed);
+ return ret;
+ }
+
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z)));
+ return ret;
+ }
}
@@ -1,108 +1,38 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
@@ -10,6 +10,7 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockTorch extends Block
{
@@ -51,13 +52,17 @@
@@ -70,7 +70,7 @@
else
{
Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_);
- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK;
+ return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_);
Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c();
- return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn;
+ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_);
}
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -97,7 +97,7 @@
{
- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_))));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH, true) ||
+ func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
BlockPos blockpos1 = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d());
boolean flag = p_176595_3_.func_176740_k().func_176722_c();
- return flag && p_176595_1_.func_175677_d(blockpos1, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
+ return flag && p_176595_1_.isSideSolid(blockpos1, p_176595_3_, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -69,22 +74,22 @@
j1 = 5;
}
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
@@ -120,7 +120,7 @@
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
{
j1 = 4;
}
enumfacing1 = (EnumFacing)iterator.next();
}
- while (!p_180642_1_.func_175677_d(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), true));
+ while (!p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1, true));
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
{
j1 = 3;
return this.func_176223_P().func_177226_a(field_176596_a, enumfacing1);
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
{
j1 = 2;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
{
j1 = 1;
}
@@ -106,19 +111,19 @@
{
if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0)
{
- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true))
+ if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2);
}
@@ -143,22 +148,22 @@
int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_);
@@ -149,7 +149,7 @@
EnumFacing enumfacing1 = enumfacing.func_176734_d();
boolean flag = false;
- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1)
+ if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2)
+ if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3)
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4)
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4)
- if (axis.func_176722_c() && !p_176592_1_.func_175677_d(p_176592_2_.func_177972_a(enumfacing1), true))
+ if (axis.func_176722_c() && !p_176592_1_.isSideSolid(p_176592_2_.func_177972_a(enumfacing1), enumfacing1, true))
{
flag = true;
}
@@ -1,49 +1,43 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
@@ -11,9 +11,12 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
@@ -25,6 +25,8 @@
public class BlockTrapDoor extends Block
{
+ /** Set this to allow trapdoors to remain free-floating */
+ public static boolean disableValidation = false;
private static final String __OBFID = "CL_00000327";
protected BlockTrapDoor(Material p_i45434_1_)
@@ -163,7 +166,7 @@
--i1;
}
- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)))
+ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2))))
{
p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_);
this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
@@ -218,6 +221,7 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL);
public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open");
public static final PropertyEnum field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class);
@@ -141,9 +143,10 @@
{
+ if (disableValidation) return true;
if (p_149707_5_ == 0)
if (!p_176204_1_.field_72995_K)
{
return false;
@@ -248,7 +252,7 @@
--p_149707_2_;
}
+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a);
BlockPos blockpos1 = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d());
- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_));
+ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP);
}
- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()))
+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()) || p_176204_1_.isSideSolid(blockpos1, direction, true)))
{
p_176204_1_.func_175698_g(p_176204_2_);
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
@@ -187,7 +190,10 @@
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c());
+ if (disableValidation) return true;
+ EnumFacing dir = p_176198_3_.func_176734_d();
+ p_176198_2_ = p_176198_2_.func_177972_a(dir);
+ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true));
}
@@ -259,6 +263,7 @@
protected static EnumFacing func_176281_b(int p_176281_0_)
@@ -224,6 +230,7 @@
private static boolean func_150119_a(Block p_150119_0_)
{
+ if (disableValidation) return true;
return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs;
}
}
@@ -1,96 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
@@ -9,6 +9,9 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -60,7 +60,7 @@
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockTripWireHook extends Block
{
private static final String __OBFID = "CL_00000329";
@@ -47,34 +50,41 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -77,7 +77,7 @@
enumfacing = (EnumFacing)iterator.next();
}
- while (!p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r());
+ while (!p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true));
return true;
}
@@ -107,7 +107,7 @@
{
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a);
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
{
byte b0 = 0;
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
{
b0 = 2;
}
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
{
b0 = 0;
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
{
b0 = 1;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
{
b0 = 3;
}
@@ -97,22 +107,22 @@
int i1 = l & 3;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3)
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2)
{
flag = true;
}
@@ -133,7 +143,7 @@
boolean flag3 = (p_150136_6_ & 8) == 8;
boolean flag4 = !p_150136_5_;
boolean flag5 = false;
- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_);
+ boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP);
int l1 = Direction.field_71583_a[k1];
int i2 = Direction.field_71581_b[k1];
int j2 = 0;
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);
@@ -1,61 +1,42 @@
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
@@ -2,9 +2,11 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -16,8 +18,10 @@
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.IShearable;
@@ -26,7 +26,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockVine extends Block
+public class BlockVine extends Block implements IShearable
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable
{
private static final String __OBFID = "CL_00000330";
public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up");
public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north");
@@ -416,13 +416,7 @@
@@ -375,14 +379,28 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0));
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0));
- }
- else
- {
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
@@ -508,6 +502,16 @@
return i;
}
+ /*************************FORGE START***********************************/
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return true;
+ return java.util.Arrays.asList(new ItemStack(this, 1));
+ }
+ /*************************FORGE END***********************************/
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1));
+ return ret;
+ }
+
+ @Override
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
+ {
+ return true;
+ }
}
static final class SwitchEnumFacing
{
static final int[] field_177057_a = new int[EnumFacing.values().length];
@@ -0,0 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
@@ -80,7 +80,7 @@
{
Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c();
- if (block.func_149688_o() == Material.field_151579_a)
+ if (block.isAir(field_177261_a, p_177251_1_))
{
return true;
}
@@ -111,7 +111,7 @@
BlockPos blockpos1 = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c();
- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
+ if (block.isAir(field_177261_a, blockpos1)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
{
break;
}
@@ -159,7 +159,7 @@
block = this.field_177261_a.func_180495_p(blockpos2).func_177230_c();
- if (block.func_149688_o() == Material.field_151579_a)
+ if (block.isAir(field_177261_a, blockpos2))
{
return true;
}
@@ -0,0 +1,39 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
@@ -47,6 +47,16 @@
public BlockState(Block p_i45663_1_, IProperty ... p_i45663_2_)
{
+ this(p_i45663_1_, p_i45663_2_, null);
+ }
+
+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap unlistedProperties)
+ {
+ return new StateImplementation(block, properties);
+ }
+
+ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap unlistedProperties)
+ {
this.field_177627_c = p_i45663_1_;
Arrays.sort(p_i45663_2_, new Comparator()
{
@@ -70,7 +80,7 @@
{
List list = (List)iterator.next();
Map map = MapPopulator.func_179400_b(this.field_177624_d, list);
- BlockState.StateImplementation stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map), null);
+ BlockState.StateImplementation stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map), unlistedProperties);
linkedhashmap.put(map, stateimplementation);
arraylist.add(stateimplementation);
}
@@ -231,5 +241,10 @@
{
this(p_i45661_1_, p_i45661_2_);
}
+
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
+ {
+ return field_177238_c;
+ }
}
}
@@ -1,48 +1,23 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -135,6 +135,14 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.GuiIngameForge;
+import net.minecraftforge.client.event.GuiOpenEvent;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.ForgeEventFactory;
+import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
+import net.minecraftforge.event.world.WorldEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.LWJGLException;
@@ -246,7 +254,7 @@
this.func_71389_H();
this.field_71449_j = p_i1014_1_;
field_147123_G.info("Setting user: " + p_i1014_1_.func_111285_a());
- field_147123_G.info("(Session ID is " + p_i1014_1_.func_111286_b() + ")");
+ //logger.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid...
this.field_71459_aj = p_i1014_5_;
this.field_71443_c = p_i1014_2_;
this.field_71440_d = p_i1014_3_;
@@ -419,7 +427,7 @@
try
{
- Display.create((new PixelFormat()).withDepthBits(24));
+ ForgeHooksClient.createDisplay();
}
catch (LWJGLException lwjglexception)
{
@@ -518,7 +526,7 @@
@@ -296,7 +296,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService();
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a());
- field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")");
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1;
this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1;
@@ -484,7 +483,7 @@
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
FMLClientHandler.instance().finishMinecraftLoading();
net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading();
this.func_71361_d("Post startup");
- this.field_71456_v = new GuiIngame(this);
+ this.field_71456_v = new GuiIngameForge(this);
+ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this);
if (this.field_71475_ae != null)
{
@@ -701,11 +709,6 @@
@@ -891,11 +890,6 @@
public void func_147108_a(GuiScreen p_147108_1_)
{
@@ -54,83 +29,76 @@
if (p_147108_1_ == null && this.field_71441_e == null)
{
p_147108_1_ = new GuiMainMenu();
@@ -715,6 +718,17 @@
@@ -905,6 +899,17 @@
p_147108_1_ = new GuiGameOver();
}
+ GuiScreen old = this.field_71462_r;
+ GuiOpenEvent event = new GuiOpenEvent(p_147108_1_);
+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_);
+
+ if (MinecraftForge.EVENT_BUS.post(event)) return;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
+
+ p_147108_1_ = event.gui;
+ if (old != null && p_147108_1_ != old)
+ {
+ old.func_146281_b();
+ }
+
+
if (p_147108_1_ instanceof GuiMainMenu)
{
this.field_71474_y.field_74330_P = false;
@@ -1296,7 +1310,7 @@
@@ -1388,7 +1393,7 @@
if (this.field_71439_g.func_82246_f(i, j, k))
{
- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e);
+ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x);
this.field_71439_g.func_71038_i();
}
if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
{
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
+ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x);
this.field_71439_g.func_71038_i();
}
@@ -1377,11 +1391,12 @@
int j = this.field_71476_x.field_72312_c;
int k = this.field_71476_x.field_72309_d;
}
@@ -1468,15 +1473,19 @@
case 2:
BlockPos blockpos = this.field_71476_x.func_178782_a();
- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a)
+ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k))
- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a)
+ if (!this.field_71441_e.func_175623_d(blockpos))
{
int l = itemstack != null ? itemstack.field_77994_a : 0;
int i = itemstack != null ? itemstack.field_77994_a : 0;
- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e, this.field_71441_e).isCanceled();
+ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
+
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b).isCanceled();
+ if (result) { //Forge: Kept separate to simplify patch
if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f))
{
flag = false;
this.field_71439_g.func_71038_i();
@@ -1408,7 +1423,8 @@
{
ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
}
+ }
- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, this.field_71441_e).isCanceled();
+ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
{
this.field_71460_t.field_78516_c.func_78445_c();
}
@@ -1607,6 +1623,8 @@
if (itemstack == null)
{
@@ -1697,6 +1706,8 @@
while (Mouse.next())
{
+ if (ForgeHooksClient.postMouseEvent()) continue;
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
+
i = Mouse.getEventButton();
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)))
@@ -2080,6 +2098,11 @@
@@ -2217,6 +2228,8 @@
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
{
+ if (field_71441_e != null)
+ {
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(field_71441_e));
+ }
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
+
if (p_71353_1_ == null)
{
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
@@ -2092,6 +2115,18 @@
if (this.field_71437_Z != null)
@@ -2230,6 +2243,18 @@
{
this.field_71437_Z.func_71263_m();
this.field_71437_Z.func_175592_a();
+ if (field_71461_s != null)
+ {
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
@@ -146,37 +114,40 @@
}
this.field_71437_Z = null;
@@ -2240,113 +2275,10 @@
@@ -2361,134 +2386,11 @@
if (this.field_71476_x != null)
{
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
- int i = 0;
- boolean flag1 = false;
- Item item;
int j;
- TileEntity tileentity = null;
- Object object;
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- j = this.field_71476_x.field_72311_b;
- int k = this.field_71476_x.field_72312_c;
- int l = this.field_71476_x.field_72309_d;
- Block block = this.field_71441_e.func_147439_a(j, k, l);
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c();
-
- if (block.func_149688_o() == Material.field_151579_a)
- {
- return;
- }
-
- item = block.func_149694_d(this.field_71441_e, j, k, l);
- object = block.func_180665_b(this.field_71441_e, blockpos);
-
- if (item == null)
- if (object == null)
- {
- return;
- }
-
- flag1 = item.func_77614_k();
- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block;
- i = block1.func_149643_k(this.field_71441_e, j, k, l);
- if (flag && GuiScreen.func_146271_m())
- {
- tileentity = this.field_71441_e.func_175625_s(blockpos);
- }
-
- Block block1 = object instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a((Item)object) : block;
- i = block1.func_176222_j(this.field_71441_e, blockpos);
- flag1 = ((Item)object).func_77614_k();
- }
- else
- {
@@ -187,11 +158,11 @@
-
- if (this.field_71476_x.field_72308_g instanceof EntityPainting)
- {
- item = Items.field_151159_an;
- object = Items.field_151159_an;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
- {
- item = Items.field_151058_ca;
- object = Items.field_151058_ca;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame)
- {
@@ -200,11 +171,11 @@
-
- if (itemstack == null)
- {
- item = Items.field_151160_bD;
- object = Items.field_151160_bD;
- }
- else
- {
- item = itemstack.func_77973_b();
- object = itemstack.func_77973_b();
- i = itemstack.func_77960_j();
- flag1 = true;
- }
@@ -213,72 +184,86 @@
- {
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
-
- if (entityminecart.func_94087_l() == 2)
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.func_180456_s().ordinal()])
- {
- item = Items.field_151109_aJ;
- }
- else if (entityminecart.func_94087_l() == 1)
- {
- item = Items.field_151108_aI;
- }
- else if (entityminecart.func_94087_l() == 3)
- {
- item = Items.field_151142_bV;
- }
- else if (entityminecart.func_94087_l() == 5)
- {
- item = Items.field_151140_bW;
- }
- else if (entityminecart.func_94087_l() == 6)
- {
- item = Items.field_151095_cc;
- }
- else
- {
- item = Items.field_151143_au;
- case 1:
- object = Items.field_151109_aJ;
- break;
- case 2:
- object = Items.field_151108_aI;
- break;
- case 3:
- object = Items.field_151142_bV;
- break;
- case 4:
- object = Items.field_151140_bW;
- break;
- case 5:
- object = Items.field_151095_cc;
- break;
- default:
- object = Items.field_151143_au;
- }
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
- {
- item = Items.field_151124_az;
- object = Items.field_151124_az;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand)
- {
- object = Items.field_179565_cj;
- }
- else
- {
- item = Items.field_151063_bx;
- object = Items.field_151063_bx;
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
- flag1 = true;
-
- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
- {
- return;
- }
- }
- }
-
- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag);
InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
- if (tileentity == null)
- {
- inventoryplayer.func_146030_a((Item)object, i, flag1, flag);
- }
- else
- {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- tileentity.func_145841_b(nbttagcompound1);
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
- itemstack1.func_77983_a("BlockEntityTag", nbttagcompound1);
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- NBTTagList nbttaglist = new NBTTagList();
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
- nbttagcompound.func_74782_a("Lore", nbttaglist);
- itemstack1.func_77983_a("display", nbttagcompound);
- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1);
- }
-
+ if (!ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
if (flag)
{
j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c;
@@ -2513,8 +2445,15 @@
p_70001_1_.func_76472_a("gl_max_texture_size", Integer.valueOf(func_71369_N()));
int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
@@ -2744,8 +2646,11 @@
p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
}
+ //Forge: Adds a optimization to the getGLMaximumTextureSize, only calculate it once.
+ private static int max_texture_size = -1;
public static int func_71369_N()
{
+ if (max_texture_size != -1)
+ {
+ return max_texture_size;
+ }
+
+ if (max_texture_size != -1) return max_texture_size;
for (int i = 16384; i > 0; i >>= 1)
{
GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null);
@@ -2522,6 +2461,7 @@
@@ -2753,6 +2658,7 @@
if (j != 0)
{
@@ -1,17 +1,17 @@
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
@@ -35,6 +35,10 @@
@@ -36,6 +36,10 @@
import paulscode.sound.codecs.CodecJOrbis;
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
+import net.minecraftforge.client.*;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.event.sound.*;
+import net.minecraftforge.common.MinecraftForge;
+
@SideOnly(Side.CLIENT)
public class SoundManager
{
@@ -69,6 +73,7 @@
@@ -70,6 +74,7 @@
{
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
@@ -19,7 +19,7 @@
}
catch (SoundSystemException soundsystemexception)
{
@@ -80,6 +85,7 @@
@@ -81,6 +86,7 @@
{
this.func_148613_b();
this.func_148608_i();
@@ -27,7 +27,7 @@
}
private synchronized void func_148608_i()
@@ -302,6 +308,9 @@
@@ -329,6 +335,9 @@
}
else
{
@@ -37,7 +37,7 @@
SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b());
if (soundeventaccessorcomposite == null)
@@ -343,10 +352,12 @@
@@ -370,10 +379,12 @@
if (soundpoolentry.func_148648_d())
{
this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
@@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
@@ -129,6 +129,6 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
}
}
@@ -1,12 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
@@ -151,7 +151,8 @@
}
}
- public float func_70047_e()
+ @Override
+ public float getDefaultEyeHeight()
{
return 1.82F;
}
@@ -1,85 +1,78 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -50,6 +50,9 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Session;
@@ -53,6 +53,9 @@
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
@SideOnly(Side.CLIENT)
public class EntityPlayerSP extends AbstractClientPlayer
@@ -325,7 +328,7 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
+ return ForgeHooksClient.getOffsetFOV(this, f);
@@ -342,6 +345,15 @@
this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_);
}
public void func_71053_j()
@@ -479,20 +482,45 @@
return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r();
}
+ private boolean isHeadspaceFree(int x, int y, int z, int height)
+ private boolean isHeadspaceFree(BlockPos pos, int height)
+ {
+ for (int i1 = 0; i1 < height; i1++)
+ for (int y = 0; y < height; y++)
+ {
+ if (func_71153_f(x, y + i1, z + 1)) return false;
+ if (func_175162_d(pos.func_177982_a(0, y, 0))) return false;
+ }
+ return true;
+ }
+
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
{
+ if (this.field_70145_X)
+ {
+ return false;
+ }
int i = MathHelper.func_76128_c(p_145771_1_);
int j = MathHelper.func_76128_c(p_145771_3_);
int k = MathHelper.func_76128_c(p_145771_5_);
double d3 = p_145771_1_ - (double)i;
double d4 = p_145771_5_ - (double)k;
if (this.field_70145_X)
@@ -354,30 +366,34 @@
double d3 = p_145771_1_ - (double)blockpos.func_177958_n();
double d4 = p_145771_5_ - (double)blockpos.func_177952_p();
- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k))
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
- if (!this.func_175162_d(blockpos))
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
+
+ boolean inTranslucentBlock = true;
+ boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight);
+
+ for (int i1 = 0; i1 < entHeight; i1++)
{
- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k);
- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k);
- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1);
- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1);
+ if (!this.func_71153_f(i, j + i1, k))
+ {
+ inTranslucentBlock = false;
+ }
+ }
+
+ if (inTranslucentBlock)
+ {
+ boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight);
+ boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight);
+ boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight);
+ boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight);
byte b0 = -1;
double d5 = 9999.0D;
+ if (inTranslucentBlock)
{
byte b0 = -1;
double d5 = 9999.0D;
@@ -576,6 +604,12 @@
- if (this.func_175162_d(blockpos.func_177976_e()) && d3 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d3 < d5)
{
d5 = d3;
b0 = 0;
}
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d3 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d3 < d5)
{
d5 = 1.0D - d3;
b0 = 1;
}
- if (this.func_175162_d(blockpos.func_177978_c()) && d4 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d4 < d5)
{
d5 = d4;
b0 = 4;
}
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d4 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d4 < d5)
{
d5 = 1.0D - d4;
b0 = 5;
@@ -445,6 +461,9 @@
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
{
+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return;
+ }
+ if (MinecraftForge.EVENT_BUS.post(event)) return;
+ p_85030_1_ = event.name;
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
}
@@ -1,53 +1,29 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
@@ -1,6 +1,7 @@
package net.minecraft.client.gui;
import com.google.common.collect.Lists;
+import com.google.common.collect.ObjectArrays;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.File;
@@ -24,6 +25,7 @@
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
+import net.minecraftforge.client.ClientCommandHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
@@ -131,6 +133,7 @@
public void func_146403_a(String p_146403_1_)
{
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_);
+ if (ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) == 1) return;
this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_);
}
@@ -305,13 +308,14 @@
@@ -217,13 +217,14 @@
this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1);
}
- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++));
+ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
+ this.field_146415_a.func_146191_b(net.minecraft.util.EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
}
private void func_146405_a(String p_146405_1_, String p_146405_2_)
{
if (p_146405_1_.length() >= 1)
{
+ ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_));
this.field_146414_r = true;
}
@@ -433,6 +437,13 @@
+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
BlockPos blockpos = null;
if (this.field_146297_k.field_71476_x != null && this.field_146297_k.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
@@ -285,6 +286,13 @@
String[] astring1 = p_146406_1_;
int i = p_146406_1_.length;
+ String[] complete = ClientCommandHandler.instance.latestAutoComplete;
+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete;
+ if (complete != null)
+ {
+ astring1 = ObjectArrays.concat(complete, astring1, String.class);
+ astring1 = com.google.common.collect.ObjectArrays.concat(complete, astring1, String.class);
+ i = astring1.length;
+ }
+
@@ -1,20 +1,27 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
@@ -320,7 +320,7 @@
@@ -322,14 +322,7 @@
}
else if (p_146284_1_.field_146127_k == 8)
{
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
+ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this);
- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c)
- {
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
- }
- else
- {
- this.field_146297_k.func_147108_a(new GuiCustomizeWorldScreen(this, this.field_146334_a));
- }
+ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(field_146297_k, this);
}
}
}
@@ -338,7 +338,7 @@
this.field_146326_C.field_146125_m = this.field_146344_y;
this.field_146320_D.field_146125_m = this.field_146344_y;
this.field_146321_E.field_146125_m = this.field_146344_y;
- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c;
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
@@ -381,7 +374,7 @@
this.field_146326_C.field_146125_m = this.field_146344_y;
this.field_146320_D.field_146125_m = this.field_146344_y;
this.field_146321_E.field_146125_m = this.field_146344_y;
- this.field_146322_F.field_146125_m = this.field_146344_y && (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c || WorldType.field_77139_a[this.field_146331_K] == WorldType.field_180271_f);
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
}
if (this.field_146344_y)
{
this.func_146319_h();
@@ -1,18 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
@@ -30,6 +30,7 @@
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.WorldInfo;
+import net.minecraftforge.client.ForgeHooksClient;
import org.apache.commons.io.Charsets;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -614,6 +615,7 @@
@@ -511,6 +511,7 @@
this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215);
}
}
+ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m);
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m);
String s1 = "Copyright Mojang AB. Do not distribute!";
this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1);
@@ -1,27 +1,26 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
@@ -17,6 +17,10 @@
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
@@ -37,6 +37,9 @@
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
+import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
+import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
+import net.minecraftforge.common.MinecraftForge;
+
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@@ -111,7 +115,8 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.StringUtils;
@@ -146,7 +149,8 @@
}
}
- this.func_146283_a(list, p_146285_2_, p_146285_3_);
+ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_);
+ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
+ this.drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
}
protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_)
@@ -121,6 +126,11 @@
@@ -156,6 +160,11 @@
protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_)
{
@@ -32,8 +31,8 @@
+ {
if (!p_146283_1_.isEmpty())
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -133,7 +143,7 @@
GlStateManager.func_179101_C();
@@ -168,7 +177,7 @@
while (iterator.hasNext())
{
String s = (String)iterator.next();
@@ -42,16 +41,24 @@
if (l > k)
{
@@ -178,7 +188,7 @@
@@ -213,7 +222,7 @@
for (int i2 = 0; i2 < p_146283_1_.size(); ++i2)
{
String s1 = (String)p_146283_1_.get(i2);
- this.field_146289_q.func_78261_a(s1, j2, k2, -1);
+ font.func_78261_a(s1, j2, k2, -1);
- this.field_146289_q.func_175063_a(s1, (float)j2, (float)k2, -1);
+ font.func_175063_a(s1, j2, k2, -1);
if (i2 == 0)
{
@@ -207,9 +217,14 @@
@@ -441,6 +450,7 @@
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
}
+ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_175281_1_) != 0) return;
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
}
@@ -454,9 +464,14 @@
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
{
@@ -69,7 +76,7 @@
}
}
}
@@ -234,8 +249,12 @@
@@ -482,8 +497,12 @@
this.field_146289_q = p_146280_1_.field_71466_p;
this.field_146294_l = p_146280_2_;
this.field_146295_m = p_146280_3_;
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSleepMP.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSleepMP.java
@@ -34,7 +34,7 @@
if (!s.isEmpty())
{
- this.field_146297_k.field_71439_g.func_71165_d(s);
+ this.func_175275_f(s); // Forge: fix vanilla not adding messages to the sent list while sleeping
}
this.field_146415_a.func_146180_a("");
@@ -1,39 +1,40 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
@@ -294,16 +294,7 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.field_78398_a;
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- tessellator.func_78382_b();
- tessellator.func_78378_d(2105376);
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78381_a();
+ drawContainerBackground(tessellator);
l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
i2 = this.field_148153_b + 4 - (int)this.field_148169_q;
@@ -185,16 +185,7 @@
GlStateManager.func_179106_n();
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldrenderer = tessellator.func_178180_c();
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- worldrenderer.func_178970_b();
- worldrenderer.func_178991_c(2105376);
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78381_a();
+ this.drawContainerBackground(tessellator);
int i1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
int j1 = this.field_148153_b + 4 - (int)this.field_148169_q;
@@ -475,4 +466,18 @@
@@ -456,4 +447,19 @@
{
return this.field_148149_f;
}
+
+ protected void drawContainerBackground(Tessellator tessellator)
+ {
+ WorldRenderer worldrenderer = tessellator.func_178180_c();
+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
+ float f1 = 32.0F;
+ tessellator.func_78382_b();
+ tessellator.func_78378_d(2105376);
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178970_b();
+ worldrenderer.func_178991_c(2105376);
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ tessellator.func_78381_a();
+ }
}
@@ -1,9 +1,9 @@
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
@@ -24,6 +24,9 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import java.util.LinkedList;
+import java.util.List;
+import net.minecraftforge.common.AchievementPage;
@@ -43,7 +43,7 @@
+ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
}
protected void func_146284_a(GuiButton p_146284_1_)
protected void func_146284_a(GuiButton p_146284_1_) throws IOException
@@ -75,6 +91,16 @@
{
this.field_146297_k.func_147108_a(this.field_146562_a);
@@ -56,13 +56,13 @@
+ {
+ currentPage = -1;
+ }
+ button.field_146126_j = AchievementPage.getTitle(currentPage);
+ this.button.field_146126_j = AchievementPage.getTitle(currentPage);
+ }
}
}
@@ -339,11 +365,12 @@
int j4;
@@ -341,11 +367,12 @@
int i4;
int l4;
- for (i3 = 0; i3 < AchievementList.field_76007_e.size(); ++i3)
@@ -77,15 +77,40 @@
{
j3 = achievement1.field_75993_a * 24 - k + 11;
k3 = achievement1.field_75991_b * 24 - l + 11;
@@ -400,9 +427,9 @@
@@ -401,9 +428,9 @@
int i5;
int j5;
- for (l4 = 0; l4 < AchievementList.field_76007_e.size(); ++l4)
+ for (l4 = 0; l4 < achievementList.size(); ++l4)
- for (k3 = 0; k3 < AchievementList.field_76007_e.size(); ++k3)
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
{
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(l4);
+ Achievement achievement2 = (Achievement)achievementList.get(l4);
i5 = achievement2.field_75993_a * 24 - k;
j5 = achievement2.field_75991_b * 24 - l;
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(k3);
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
l4 = achievement2.field_75993_a * 24 - k;
i5 = achievement2.field_75991_b * 24 - l;
@@ -445,6 +472,7 @@
this.field_146297_k.func_110434_K().func_110577_a(field_146561_C);
+ GlStateManager.func_179147_l(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it.
if (achievement2.func_75984_f())
{
this.func_73729_b(l4 - 2, i5 - 2, 26, 202, 26, 26);
@@ -453,6 +481,7 @@
{
this.func_73729_b(l4 - 2, i5 - 2, 0, 202, 26, 26);
}
+ GlStateManager.func_179084_k(); //Forge: Cleanup states we set.
if (!this.field_146556_E.func_77442_b(achievement2))
{
@@ -461,7 +490,7 @@
this.field_146296_j.func_175039_a(false);
}
- GlStateManager.func_179145_e();
+ GlStateManager.func_179140_f(); //Forge: Make sure Lighting is disabled. Fixes MC-33065
GlStateManager.func_179089_o();
this.field_146296_j.func_180450_b(achievement2.field_75990_d, l4 + 3, i5 + 3);
GlStateManager.func_179112_b(770, 771);
@@ -1,40 +1,44 @@
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
@@ -6,6 +6,7 @@
@@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.Set;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
@@ -112,7 +113,11 @@
}
}
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
+ //incorrectly be applied based on items that are in the inventory.
+ GL11.glDisable(GL11.GL_LIGHTING);
this.func_146979_b(p_73863_1_, p_73863_2_);
+ GL11.glEnable(GL11.GL_LIGHTING);
InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by;
ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.func_70445_o() : this.field_147012_x;
@@ -176,8 +181,11 @@
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
@@ -178,8 +179,11 @@
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
this.field_73735_i = 200.0F;
field_146296_j.field_77023_b = 200.0F;
- field_146296_j.func_82406_b(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
- field_146296_j.func_94148_a(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_146296_j.field_77023_b = 200.0F;
+ FontRenderer font = null;
+ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_);
+ if (font == null) font = field_146289_q;
+ field_146296_j.func_82406_b(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
+ field_146296_j.func_94148_a(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_146296_j.func_180450_b(p_146982_1_, p_146982_2_, p_146982_3_);
- this.field_146296_j.func_180453_a(this.field_146289_q, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
+ this.field_146296_j.func_180453_a(font, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_73735_i = 0.0F;
field_146296_j.field_77023_b = 0.0F;
this.field_146296_j.field_77023_b = 0.0F;
}
@@ -458,6 +466,7 @@
@@ -240,13 +244,12 @@
if (itemstack == null)
{
- String s1 = p_146977_1_.func_178171_c();
+ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite();
- if (s1 != null)
+ if (textureatlassprite != null)
{
- TextureAtlasSprite textureatlassprite = this.field_146297_k.func_147117_R().func_110572_b(s1);
GlStateManager.func_179140_f();
- this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110575_b);
+ this.field_146297_k.func_110434_K().func_110577_a(p_146977_1_.getBackgroundLocation());
this.func_175175_a(i, j, textureatlassprite, 16, 16);
GlStateManager.func_179145_e();
flag1 = true;
@@ -465,6 +468,7 @@
protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_)
{
@@ -9,7 +9,7 @@
public GuiContainerCreative(EntityPlayer p_i1088_1_)
{
@@ -185,7 +187,7 @@
@@ -187,7 +189,7 @@
return;
}
@@ -18,30 +18,30 @@
{
if (p_146984_3_ == 0)
{
@@ -260,6 +262,13 @@
@@ -262,6 +264,13 @@
this.func_147050_b(CreativeTabs.field_78032_a[i]);
this.field_147059_E = new CreativeCrafting(this.field_146297_k);
this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E);
+ int tabCount = CreativeTabs.field_78032_a.length;
+ if (tabCount > 12)
+ {
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
+ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">"));
+ maxPages = ((tabCount - 12) / 10) + 1;
+ }
}
else
{
@@ -281,7 +290,7 @@
@@ -283,7 +292,7 @@
protected void func_73869_a(char p_73869_1_, int p_73869_2_)
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException
{
- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a())
+ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar())
{
if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D))
{
@@ -318,6 +327,15 @@
@@ -320,6 +329,15 @@
{
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
containercreative.field_148330_a.clear();
@@ -57,7 +57,7 @@
Iterator iterator = Item.field_150901_e.iterator();
while (iterator.hasNext())
@@ -329,7 +347,13 @@
@@ -331,10 +349,17 @@
item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a);
}
}
@@ -71,25 +71,20 @@
Enchantment[] aenchantment = Enchantment.field_77331_b;
int j = aenchantment.length;
@@ -383,7 +407,7 @@
+ if (CreativeTabs.field_78032_a[field_147058_w] != CreativeTabs.field_78027_g) j = 0; //Forge: Don't add enchants to custom tabs.
for (int i = 0; i < j; ++i)
{
Enchantment enchantment = aenchantment[i];
@@ -385,7 +410,7 @@
{
CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w];
- if (creativetabs.func_78019_g())
+ if (creativetabs != null && creativetabs.func_78019_g())
{
GL11.glDisable(GL11.GL_BLEND);
GlStateManager.func_179084_k();
this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752);
@@ -403,7 +427,7 @@
{
CreativeTabs creativetabs = acreativetabs[k1];
- if (this.func_147049_a(creativetabs, l, i1))
+ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1))
{
return;
}
@@ -426,7 +450,7 @@
@@ -428,7 +453,7 @@
{
CreativeTabs creativetabs = acreativetabs[k1];
@@ -98,7 +93,7 @@
{
this.func_147050_b(creativetabs);
return;
@@ -439,11 +463,13 @@
@@ -441,11 +466,13 @@
private boolean func_147055_p()
{
@@ -112,7 +107,7 @@
int i = field_147058_w;
field_147058_w = p_147050_1_.func_78021_a();
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
@@ -512,7 +538,7 @@
@@ -514,12 +541,14 @@
if (this.field_147062_A != null)
{
@@ -121,7 +116,14 @@
{
this.field_147062_A.func_146189_e(true);
this.field_147062_A.func_146205_d(false);
@@ -608,23 +634,45 @@
this.field_147062_A.func_146195_b(true);
this.field_147062_A.func_146180_a("");
+ this.field_147062_A.field_146218_h = p_147050_1_.getSearchbarWidth();
+ this.field_147062_A.field_146209_f = this.field_147003_i + (82 /*default left*/ + 89 /*default width*/) - this.field_147062_A.field_146218_h;
this.func_147053_i();
}
else
@@ -590,23 +619,45 @@
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
CreativeTabs[] acreativetabs = CreativeTabs.field_78032_a;
@@ -158,7 +160,7 @@
+ {
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
+ int width = field_146289_q.func_78256_a(page);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GlStateManager.func_179140_f();
+ this.field_73735_i = 300.0F;
+ field_146296_j.field_77023_b = 300.0F;
+ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1);
@@ -166,10 +168,10 @@
+ field_146296_j.field_77023_b = 0.0F;
+ }
+
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179140_f();
}
@@ -693,17 +741,37 @@
@@ -675,17 +726,36 @@
int k = acreativetabs.length;
int l;
@@ -184,7 +186,6 @@
this.field_146297_k.func_110434_K().func_110577_a(field_147061_u);
+ if (creativetabs1 == null) continue;
+
if (creativetabs1.func_78021_a() != field_147058_w)
{
this.func_147051_a(creativetabs1);
@@ -208,7 +209,7 @@
this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f()));
this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g);
this.field_147062_A.func_146194_f();
@@ -718,6 +786,14 @@
@@ -700,6 +770,14 @@
this.func_73729_b(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15);
}
@@ -223,7 +224,7 @@
this.func_147051_a(creativetabs);
if (creativetabs == CreativeTabs.field_78036_m)
@@ -728,6 +804,15 @@
@@ -710,6 +788,15 @@
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
{
@@ -239,15 +240,16 @@
int k = p_147049_1_.func_78020_k();
int l = 28 * k;
byte b0 = 0;
@@ -828,6 +913,7 @@
@@ -810,6 +897,8 @@
}
GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it.
GlStateManager.func_179140_f();
+ GlStateManager.func_179124_c(1F, 1F, 1F); //Forge: Reset color in case Items change it.
+ GlStateManager.func_179147_l(); //Forge: Make sure blend is enabled else tabs show a white border.
this.func_73729_b(l, i1, j, k, 28, b0);
this.field_73735_i = 100.0F;
field_146296_j.field_77023_b = 100.0F;
@@ -854,6 +940,15 @@
this.field_146296_j.field_77023_b = 100.0F;
@@ -836,6 +925,15 @@
{
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
}
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java
+++ ../src-work/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java
@@ -202,7 +202,7 @@
GuiScreenCreateOnlineWorld.field_146765_a.error("Couldn\'t create world");
this.func_148416_a(unsupportedencodingexception.getLocalizedMessage());
}
- catch (IOException ioexception)
+ catch (@SuppressWarnings("hiding") IOException ioexception)
{
GuiScreenCreateOnlineWorld.field_146765_a.error("Could not parse response creating world");
this.func_148416_a(ioexception.getLocalizedMessage());
@@ -1,8 +1,8 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java
@@ -10,7 +10,6 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public abstract class ModelBase
@@ -1,18 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java
@@ -4,7 +4,6 @@
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class ModelBox
{
private PositionTextureVertex[] field_78253_h;
@@ -77,6 +76,7 @@
@@ -82,6 +81,7 @@
}
}
+ @SideOnly(Side.CLIENT)
public void func_78245_a(Tessellator p_78245_1_, float p_78245_2_)
public void func_178780_a(WorldRenderer p_178780_1_, float p_178780_2_)
{
for (int i = 0; i < this.field_78254_i.length; ++i)
@@ -1,14 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
@@ -8,7 +8,6 @@
import net.minecraft.client.renderer.Tessellator;
@@ -10,7 +10,6 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
-@SideOnly(Side.CLIENT)
public class ModelRenderer
{
public float field_78801_a;
@@ -102,6 +101,7 @@
@@ -110,6 +109,7 @@
this.field_78798_e = p_78793_3_;
}
@@ -16,7 +16,7 @@
public void func_78785_a(float p_78785_1_)
{
if (!this.field_78807_k)
@@ -184,6 +184,7 @@
@@ -192,6 +192,7 @@
}
}
@@ -24,7 +24,7 @@
public void func_78791_b(float p_78791_1_)
{
if (!this.field_78807_k)
@@ -219,6 +220,7 @@
@@ -227,6 +228,7 @@
}
}
@@ -32,7 +32,7 @@
public void func_78794_c(float p_78794_1_)
{
if (!this.field_78807_k)
@@ -260,6 +262,7 @@
@@ -268,6 +270,7 @@
}
}
@@ -3,9 +3,9 @@
@@ -1,10 +1,7 @@
package net.minecraft.client.model;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.Vec3;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class PositionTextureVertex
@@ -1,12 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
@@ -1,11 +1,8 @@
package net.minecraft.client.model;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
@@ -3,10 +3,7 @@
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.util.Vec3;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class TexturedQuad
@@ -5,6 +5,6 @@
this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk);
this.field_73237_c.add(chunk);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
chunk.field_76636_d = true;
chunk.func_177417_c(true);
return chunk;
}
@@ -1,85 +1,69 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
@@ -28,6 +28,10 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings;
@@ -113,6 +113,12 @@
}
}
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
+
@SideOnly(Side.CLIENT)
public class PlayerControllerMP
{
@@ -88,6 +92,12 @@
public boolean func_78751_a(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_)
{
+ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC();
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_78751_1_, p_78751_2_, p_78751_3_, field_78776_a.field_71439_g))
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_178888_1_, field_78776_a.field_71439_g))
+ {
+ return false;
+ }
+
if (this.field_78779_k.func_82752_c() && !this.field_78776_a.field_71439_g.func_82246_f(p_78751_1_, p_78751_2_, p_78751_3_))
if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_70694_bm() != null && this.field_78776_a.field_71439_g.func_70694_bm().func_77973_b() instanceof ItemSword)
{
return false;
@@ -109,7 +119,7 @@
@@ -130,7 +136,7 @@
else
{
worldclient.func_72926_e(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.func_149682_b(block) + (worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_) << 12));
int i1 = worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_);
- boolean flag = worldclient.func_147468_f(p_78751_1_, p_78751_2_, p_78751_3_);
+ boolean flag = block.removedByPlayer(worldclient, field_78776_a.field_71439_g, p_78751_1_, p_78751_2_, p_78751_3_);
worldclient.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate));
- boolean flag = worldclient.func_175698_g(p_178888_1_);
+ boolean flag = block1.removedByPlayer(worldclient, p_178888_1_, field_78776_a.field_71439_g, false);
if (flag)
{
@@ -304,11 +314,18 @@
float f2 = (float)p_78760_8_.field_72449_c - (float)p_78760_6_;
boolean flag = false;
- if ((!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null) && p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2))
+ if (p_78760_3_ != null &&
+ p_78760_3_.func_77973_b() != null &&
+ p_78760_3_.func_77973_b().onItemUseFirst(p_78760_3_, p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
@@ -360,11 +366,19 @@
{
- flag = true;
+ return true;
}
+ if (!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null || p_78760_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_))
+ {
+ flag = p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2);
+ }
+
if (!flag && p_78760_3_ != null && p_78760_3_.func_77973_b() instanceof ItemBlock)
{
ItemBlock itemblock = (ItemBlock)p_78760_3_.func_77973_b();
@@ -340,7 +357,15 @@
}
else
{
- return p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2);
+ if (!p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
+ {
+ return false;
+ }
+ if (p_78760_3_.field_77994_a <= 0)
+ {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78760_1_, p_78760_3_));
+ }
+ return true;
}
}
@@ -359,9 +384,10 @@
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
- if (itemstack1.field_77994_a == 0)
+ if (itemstack1.field_77994_a <= 0)
if (this.field_78779_k != WorldSettings.GameType.SPECTATOR)
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78769_1_, itemstack1));
}
+
+ if (p_178890_3_ != null &&
+ p_178890_3_.func_77973_b() != null &&
+ p_178890_3_.func_77973_b().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2))
+ {
+ return true;
+ }
+
IBlockState iblockstate = p_178890_2_.func_180495_p(p_178890_4_);
return true;
- if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null) && iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2))
+ if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null || p_178890_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_)))
{
- flag = true;
+ flag = iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2);
}
if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock)
@@ -397,7 +411,9 @@
}
else
{
- return p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2);
+ if (!p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false;
+ if (p_178890_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_);
+ return true;
}
}
else
@@ -428,9 +444,10 @@
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
- if (itemstack1.field_77994_a == 0)
+ if (itemstack1.field_77994_a <= 0)
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_78769_1_, itemstack1);
}
return true;
@@ -1,38 +1,12 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
@@ -34,6 +34,9 @@
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.SaveHandlerMP;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.world.WorldEvent;
+
@SideOnly(Side.CLIENT)
public class WorldClient extends World
{
@@ -51,8 +54,11 @@
super(new SaveHandlerMP(), "MpServer", WorldProvider.func_76570_a(p_i45063_3_), p_i45063_2_, p_i45063_5_);
@@ -54,8 +54,8 @@
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true);
this.field_73035_a = p_i45063_1_;
this.field_73013_u = p_i45063_4_;
- this.func_72950_A(8, 64, 8);
this.field_72988_C = p_i45063_1_.field_147305_a;
+ this.field_72995_K = true;
+ this.finishSetup();
+ this.func_72950_A(8, 64, 8);
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
}
public void func_72835_b()
@@ -261,6 +267,12 @@
protected void func_72979_l()
{
+ super.func_72979_l();
+ }
+
+ @Override
+ public void updateWeatherBody()
+ {
if (!this.field_73011_w.field_76576_e)
{
;
this.func_72912_H().func_176144_a(p_i45063_4_);
- this.func_175652_B(new BlockPos(8, 64, 8));
this.field_73011_w.func_76558_a(this);
+ this.func_175652_B(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect.
this.field_73020_y = this.func_72970_h();
this.field_72988_C = new SaveDataMemoryStorage();
this.func_72966_v();
@@ -1,35 +1,42 @@
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
@@ -190,6 +190,8 @@
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.MapData;
import net.minecraft.world.storage.MapStorage;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -673,7 +675,11 @@
@@ -410,7 +410,8 @@
public void func_147286_a(S11PacketSpawnExperienceOrb p_147286_1_)
{
PacketThreadUtil.func_180031_a(p_147286_1_, this, this.field_147299_f);
- EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d(), (double)p_147286_1_.func_148983_e(), (double)p_147286_1_.func_148982_f(), p_147286_1_.func_148986_g());
+ EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d() / 32.0D, (double)p_147286_1_.func_148983_e() / 32.0D, (double)p_147286_1_.func_148982_f() / 32.0D, p_147286_1_.func_148986_g());
+ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position
entityxporb.field_70118_ct = p_147286_1_.func_148984_d();
entityxporb.field_70117_cu = p_147286_1_.func_148983_e();
entityxporb.field_70116_cv = p_147286_1_.func_148982_f();
@@ -754,14 +755,16 @@
public void func_147251_a(S02PacketChat p_147251_1_)
{
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
+ ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c());
+ if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null)
+ {
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(event.message);
+ }
}
PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f);
+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c());
+ if (message == null) return;
public void func_147279_a(S0BPacketAnimation p_147279_1_)
@@ -1113,6 +1119,10 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
+ else
+ {
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
}
if (p_147251_1_.func_179841_c() == 2)
{
- this.field_147299_f.field_71456_v.func_175188_a(p_147251_1_.func_148915_c(), false);
+ this.field_147299_f.field_71456_v.func_175188_a(message, false);
}
else
{
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(message);
}
}
@@ -1137,6 +1140,10 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
+ else
+ {
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
}
}
@@ -1,74 +1,33 @@
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
@@ -16,9 +16,11 @@
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
+
import org.lwjgl.opengl.GL11;
@@ -135,6 +135,7 @@
@SideOnly(Side.CLIENT)
@@ -70,7 +72,10 @@
try
{
- entityfx.func_70071_h_();
+ if (entityfx != null)
+ {
+ entityfx.func_70071_h_();
+ }
}
catch (Throwable throwable)
{
@@ -95,7 +100,7 @@
throw new ReportedException(crashreport);
}
- if (entityfx.field_70128_L)
+ if (entityfx == null || entityfx.field_70128_L)
{
this.field_78876_b[i].remove(j--);
}
@@ -144,6 +149,7 @@
for (int j = 0; j < this.field_78876_b[i].size(); ++j)
{
final EntityFX entityfx = (EntityFX)this.field_78876_b[i].get(j);
+ if (entityfx == null) continue;
tessellator.func_78380_c(entityfx.func_70070_b(p_78874_2_));
try
@@ -200,6 +206,7 @@
for (int i = 0; i < list.size(); ++i)
{
EntityFX entityfx = (EntityFX)list.get(i);
+ if (entityfx == null) continue;
tessellator.func_78380_c(entityfx.func_70070_b(p_78872_2_));
entityfx.func_70539_a(tessellator, p_78872_2_, f2, f6, f3, f4, f5);
}
@@ -218,7 +225,7 @@
public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_)
public void func_78873_a(EntityFX p_78873_1_)
{
- if (p_147215_4_.func_149688_o() != Material.field_151579_a)
+ if (!p_147215_4_.isAir(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this))
+ if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs.
int i = p_78873_1_.func_70537_b();
int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1;
@@ -361,7 +362,7 @@
public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_)
{
- if (p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a)
+ if (!p_180533_2_.func_177230_c().isAir(field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this))
{
p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_);
byte b0 = 4;
@@ -467,4 +468,13 @@
@@ -287,4 +294,13 @@
{
return "" + (this.field_78876_b[0].size() + this.field_78876_b[1].size() + this.field_78876_b[2].size());
return "" + i;
}
+
+ public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target)
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target)
+ {
+ Block block = field_78878_a.func_147439_a(x, y, z);
+ Block block = field_78878_a.func_180495_p(pos).func_177230_c();
+ if (block != null && !block.addHitEffects(field_78878_a, target, this))
+ {
+ func_78867_a(x, y, z, target.field_72310_e);
+ func_180532_a(pos, target.field_178784_b);
+ }
+ }
}
@@ -1,32 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
+++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
@@ -12,20 +12,27 @@
{
private Block field_145784_a;
private static final String __OBFID = "CL_00000932";
+ private int side;
public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_)
{
+ this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.field_73012_v.nextInt(6));
+ }
+
+ public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_, int side)
+ {
super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_);
this.field_145784_a = p_i1234_14_;
- this.func_110125_a(p_i1234_14_.func_149691_a(0, p_i1234_15_));
+ this.func_110125_a(p_i1234_14_.func_149691_a(side, p_i1234_15_));
this.field_70545_g = p_i1234_14_.field_149763_I;
this.field_70552_h = this.field_70553_i = this.field_70551_j = 0.6F;
this.field_70544_f /= 2.0F;
+ this.side = side;
}
public EntityDiggingFX func_70596_a(int p_70596_1_, int p_70596_2_, int p_70596_3_)
{
- if (this.field_145784_a == Blocks.field_150349_c)
+ if (this.field_145784_a == Blocks.field_150349_c && this.side != 1)
{
return this;
}
@@ -0,0 +1,15 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
@@ -129,6 +129,12 @@
ibakedmodel = ((WeightedBakedModel)ibakedmodel).func_177564_a(MathHelper.func_180186_a(p_175022_3_));
}
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
+ {
+ IBlockState extendedState = block.getExtendedState(p_175022_1_, p_175022_2_, p_175022_3_);
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState);
+ }
+
return ibakedmodel;
}
@@ -1,162 +1,110 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -51,6 +51,12 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.Project;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.event.DrawBlockHighlightEvent;
+import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
+import net.minecraftforge.client.event.RenderWorldLastEvent;
+import net.minecraftforge.common.MinecraftForge;
@SideOnly(Side.CLIENT)
public class EntityRenderer implements IResourceManagerReloadListener
@@ -358,7 +364,7 @@
@@ -403,7 +403,7 @@
if (d3 < d2 || d2 == 0.0D)
{
- if (entity == this.field_78531_r.field_71451_h.field_70154_o)
+ if (entity == this.field_78531_r.field_71451_h.field_70154_o && !entity.canRiderInteract())
- if (entity1 == entity.field_70154_o)
+ if (entity1 == entity.field_70154_o && !entity.canRiderInteract())
{
if (d2 == 0.0D)
{
@@ -392,8 +398,15 @@
private void func_78477_e()
{
- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
- this.field_78501_T = entityplayersp.func_71151_f();
+ if (field_78531_r.field_71451_h instanceof EntityPlayerSP)
+ {
+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
+ this.field_78501_T = entityplayersp.func_71151_f();
+ }
+ else
+ {
+ this.field_78501_T = field_78531_r.field_71439_g.func_71151_f();
+ }
this.field_78506_S = this.field_78507_R;
this.field_78507_R += (this.field_78501_T - this.field_78507_R) * 0.5F;
@@ -416,7 +429,7 @@
}
else
{
- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.field_71451_h;
+ EntityLivingBase entityplayer = (EntityLivingBase)this.field_78531_r.field_71451_h;
float f1 = 70.0F;
if (p_78481_2_)
@@ -497,15 +510,7 @@
if (!this.field_78531_r.field_71474_y.field_74325_U)
@@ -556,14 +556,8 @@
{
- Block block = this.field_78531_r.field_71441_e.func_147439_a(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
-
BlockPos blockpos = new BlockPos(entity);
IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity);
- if (block == Blocks.field_150324_C)
- {
- int i = this.field_78531_r.field_71441_e.func_72805_g(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
- int j = i & 3;
- GL11.glRotatef((float)(j * 90), 0.0F, 1.0F, 0.0F);
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
- }
-
+ ForgeHooksClient.orientBedCamera(field_78531_r, entitylivingbase);
GL11.glRotatef(entitylivingbase.field_70126_B + (entitylivingbase.field_70177_z - entitylivingbase.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
GL11.glRotatef(entitylivingbase.field_70127_C + (entitylivingbase.field_70125_A - entitylivingbase.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
}
@@ -1052,7 +1057,9 @@
@@ -1081,7 +1075,7 @@
try
{
- this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
+ if (!MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Pre(this.field_78531_r.field_71462_r, k, l, p_78480_1_)))
+ this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
+ MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Post(this.field_78531_r.field_71462_r, k, l, p_78480_1_));
- this.field_78531_r.field_71462_r.func_73863_a(l, i1, p_78480_1_);
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, l, i1, p_78480_1_);
}
catch (Throwable throwable)
{
@@ -1203,7 +1210,10 @@
GL11.glPushMatrix();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ ForgeHooksClient.setRenderPass(0);
renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
+ ForgeHooksClient.setRenderPass(0);
+ // ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water}
this.func_78463_b((double)p_78471_1_);
this.field_78531_r.field_71424_I.func_76318_c("litParticles");
effectrenderer.func_78872_b(entitylivingbase, p_78471_1_);
@@ -1221,7 +1231,10 @@
entityplayer = (EntityPlayer)entitylivingbase;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.field_78531_r.field_71424_I.func_76318_c("outline");
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
+ {
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ }
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
}
@@ -1234,14 +1247,17 @@
entityplayer = (EntityPlayer)entitylivingbase;
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -1145,7 +1139,7 @@
if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR)
{
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
+ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
}
else
{
@@ -1296,7 +1290,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
renderglobal.func_180446_a(entity, frustum, p_175068_2_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
RenderHelper.func_74518_a();
this.func_175072_h();
GlStateManager.func_179128_n(5888);
@@ -1308,6 +1304,7 @@
entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
+ {
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ }
GL11.glEnable(GL11.GL_ALPHA_TEST);
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1321,6 +1318,7 @@
entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1373,6 +1371,16 @@
renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
}
this.field_78531_r.field_71424_I.func_76318_c("destroyProgress");
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(770, 1, 1, 0);
- renderglobal.func_72717_a(Tessellator.field_78398_a, (EntityPlayer)entitylivingbase, p_78471_1_);
+ renderglobal.drawBlockDamageTexture(Tessellator.field_78398_a, entitylivingbase, p_78471_1_);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_CULL_FACE);
@@ -1296,6 +1312,16 @@
renderglobal.func_72719_a(entitylivingbase, 1, (double)p_78471_1_);
}
+ if (this.field_78532_q == 0) //Only render if render pass 0 happens as well.
+ {
+ RenderHelper.func_74519_b();
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
+ ForgeHooksClient.setRenderPass(1);
+ renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
+ ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
+ if (!this.field_175078_W) //Only render if render pass 0 happens as well.
+ {
+ RenderHelper.func_74519_b();
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
+ renderglobal.func_180446_a(entity, frustum, p_175068_2_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
+
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
@@ -1307,9 +1333,12 @@
this.func_82829_a(renderglobal, p_78471_1_);
}
GlStateManager.func_179103_j(7424);
GlStateManager.func_179132_a(true);
GlStateManager.func_179089_o();
@@ -1385,8 +1393,12 @@
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_);
}
+ this.field_78531_r.field_71424_I.func_76318_c("FRenderLast");
+ ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_);
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_);
+
this.field_78531_r.field_71424_I.func_76318_c("hand");
this.field_78531_r.field_71424_I.func_76318_c("hand");
- if (this.field_78503_V == 1.0D)
+ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.field_78503_V == 1.0D)
{
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
this.func_78476_b(p_78471_1_, j);
@@ -1425,6 +1454,13 @@
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_))
if (this.field_175074_C)
{
GlStateManager.func_179086_m(256);
@@ -1498,6 +1510,13 @@
protected void func_78474_d(float p_78474_1_)
{
+ IRenderHandler renderer = null;
+ if ((renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ return;
@@ -165,31 +113,36 @@
float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (f1 > 0.0F)
@@ -1774,6 +1810,13 @@
this.field_78533_p = f7;
@@ -1835,6 +1854,13 @@
this.field_175081_S = f8;
}
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.field_78518_n, this.field_78519_o, this.field_78533_p);
+ MinecraftForge.EVENT_BUS.post(event);
+
+ this.field_78518_n = event.red;
+ this.field_78533_p = event.blue;
+ this.field_78519_o = event.green;
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+
GL11.glClearColor(this.field_78518_n, this.field_78519_o, this.field_78533_p, 0.0F);
+ this.field_175080_Q = event.red;
+ this.field_175082_R = event.green;
+ this.field_175081_S = event.blue;
+
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
}
@@ -1809,6 +1852,13 @@
Block block = ActiveRenderInfo.func_151460_a(this.field_78531_r.field_71441_e, entitylivingbase, p_78468_2_);
float f1;
@@ -1854,6 +1880,10 @@
Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
float f1;
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, 0.1F, p_78468_2_);
+
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ GL11.glFogf(GL11.GL_FOG_DENSITY, event.density);
+ }
+ else
if (entitylivingbase.func_70644_a(Potion.field_76440_q))
{
f1 = 5.0F;
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F);
+ if (hook >= 0)
+ GlStateManager.func_179095_a(hook);
+ else
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q))
{
f1 = 5.0F;
@@ -1931,6 +1961,7 @@
GlStateManager.func_179102_b(f1 * 0.05F);
GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F);
}
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f1);
}
GlStateManager.func_179142_g();
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
@@ -83,6 +83,8 @@
this.func_73729_b(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18);
}
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
+ if (!potion.shouldRenderInvText(potioneffect)) continue;
String s1 = I18n.func_135052_a(potion.func_76393_a(), new Object[0]);
if (potioneffect.func_76458_c() == 1)
@@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
@@ -52,6 +52,11 @@
}
}
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartItemModel)
+ {
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(p_178089_1_);
+ }
+
if (ibakedmodel == null)
{
ibakedmodel = this.field_178090_d.func_174951_a();
@@ -1,122 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
@@ -20,6 +20,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
+import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
@@ -28,6 +29,13 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.IItemRenderer;
+import net.minecraftforge.client.IItemRenderer.ItemRenderType;
+import net.minecraftforge.client.MinecraftForgeClient;
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
+
@SideOnly(Side.CLIENT)
public class ItemRenderer
{
@@ -49,13 +57,24 @@
public void func_78443_a(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_)
{
+ this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED);
+ }
+
+ public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type)
+ {
GL11.glPushMatrix();
TextureManager texturemanager = this.field_78455_a.func_110434_K();
Item item = p_78443_2_.func_77973_b();
Block block = Block.func_149634_a(item);
- if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type);
+ if (customRenderer != null)
{
+ texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d()));
+ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, p_78443_1_, p_78443_2_);
+ }
+ else if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b()))
+ {
texturemanager.func_110577_a(texturemanager.func_130087_a(0));
if (p_78443_2_ != null && p_78443_2_.func_77973_b() instanceof ItemCloth)
@@ -100,7 +119,7 @@
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
func_78439_a(tessellator, f1, f2, f, f3, iicon.func_94211_a(), iicon.func_94216_b(), 0.0625F);
- if (p_78443_2_.func_77962_s() && p_78443_3_ == 0)
+ if (p_78443_2_.hasEffect(p_78443_3_))
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -273,7 +292,7 @@
Render render;
RenderPlayer renderplayer;
- if (itemstack != null && itemstack.func_77973_b() == Items.field_151098_aY)
+ if (itemstack != null && itemstack.func_77973_b() instanceof ItemMap)
{
GL11.glPushMatrix();
f13 = 0.8F;
@@ -340,12 +359,21 @@
tessellator.func_78374_a((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
tessellator.func_78374_a((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
tessellator.func_78381_a();
- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_78455_a.field_71441_e);
- if (mapdata != null)
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
+ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).func_77873_a(itemstack, this.field_78455_a.field_71441_e);
+
+ if (custom == null)
{
- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
+ if (mapdata != null)
+ {
+ this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
+ }
}
+ else
+ {
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, field_78455_a.field_71439_g, field_78455_a.func_110434_K(), mapdata);
+ }
GL11.glPopMatrix();
}
@@ -446,17 +474,20 @@
if (itemstack.func_77973_b().func_77623_v())
{
- this.func_78443_a(entityclientplayermp, itemstack, 0);
- int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1);
- f10 = (float)(k1 >> 16 & 255) / 255.0F;
- f11 = (float)(k1 >> 8 & 255) / 255.0F;
- f12 = (float)(k1 & 255) / 255.0F;
- GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
- this.func_78443_a(entityclientplayermp, itemstack, 1);
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
+ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++)
+ {
+ int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1);
+ f10 = (float)(k1 >> 16 & 255) / 255.0F;
+ f11 = (float)(k1 >> 8 & 255) / 255.0F;
+ f12 = (float)(k1 & 255) / 255.0F;
+ GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
+ this.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON);
+ }
}
else
{
- this.func_78443_a(entityclientplayermp, itemstack, 0);
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
}
GL11.glPopMatrix();
@@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
@@ -24,6 +24,10 @@
public static boolean field_148824_g;
@@ -78,6 +78,10 @@
public static int field_148826_e;
private static final String __OBFID = "CL_00001179";
+ /* Stores the last values sent into setLightmapTextureCoords */
@@ -10,8 +10,8 @@
+
public static void func_77474_a()
{
field_77477_c = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13;
@@ -82,6 +86,12 @@
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
@@ -813,6 +817,12 @@
{
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
}
@@ -1,128 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java
@@ -52,6 +52,8 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
@SideOnly(Side.CLIENT)
public class RenderBlocks
{
@@ -336,9 +338,9 @@
public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_)
{
Tessellator tessellator = Tessellator.field_78398_a;
- int l = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_);
- int i1 = BlockBed.func_149895_l(l);
- boolean flag = BlockBed.func_149975_b(l);
+ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_);
+ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
+ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
float f = 0.5F;
float f1 = 1.0F;
float f2 = 0.8F;
@@ -347,6 +349,7 @@
tessellator.func_78380_c(j1);
tessellator.func_78386_a(f, f, f);
IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0);
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
double d0 = (double)iicon.func_94209_e();
double d1 = (double)iicon.func_94212_f();
double d2 = (double)iicon.func_94206_g();
@@ -363,6 +366,7 @@
tessellator.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_));
tessellator.func_78386_a(f1, f1, f1);
iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1);
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
d0 = (double)iicon.func_94209_e();
d1 = (double)iicon.func_94212_f();
d2 = (double)iicon.func_94206_g();
@@ -2037,7 +2041,7 @@
double d10;
double d11;
- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_))
+ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP))
{
float f2 = 0.2F;
float f1 = 0.0625F;
@@ -2057,7 +2061,7 @@
d0 = d5;
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST))
{
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3);
@@ -2069,7 +2073,7 @@
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST))
{
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3);
@@ -2081,7 +2085,7 @@
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH))
{
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3);
@@ -2093,7 +2097,7 @@
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH))
{
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3);
@@ -2105,7 +2109,7 @@
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN))
{
d5 = (double)p_147801_2_ + 0.5D + 0.5D;
d6 = (double)p_147801_2_ + 0.5D - 0.5D;
@@ -3118,10 +3122,10 @@
double d16 = (double)p_147767_2_ + 0.5D + 0.0625D;
double d17 = (double)p_147767_4_ + 0.5D - 0.0625D;
double d18 = (double)p_147767_4_ + 0.5D + 0.0625D;
- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1));
- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1));
- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_));
- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_));
+ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH);
+ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH);
+ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST );
+ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST );
boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1);
boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0);
double d19 = 0.01D;
@@ -8218,4 +8222,18 @@
return (IIcon)p_147758_1_;
}
+
+ /*==================================== FORGE START ===========================================*/
+ private static RenderBlocks instance;
+ /**
+ * Returns a single lazy loaded instance of RenderBlocks, for use in mods who
+ * don't care about the interaction of other objects on the current state of the RenderBlocks they are using.
+ * @return A global instance of RenderBlocks
+ */
+ public static RenderBlocks getInstance()
+ {
+ if (instance == null) instance = new RenderBlocks();
+ return instance;
+ }
+ /*==================================== FORGE END =============================================*/
}
@@ -1,130 +1,134 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -79,6 +79,9 @@
import org.lwjgl.opengl.ARBOcclusionQuery;
import org.lwjgl.opengl.GL11;
@@ -517,8 +517,10 @@
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.MinecraftForgeClient;
+
@SideOnly(Side.CLIENT)
public class RenderGlobal implements IWorldAccess
{
@@ -375,8 +378,10 @@
public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_)
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
{
+ int pass = MinecraftForgeClient.getRenderPass();
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
if (this.field_72740_G > 0)
{
+ if (pass > 0) return;
--this.field_72740_G;
}
else
@@ -387,9 +392,12 @@
@@ -529,9 +531,12 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_);
RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_);
TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
+ if (pass == 0) // no indentation to shrink patch
+ {
this.field_72748_H = 0;
this.field_72749_I = 0;
this.field_72750_J = 0;
+ }
EntityLivingBase entitylivingbase1 = this.field_72777_q.field_71451_h;
double d3 = entitylivingbase1.field_70142_S + (entitylivingbase1.field_70165_t - entitylivingbase1.field_70142_S) * (double)p_147589_3_;
double d4 = entitylivingbase1.field_70137_T + (entitylivingbase1.field_70163_u - entitylivingbase1.field_70137_T) * (double)p_147589_3_;
@@ -418,13 +426,17 @@
this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_);
Entity entity1 = this.field_72777_q.func_175606_aa();
double d3 = entity1.field_70142_S + (entity1.field_70165_t - entity1.field_70142_S) * (double)p_180446_3_;
double d4 = entity1.field_70137_T + (entity1.field_70163_u - entity1.field_70137_T) * (double)p_180446_3_;
@@ -543,13 +548,17 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List list = this.field_72769_h.func_72910_y();
+ if (pass == 0) // no indentation for smaller patch size
+ if (pass == 0) // no indentation to shrink patch
+ {
this.field_72748_H = list.size();
+ }
int i;
Entity entity;
Entity entity2;
for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i)
{
entity = (Entity)this.field_72769_h.field_73007_j.get(i);
+ if (!entity.shouldRenderInPass(pass)) continue;
entity2 = (Entity)this.field_72769_h.field_73007_j.get(i);
+ if (!entity2.shouldRenderInPass(pass)) continue;
++this.field_72749_I;
if (entity.func_145770_h(d0, d1, d2))
@@ -438,6 +450,7 @@
for (i = 0; i < list.size(); ++i)
{
entity = (Entity)list.get(i);
+ if (!entity.shouldRenderInPass(pass)) continue;
boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.field_70158_ak || p_147589_2_.func_78546_a(entity.field_70121_D) || entity.field_70153_n == this.field_72777_q.field_71439_g);
if (entity2.func_145770_h(d0, d1, d2))
@@ -571,6 +580,7 @@
for (i = 0; i < list.size(); ++i)
{
entity2 = (Entity)list.get(i);
+ if (!entity2.shouldRenderInPass(pass)) continue;
boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn();
boolean flag1 = entity2.func_145770_h(d0, d1, d2) && (entity2.field_70158_ak || p_180446_2_.func_78546_a(entity2.func_174813_aQ()) || entity2.field_70153_n == this.field_72777_q.field_71439_g) && entity2 instanceof EntityPlayer;
if (!flag && entity instanceof EntityLiving)
@@ -463,7 +476,11 @@
@@ -605,6 +615,7 @@
while (iterator2.hasNext())
{
Entity entity3 = (Entity)iterator2.next();
+ if (!entity3.shouldRenderInPass(pass)) continue;
boolean flag2 = this.field_175010_j.func_178635_a(entity3, p_180446_2_, d0, d1, d2) || entity3.field_70153_n == this.field_72777_q.field_71439_g;
for (i = 0; i < this.field_147598_a.size(); ++i)
{
- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_);
+ TileEntity tile = (TileEntity)this.field_147598_a.get(i);
+ if (tile.shouldRenderInPass(pass) && p_147589_2_.func_78546_a(tile.getRenderBoundingBox()))
+ {
+ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_);
+ }
if (flag2)
@@ -640,6 +651,7 @@
while (iterator1.hasNext())
{
tileentity = (TileEntity)iterator1.next();
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
}
}
@@ -671,7 +683,7 @@
this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_);
@@ -933,6 +950,12 @@
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
public void func_72714_a(float p_72714_1_)
- if (tileentity != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull))
+ if (tileentity != null && tileentity.shouldRenderInPass(pass) && tileentity.canRenderBreaking() && p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox()))
{
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, destroyblockprogress.func_73106_e());
}
@@ -1151,6 +1163,12 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)
{
+ IRenderHandler skyProvider = null;
+ if ((skyProvider = this.field_72777_q.field_71441_e.field_73011_w.getSkyRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
+ if (renderer != null)
+ {
+ skyProvider.render(p_72714_1_, this.field_72769_h, field_72777_q);
+ renderer.render(p_174976_1_, field_72769_h, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1)
if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1)
{
GL11.glDisable(GL11.GL_FOG);
@@ -1171,6 +1194,12 @@
this.func_180448_r();
@@ -1381,6 +1399,12 @@
public void func_72718_b(float p_72718_1_)
public void func_180447_b(float p_180447_1_, int p_180447_2_)
{
+ IRenderHandler renderer = null;
+ if ((renderer = field_72769_h.field_73011_w.getCloudRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_72718_1_, field_72769_h, field_72777_q);
+ renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
{
if (this.field_72777_q.field_71474_y.field_74347_j)
@@ -1571,6 +1600,11 @@
@@ -1805,8 +1829,11 @@
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
public void func_72717_a(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_)
{
+ drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_);
+ }
+
+ public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityLivingBase p_72717_2_, float p_72717_3_)
+ {
double d0 = p_72717_2_.field_70142_S + (p_72717_2_.field_70165_t - p_72717_2_.field_70142_S) * (double)p_72717_3_;
double d1 = p_72717_2_.field_70137_T + (p_72717_2_.field_70163_u - p_72717_2_.field_70137_T) * (double)p_72717_3_;
double d2 = p_72717_2_.field_70136_U + (p_72717_2_.field_70161_v - p_72717_2_.field_70136_U) * (double)p_72717_3_;
@@ -1789,12 +1823,15 @@
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
+ if (!hasBreak)
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{
@@ -1949,13 +1976,16 @@
if (p_174961_1_ != null)
{
ItemRecord itemrecord = ItemRecord.func_150926_b(p_72702_1_);
ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_);
+ ResourceLocation resource = null;
if (itemrecord != null)
{
this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
+ resource = itemrecord.getRecordResource(p_72702_1_);
+ resource = itemrecord.getRecordResource(p_174961_1_);
}
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_72702_1_), (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
+ if (resource == null) resource = new ResourceLocation(p_72702_1_);
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
this.field_147593_P.put(chunkcoordinates, positionedsoundrecord);
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
+ if (resource == null) resource = new ResourceLocation(p_174961_1_);
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
this.field_147593_P.put(p_174961_2_, positionedsoundrecord);
this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
}
@@ -1,145 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java
@@ -7,6 +7,7 @@
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
+import java.util.Arrays;
import java.util.PriorityQueue;
import net.minecraft.client.shader.TesselatorVertexState;
import net.minecraft.client.util.QuadComparator;
@@ -15,10 +16,17 @@
@SideOnly(Side.CLIENT)
public class Tessellator
{
- private ByteBuffer field_78394_d;
- private IntBuffer field_147568_c;
- private FloatBuffer field_147566_d;
- private ShortBuffer field_147567_e;
+ private static int nativeBufferSize = 0x200000;
+ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6;
+ public static boolean renderingWorldRenderer = false;
+ public boolean defaultTexture = false;
+ private int rawBufferSize = 0;
+ public int textureID = 0;
+
+ private static ByteBuffer field_78394_d = GLAllocation.func_74524_c(nativeBufferSize * 4);
+ private static IntBuffer field_147568_c = field_78394_d.asIntBuffer();
+ private static FloatBuffer field_147566_d = field_78394_d.asFloatBuffer();
+ private static ShortBuffer field_147567_e = field_78394_d.asShortBuffer();
private int[] field_78405_h;
private int field_78406_i;
private double field_78403_j;
@@ -44,14 +52,17 @@
private Tessellator(int p_i1250_1_)
{
- this.field_78388_E = p_i1250_1_;
- this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4);
- this.field_147568_c = this.field_78394_d.asIntBuffer();
- this.field_147566_d = this.field_78394_d.asFloatBuffer();
- this.field_147567_e = this.field_78394_d.asShortBuffer();
- this.field_78405_h = new int[p_i1250_1_];
}
+ public Tessellator()
+ {
+ }
+
+ static
+ {
+ field_78398_a.defaultTexture = true;
+ }
+
public int func_78381_a()
{
if (!this.field_78415_z)
@@ -62,12 +73,15 @@
{
this.field_78415_z = false;
- if (this.field_78406_i > 0)
+ int offs = 0;
+ while (offs < field_78406_i)
{
+ int vtc = Math.min(field_78406_i - offs, nativeBufferSize >> 5);
this.field_147568_c.clear();
- this.field_147568_c.put(this.field_78405_h, 0, this.field_147569_p);
+ this.field_147568_c.put(this.field_78405_h, offs * 8, vtc * 8);
this.field_78394_d.position(0);
- this.field_78394_d.limit(this.field_147569_p * 4);
+ this.field_78394_d.limit(vtc * 32);
+ offs += vtc;
if (this.field_78400_o)
{
@@ -102,7 +116,7 @@
this.field_147566_d.position(0);
GL11.glVertexPointer(3, 32, this.field_147566_d);
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
- GL11.glDrawArrays(this.field_78409_u, 0, this.field_78406_i);
+ GL11.glDrawArrays(this.field_78409_u, 0, vtc);
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
if (this.field_78400_o)
@@ -128,6 +142,12 @@
}
}
+ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3))
+ {
+ rawBufferSize = 0x10000;
+ field_78405_h = new int[rawBufferSize];
+ }
+
int i = this.field_147569_p * 4;
this.func_78379_d();
return i;
@@ -162,6 +182,14 @@
public void func_147565_a(TesselatorVertexState p_147565_1_)
{
+ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0)
+ {
+ rawBufferSize <<= 1;
+ }
+ if (rawBufferSize > field_78405_h.length)
+ {
+ field_78405_h = new int[rawBufferSize];
+ }
System.arraycopy(p_147565_1_.func_147572_a(), 0, this.field_78405_h, 0, p_147565_1_.func_147572_a().length);
this.field_147569_p = p_147565_1_.func_147576_b();
this.field_78406_i = p_147565_1_.func_147575_c();
@@ -296,6 +324,19 @@
public void func_78377_a(double p_78377_1_, double p_78377_3_, double p_78377_5_)
{
+ if (field_147569_p >= rawBufferSize - 32)
+ {
+ if (rawBufferSize == 0)
+ {
+ rawBufferSize = 0x10000;
+ field_78405_h = new int[rawBufferSize];
+ }
+ else
+ {
+ rawBufferSize *= 2;
+ field_78405_h = Arrays.copyOf(field_78405_h, rawBufferSize);
+ }
+ }
++this.field_78411_s;
if (this.field_78400_o)
@@ -324,12 +365,6 @@
this.field_78405_h[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.field_78417_x));
this.field_147569_p += 8;
++this.field_78406_i;
-
- if (this.field_78406_i % 4 == 0 && this.field_147569_p >= this.field_78388_E - 32)
- {
- this.func_78381_a();
- this.field_78415_z = true;
- }
}
public void func_78378_d(int p_78378_1_)
@@ -1,85 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
@@ -28,7 +28,7 @@
private TesselatorVertexState field_147894_y;
public World field_78924_a;
private int field_78942_y = -1;
- private static Tessellator field_78941_z = Tessellator.field_78398_a;
+ //private static Tessellator tessellator = Tessellator.instance;
public static int field_78922_b;
public int field_78923_c;
public int field_78920_d;
@@ -132,6 +132,7 @@
{
++field_78922_b;
RenderBlocks renderblocks = new RenderBlocks(chunkcache);
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(renderblocks);
this.field_78917_C = 0;
this.field_147894_y = null;
@@ -157,7 +158,7 @@
this.func_147890_b(k2);
}
- if (k2 == 0 && block.func_149716_u())
+ if (k2 == 0 && block.hasTileEntity(chunkcache.func_72805_g(j3, l2, i3)))
{
TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3);
@@ -173,7 +174,9 @@
{
flag = true;
}
- else if (k3 == k2)
+
+ if (!block.canRenderInPass(k2)) continue;
+
{
flag1 |= renderblocks.func_147805_b(block, j3, l2, i3);
@@ -210,6 +213,7 @@
break;
}
}
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(null);
}
HashSet hashset1 = new HashSet();
@@ -232,21 +236,23 @@
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
GL11.glScalef(f, f, f);
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
- field_78941_z.func_78382_b();
- field_78941_z.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
+ net.minecraftforge.client.ForgeHooksClient.onPreRenderWorld(this, p_147890_1_);
+ Tessellator.field_78398_a.func_78382_b();
+ Tessellator.field_78398_a.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
}
private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_)
{
if (p_147891_1_ == 1 && !this.field_78928_m[p_147891_1_])
{
- this.field_147894_y = field_78941_z.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
+ this.field_147894_y = Tessellator.field_78398_a.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
}
- this.field_78917_C += field_78941_z.func_78381_a();
+ this.field_78917_C += Tessellator.field_78398_a.func_78381_a();
+ net.minecraftforge.client.ForgeHooksClient.onPostRenderWorld(this, p_147891_1_);
GL11.glPopMatrix();
GL11.glEndList();
- field_78941_z.func_78373_b(0.0D, 0.0D, 0.0D);
+ Tessellator.field_78398_a.func_78373_b(0.0D, 0.0D, 0.0D);
}
public void func_147889_b(EntityLivingBase p_147889_1_)
@@ -254,7 +260,7 @@
if (this.field_147894_y != null && !this.field_78928_m[1])
{
this.func_147890_b(1);
- field_78941_z.func_147565_a(this.field_147894_y);
+ Tessellator.field_78398_a.func_147565_a(this.field_147894_y);
this.func_147891_a(1, p_147889_1_);
}
}
@@ -0,0 +1,70 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
@@ -29,35 +29,9 @@
while (iterator.hasNext())
{
+ // moved to VertexFormatElement.preDraw
vertexformatelement = (VertexFormatElement)iterator.next();
- enumusage = vertexformatelement.func_177375_c();
- k = vertexformatelement.func_177367_b().func_177397_c();
- int l = vertexformatelement.func_177369_e();
-
- switch (WorldVertexBufferUploader.SwitchEnumUsage.field_178958_a[enumusage.ordinal()])
- {
- case 1:
- bytebuffer.position(vertexformatelement.func_177373_a());
- GL11.glVertexPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
- break;
- case 2:
- bytebuffer.position(vertexformatelement.func_177373_a());
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l);
- GL11.glTexCoordPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
- GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case 3:
- bytebuffer.position(vertexformatelement.func_177373_a());
- GL11.glColorPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
- GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
- break;
- case 4:
- bytebuffer.position(vertexformatelement.func_177373_a());
- GL11.glNormalPointer(k, j, bytebuffer);
- GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
- }
+ vertexformatelement.func_177375_c().preDraw(vertexformatelement, j, bytebuffer);
}
GL11.glDrawArrays(p_178177_1_.func_178979_i(), 0, p_178177_1_.func_178989_h());
@@ -65,27 +39,9 @@
while (iterator.hasNext())
{
+ // moved to VertexFormatElement.postDraw
vertexformatelement = (VertexFormatElement)iterator.next();
- enumusage = vertexformatelement.func_177375_c();
- k = vertexformatelement.func_177369_e();
-
- switch (WorldVertexBufferUploader.SwitchEnumUsage.field_178958_a[enumusage.ordinal()])
- {
- case 1:
- GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
- break;
- case 2:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k);
- GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case 3:
- GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
- GlStateManager.func_179117_G();
- break;
- case 4:
- GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
- }
+ vertexformatelement.func_177375_c().postDraw(vertexformatelement, j, bytebuffer);
}
}
@@ -0,0 +1,76 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
@@ -22,7 +22,12 @@
public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
{
- int[] aint = this.func_178405_a(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
+ return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.client.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
+ }
+
+ public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.client.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
+ {
+ int[] aint = this.makeQuadVertexData(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
EnumFacing enumfacing1 = func_178410_a(aint);
if (p_178414_8_)
@@ -40,11 +45,16 @@
private int[] func_178405_a(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, ModelRotation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_)
{
+ return makeQuadVertexData(p_178405_1_, p_178405_2_, p_178405_3_, p_178405_4_, (net.minecraftforge.client.model.ITransformation)p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
+ }
+
+ private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_)
+ {
int[] aint = new int[28];
for (int i = 0; i < 4; ++i)
{
- this.func_178402_a(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
+ this.fillVertexData(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
}
return aint;
@@ -90,12 +100,17 @@
private void func_178402_a(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, ModelRotation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_)
{
- EnumFacing enumfacing1 = p_178402_7_.func_177523_a(p_178402_3_);
+ fillVertexData(p_178402_1_, p_178402_2_, p_178402_3_, p_178402_4_, p_178402_5_, p_178402_6_, (net.minecraftforge.client.model.ITransformation)p_178402_7_, p_178402_8_, p_178402_9_, p_178402_10_);
+ }
+
+ private void fillVertexData(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, net.minecraftforge.client.model.ITransformation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_)
+ {
+ EnumFacing enumfacing1 = p_178402_7_.rotate(p_178402_3_);
int j = p_178402_10_ ? this.func_178413_a(enumfacing1) : -1;
EnumFaceDirection.VertexInformation vertexinformation = EnumFaceDirection.func_179027_a(p_178402_3_).func_179025_a(p_178402_2_);
Vector3d vector3d = new Vector3d((double)p_178402_5_[vertexinformation.field_179184_a], (double)p_178402_5_[vertexinformation.field_179182_b], (double)p_178402_5_[vertexinformation.field_179183_c]);
this.func_178407_a(vector3d, p_178402_8_);
- int k = this.func_178415_a(vector3d, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_);
+ int k = this.rotateVertex(vector3d, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_);
this.func_178404_a(p_178402_1_, k, p_178402_2_, vector3d, j, p_178402_6_, p_178402_4_.field_178243_e);
}
@@ -156,14 +171,19 @@
public int func_178415_a(Vector3d p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, ModelRotation p_178415_4_, boolean p_178415_5_)
{
+ return rotateVertex(p_178415_1_, p_178415_2_, p_178415_3_, (net.minecraftforge.client.model.ITransformation)p_178415_4_, p_178415_5_);
+ }
+
+ public int rotateVertex(Vector3d p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, net.minecraftforge.client.model.ITransformation p_178415_4_, boolean p_178415_5_)
+ {
if (p_178415_4_ == ModelRotation.X0_Y0)
{
return p_178415_3_;
}
else
{
- this.func_178406_a(p_178415_1_, new Vector3d(0.5D, 0.5D, 0.5D), p_178415_4_.func_177525_a(), new Vector3d(1.0D, 1.0D, 1.0D));
- return p_178415_4_.func_177520_a(p_178415_2_, p_178415_3_);
+ this.func_178406_a(p_178415_1_, new Vector3d(0.5D, 0.5D, 0.5D), new Matrix4d(p_178415_4_.getMatrix()), new Vector3d(1.0D, 1.0D, 1.0D));
+ return p_178415_4_.rotate(p_178415_2_, p_178415_3_);
}
}
@@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
@@ -8,7 +8,11 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
+/*
+ * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead
+ */
@SideOnly(Side.CLIENT)
+@Deprecated
public class ItemCameraTransforms
{
public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a);
@@ -0,0 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
@@ -13,9 +13,14 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
+/*
+ * @deprecated use {@link net.minecraftforge.client.model.IModelState} and {@link net.minecraftforge.client.model.TRSRTransformation}
+ */
@SideOnly(Side.CLIENT)
-public class ItemTransformVec3f
+@Deprecated
+public class ItemTransformVec3f implements net.minecraftforge.client.model.IModelState
{
+ public net.minecraftforge.client.model.TRSRTransformation apply(net.minecraftforge.client.model.IModelPart part) { return new net.minecraftforge.client.model.TRSRTransformation(this); }
public static final ItemTransformVec3f field_178366_a = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F));
public final Vector3f field_178364_b;
public final Vector3f field_178365_c;
@@ -0,0 +1,30 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -150,7 +150,7 @@
visgraph.func_178606_a(mutableblockpos);
}
- if (block.func_149716_u())
+ if (block.hasTileEntity(iblockstate))
{
TileEntity tileentity = regionrendercache.func_175625_s(new BlockPos(mutableblockpos));
@@ -160,7 +160,9 @@
}
}
- EnumWorldBlockLayer enumworldblocklayer1 = block.func_180664_k();
+ for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) {
+ if(!block.canRenderInLayer(enumworldblocklayer1)) continue;
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1);
int i = enumworldblocklayer1.ordinal();
if (block.func_149645_b() != -1)
@@ -178,6 +180,7 @@
compiledchunk.func_178486_a(enumworldblocklayer1);
}
}
+ }
}
EnumWorldBlockLayer[] aenumworldblocklayer = EnumWorldBlockLayer.values();
@@ -1,138 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
@@ -15,9 +15,15 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.IItemRenderer;
+import net.minecraftforge.client.MinecraftForgeClient;
@SideOnly(Side.CLIENT)
public class RenderBiped extends RenderLiving
@@ -49,11 +55,13 @@
this.field_82425_h = new ModelBiped(0.5F);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
public static ResourceLocation func_110857_a(ItemArmor p_110857_0_, int p_110857_1_)
{
return func_110858_a(p_110857_0_, p_110857_1_, (String)null);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
public static ResourceLocation func_110858_a(ItemArmor p_110858_0_, int p_110858_1_, String p_110858_2_)
{
String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {field_82424_k[p_110858_0_.field_77880_c], Integer.valueOf(p_110858_1_ == 2 ? 2 : 1), p_110858_2_ == null ? "" : String.format("_%s", new Object[]{p_110858_2_})});
@@ -79,7 +87,7 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
- this.func_110776_a(func_110857_a(itemarmor, p_130006_2_));
+ this.func_110776_a(getArmorResource(p_130006_1_, itemstack, p_130006_2_, null));
ModelBiped modelbiped = p_130006_2_ == 2 ? this.field_82425_h : this.field_82423_g;
modelbiped.field_78116_c.field_78806_j = p_130006_2_ == 0;
modelbiped.field_78114_d.field_78806_j = p_130006_2_ == 0;
@@ -88,14 +96,16 @@
modelbiped.field_78113_g.field_78806_j = p_130006_2_ == 1;
modelbiped.field_78123_h.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
modelbiped.field_78124_i.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
+ modelbiped = ForgeHooksClient.getArmorModel(p_130006_1_, itemstack, p_130006_2_, modelbiped);
this.func_77042_a(modelbiped);
modelbiped.field_78095_p = this.field_77045_g.field_78095_p;
modelbiped.field_78093_q = this.field_77045_g.field_78093_q;
modelbiped.field_78091_s = this.field_77045_g.field_78091_s;
- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH)
+ //Move out of if to allow for more then just CLOTH to have color
+ int j = itemarmor.func_82814_b(itemstack);
+ if (j != -1)
{
- int j = itemarmor.func_82814_b(itemstack);
float f1 = (float)(j >> 16 & 255) / 255.0F;
float f2 = (float)(j >> 8 & 255) / 255.0F;
float f3 = (float)(j & 255) / 255.0F;
@@ -133,7 +143,7 @@
if (item instanceof ItemArmor)
{
- this.func_110776_a(func_110858_a((ItemArmor)item, p_82408_2_, "overlay"));
+ this.func_110776_a(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay"));
float f1 = 1.0F;
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
@@ -184,9 +194,12 @@
this.field_77071_a.field_78116_c.func_78794_c(0.0625F);
item = itemstack1.func_77973_b();
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
+
if (item instanceof ItemBlock)
{
- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
{
f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
@@ -229,7 +242,10 @@
this.field_77071_a.field_78112_f.func_78794_c(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
+
+ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())))
{
f1 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
@@ -278,7 +294,7 @@
if (itemstack.func_77973_b().func_77623_v())
{
- for (i = 0; i <= 1; ++i)
+ for (i = 0; i < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++i)
{
int j = itemstack.func_77973_b().func_82790_a(itemstack, i);
f2 = (float)(j >> 16 & 255) / 255.0F;
@@ -336,4 +352,33 @@
{
this.func_76986_a((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
+
+ /*=================================== FORGE START =========================================*/
+ /**
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
+ *
+ * @param entity Entity wearing the armor
+ * @param stack ItemStack for the armor
+ * @param slot Slot ID that the item is in
+ * @param type Subtype, can be null or "overlay"
+ * @return ResourceLocation pointing at the armor's texture
+ */
+ public static ResourceLocation getArmorResource(Entity entity, ItemStack stack, int slot, String type)
+ {
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
+ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png",
+ field_82424_k[item.field_77880_c], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type));
+
+ s1 = ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
+ ResourceLocation resourcelocation = (ResourceLocation)field_110859_k.get(s1);
+
+ if (resourcelocation == null)
+ {
+ resourcelocation = new ResourceLocation(s1);
+ field_110859_k.put(s1, resourcelocation);
+ }
+
+ return resourcelocation;
+ }
+ /*=================================== FORGE END ===========================================*/
}
@@ -0,0 +1,67 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
@@ -42,7 +42,7 @@
boolean flag = p_177077_9_.func_177556_c();
int i = this.func_177078_a(itemstack);
float f1 = 0.25F;
- float f2 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F;
+ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0.0F;
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f2 + 0.25F, (float)p_177077_6_);
float f3;
@@ -109,6 +109,9 @@
IBakedModel ibakedmodel = this.field_177080_a.func_175037_a().func_178089_a(itemstack);
int i = this.func_177077_a(p_177075_1_, p_177075_2_, p_177075_4_, p_177075_6_, p_177075_9_, ibakedmodel);
+ // Forge: Call to IItemRenderer, For now Its disabled.
+ //i = net.minecraftforge.client.ForgeHooksClient.renderEntityItem(p_177075_1_, itemstack, this.field_177079_e, this.renderManager.renderEngine, i);
+
for (int j = 0; j < i; ++j)
{
if (ibakedmodel.func_177556_c())
@@ -129,8 +132,19 @@
}
else
{
+ GlStateManager.func_179094_E();
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
+ if (j > 0 && shouldSpreadItems())
+ {
+ float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f3 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f4 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ GlStateManager.func_179109_b(f2, f3, 0.046875F);
+ }
this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ if (!shouldSpreadItems())
GlStateManager.func_179109_b(0.0F, 0.0F, 0.046875F);
+ GlStateManager.func_179121_F();
}
}
@@ -161,4 +175,25 @@
{
this.func_177075_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
+
+ /*==================================== FORGE START ===========================================*/
+
+ /**
+ * Items should spread out when rendered in 3d?
+ * @return
+ */
+ public boolean shouldSpreadItems()
+ {
+ return true;
+ }
+
+ /**
+ * Items should have a bob effect
+ * @return
+ */
+ public boolean shouldBob()
+ {
+ return true;
+ }
+ /*==================================== FORGE END =============================================*/
}
Loaded 100 of 470 files, more files were not shown because too many files have changed in this diff. Show more