nus-yam/ex-repair huggingface dataset:
Program: 174508
Project: 174508
Buggy source:
public boolean processInteract(EntityPlayer player,EnumHand hand){
  if (!this.world.isRemote) {
    if (hand == EnumHand.MAIN_HAND) {
      ItemStack stack=player.getHeldItemMainhand();
      if (this.isTamed()) {
        if (this.isOwner(player)) {
          if (DyeUtils.isDye(stack)) {
            return true;
          }
 else           if (!this.isCoreItem(stack) && stack.getItem() != Item.getItemFromBlock(Blocks.WOOL) && stack.getItem() != Items.SHEARS) {
            this.openGUI(player);
            this.playObeySound();
            return true;
          }
        }
      }
    }
  }
  return super.processInteract(player,hand);
}

Fixed version (ground truth):
public boolean processInteract(EntityPlayer player,EnumHand hand){
  if (!this.world.isRemote) {
    if (hand == EnumHand.MAIN_HAND) {
      ItemStack stack=player.getHeldItemMainhand();
      if (this.isTamed()) {
        if (this.isOwner(player)) {
          if (DyeUtils.isDye(stack)) {
            return true;
          }
        }
      }
    }
  }
  return super.processInteract(player,hand);
}
Program: 174509
Project: 174509
Buggy source:
public void itemDataToGemData(int data){
  this.setSpecial(data);
  this.setSkinColor(this.generateSkinColor());
  this.setHairStyle(this.generateHairStyle());
  this.setHairColor(this.generateHairColor());
  if (this.getSpecial() == 1) {
    this.nativeColor=11;
  }
 else {
    this.nativeColor=14;
  }
}

Fixed version (ground truth):
public void itemDataToGemData(int data){
  this.setSpecial(data);
  this.setSkinColor(this.generateSkinColor());
  this.setHairStyle(this.generateHairStyle());
  this.setHairColor(this.generateHairColor());
  this.setGemColor(this.generateGemColor());
  if (this.getSpecial() == 1) {
    this.nativeColor=11;
  }
 else {
    this.nativeColor=14;
  }
}
Program: 174510
Project: 174510
Buggy source:
public RenderAquamarine(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelAquamarine(),0.25F);
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}

Fixed version (ground truth):
public RenderAquamarine(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelAquamarine(),0.25F);
  this.addLayer(new LayerAquamarineItem(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}
Program: 174511
Project: 174511
Buggy source:
public RenderSapphire(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelSapphire(),0.25F);
  this.addLayer(new LayerSkin(this,0.25F));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerNoDyeOverlay(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this,0.5F));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}

Fixed version (ground truth):
public RenderSapphire(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelSapphire(),0.25F);
  this.addLayer(new LayerSapphireItem(this));
  this.addLayer(new LayerSkin(this,0.25F));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerNoDyeOverlay(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this,0.5F));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}
