Skip to content

Commit

Permalink
#26: Обновить ссылку на ActionResultType.
Browse files Browse the repository at this point in the history
  • Loading branch information
xunto committed Jun 2, 2022
1 parent 6a1637b commit fb580bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/main/java/pw/tales/fairy/item/ItemPosedFBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -42,8 +42,8 @@ public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity play
}

@Override
public EnumActionResult onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!player.isSneaking()) return EnumActionResult.PASS;
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!player.isSneaking()) return ActionResultType.PASS;
return super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/pw/tales/fairy/item/ItemRPSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
Expand All @@ -35,10 +35,10 @@ private BlockPos determinePosition(World worldIn, BlockPos pos, EnumFacing facin
}

@ParametersAreNonnullByDefault
public EnumActionResult onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
EnumActionResult result = super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ActionResultType result = super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);

if (worldIn.isRemote || result != EnumActionResult.SUCCESS)
if (worldIn.isRemote || result != ActionResultType.SUCCESS)
return result;

pos = this.determinePosition(worldIn, pos, facing);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/pw/tales/fairy/item/ItemWearable.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
Expand All @@ -27,9 +27,9 @@ public ItemWearable() {
}

@ParametersAreNonnullByDefault
public EnumActionResult onItemUse(PlayerEntity player, World worldIn, BlockPos pos,
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos,
Hand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return EnumActionResult.PASS;
return ActionResultType.PASS;
}

public void registerModels() {
Expand Down

0 comments on commit fb580bc

Please sign in to comment.