mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Block patches and event work (#5138)
This commit is contained in:
1 parent
b25f92b0c0
commit
0cd21ebe7e
12 files changed
+1096
-44
No files matched your search
@@ -21,8 +21,7 @@ package net.minecraftforge.event.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
|
||||
/**
|
||||
* EntityMobGriefingEvent is fired when mob griefing is about to occur and allows an event listener to specify whether it should or not.<br>
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
|
||||
@@ -38,7 +37,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
@Cancelable
|
||||
public class LivingDestroyBlockEvent extends LivingEvent
|
||||
{
|
||||
private final BlockPos pos;
|
||||
|
||||
@@ -69,7 +69,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||
* Let result be the return value of {@link Entity#applyPlayerInteraction}, or {@link #cancellationResult} if the event is cancelled.
|
||||
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link EntityInteract}.
|
||||
*/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
@Cancelable
|
||||
public static class EntityInteractSpecific extends PlayerInteractEvent
|
||||
{
|
||||
private final Vec3d localPos;
|
||||
@@ -110,7 +110,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||
* or {@link #cancellationResult} if the event is cancelled.
|
||||
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link RightClickItem}.
|
||||
*/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
@Cancelable
|
||||
public static class EntityInteract extends PlayerInteractEvent
|
||||
{
|
||||
private final Entity target;
|
||||
@@ -248,7 +248,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||
* Also note that creative mode directly breaks the block without running any other logic.
|
||||
* Therefore, in creative mode, {@link #setUseBlock} and {@link #setUseItem} have no effect.
|
||||
*/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
@Cancelable
|
||||
public static class LeftClickBlock extends PlayerInteractEvent
|
||||
{
|
||||
private Result useBlock = DEFAULT;
|
||||
@@ -369,11 +369,11 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The effective, i.e. logical, side of this interaction. This will be {@link Side#CLIENT} on the client thread, and {@link Side#SERVER} on the server thread.
|
||||
* @return The effective, i.e. logical, side of this interaction. This will be {@link Dist#CLIENT} on the client thread, and {@link Dist#DEDICATED_SERVER} on the server thread.
|
||||
*/
|
||||
public Side getSide()
|
||||
public Dist getSide()
|
||||
{
|
||||
return getWorld().isRemote ? Side.CLIENT : Side.SERVER;
|
||||
return getWorld().isRemote ? Dist.CLIENT : Dist.DEDICATED_SERVER;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-2
@@ -24,7 +24,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
|
||||
/**
|
||||
@@ -34,7 +33,7 @@ import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
* This event has a result. {@link HasResult}<br>
|
||||
*
|
||||
* setResult(ALLOW) informs game that player is still "in bed"<br>
|
||||
* setResult(DEFAULT) causes game to check {@link Block#isBed(IBlockState, IBlockAccess, BlockPos, Entity)} instead
|
||||
* setResult(DEFAULT) causes game to check {@link Block#isBed(IBlockState, net.minecraft.world.IWorldReader, BlockPos, Entity)} instead
|
||||
*/
|
||||
@HasResult
|
||||
public class SleepingLocationCheckEvent extends PlayerEvent
|
||||
|
||||
@@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.player;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
|
||||
/**
|
||||
* This event is fired when the game checks if players can sleep at this time.<br>
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -38,7 +38,7 @@ import javax.annotation.Nonnull;
|
||||
* setResult(ALLOW) is the same as the old setHandled();
|
||||
*/
|
||||
@Cancelable
|
||||
@net.minecraftforge.eventbus.api.Event.HasResult
|
||||
@HasResult
|
||||
public class UseHoeEvent extends PlayerEvent
|
||||
{
|
||||
|
||||
|
||||
Reference in new issue
Block a user