2012-09-27 00:54:15 +00:00
|
|
|
package net.minecraftforge.event;
|
2012-12-13 07:27:57 +00:00
|
|
|
|
2014-06-21 21:38:21 +00:00
|
|
|
import java.io.File;
|
2015-03-01 06:53:32 +00:00
|
|
|
import java.util.EnumSet;
|
2013-03-05 04:29:05 +00:00
|
|
|
import java.util.List;
|
2016-05-07 18:17:18 +00:00
|
|
|
import java.util.Random;
|
2014-12-07 08:28:41 +00:00
|
|
|
|
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.minecraft.block.state.IBlockState;
|
2013-12-21 08:10:35 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-01-02 06:20:30 +00:00
|
|
|
import net.minecraft.entity.EntityLiving;
|
2013-10-13 16:21:57 +00:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2013-03-05 04:29:05 +00:00
|
|
|
import net.minecraft.entity.EnumCreatureType;
|
2013-12-21 08:10:35 +00:00
|
|
|
import net.minecraft.entity.effect.EntityLightningBolt;
|
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.minecraft.entity.item.EntityItem;
|
2013-10-13 16:21:57 +00:00
|
|
|
import net.minecraft.entity.monster.EntityZombie;
|
2012-12-13 07:27:57 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
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.minecraft.entity.player.EntityPlayer.EnumStatus;
|
2015-06-25 17:07:27 +00:00
|
|
|
import net.minecraft.init.Blocks;
|
2016-01-12 00:04:22 +00:00
|
|
|
import net.minecraft.item.Item;
|
2012-12-13 07:27:57 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-01-12 00:04:22 +00:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2016-03-02 07:38:31 +00:00
|
|
|
import net.minecraft.util.ActionResult;
|
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.minecraft.util.DamageSource;
|
2016-03-02 07:38:31 +00:00
|
|
|
import net.minecraft.util.EnumActionResult;
|
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.minecraft.util.EnumFacing;
|
2016-03-02 04:42:36 +00:00
|
|
|
import net.minecraft.util.EnumHand;
|
2016-03-08 19:43:05 +00:00
|
|
|
import net.minecraft.util.SoundCategory;
|
2016-03-08 05:06:54 +00:00
|
|
|
import net.minecraft.util.SoundEvent;
|
2016-03-01 08:31:58 +00:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-03-02 04:42:36 +00:00
|
|
|
import net.minecraft.util.math.RayTraceResult;
|
2016-03-07 05:23:00 +00:00
|
|
|
import net.minecraft.util.math.Vec3d;
|
2016-03-02 04:42:36 +00:00
|
|
|
import net.minecraft.util.text.ITextComponent;
|
2014-12-07 08:28:41 +00:00
|
|
|
import net.minecraft.world.Explosion;
|
2013-01-02 06:20:30 +00:00
|
|
|
import net.minecraft.world.World;
|
2013-03-05 04:29:05 +00:00
|
|
|
import net.minecraft.world.WorldServer;
|
2014-12-07 09:52:29 +00:00
|
|
|
import net.minecraft.world.WorldSettings;
|
2014-01-18 05:55:48 +00:00
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
2016-03-05 00:40:34 +00:00
|
|
|
import net.minecraft.world.chunk.ChunkPrimer;
|
|
|
|
import net.minecraft.world.chunk.IChunkGenerator;
|
2014-06-22 18:39:23 +00:00
|
|
|
import net.minecraft.world.storage.IPlayerFileData;
|
|
|
|
import net.minecraft.world.storage.SaveHandler;
|
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.client.event.ClientChatReceivedEvent;
|
2015-06-25 17:07:27 +00:00
|
|
|
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
|
|
|
import net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType;
|
2012-09-27 00:54:15 +00:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2016-01-12 00:04:22 +00:00
|
|
|
import net.minecraftforge.common.capabilities.CapabilityDispatcher;
|
|
|
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
2014-08-27 02:47:22 +00:00
|
|
|
import net.minecraftforge.common.util.BlockSnapshot;
|
2014-12-07 11:30:10 +00:00
|
|
|
import net.minecraftforge.event.brewing.PotionBrewEvent;
|
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.event.entity.EntityEvent;
|
2015-02-21 02:03:16 +00:00
|
|
|
import net.minecraftforge.event.entity.EntityMountEvent;
|
2013-12-21 08:10:35 +00:00
|
|
|
import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
|
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.event.entity.PlaySoundAtEntityEvent;
|
|
|
|
import net.minecraftforge.event.entity.item.ItemExpireEvent;
|
2016-03-02 04:42:36 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
|
2015-04-13 22:09:42 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingExperienceDropEvent;
|
2014-12-07 10:34:28 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingHealEvent;
|
2013-03-20 02:59:28 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingPackSizeEvent;
|
2013-01-02 06:20:30 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
2013-09-06 17:19:51 +00:00
|
|
|
import net.minecraftforge.event.entity.living.LivingSpawnEvent.AllowDespawn;
|
2013-10-13 16:21:57 +00:00
|
|
|
import net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent;
|
2016-03-02 07:38:31 +00:00
|
|
|
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
|
|
|
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
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.event.entity.player.BonemealEvent;
|
|
|
|
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
|
|
|
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
2013-09-23 08:50:59 +00:00
|
|
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
2013-03-05 04:29:05 +00:00
|
|
|
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
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.event.entity.player.PlayerDropsEvent;
|
2013-03-05 04:29:05 +00:00
|
|
|
import net.minecraftforge.event.entity.player.PlayerEvent;
|
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.event.entity.player.PlayerFlyableFallEvent;
|
2015-10-10 22:39:27 +00:00
|
|
|
import net.minecraftforge.event.entity.player.PlayerSetSpawnEvent;
|
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.event.entity.player.PlayerSleepInBedEvent;
|
|
|
|
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
|
2016-01-09 21:39:12 +00:00
|
|
|
import net.minecraftforge.event.entity.player.SleepingLocationCheckEvent;
|
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.event.entity.player.UseHoeEvent;
|
2016-03-05 00:40:34 +00:00
|
|
|
import net.minecraftforge.event.terraingen.ChunkGeneratorEvent;
|
|
|
|
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
2013-09-07 04:10:08 +00:00
|
|
|
import net.minecraftforge.event.world.BlockEvent;
|
2014-08-27 02:47:22 +00:00
|
|
|
import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent;
|
2016-03-23 14:34:48 +00:00
|
|
|
import net.minecraftforge.event.world.BlockEvent.NeighborNotifyEvent;
|
2014-08-27 02:47:22 +00:00
|
|
|
import net.minecraftforge.event.world.BlockEvent.PlaceEvent;
|
2014-12-07 08:28:41 +00:00
|
|
|
import net.minecraftforge.event.world.ExplosionEvent;
|
2013-03-05 04:29:05 +00:00
|
|
|
import net.minecraftforge.event.world.WorldEvent;
|
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.ObfuscationReflectionHelper;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
2012-09-27 00:54:15 +00:00
|
|
|
|
|
|
|
public class ForgeEventFactory
|
|
|
|
{
|
2014-08-27 02:47:22 +00:00
|
|
|
|
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
|
|
|
public static MultiPlaceEvent onPlayerMultiBlockPlace(EntityPlayer player, List<BlockSnapshot> blockSnapshots, EnumFacing direction)
|
2014-08-27 02:47:22 +00:00
|
|
|
{
|
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
|
|
|
BlockSnapshot snap = blockSnapshots.get(0);
|
2016-03-24 10:14:39 +00:00
|
|
|
IBlockState placedAgainst = snap.getWorld().getBlockState(snap.getPos().offset(direction.getOpposite()));
|
2014-08-27 02:47:22 +00:00
|
|
|
MultiPlaceEvent event = new MultiPlaceEvent(blockSnapshots, placedAgainst, player);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
public static PlaceEvent onPlayerBlockPlace(EntityPlayer player, BlockSnapshot blockSnapshot, EnumFacing direction)
|
2014-08-27 02:47:22 +00:00
|
|
|
{
|
2016-03-24 10:14:39 +00:00
|
|
|
IBlockState placedAgainst = blockSnapshot.getWorld().getBlockState(blockSnapshot.getPos().offset(direction.getOpposite()));
|
2014-08-27 02:47:22 +00:00
|
|
|
PlaceEvent event = new PlaceEvent(blockSnapshot, placedAgainst, player);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event;
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-03-01 06:53:32 +00:00
|
|
|
public static NeighborNotifyEvent onNeighborNotify(World world, BlockPos pos, IBlockState state, EnumSet<EnumFacing> notifiedSides)
|
|
|
|
{
|
|
|
|
NeighborNotifyEvent event = new NeighborNotifyEvent(world, pos, state, notifiedSides);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event;
|
|
|
|
}
|
2014-08-27 02:47:22 +00:00
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static boolean doPlayerHarvestCheck(EntityPlayer player, IBlockState state, boolean success)
|
2012-09-27 00:54:15 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
PlayerEvent.HarvestCheck event = new PlayerEvent.HarvestCheck(player, state, success);
|
2012-09-27 00:54:15 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-02 04:42:36 +00:00
|
|
|
return event.canHarvest();
|
2012-09-27 00:54:15 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
public static float getBreakSpeed(EntityPlayer player, IBlockState state, float original, BlockPos pos)
|
2014-04-01 21:40:53 +00:00
|
|
|
{
|
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
|
|
|
PlayerEvent.BreakSpeed event = new PlayerEvent.BreakSpeed(player, state, original, pos);
|
2016-03-24 08:44:52 +00:00
|
|
|
return (MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getNewSpeed());
|
2012-09-27 00:54:15 +00:00
|
|
|
}
|
2012-09-27 04:18:18 +00:00
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static void onPlayerDestroyItem(EntityPlayer player, ItemStack stack, EnumHand hand)
|
2012-09-27 04:18:18 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, stack, hand));
|
2012-09-27 04:18:18 +00:00
|
|
|
}
|
2013-01-02 06:20:30 +00:00
|
|
|
|
|
|
|
public static Result canEntitySpawn(EntityLiving entity, World world, float x, float y, float z)
|
|
|
|
{
|
|
|
|
LivingSpawnEvent.CheckSpawn event = new LivingSpawnEvent.CheckSpawn(entity, world, x, y, z);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event.getResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean doSpecialSpawn(EntityLiving entity, World world, float x, float y, float z)
|
|
|
|
{
|
2013-03-05 04:29:05 +00:00
|
|
|
return MinecraftForge.EVENT_BUS.post(new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z));
|
|
|
|
}
|
2013-01-02 06:20:30 +00:00
|
|
|
|
2013-09-06 20:05:29 +00:00
|
|
|
public static Result canEntityDespawn(EntityLiving entity)
|
2013-09-06 17:19:51 +00:00
|
|
|
{
|
2013-09-06 20:05:29 +00:00
|
|
|
AllowDespawn event = new AllowDespawn(entity);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event.getResult();
|
2013-09-06 17:19:51 +00:00
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-04-13 22:09:42 +00:00
|
|
|
public static int getExperienceDrop(EntityLivingBase entity, EntityPlayer attackingPlayer, int originalExperience)
|
|
|
|
{
|
|
|
|
LivingExperienceDropEvent event = new LivingExperienceDropEvent(entity, attackingPlayer, originalExperience);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return event.getDroppedExperience();
|
|
|
|
}
|
2014-06-22 14:11:32 +00:00
|
|
|
|
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
|
|
|
public static List<BiomeGenBase.SpawnListEntry> getPotentialSpawns(WorldServer world, EnumCreatureType type, BlockPos pos, List<BiomeGenBase.SpawnListEntry> oldList)
|
2013-03-05 04:29:05 +00:00
|
|
|
{
|
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
|
|
|
WorldEvent.PotentialSpawns event = new WorldEvent.PotentialSpawns(world, type, pos, oldList);
|
2013-03-05 04:29:05 +00:00
|
|
|
if (MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
{
|
|
|
|
return null;
|
2013-01-02 06:20:30 +00:00
|
|
|
}
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getList();
|
2013-01-02 06:20:30 +00:00
|
|
|
}
|
2014-06-22 14:11:32 +00:00
|
|
|
|
2013-03-20 02:59:28 +00:00
|
|
|
public static int getMaxSpawnPackSize(EntityLiving entity)
|
2013-03-20 00:43:37 +00:00
|
|
|
{
|
2013-03-20 02:59:28 +00:00
|
|
|
LivingPackSizeEvent maxCanSpawnEvent = new LivingPackSizeEvent(entity);
|
2013-03-20 00:43:37 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(maxCanSpawnEvent);
|
2016-03-24 08:44:52 +00:00
|
|
|
return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.getMaxPackSize() : entity.getMaxSpawnedInChunk();
|
2013-03-20 00:43:37 +00:00
|
|
|
}
|
2013-09-03 20:55:11 +00:00
|
|
|
|
|
|
|
public static String getPlayerDisplayName(EntityPlayer player, String username)
|
|
|
|
{
|
|
|
|
PlayerEvent.NameFormat event = new PlayerEvent.NameFormat(player, username);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getDisplayname();
|
2013-09-03 20:55:11 +00:00
|
|
|
}
|
2013-09-07 04:10:08 +00:00
|
|
|
|
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
|
|
|
public static float fireBlockHarvesting(List<ItemStack> drops, World world, BlockPos pos, IBlockState state, int fortune, float dropChance, boolean silkTouch, EntityPlayer player)
|
2013-09-07 04:10:08 +00:00
|
|
|
{
|
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
|
|
|
BlockEvent.HarvestDropsEvent event = new BlockEvent.HarvestDropsEvent(world, pos, state, fortune, dropChance, drops, player, silkTouch);
|
2013-09-07 04:10:08 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getDropChance();
|
2013-09-07 04:10:08 +00:00
|
|
|
}
|
2014-06-22 14:11:32 +00:00
|
|
|
|
2013-09-23 08:50:59 +00:00
|
|
|
public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, EntityPlayer entityPlayer, List<String> toolTip, boolean showAdvancedItemTooltips)
|
|
|
|
{
|
|
|
|
ItemTooltipEvent event = new ItemTooltipEvent(itemStack, entityPlayer, toolTip, showAdvancedItemTooltips);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event;
|
|
|
|
}
|
2013-10-13 16:21:57 +00:00
|
|
|
|
|
|
|
public static SummonAidEvent fireZombieSummonAid(EntityZombie zombie, World world, int x, int y, int z, EntityLivingBase attacker, double summonChance)
|
|
|
|
{
|
|
|
|
SummonAidEvent summonEvent = new SummonAidEvent(zombie, world, x, y, z, attacker, summonChance);
|
|
|
|
MinecraftForge.EVENT_BUS.post(summonEvent);
|
|
|
|
return summonEvent;
|
|
|
|
}
|
2013-12-21 08:10:35 +00:00
|
|
|
|
|
|
|
public static boolean onEntityStruckByLightning(Entity entity, EntityLightningBolt bolt)
|
|
|
|
{
|
|
|
|
return MinecraftForge.EVENT_BUS.post(new EntityStruckByLightningEvent(entity, bolt));
|
|
|
|
}
|
2014-01-25 03:10:51 +00:00
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static int onItemUseStart(EntityLivingBase entity, ItemStack item, int duration)
|
2014-01-25 03:10:51 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
LivingEntityUseItemEvent event = new LivingEntityUseItemEvent.Start(entity, item, duration);
|
2016-03-24 08:44:52 +00:00
|
|
|
return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getDuration();
|
2014-01-25 03:10:51 +00:00
|
|
|
}
|
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static int onItemUseTick(EntityLivingBase entity, ItemStack item, int duration)
|
2014-01-25 03:10:51 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
LivingEntityUseItemEvent event = new LivingEntityUseItemEvent.Tick(entity, item, duration);
|
2016-03-24 08:44:52 +00:00
|
|
|
return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getDuration();
|
2014-01-25 03:10:51 +00:00
|
|
|
}
|
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static boolean onUseItemStop(EntityLivingBase entity, ItemStack item, int duration)
|
2014-01-25 03:10:51 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
return MinecraftForge.EVENT_BUS.post(new LivingEntityUseItemEvent.Stop(entity, item, duration));
|
2014-01-25 03:10:51 +00:00
|
|
|
}
|
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
public static ItemStack onItemUseFinish(EntityLivingBase entity, ItemStack item, int duration, ItemStack result)
|
2014-01-25 03:10:51 +00:00
|
|
|
{
|
2016-03-02 04:42:36 +00:00
|
|
|
LivingEntityUseItemEvent.Finish event = new LivingEntityUseItemEvent.Finish(entity, item, duration, result);
|
2014-01-25 03:10:51 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getResultStack();
|
2014-01-25 03:10:51 +00:00
|
|
|
}
|
2014-06-22 14:11:32 +00:00
|
|
|
|
2014-05-29 01:33:32 +00:00
|
|
|
public static void onStartEntityTracking(Entity entity, EntityPlayer player)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.StartTracking(player, entity));
|
|
|
|
}
|
2014-06-22 14:11:32 +00:00
|
|
|
|
2014-05-29 01:33:32 +00:00
|
|
|
public static void onStopEntityTracking(Entity entity, EntityPlayer player)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.StopTracking(player, entity));
|
|
|
|
}
|
2014-06-21 21:38:21 +00:00
|
|
|
|
|
|
|
public static void firePlayerLoadingEvent(EntityPlayer player, File playerDirectory, String uuidString)
|
|
|
|
{
|
2014-06-22 14:11:32 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, playerDirectory, uuidString));
|
2014-06-21 21:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void firePlayerSavingEvent(EntityPlayer player, File playerDirectory, String uuidString)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.SaveToFile(player, playerDirectory, uuidString));
|
|
|
|
}
|
2014-06-22 18:39:23 +00:00
|
|
|
|
|
|
|
public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString)
|
|
|
|
{
|
|
|
|
SaveHandler sh = (SaveHandler) playerFileData;
|
|
|
|
File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_"+"75771_c");
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString));
|
|
|
|
}
|
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
|
|
|
|
2016-03-01 12:58:03 +00:00
|
|
|
public static ITextComponent onClientChat(byte type, ITextComponent message)
|
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
|
|
|
{
|
|
|
|
ClientChatReceivedEvent event = new ClientChatReceivedEvent(type, message);
|
2016-03-24 08:44:52 +00:00
|
|
|
return MinecraftForge.EVENT_BUS.post(event) ? null : event.getMessage();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
public static int onHoeUse(ItemStack stack, EntityPlayer player, World worldIn, BlockPos pos)
|
|
|
|
{
|
|
|
|
UseHoeEvent event = new UseHoeEvent(player, stack, worldIn, pos);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event)) return -1;
|
|
|
|
if (event.getResult() == Result.ALLOW)
|
|
|
|
{
|
|
|
|
stack.damageItem(1, player);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int onApplyBonemeal(EntityPlayer player, World world, BlockPos pos, IBlockState state, ItemStack stack)
|
|
|
|
{
|
|
|
|
BonemealEvent event = new BonemealEvent(player, world, pos, state);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event)) return -1;
|
|
|
|
if (event.getResult() == Result.ALLOW)
|
|
|
|
{
|
|
|
|
if (!world.isRemote)
|
|
|
|
stack.stackSize--;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-03-02 07:38:31 +00:00
|
|
|
public static ActionResult<ItemStack> onBucketUse(EntityPlayer player, World world, ItemStack stack, RayTraceResult target)
|
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
|
|
|
{
|
|
|
|
FillBucketEvent event = new FillBucketEvent(player, stack, world, target);
|
2016-03-02 07:38:31 +00:00
|
|
|
if (MinecraftForge.EVENT_BUS.post(event)) return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack);
|
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
|
|
|
|
|
|
|
if (event.getResult() == Result.ALLOW)
|
|
|
|
{
|
|
|
|
if (player.capabilities.isCreativeMode)
|
2016-03-02 07:38:31 +00:00
|
|
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
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
|
|
|
|
|
|
|
if (--stack.stackSize <= 0)
|
2016-03-02 07:38:31 +00:00
|
|
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, event.getFilledBucket());
|
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
|
|
|
|
2016-03-02 04:42:36 +00:00
|
|
|
if (!player.inventory.addItemStackToInventory(event.getFilledBucket()))
|
|
|
|
player.dropPlayerItemWithRandomChoice(event.getFilledBucket(), false);
|
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
|
|
|
|
2016-03-02 07:38:31 +00:00
|
|
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
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
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean canEntityUpdate(Entity entity)
|
|
|
|
{
|
|
|
|
EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(entity);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getCanUpdate();
|
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
|
|
|
}
|
|
|
|
|
2016-03-08 19:43:05 +00:00
|
|
|
public static PlaySoundAtEntityEvent onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)
|
2015-03-19 11:37:21 +00:00
|
|
|
{
|
2016-03-08 19:43:05 +00:00
|
|
|
PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(entity, name, category, volume, pitch);
|
2015-03-19 11:37:21 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
public static int onItemExpire(EntityItem entity, ItemStack item)
|
|
|
|
{
|
|
|
|
if (item == null) return -1;
|
|
|
|
ItemExpireEvent event = new ItemExpireEvent(entity, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, entity.worldObj)));
|
|
|
|
if (!MinecraftForge.EVENT_BUS.post(event)) return -1;
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getExtraLife();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
public static int onItemPickup(EntityItem entityItem, EntityPlayer entityIn, ItemStack itemstack)
|
|
|
|
{
|
|
|
|
Event event = new EntityItemPickupEvent(entityIn, entityItem);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event)) return -1;
|
|
|
|
return event.getResult() == Result.ALLOW ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void onPlayerDrops(EntityPlayer player, DamageSource cause, List<EntityItem> capturedDrops, boolean recentlyHit)
|
|
|
|
{
|
|
|
|
PlayerDropsEvent event = new PlayerDropsEvent(player, cause, capturedDrops, recentlyHit);
|
|
|
|
if (!MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
{
|
|
|
|
for (EntityItem item : capturedDrops)
|
|
|
|
{
|
2016-03-13 01:40:03 +00:00
|
|
|
player.dropItemAndGetStack(item);
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-21 02:03:16 +00:00
|
|
|
public static boolean canMountEntity(Entity entityMounting, Entity entityBeingMounted, boolean isMounting)
|
|
|
|
{
|
|
|
|
boolean isCanceled = MinecraftForge.EVENT_BUS.post(new EntityMountEvent(entityMounting, entityBeingMounted, entityMounting.worldObj, isMounting));
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-02-21 02:03:16 +00:00
|
|
|
if(isCanceled)
|
|
|
|
{
|
|
|
|
entityMounting.setPositionAndRotation(entityMounting.posX, entityMounting.posY, entityMounting.posZ, entityMounting.prevRotationYaw, entityMounting.prevRotationPitch);
|
|
|
|
return false;
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
else
|
|
|
|
return true;
|
2015-02-21 02:03:16 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
public static EnumStatus onPlayerSleepInBed(EntityPlayer player, BlockPos pos)
|
|
|
|
{
|
|
|
|
PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(player, pos);
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-03-24 08:44:52 +00:00
|
|
|
return event.getResultStatus();
|
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
|
|
|
}
|
|
|
|
|
2016-03-23 14:34:48 +00:00
|
|
|
public static void onPlayerWakeup(EntityPlayer player, boolean wakeImmediately, boolean updateWorldFlag, boolean setSpawn)
|
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
|
|
|
{
|
2016-03-23 14:34:48 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerWakeUpEvent(player, wakeImmediately, updateWorldFlag, setSpawn));
|
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
|
|
|
}
|
|
|
|
|
|
|
|
public static void onPlayerFall(EntityPlayer player, float distance, float multiplier)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(player, distance, multiplier));
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-10-10 22:39:27 +00:00
|
|
|
public static boolean onPlayerSpawnSet(EntityPlayer player, BlockPos pos, boolean forced) {
|
|
|
|
return MinecraftForge.EVENT_BUS.post(new PlayerSetSpawnEvent(player, pos, forced));
|
|
|
|
}
|
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
|
|
|
|
|
|
|
public static void onPlayerClone(EntityPlayer player, EntityPlayer oldPlayer, boolean wasDeath)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerEvent.Clone(player, oldPlayer, wasDeath));
|
|
|
|
}
|
2014-12-07 08:28:41 +00:00
|
|
|
|
|
|
|
public static boolean onExplosionStart(World world, Explosion explosion)
|
|
|
|
{
|
|
|
|
return MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Start(world, explosion));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void onExplosionDetonate(World world, Explosion explosion, List<Entity> list, double diameter)
|
|
|
|
{
|
|
|
|
//Filter entities to only those who are effected, to prevent modders from seeing more then will be hurt.
|
|
|
|
/* Enable this if we get issues with modders looping to much.
|
|
|
|
Iterator<Entity> itr = list.iterator();
|
|
|
|
Vec3 p = explosion.getPosition();
|
|
|
|
while (itr.hasNext())
|
|
|
|
{
|
|
|
|
Entity e = itr.next();
|
|
|
|
double dist = e.getDistance(p.xCoord, p.yCoord, p.zCoord) / diameter;
|
|
|
|
if (e.func_180427_aV() || dist > 1.0F) itr.remove();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list));
|
|
|
|
}
|
2014-12-07 09:52:29 +00:00
|
|
|
|
|
|
|
public static boolean onCreateWorldSpawn(World world, WorldSettings settings)
|
|
|
|
{
|
|
|
|
return MinecraftForge.EVENT_BUS.post(new WorldEvent.CreateSpawnPosition(world, settings));
|
|
|
|
}
|
2014-12-07 10:34:28 +00:00
|
|
|
|
|
|
|
public static float onLivingHeal(EntityLivingBase entity, float amount)
|
|
|
|
{
|
|
|
|
LivingHealEvent event = new LivingHealEvent(entity, amount);
|
2016-03-24 08:44:52 +00:00
|
|
|
return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.getAmount());
|
2014-12-07 10:34:28 +00:00
|
|
|
}
|
2014-12-07 11:30:10 +00:00
|
|
|
|
2016-03-23 14:34:48 +00:00
|
|
|
public static boolean onPotionAttemptBrew(ItemStack[] stacks)
|
2014-12-07 11:30:10 +00:00
|
|
|
{
|
|
|
|
ItemStack[] tmp = new ItemStack[stacks.length];
|
|
|
|
for (int x = 0; x < tmp.length; x++)
|
2014-12-10 13:12:36 +00:00
|
|
|
tmp[x] = ItemStack.copyItemStack(stacks[x]);
|
2014-12-07 11:30:10 +00:00
|
|
|
|
|
|
|
PotionBrewEvent.Pre event = new PotionBrewEvent.Pre(tmp);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
{
|
|
|
|
boolean changed = false;
|
|
|
|
for (int x = 0; x < stacks.length; x++)
|
|
|
|
{
|
|
|
|
changed |= ItemStack.areItemStacksEqual(tmp[x], stacks[x]);
|
|
|
|
stacks[x] = event.getItem(x);
|
|
|
|
}
|
2014-12-07 11:41:53 +00:00
|
|
|
if (changed)
|
|
|
|
onPotionBrewed(stacks);
|
2014-12-07 11:30:10 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void onPotionBrewed(ItemStack[] brewingItemStacks)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(new PotionBrewEvent.Post(brewingItemStacks));
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-06-25 17:07:27 +00:00
|
|
|
public static boolean renderFireOverlay(EntityPlayer player, float renderPartialTicks)
|
|
|
|
{
|
|
|
|
return renderBlockOverlay(player, renderPartialTicks, OverlayType.FIRE, Blocks.fire.getDefaultState(), new BlockPos(player));
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-06-25 17:07:27 +00:00
|
|
|
public static boolean renderWaterOverlay(EntityPlayer player, float renderPartialTicks)
|
|
|
|
{
|
|
|
|
return renderBlockOverlay(player, renderPartialTicks, OverlayType.WATER, Blocks.water.getDefaultState(), new BlockPos(player));
|
|
|
|
}
|
2016-01-12 00:04:22 +00:00
|
|
|
|
2015-06-25 17:07:27 +00:00
|
|
|
public static boolean renderBlockOverlay(EntityPlayer player, float renderPartialTicks, OverlayType type, IBlockState block, BlockPos pos)
|
|
|
|
{
|
|
|
|
return MinecraftForge.EVENT_BUS.post(new RenderBlockOverlayEvent(player, renderPartialTicks, type, block, pos));
|
|
|
|
}
|
|
|
|
|
2016-01-12 00:04:22 +00:00
|
|
|
public static CapabilityDispatcher gatherCapabilities(TileEntity tileEntity)
|
|
|
|
{
|
|
|
|
return gatherCapabilities(new AttachCapabilitiesEvent.TileEntity(tileEntity), null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static CapabilityDispatcher gatherCapabilities(Entity entity)
|
|
|
|
{
|
|
|
|
return gatherCapabilities(new AttachCapabilitiesEvent.Entity(entity), null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static CapabilityDispatcher gatherCapabilities(Item item, ItemStack stack, ICapabilityProvider parent)
|
|
|
|
{
|
|
|
|
return gatherCapabilities(new AttachCapabilitiesEvent.Item(item, stack), parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static CapabilityDispatcher gatherCapabilities(AttachCapabilitiesEvent event, ICapabilityProvider parent)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(event);
|
2016-01-17 21:37:57 +00:00
|
|
|
return event.getCapabilities().size() > 0 || parent != null ? new CapabilityDispatcher(event.getCapabilities(), parent) : null;
|
2016-01-12 00:04:22 +00:00
|
|
|
}
|
2016-01-09 21:39:12 +00:00
|
|
|
|
|
|
|
public static boolean fireSleepingLocationCheck(EntityPlayer player, BlockPos sleepingLocation)
|
|
|
|
{
|
|
|
|
SleepingLocationCheckEvent evt = new SleepingLocationCheckEvent(player, sleepingLocation);
|
|
|
|
MinecraftForge.EVENT_BUS.post(evt);
|
|
|
|
|
|
|
|
Result canContinueSleep = evt.getResult();
|
|
|
|
if (canContinueSleep == Result.DEFAULT)
|
2016-03-05 00:40:34 +00:00
|
|
|
{
|
|
|
|
IBlockState state = player.worldObj.getBlockState(player.playerLocation);
|
|
|
|
return state.getBlock().isBed(state, player.worldObj, player.playerLocation, player);
|
|
|
|
}
|
2016-01-09 21:39:12 +00:00
|
|
|
else
|
|
|
|
return canContinueSleep == Result.ALLOW;
|
|
|
|
}
|
|
|
|
|
2016-03-02 07:38:31 +00:00
|
|
|
public static ActionResult<ItemStack> onArrowNock(ItemStack item, World world, EntityPlayer player, EnumHand hand, boolean hasAmmo)
|
|
|
|
{
|
|
|
|
ArrowNockEvent event = new ArrowNockEvent(player, item, hand, world, hasAmmo);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
return new ActionResult<ItemStack>(EnumActionResult.FAIL, item);
|
|
|
|
return event.getAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int onArrowLoose(ItemStack stack, World world, EntityPlayer player, int charge, boolean hasAmmo)
|
|
|
|
{
|
|
|
|
ArrowLooseEvent event = new ArrowLooseEvent(player, stack, world, charge, hasAmmo);
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event))
|
|
|
|
return -1;
|
|
|
|
return event.getCharge();
|
|
|
|
}
|
|
|
|
|
2016-03-05 00:40:34 +00:00
|
|
|
public static boolean onReplaceBiomeBlocks(IChunkGenerator gen, int x, int z, ChunkPrimer primer, World world)
|
|
|
|
{
|
|
|
|
ChunkGeneratorEvent.ReplaceBiomeBlocks event = new ChunkGeneratorEvent.ReplaceBiomeBlocks(gen, x, z, primer, world);
|
|
|
|
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
|
|
return event.getResult() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY;
|
|
|
|
}
|
|
|
|
|
2016-05-07 18:17:18 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Use {@link #onChunkPopulate(boolean, IChunkGenerator, World, Random, int, int, boolean)}<br>
|
|
|
|
* The Random param should not be world.rand, it should be the same chunk-position-seeded rand used by the Chunk Provider.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2016-03-05 00:40:34 +00:00
|
|
|
public static void onChunkPopulate(boolean pre, IChunkGenerator gen, World world, int x, int z, boolean hasVillageGenerated)
|
|
|
|
{
|
2016-03-24 01:17:32 +00:00
|
|
|
MinecraftForge.EVENT_BUS.post(pre ? new PopulateChunkEvent.Pre(gen, world, world.rand, x, z, hasVillageGenerated) : new PopulateChunkEvent.Post(gen, world, world.rand, x, z, hasVillageGenerated));
|
2016-03-05 00:40:34 +00:00
|
|
|
}
|
|
|
|
|
2016-05-07 18:17:18 +00:00
|
|
|
public static void onChunkPopulate(boolean pre, IChunkGenerator gen, World world, Random rand, int x, int z, boolean hasVillageGenerated)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.post(pre ? new PopulateChunkEvent.Pre(gen, world, rand, x, z, hasVillageGenerated) : new PopulateChunkEvent.Post(gen, world, rand, x, z, hasVillageGenerated));
|
|
|
|
}
|
|
|
|
|
2012-09-27 00:54:15 +00:00
|
|
|
}
|