Skip to content

Commit

Permalink
Fixes...
Browse files Browse the repository at this point in the history
  • Loading branch information
GTNH-Colen committed Jan 4, 2024
1 parent d2e78a2 commit 69a12ed
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
package com.mitchej123.hodgepodge.mixins.early.minecraft;

import java.util.Random;

import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemEnderPearl;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(ItemEnderPearl.class)
public class MixinItemEnderPearl {

@Shadow
protected static Random itemRand;
public abstract class MixinItemEnderPearl extends Item {

/**
* @author Colen
* @reason Enables enderpearls to be used in creative by removing check.
*/
@Overwrite
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) {
--itemStackIn.stackSize;
itemStackIn.stackSize--;
worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

if (!worldIn.isRemote) {
Expand Down

0 comments on commit 69a12ed

Please sign in to comment.