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
2013-11-09 15:57:08 -06:00
2013-03-03 22:45:09 -05:00
2013-11-19 22:37:52 +00:00
2013-11-09 21:48:53 -06:00
2013-11-09 21:48:53 -06:00
2014-08-06 16:29:34 -04:00
2013-11-10 00:54:57 -06:00

*** HOW TO INSTALL ***
For Mod Users:

Download the latest installer from http://files.minecraftforge.net and follow instructions given by the installer.


For Mod Devs:

Download the latest Forge source distribution from http://files.minecraftforge.net and unzip it to a folder.
Open a command prompt, navigate to the directory where you unzipped the Forge sources, and run:
If you have Gradle: gradle setupDevWorkspace
If you DO NOT have Gradle installed:
Windows: ./gradlew.bat setupDevWorkspace
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.

Clone this repository to a folder. 
Open a command prompt and navigate to the folder where you cloned this repo.
Run gradle setupForge to setup your development environment.

To use Eclipse, point your Eclipse workspace at the eclipse folder inside the repo.


Requirements (for both mod devs and contributors):
  You must have a JDK installed and accessible.
  If you do not wish to use the gradle wrapper, you can install Gradle from http://www.gradle.org/ .
 
S
Description
No description provided
Readme
266 MiB
0 Stars 1 Watchers 0 Forks
Languages
Java 98.9%
Groovy 0.5%
CSS 0.5%