Program: 174512
Project: 174512
Buggy source:
private void renderHeldItem(EntityAgate entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
private void renderHeldItem(EntityAgate entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 8.0F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}
Program: 174513
Project: 174513
Buggy source:
private void renderHeldItem(EntityBismuth entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
private void renderHeldItem(EntityBismuth entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 3.25F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}
Program: 174514
Project: 174514
Buggy source:
private void renderHeldItem(EntityGem entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
private void renderHeldItem(EntityGem entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 8.0F,0.125F,-0.6F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}
Program: 174515
Project: 174515
Buggy source:
public boolean isOwner(EntityLivingBase entityIn){
  if (this.servitude == EntityGem.SERVE_HUMAN) {
    if (entityIn instanceof EntityPlayer) {
      EntityPlayer playerIn=(EntityPlayer)entityIn;
      if (playerIn.getUniqueID().equals(this.getOwnerId())) {
        return true;
      }
 else {
        for (        UUID ownerId : this.jointOwners) {
          if (playerIn.getUniqueID().equals(ownerId)) {
            return true;
          }
        }
      }
    }
    if (entityIn.getHeldItemMainhand().getItem() == ModItems.COMMANDER_STAFF) {
      return this.isOwnerId(ModItems.COMMANDER_STAFF.getOwner(entityIn.getHeldItemMainhand()));
    }
  }
 else   if (this.servitude == EntityGem.SERVE_BLUE_DIAMOND) {
    return entityIn instanceof EntityBlueDiamond;
  }
 else   if (this.servitude == EntityGem.SERVE_YELLOW_DIAMOND) {
    return entityIn instanceof EntityYellowDiamond;
  }
  return false;
}

Fixed version (ground truth):
public boolean isOwner(EntityLivingBase entityIn){
  if (entityIn != null) {
    if (this.servitude == EntityGem.SERVE_HUMAN) {
      if (entityIn instanceof EntityPlayer) {
        EntityPlayer playerIn=(EntityPlayer)entityIn;
        if (playerIn.getUniqueID().equals(this.getOwnerId())) {
          return true;
        }
 else {
          for (          UUID ownerId : this.jointOwners) {
            if (playerIn.getUniqueID().equals(ownerId)) {
              return true;
            }
          }
        }
      }
      if (entityIn.getHeldItemMainhand().getItem() == ModItems.COMMANDER_STAFF) {
        return this.isOwnerId(ModItems.COMMANDER_STAFF.getOwner(entityIn.getHeldItemMainhand()));
      }
    }
 else     if (this.servitude == EntityGem.SERVE_BLUE_DIAMOND) {
      return entityIn instanceof EntityBlueDiamond;
    }
 else     if (this.servitude == EntityGem.SERVE_YELLOW_DIAMOND) {
      return entityIn instanceof EntityYellowDiamond;
    }
  }
  return false;
}
Program: 174516
Project: 174516
Buggy source:
/** 
 * Methods related to entity combat.                     
 */
public boolean attackEntityFrom(DamageSource source,float amount){
  if (this.getHeldEntities().isEmpty() || source.isUnblockable()) {
    return super.attackEntityFrom(source,amount);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Methods related to entity combat.                     
 */
public boolean attackEntityFrom(DamageSource source,float amount){
  return super.attackEntityFrom(source,amount);
}
Program: 174519
Project: 174519
Buggy source:
public void setRotationAngles(float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scaleFactor,Entity entityIn){
  super.setRotationAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scaleFactor,entityIn);
  float f=0.2617994F;
  float f1=-0.2617994F;
  float f2=0.0F;
  float f4=1.0F;
  if (entityIn.motionY < 0.0D) {
    Vec3d vec3d=(new Vec3d(entityIn.motionX,entityIn.motionY,entityIn.motionZ)).normalize();
    f4=1.0F - (float)Math.pow(-vec3d.y,1.5D);
  }
 else   if (entityIn.motionY > 0.0D) {
    Vec3d vec3d=(new Vec3d(entityIn.motionX,entityIn.motionY,entityIn.motionZ)).normalize();
    f4=1.0F + (float)Math.pow(vec3d.y,1.5D);
  }
  f=f4 * 0.34906584F + (1.0F - f4) * f;
  f1=f4 * -((float)Math.PI / 2F) + (1.0F - f4) * f1;
  this.bipedLeftWing.rotationPointX=5.0F;
  this.bipedLeftWing.rotationPointY=f2;
  this.bipedLeftWing.rotateAngleX=f;
  this.bipedLeftWing.rotateAngleZ=f1;
  this.bipedRightWing.rotationPointX=-this.bipedLeftWing.rotationPointX;
  this.bipedRightWing.rotationPointY=this.bipedLeftWing.rotationPointY;
  this.bipedRightWing.rotateAngleX=this.bipedLeftWing.rotateAngleX;
  this.bipedRightWing.rotateAngleZ=-this.bipedLeftWing.rotateAngleZ;
  if (entityIn.isBeingRidden()) {
    this.bipedLeftArm.rotateAngleX=(float)(-Math.PI / 2f);
    this.bipedRightArm.rotateAngleX=(float)(-Math.PI / 2f);
  }
}

Fixed version (ground truth):
@Override public void setRotationAngles(float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scaleFactor,Entity entityIn){
  super.setRotationAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scaleFactor,entityIn);
  float f=0.2617994F;
  float f1=-0.2617994F;
  float f2=0.0F;
  float f4=1.0F;
  if (entityIn.motionY < 0.0D) {
    Vec3d vec3d=(new Vec3d(entityIn.motionX,entityIn.motionY,entityIn.motionZ)).normalize();
    f4=1.0F - (float)Math.pow(-vec3d.y,1.5D);
  }
 else   if (entityIn.motionY > 0.0D) {
    Vec3d vec3d=(new Vec3d(entityIn.motionX,entityIn.motionY,entityIn.motionZ)).normalize();
    f4=1.0F + (float)Math.pow(vec3d.y,1.5D);
  }
  f=f4 * 0.34906584F + (1.0F - f4) * f;
  f1=f4 * -((float)Math.PI / 2F) + (1.0F - f4) * f1;
  this.bipedLeftWing.rotationPointX=5.0F;
  this.bipedLeftWing.rotationPointY=f2;
  this.bipedLeftWing.rotateAngleX=f;
  this.bipedLeftWing.rotateAngleZ=f1;
  this.bipedRightWing.rotationPointX=-this.bipedLeftWing.rotationPointX;
  this.bipedRightWing.rotationPointY=this.bipedLeftWing.rotationPointY;
  this.bipedRightWing.rotateAngleX=this.bipedLeftWing.rotateAngleX;
  this.bipedRightWing.rotateAngleZ=-this.bipedLeftWing.rotateAngleZ;
  if (entityIn.isBeingRidden()) {
    this.bipedLeftArm.rotateAngleX=(float)(-Math.PI / 2f);
    this.bipedRightArm.rotateAngleX=(float)(-Math.PI / 2f);
  }
}
Program: 174520
Project: 174520
Buggy source:
public void render(Entity entityIn,float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  this.setRotationAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale,entityIn);
  if (entityIn instanceof EntityLapisLazuli) {
    EntityLapisLazuli lapis=(EntityLapisLazuli)entityIn;
    if (!lapis.isDefective()) {
      this.bipedRightWing.render(scale);
      this.bipedLeftWing.render(scale);
    }
  }
  this.bipedHead.render(scale);
  this.bipedHeadwear.render(scale);
  this.bipedBody.render(scale);
  this.bipedRightArm.render(scale);
  this.bipedLeftArm.render(scale);
  this.bipedRightLeg.render(scale);
  this.bipedLeftLeg.render(scale);
}

Fixed version (ground truth):
@Override public void render(Entity entityIn,float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  this.setRotationAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale,entityIn);
  if (entityIn instanceof EntityLapisLazuli) {
    EntityLapisLazuli lapis=(EntityLapisLazuli)entityIn;
    if (!lapis.isDefective()) {
      this.bipedRightWing.render(scale);
      this.bipedLeftWing.render(scale);
    }
  }
  this.bipedHead.render(scale);
  this.bipedHeadwear.render(scale);
  this.bipedBody.render(scale);
  this.bipedRightArm.render(scale);
  this.bipedLeftArm.render(scale);
  this.bipedRightLeg.render(scale);
  this.bipedLeftLeg.render(scale);
}
Program: 174522
Project: 174522
Buggy source:
public RenderAmethyst(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  for (Iterator<LayerRenderer<EntityAmethyst>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  LayerBipedArmor amethystArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(amethystArmor);
}

Fixed version (ground truth):
public RenderAmethyst(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  for (Iterator<LayerRenderer<EntityAmethyst>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
  LayerBipedArmor amethystArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(amethystArmor);
}
Program: 174523
Project: 174523
Buggy source:
public RenderCarnelian(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  for (Iterator<LayerRenderer<EntityCarnelian>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  LayerBipedArmor carnelianArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(carnelianArmor);
}

Fixed version (ground truth):
public RenderCarnelian(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  for (Iterator<LayerRenderer<EntityCarnelian>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
  LayerBipedArmor carnelianArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(carnelianArmor);
}
Program: 174524
Project: 174524
Buggy source:
public RenderJasper(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.25F);
  for (Iterator<LayerRenderer<EntityJasper>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerJasperMark1(this));
  this.addLayer(new LayerJasperMark2(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  LayerBipedArmor jasperArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(jasperArmor);
}

Fixed version (ground truth):
public RenderJasper(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.25F);
  for (Iterator<LayerRenderer<EntityJasper>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerJasperMark1(this));
  this.addLayer(new LayerJasperMark2(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
  LayerBipedArmor jasperArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(jasperArmor);
}
Program: 174525
Project: 174525
Buggy source:
public RenderLapisLazuli(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelLapisLazuli(),0.25F);
  this.addLayer(new LayerLapisLazuliItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerGemPlacement(this));
}

Fixed version (ground truth):
public RenderLapisLazuli(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelLapisLazuli(),0.25F);
  this.addLayer(new LayerLapisLazuliItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
}
Program: 174526
Project: 174526
Buggy source:
protected void preRenderCallback(EntityLapisLazuli entitylivingbaseIn,float partialTickTime){
  if (entitylivingbaseIn.isBeingRidden() && entitylivingbaseIn.canBeSteered()) {
    GlStateManager.translate(0F,-1F,1.25F);
    GlStateManager.rotate(90.0F,1,0,0);
  }
}

Fixed version (ground truth):
@Override protected void preRenderCallback(EntityLapisLazuli entitylivingbaseIn,float partialTickTime){
  if (entitylivingbaseIn.isBeingRidden() && entitylivingbaseIn.canBeSteered()) {
    GlStateManager.translate(0F,-1F,1.25F);
    GlStateManager.rotate(90.0F,1,0,0);
  }
}
Program: 174527
Project: 174527
Buggy source:
protected ResourceLocation getEntityTexture(EntityLapisLazuli entity){
  return new ResourceLocation("String_Node_Str");
}

Fixed version (ground truth):
@Override protected ResourceLocation getEntityTexture(EntityLapisLazuli entity){
  return new ResourceLocation("String_Node_Str");
}
Program: 174528
Project: 174528
Buggy source:
public RenderRoseQuartz(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.25F);
  for (Iterator<LayerRenderer<EntityRoseQuartz>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  LayerBipedArmor roseQuartzArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(roseQuartzArmor);
}

Fixed version (ground truth):
public RenderRoseQuartz(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.25F);
  for (Iterator<LayerRenderer<EntityRoseQuartz>> iter=this.layerRenderers.iterator(); iter.hasNext(); ) {
    LayerRenderer layer=iter.next();
    if (layer instanceof LayerHeldItem) {
      iter.remove();
    }
  }
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
  LayerBipedArmor roseQuartzArmor=new LayerBipedArmor(this){
    @Override protected void initArmor(){
      this.modelLeggings=new ModelQuartz(0.5F,true);
      this.modelArmor=new ModelQuartz(1F,true);
    }
  }
;
  this.addLayer(roseQuartzArmor);
}
Program: 174529
Project: 174529
Buggy source:
public void doRenderLayer(EntityGem gem,float limbSwing,float limbSwingAmount,float partialTicks,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  this.gemRenderer.bindTexture(this.getTexture(gem));
  float[] afloat=EntitySheep.getDyeRgb(EnumDyeColor.values()[gem.getInsigniaColor()]);
  GlStateManager.color(afloat[0] * 2,afloat[1] * 2,afloat[2] * 2,0.99f);
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(SourceFactor.SRC_ALPHA,DestFactor.ONE_MINUS_SRC_ALPHA);
  this.gemModel.setModelAttributes(this.gemRenderer.getMainModel());
  this.gemModel.render(gem,limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale);
  GlStateManager.disableBlend();
}

Fixed version (ground truth):
public void doRenderLayer(EntityGem gem,float limbSwing,float limbSwingAmount,float partialTicks,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  this.gemRenderer.bindTexture(this.getTexture(gem));
  float[] insigniaColor=EntitySheep.getDyeRgb(EnumDyeColor.values()[gem.getInsigniaColor()]);
  GlStateManager.color(insigniaColor[0] * 2,insigniaColor[1] * 2,insigniaColor[2] * 2,0.99f);
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(SourceFactor.SRC_ALPHA,DestFactor.ONE_MINUS_SRC_ALPHA);
  this.gemModel.setModelAttributes(this.gemRenderer.getMainModel());
  this.gemModel.render(gem,limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale);
  GlStateManager.disableBlend();
}
Program: 174530
Project: 174530
Buggy source:
public boolean isCoreItem(ItemStack stack){
  if (stack.getItem() == ModItems.CRACKED_BLUE_DIAMOND_GEM || stack.getItem() == ModItems.CRACKED_YELLOW_DIAMOND_GEM || stack.getItem() == ModItems.BLUE_DIAMOND_GEM || stack.getItem() == ModItems.YELLOW_DIAMOND_GEM) {
    return true;
  }
 else   if (stack.getItem() == Items.DYE && (this.canChangeInsigniaColorByDefault() || this.canChangeUniformColorByDefault())) {
    return true;
  }
 else   if (stack.getItem() == ModItems.GEM_STAFF) {
    return true;
  }
 else   if (stack.getItem() == ModItems.TRANSFER_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.JOINT_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.AUTONOMY_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.LIBERATION_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.WAR_DECLARATION) {
    return true;
  }
 else   if (stack.getItem() == ModItems.PEACE_TREATY) {
    return true;
  }
 else   if (stack.getItem() == Items.NAME_TAG) {
    return true;
  }
 else   if (stack.getItem() == Items.LEAD) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isCoreItem(ItemStack stack){
  if (stack.getItem() == ModItems.CRACKED_BLUE_DIAMOND_GEM || stack.getItem() == ModItems.CRACKED_YELLOW_DIAMOND_GEM || stack.getItem() == ModItems.BLUE_DIAMOND_GEM || stack.getItem() == ModItems.YELLOW_DIAMOND_GEM) {
    return true;
  }
 else   if (DyeUtils.isDye(stack) && (this.canChangeInsigniaColorByDefault() || this.canChangeUniformColorByDefault())) {
    return true;
  }
 else   if (stack.getItem() == ModItems.GEM_STAFF) {
    return true;
  }
 else   if (stack.getItem() == ModItems.TRANSFER_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.JOINT_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.AUTONOMY_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.LIBERATION_CONTRACT) {
    return true;
  }
 else   if (stack.getItem() == ModItems.WAR_DECLARATION) {
    return true;
  }
 else   if (stack.getItem() == ModItems.PEACE_TREATY) {
    return true;
  }
 else   if (stack.getItem() == Items.NAME_TAG) {
    return true;
  }
 else   if (stack.getItem() == Items.LEAD) {
    return true;
  }
  return false;
}
Program: 174535
Project: 174535
Buggy source:
protected boolean checkCorners(World world,BlockPos pos,byte rotation){
  int xFar=pos.getX() + ((rotation % 2 == 0) ? this.width : this.length) - 1;
  int zFar=pos.getZ() + ((rotation % 2 == 0) ? this.length : this.width) - 1;
  BlockPos corner1=world.getTopSolidOrLiquidBlock(pos).down();
  BlockPos corner2=world.getTopSolidOrLiquidBlock(new BlockPos(xFar,255,0)).down();
  BlockPos corner3=world.getTopSolidOrLiquidBlock(new BlockPos(0,255,zFar)).down();
  BlockPos corner4=world.getTopSolidOrLiquidBlock(new BlockPos(xFar,255,zFar)).down();
  if (!allowedBlocks.contains(world.getBlockState(corner1))) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner2)) || (Math.abs(corner2.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner3)) || (Math.abs(corner3.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner4)) || (Math.abs(corner4.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkCorners(World world,BlockPos pos,byte rotation){
  int xFar=pos.getX() + ((rotation % 2 == 0) ? this.width : this.length) - 1;
  int zFar=pos.getZ() + ((rotation % 2 == 0) ? this.length : this.width) - 1;
  BlockPos corner1=world.getTopSolidOrLiquidBlock(pos).down();
  BlockPos corner2=world.getTopSolidOrLiquidBlock(new BlockPos(xFar,255,pos.getZ())).down();
  BlockPos corner3=world.getTopSolidOrLiquidBlock(new BlockPos(pos.getX(),255,zFar)).down();
  BlockPos corner4=world.getTopSolidOrLiquidBlock(new BlockPos(xFar,255,zFar)).down();
  if (!allowedBlocks.contains(world.getBlockState(corner1))) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner2)) || (Math.abs(corner2.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner3)) || (Math.abs(corner3.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  if (!allowedBlocks.contains(world.getBlockState(corner4)) || (Math.abs(corner4.getY() - corner1.getY())) > this.foundationDepth) {
    return false;
  }
  return true;
}
Program: 174536
Project: 174536
Buggy source:
@Override protected boolean checkCorners(World world,BlockPos pos,byte rotation){
  return true;
}

Fixed version (ground truth):
@Override protected boolean checkCorners(World world,BlockPos pos,byte rotation){
  int xFar=pos.getX() + ((rotation % 2 == 0) ? this.width : this.length) - 1;
  int zFar=pos.getZ() + ((rotation % 2 == 0) ? this.length : this.width) - 1;
  BlockPos corner1=pos;
  BlockPos corner2=new BlockPos(xFar,pos.getY(),pos.getZ());
  BlockPos corner3=new BlockPos(pos.getX(),pos.getY(),zFar);
  BlockPos corner4=new BlockPos(xFar,pos.getY(),zFar);
  if (!checkBiome(world,corner1)) {
    return false;
  }
  if (!checkBiome(world,corner2)) {
    return false;
  }
  if (!checkBiome(world,corner3)) {
    return false;
  }
  if (!checkBiome(world,corner4)) {
    return false;
  }
  return true;
}
Program: 174537
Project: 174537
Buggy source:
public int getMetaFromState(IBlockState state){
  return ((EnumFacing)state.getValue(FACING)).getIndex();
}

Fixed version (ground truth):
@Override public int getMetaFromState(IBlockState state){
  return ((EnumFacing)state.getValue(FACING)).getIndex();
}
Program: 174538
Project: 174538
Buggy source:
/** 
 * Methods related to block rendering.                   
 */
@SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer(){
  return BlockRenderLayer.TRANSLUCENT;
}

Fixed version (ground truth):
/** 
 * Methods related to block rendering.                   
 */
@Override @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer(){
  return BlockRenderLayer.TRANSLUCENT;
}
Program: 174539
Project: 174539
Buggy source:
public IBlockState withMirror(IBlockState state,Mirror mirrorIn){
  return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}

Fixed version (ground truth):
@Override public IBlockState withMirror(IBlockState state,Mirror mirrorIn){
  return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
Program: 174540
Project: 174540
Buggy source:
/** 
 * Methods related to block activation and interaction.  
 */
public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  if (!worldIn.isRemote) {
    ItemStack heldItem=playerIn.getHeldItem(hand);
    if (this.isEquipped && heldItem.isEmpty()) {
      worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_OPEN,SoundCategory.BLOCKS,0.3F,1.0F);
      worldIn.setBlockState(pos,ModBlocks.INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
      EntityItem activatedBase=new EntityItem(worldIn,pos.getX(),pos.getY() + 1,pos.getZ(),new ItemStack(ModItems.ACTIVATED_GEM_BASE));
      worldIn.spawnEntity(activatedBase);
    }
 else     if (!this.isEquipped) {
      if (heldItem.getItem() == ModItems.ACTIVATED_GEM_BASE) {
        worldIn.setBlockState(pos,ModBlocks.EQUIPPED_INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
        worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_CLOSE,SoundCategory.BLOCKS,0.3F,1.0F);
        if (!playerIn.capabilities.isCreativeMode) {
          heldItem.splitStack(1);
        }
        Injector.onGemBasePlacement(worldIn,pos);
      }
    }
    if (heldItem.getItem() instanceof ItemBlock) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Methods related to block activation and interaction.  
 */
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  if (!worldIn.isRemote) {
    ItemStack heldItem=playerIn.getHeldItem(hand);
    if (this.isEquipped && heldItem.isEmpty()) {
      worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_OPEN,SoundCategory.BLOCKS,0.3F,1.0F);
      worldIn.setBlockState(pos,ModBlocks.INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
      EntityItem activatedBase=new EntityItem(worldIn,pos.getX(),pos.getY() + 1,pos.getZ(),new ItemStack(ModItems.ACTIVATED_GEM_BASE));
      worldIn.spawnEntity(activatedBase);
    }
 else     if (!this.isEquipped) {
      if (heldItem.getItem() == ModItems.ACTIVATED_GEM_BASE) {
        worldIn.setBlockState(pos,ModBlocks.EQUIPPED_INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
        worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_CLOSE,SoundCategory.BLOCKS,0.3F,1.0F);
        if (!playerIn.capabilities.isCreativeMode) {
          heldItem.splitStack(1);
        }
        Injector.onGemBasePlacement(worldIn,pos);
      }
    }
    if (heldItem.getItem() instanceof ItemBlock) {
      return false;
    }
  }
  return true;
}
Program: 174541
Project: 174541
Buggy source:
public boolean isFullCube(IBlockState state){
  return false;
}

Fixed version (ground truth):
@Override public boolean isFullCube(IBlockState state){
  return false;
}
Program: 174542
Project: 174542
Buggy source:
public ItemStack getItem(World worldIn,BlockPos pos,IBlockState state){
  return new ItemStack(ModBlocks.INJECTOR);
}

Fixed version (ground truth):
@Override public ItemStack getItem(World worldIn,BlockPos pos,IBlockState state){
  return new ItemStack(ModBlocks.INJECTOR);
}
Program: 174543
Project: 174543
Buggy source:
public void onBlockAdded(World worldIn,BlockPos pos,IBlockState state){
  super.onBlockAdded(worldIn,pos,state);
  this.setDefaultFacing(worldIn,pos,state);
  if (worldIn.isBlockPowered(pos) && this.isEquipped) {
    this.injectGemSeed(worldIn,pos);
  }
}

Fixed version (ground truth):
@Override public void onBlockAdded(World worldIn,BlockPos pos,IBlockState state){
  super.onBlockAdded(worldIn,pos,state);
  this.setDefaultFacing(worldIn,pos,state);
  if (worldIn.isBlockPowered(pos) && this.isEquipped) {
    this.injectGemSeed(worldIn,pos);
  }
}
Program: 174544
Project: 174544
Buggy source:
public IBlockState withRotation(IBlockState state,Rotation rot){
  return state.withProperty(FACING,rot.rotate((EnumFacing)state.getValue(FACING)));
}

Fixed version (ground truth):
@Override public IBlockState withRotation(IBlockState state,Rotation rot){
  return state.withProperty(FACING,rot.rotate((EnumFacing)state.getValue(FACING)));
}
Program: 174545
Project: 174545
Buggy source:
protected BlockStateContainer createBlockState(){
  return new BlockStateContainer(this,new IProperty[]{FACING});
}

Fixed version (ground truth):
@Override protected BlockStateContainer createBlockState(){
  return new BlockStateContainer(this,new IProperty[]{FACING});
}
Program: 174546
Project: 174546
Buggy source:
public void onBlockPlacedBy(World worldIn,BlockPos pos,IBlockState state,EntityLivingBase placer,ItemStack stack){
  worldIn.setBlockState(pos,state.withProperty(FACING,placer.getHorizontalFacing().getOpposite()),2);
  Injector.onInjectorPlacement(worldIn,pos);
}

Fixed version (ground truth):
@Override public void onBlockPlacedBy(World worldIn,BlockPos pos,IBlockState state,EntityLivingBase placer,ItemStack stack){
  worldIn.setBlockState(pos,state.withProperty(FACING,placer.getHorizontalFacing().getOpposite()),2);
  Injector.onInjectorPlacement(worldIn,pos);
}
Program: 174547
Project: 174547
Buggy source:
public void neighborChanged(IBlockState state,World worldIn,BlockPos pos,Block blockIn,BlockPos p_189540_5_){
  if (worldIn.isBlockPowered(pos) && this.isEquipped) {
    this.injectGemSeed(worldIn,pos);
  }
}

Fixed version (ground truth):
@Override public void neighborChanged(IBlockState state,World worldIn,BlockPos pos,Block blockIn,BlockPos p_189540_5_){
  if (worldIn.isBlockPowered(pos) && this.isEquipped) {
    this.injectGemSeed(worldIn,pos);
  }
}
Program: 174548
Project: 174548
Buggy source:
public IBlockState getStateFromMeta(int meta){
  EnumFacing enumfacing=EnumFacing.getFront(meta);
  if (enumfacing.getAxis() == EnumFacing.Axis.Y) {
    enumfacing=EnumFacing.NORTH;
  }
  return this.getDefaultState().withProperty(FACING,enumfacing);
}

Fixed version (ground truth):
@Override public IBlockState getStateFromMeta(int meta){
  EnumFacing enumfacing=EnumFacing.getFront(meta);
  if (enumfacing.getAxis() == EnumFacing.Axis.Y) {
    enumfacing=EnumFacing.NORTH;
  }
  return this.getDefaultState().withProperty(FACING,enumfacing);
}
Program: 174549
Project: 174549
Buggy source:
public Item getItemDropped(IBlockState state,Random rand,int fortune){
  return Item.getItemFromBlock(ModBlocks.INJECTOR);
}

Fixed version (ground truth):
@Override public Item getItemDropped(IBlockState state,Random rand,int fortune){
  return Item.getItemFromBlock(ModBlocks.INJECTOR);
}
Program: 174550
Project: 174550
Buggy source:
public boolean isOpaqueCube(IBlockState state){
  return false;
}

Fixed version (ground truth):
@Override public boolean isOpaqueCube(IBlockState state){
  return false;
}
Program: 174551
Project: 174551
Buggy source:
@SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState,IBlockAccess blockAccess,BlockPos pos,EnumFacing side){
  return true;
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState,IBlockAccess blockAccess,BlockPos pos,EnumFacing side){
  return true;
}
Program: 174552
Project: 174552
Buggy source:
@SuppressWarnings("String_Node_Str") public void applyGemPlacementBuffs(boolean initialSpawn){
switch (this.getGemPlacement()) {
case FOREHEAD:
    this.tasks.addTask(2,new EntityAIPredictFights(this,0.9D));
  break;
case MOUTH:
this.canTalk=false;
break;
case LEFT_HAND:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue() * 2.0D);
}
break;
case RIGHT_HAND:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue() * 2.0D);
}
break;
case BACK:
this.tasks.addTask(2,new EntityAIPanic(this,0.9D));
break;
case CHEST:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).getBaseValue() * 2.5D);
}
break;
case BELLY:
if (this.fallbackServitude == -1 && this.rand.nextInt(8) == 0 && ModConfigs.canRebel) {
this.fallbackServitude=EntityGem.SERVE_REBELLION;
}
 else {
this.fallbackServitude=0;
}
break;
case RIGHT_KNEE:
this.setAIMoveSpeed(this.getAIMoveSpeed() * 1.2F);
break;
case LEFT_KNEE:
this.setAIMoveSpeed(this.getAIMoveSpeed() * 1.2F);
break;
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void applyGemPlacementBuffs(boolean initialSpawn){
switch (this.getGemPlacement()) {
case FOREHEAD:
    this.tasks.addTask(2,new EntityAIPredictFights(this,0.9D));
  break;
case MOUTH:
this.canTalk=false;
break;
case LEFT_HAND:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue() * 2.0D);
}
break;
case RIGHT_HAND:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue() * 2.0D);
}
break;
case BACK:
this.tasks.addTask(2,new EntityAIPanic(this,0.9D));
break;
case CHEST:
if (initialSpawn) {
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).getBaseValue() * 2.5D);
this.setHealth(this.getMaxHealth());
}
break;
case BELLY:
if (this.fallbackServitude == -1 && this.rand.nextInt(8) == 0 && ModConfigs.canRebel) {
this.fallbackServitude=EntityGem.SERVE_REBELLION;
}
 else {
this.fallbackServitude=0;
}
break;
case RIGHT_KNEE:
this.setAIMoveSpeed(this.getAIMoveSpeed() * 1.2F);
break;
case LEFT_KNEE:
this.setAIMoveSpeed(this.getAIMoveSpeed() * 1.2F);
break;
}
}
Program: 174554
Project: 174554
Buggy source:
public void emerge(World world){
  for (  BlockPos block : this.blocks) {
    world.destroyBlock(block,false);
    if (this.meltRocks && block.getY() == minY) {
      world.setBlockState(block,ModBlocks.ROCK_MELT.getDefaultState());
    }
  }
}

