<commit_before>package com.lothrazar.cyclicmagic.item;
import com.lothrazar.cyclicmagic.IHasRecipe;
import com.lothrazar.cyclicmagic.ModCyclic;
import com.lothrazar.cyclicmagic.net.PacketPlayerFalldamage;
import com.lothrazar.cyclicmagic.util.UtilSound;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemClimbingGlove extends BaseItem implements IHasRecipe {
  private static final double CLIMB_SPEED = 0.288D;
  private static final int ITEMSLOT_OFFHANDMAX = 8;//offhand is 0 , and hotbar is 0-8 (diff arrays)
  private static final int TICKS_FALLDIST_SYNC = 22;//tick every so often
  public ItemClimbingGlove() {
    this.setMaxStackSize(1);
  }
  @Override
  public String getTooltip() {
    return this.getUnlocalizedName() + ".tooltip";
  }
  /**
   * Called each tick as long the item is on a player inventory. Uses by maps to
   * check if is on a player hand and update it's contents.
   */
  @Override
  public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
    super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected);
    if (!(entityIn instanceof EntityLivingBase)) { return; }
    if (itemSlot > ITEMSLOT_OFFHANDMAX) { return; }
    EntityLivingBase entity = (EntityLivingBase) entityIn;
    if (!entityIn.isCollidedHorizontally) { return; }
    if (entity.isSneaking()) {
      entity.motionY = 0.0D;
    }
    else if (entity.moveForward > 0.0F && entity.motionY < CLIMB_SPEED) {
      entity.motionY = CLIMB_SPEED;
    }
    if (worldIn.isRemote && //setting fall distance on clientside wont work
        entity instanceof EntityPlayer && entity.ticksExisted % TICKS_FALLDIST_SYNC == 0) {
      UtilSound.playSound(entity, SoundEvents.BLOCK_LADDER_STEP);
      
      ModCyclic.network.sendToServer(new PacketPlayerFalldamage());
    }
  }
  @Override
  public void addRecipe() {
    GameRegistry.addRecipe(new ItemStack(this, 1),
        "s  ",
        "ls ",
        "lls",
        's', Items.SLIME_BALL,
        'L', Items.LEATHER);
 
  }<commit_msg>fix and tweak glove recipe<commit_after>package com.lothrazar.cyclicmagic.item;
import com.lothrazar.cyclicmagic.IHasRecipe;
import com.lothrazar.cyclicmagic.ModCyclic;
import com.lothrazar.cyclicmagic.net.PacketPlayerFalldamage;
import com.lothrazar.cyclicmagic.util.UtilSound;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemClimbingGlove extends BaseItem implements IHasRecipe {
  private static final double CLIMB_SPEED = 0.288D;
  private static final int ITEMSLOT_OFFHANDMAX = 8;//offhand is 0 , and hotbar is 0-8 (diff arrays)
  private static final int TICKS_FALLDIST_SYNC = 22;//tick every so often
  public ItemClimbingGlove() {
    this.setMaxStackSize(1);
  }
  @Override
  public String getTooltip() {
    return this.getUnlocalizedName() + ".tooltip";
  }
  /**
   * Called each tick as long the item is on a player inventory. Uses by maps to
   * check if is on a player hand and update it's contents.
   */
  @Override
  public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
    super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected);
    if (!(entityIn instanceof EntityLivingBase)) { return; }
    if (itemSlot > ITEMSLOT_OFFHANDMAX) { return; }
    EntityLivingBase entity = (EntityLivingBase) entityIn;
    if (!entityIn.isCollidedHorizontally) { return; }
    if (entity.isSneaking()) {
      entity.motionY = 0.0D;
    }
    else if (entity.moveForward > 0.0F && entity.motionY < CLIMB_SPEED) {
      entity.motionY = CLIMB_SPEED;
    }
    if (worldIn.isRemote && //setting fall distance on clientside wont work
        entity instanceof EntityPlayer && entity.ticksExisted % TICKS_FALLDIST_SYNC == 0) {
      UtilSound.playSound(entity, SoundEvents.BLOCK_LADDER_STEP);
      ModCyclic.network.sendToServer(new PacketPlayerFalldamage());
    }
  }
  @Override
  public void addRecipe() {
    GameRegistry.addRecipe(new ItemStack(this, 1),
        "ssl",
        "skl",
        "lli",
        's', Items.SLIME_BALL,
        'i', Items.IRON_INGOT,
        'k', new ItemStack(Items.DYE, 1, EnumDyeColor.BLACK.getDyeDamage()),
        'l', Items.LEATHER);
  }
{'fraction_non_alphanumeric': 0.10141313383208644, 'fraction_numerical': 0.007273482959268496, 'mean_word_length': 3.9364102564102565, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6987997', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1563, 'n_words': 369}