Skip to content

Commit

Permalink
FIx: items being able to be transferred into the Golden Sacrificial B…
Browse files Browse the repository at this point in the history
…owl (#1031) - thanks @irishgreencitrus

Closes #1030
  • Loading branch information
irishgreencitrus authored Jan 16, 2024
1 parent 6f206f3 commit 56521a1
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickItem;
import net.minecraftforge.items.IItemHandler;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Consumer;
Expand Down Expand Up @@ -470,6 +475,15 @@ public void onPlayerRightClickItem(PlayerInteractEvent.RightClickItem event) {
}
}

@Nonnull
@Override
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction direction) {
if (cap == ForgeCapabilities.ITEM_HANDLER) {
return LazyOptional.empty();
}
return super.getCapability(cap, direction);
}

public void onLivingDeath(LivingDeathEvent event) {
LivingEntity entityLivingBase = event.getEntity();
if (!entityLivingBase.level().isClientSide && this.getCurrentRitualRecipe() != null) {
Expand Down

0 comments on commit 56521a1

Please sign in to comment.