Fixed version (ground truth):
public void emerge(World world){
  for (  BlockPos block : this.blocks) {
    world.destroyBlock(block,false);
    if (this.meltRocks && block.getY() == minY && !world.isAirBlock(block.down())) {
      world.setBlockState(block,ModBlocks.ROCK_MELT.getDefaultState());
    }
  }
}
Program: 174556
Project: 174556
Buggy source:
/** 
 * Methods related to entity combat.					 
 */
public boolean shouldAttackEntity(EntityLivingBase attacker,EntityLivingBase victim){
  return this.isOnSameTeam(victim);
}

Fixed version (ground truth):
/** 
 * Methods related to entity combat.					 
 */
public boolean shouldAttackEntity(EntityLivingBase attacker,EntityLivingBase victim){
  return !this.isOnSameTeam(victim);
}
Program: 174560
Project: 174560
Buggy source:
@Override public void update(){
  ++(this.ticksSinceLastCheck);
  if (this.isValid() && (ticksSinceLastCheck & 10) == 0) {
    this.validateWarpPad();
    this.ticksSinceLastCheck=0;
  }
  if (this.warpTicksLeft > 0) {
    --this.warpTicksLeft;
    if (this.warpTicksLeft <= 0) {
      this.WARP();
    }
  }
  if (this.cooldownTicksLeft >= 0) {
    --this.cooldownTicksLeft;
    if (this.cooldownTicksLeft <= 0) {
      this.warping=false;
      this.setDirty();
    }
  }
}

