2014-06-19 19:03:05 +00:00
|
|
|
package net.minecraftforge.client.event;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2015-06-25 17:07:27 +00:00
|
|
|
import net.minecraft.block.state.IBlockState;
|
2014-06-19 19:03:05 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2016-03-01 12:58:03 +00:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
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 03:56:35 +00:00
|
|
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
2014-06-19 19:03:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a block's texture is going to be overlaid on the player's HUD. Cancel this event to prevent the overlay.
|
|
|
|
*/
|
|
|
|
@Cancelable
|
|
|
|
public class RenderBlockOverlayEvent extends Event {
|
2016-03-24 08:44:52 +00:00
|
|
|
|
2014-06-19 19:03:05 +00:00
|
|
|
public static enum OverlayType {
|
|
|
|
FIRE, BLOCK, WATER
|
|
|
|
}
|
|
|
|
|
2016-03-24 08:44:52 +00:00
|
|
|
private final EntityPlayer player;
|
|
|
|
private final float renderPartialTicks;
|
|
|
|
private final OverlayType overlayType;
|
|
|
|
private final IBlockState blockForOverlay;
|
|
|
|
private final BlockPos blockPos;
|
2014-06-19 19:03:05 +00:00
|
|
|
|
2015-06-25 17:07:27 +00:00
|
|
|
@Deprecated
|
|
|
|
public RenderBlockOverlayEvent(EntityPlayer player, float renderPartialTicks, OverlayType type, Block block, int x, int y, int z)
|
|
|
|
{
|
|
|
|
this(player, renderPartialTicks, type, block.getDefaultState(), new BlockPos(x, y, z));
|
|
|
|
}
|
|
|
|
|
|
|
|
public RenderBlockOverlayEvent(EntityPlayer player, float renderPartialTicks, OverlayType type, IBlockState block, BlockPos blockPos)
|
2014-06-19 19:03:05 +00:00
|
|
|
{
|
|
|
|
this.player = player;
|
|
|
|
this.renderPartialTicks = renderPartialTicks;
|
|
|
|
this.overlayType = type;
|
2015-06-25 17:07:27 +00:00
|
|
|
this.blockForOverlay = block;
|
|
|
|
this.blockPos = blockPos;
|
2014-06-19 19:03:05 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-03-24 08:44:52 +00:00
|
|
|
/**
|
|
|
|
* The player which the overlay will apply to
|
|
|
|
*/
|
|
|
|
public EntityPlayer getPlayer() { return player; }
|
|
|
|
public float getRenderPartialTicks() { return renderPartialTicks; }
|
|
|
|
/**
|
|
|
|
* The type of overlay to occur
|
|
|
|
*/
|
|
|
|
public OverlayType getOverlayType() { return overlayType; }
|
|
|
|
/**
|
|
|
|
* If the overlay type is BLOCK, then this is the block which the overlay is getting it's icon from
|
|
|
|
*/
|
|
|
|
public IBlockState getBlockForOverlay() { return blockForOverlay; }
|
|
|
|
public BlockPos getBlockPos() { return blockPos; }
|
2014-06-19 19:03:05 +00:00
|
|
|
}
|