Files
MinecraftForge/src/main/java/net/minecraftforge/event/AnvilUpdateEvent.java
T
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

33 lines
1.4 KiB
Java

package net.minecraftforge.event;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraft.item.ItemStack;
/**
*
* AnvilUpdateEvent is fired when a player places items in both the left and right slots of a anvil.
* If the event is canceled, vanilla behavior will not run, and the output will be set to null.
* If the event is not canceled, but the output is not null, it will set the output and not run vanilla behavior.
* if the output is null, and the event is not canceled, vanilla behavior will execute.
*/
@Cancelable
public class AnvilUpdateEvent extends Event
{
public final ItemStack left; // The left side of the input
public final ItemStack right; // The right side of the input
public final String name; // The name to set the item, if the user specified one.
public ItemStack output; // Set this to set the output stack
public int cost; // The base cost, set this to change it if output != null
public int materialCost; // The number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack.
public AnvilUpdateEvent(ItemStack left, ItemStack right, String name, int cost)
{
this.left = left;
this.right = right;
this.name = name;
this.cost = cost;
this.materialCost = 0;
}
}