Fixed version (ground truth):
@Override public void update(){
  ++(this.ticksSinceLastCheck);
  if (this.isValid() && (ticksSinceLastCheck & 10) == 0) {
    this.validateWarpPad();
    this.ticksSinceLastCheck=0;
  }
  if (this.warpTicksLeft > 0) {
    --this.warpTicksLeft;
    if (this.warpTicksLeft <= 0) {
      this.WARP();
    }
  }
  if (this.cooldownTicksLeft >= 0) {
    --this.cooldownTicksLeft;
  }
  if (this.cooldownTicksLeft <= 0) {
    this.warping=false;
    this.setDirty();
  }
}
Program: 174561
Project: 174561
Buggy source:
public ModelQuartz(){
  super(0.0F,0.0F,64,64);
  this.bipedHead=new ModelRenderer(this,0,0);
  this.bipedHead.addBox(-4F,-12F,-4F,8,8,8);
  this.bipedHead.setRotationPoint(0F,0F,0F);
  this.bipedHeadwear=new ModelRenderer(this,32,0);
  this.bipedHeadwear.addBox(-4F,-12F,-4F,8,8,8,1.1F);
  this.bipedHeadwear.setRotationPoint(0F,0F,0F);
  this.bipedBody=new ModelRenderer(this,16,16);
  this.bipedBody.addBox(-5F,-4F,-3F,10,16,6);
  this.bipedBody.setRotationPoint(0F,0F,0F);
  this.bipedRightArm=new ModelRenderer(this,48,16);
  this.bipedRightArm.addBox(-4F,-4F,-2F,4,14,4);
  this.bipedRightArm.setRotationPoint(0F,0F,0F);
  this.bipedLeftArm=new ModelRenderer(this,48,34);
  this.bipedLeftArm.addBox(0F,-4F,-2F,4,14,4);
  this.bipedLeftArm.setRotationPoint(0F,0F,0F);
  this.bipedRightLeg=new ModelRenderer(this,0,16);
  this.bipedRightLeg.addBox(1F,0F,-2F,4,12,4);
  this.bipedRightLeg.setRotationPoint(0F,0F,0F);
  this.bipedLeftLeg=new ModelRenderer(this,0,32);
  this.bipedLeftLeg.addBox(-5F,0F,-2F,4,12,4);
  this.bipedLeftLeg.setRotationPoint(0F,0F,0F);
}

Fixed version (ground truth):
public ModelQuartz(){
  super(0.0F,0.0F,64,64);
  this.bipedHead=new ModelRenderer(this,0,0);
  this.bipedHead.addBox(-4F,-12F,-4F,8,8,8);
  this.bipedHead.setRotationPoint(0F,0F,0F);
  this.bipedHeadwear=new ModelRenderer(this,32,0);
  this.bipedHeadwear.addBox(-4F,-12F,-4F,8,8,8,1.1F);
  this.bipedHeadwear.setRotationPoint(0F,0F,0F);
  this.bipedBody=new ModelRenderer(this,16,16);
  this.bipedBody.addBox(-5F,-4F,-3F,10,16,6);
  this.bipedBody.setRotationPoint(0F,0F,0F);
  this.bipedRightArm=new ModelRenderer(this,48,16);
  this.bipedRightArm.addBox(-4F,-4F,-2F,4,14,4);
  this.bipedRightArm.setRotationPoint(0F,0F,0F);
  this.bipedLeftArm=new ModelRenderer(this,48,34);
  this.bipedLeftArm.addBox(0F,-4F,-2F,4,14,4);
  this.bipedLeftArm.setRotationPoint(0F,0F,0F);
  this.bipedRightLeg=new ModelRenderer(this,0,16);
  this.bipedRightLeg.addBox(1F,0F,-2F,4,12,4);
  this.bipedRightLeg.setRotationPoint(0F,0F,0F);
  this.bipedLeftLeg=new ModelRenderer(this,0,32);
  this.bipedLeftLeg.addBox(-5F,0F,-2F,4,12,4);
  this.bipedLeftLeg.setRotationPoint(0F,0F,0F);
  this.bipedCape=new ModelRenderer(this,0,0);
  this.bipedCape.setTextureSize(64,32);
  this.bipedCape.addBox(-5.0F,-4.0F,-2.f,10,20,1);
}
Program: 174562
Project: 174562
Buggy source:
public RenderCarnelian(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerGemPlacement(this));
}

Fixed version (ground truth):
public RenderCarnelian(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelQuartz(),0.5F);
  this.addLayer(new LayerQuartzItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerQuartzCape(this));
  this.addLayer(new LayerGemPlacement(this));
}